This commit is contained in:
Sonic Dreamcaster 2025-02-12 17:08:24 -03:00
commit 5cf50793f5
10 changed files with 166 additions and 15 deletions

View File

@ -9,8 +9,8 @@ audio_setup:
type: NAUDIO:V1:AUDIO_SETUP type: NAUDIO:V1:AUDIO_SETUP
driver: SF64 driver: SF64
audio_seq: audio_seq:
size: 0x3AFD0 size: 0x3AB10
offset: 0xE9950 offset: 0xDD890
audio_bank: audio_bank:
size: 0x1CB20 size: 0x1CB20
offset: 0x1183A0 offset: 0x1183A0

View File

@ -118,4 +118,33 @@ d064229a32cc05ab85e2381ce07744eb3ffaf530:
# - include/sf64mesg.h # - include/sf64mesg.h
# - include/sf64audio_external.h # - include/sf64audio_external.h
# - include/sf64event.h # - include/sf64event.h
# - include/sf64player. # - include/sf64player.h
c8a10699dea52f4bb2e2311935c1376dfb352e7a:
name: Star Fox 64 (CN) (V1.1) (Compressed)
preprocess:
decompress_mio0:
method: mio0-comptool
type: decompress
target: 3a05aba5549fa71e8b16a0c6e2c8481b070818a9
restart: true
3a05aba5549fa71e8b16a0c6e2c8481b070818a9:
name: Star Fox 64 (CN) (V1.1)
path: assets/yaml/cn/rev1
config:
gbi: F3DEX
sort: OFFSET
logging: INFO
output:
binary: ./mods/sf64cn.o2r
code: src/cn/assets
headers: include/assets
modding: src/cn/assets
# enums:
# - include/sf64object.h
# - include/sf64level.h
# - include/sf64mesg.h
# - include/sf64audio_external.h
# - include/sf64event.h
# - include/sf64player.h

@ -1 +1 @@
Subproject commit e641b3777cbefb18a9cf4b95353d650b3a2abf65 Subproject commit b7040484f185de8409dfd559f37a43da50d60a28

View File

@ -1790,7 +1790,7 @@ void HUD_RadarMark_Arwing_Draw(s32 colorIdx) {
RCP_SetupDL(&gMasterDisp, SETUPDL_62); RCP_SetupDL(&gMasterDisp, SETUPDL_62);
gDPSetPrimColor(gMasterDisp++, 0, 0, arwingMarkColor[colorIdx][0], arwingMarkColor[colorIdx][1], gDPSetPrimColor(gMasterDisp++, 0, 0, arwingMarkColor[colorIdx][0], arwingMarkColor[colorIdx][1],
arwingMarkColor[colorIdx][2], arwingMarkColor[colorIdx][3]); arwingMarkColor[colorIdx][2], arwingMarkColor[colorIdx][3]);
Matrix_Scale(gGfxMatrix, var_fv1, var_fv2, 1.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, var_fv1, var_fv2, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aRadarMarkArwingDL); gSPDisplayList(gMasterDisp++, aRadarMarkArwingDL);
@ -1801,7 +1801,7 @@ void HUD_RadarMark_StarWolf_Draw(void) {
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, 255); gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, 255);
Matrix_Scale(gGfxMatrix, 54.0f, 54.0f, 1.0f, MTXF_APPLY); Matrix_Scale(gGfxMatrix, 54.0f, 54.0f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp); Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aStarWolfRadarMarkDL); gSPDisplayList(gMasterDisp++, aStarWolfRadarMarkDL);
} }
void HUD_RadarMark_Katt_Draw(void) { void HUD_RadarMark_Katt_Draw(void) {
@ -1885,17 +1885,21 @@ void HUD_RadarMark_Draw(s32 type) {
} else { } else {
arwingMarkColor = arwingMarkColor * 2; arwingMarkColor = arwingMarkColor * 2;
} }
CALL_CANCELLABLE_EVENT(DrawRadarMarkArwingEvent, arwingMarkColor) {
HUD_RadarMark_Arwing_Draw(arwingMarkColor); HUD_RadarMark_Arwing_Draw(arwingMarkColor);
}
break; break;
case RADARMARK_WOLF: case RADARMARK_WOLF:
case RADARMARK_LEON: case RADARMARK_LEON:
case RADARMARK_PIGMA: case RADARMARK_PIGMA:
case RADARMARK_ANDREW: case RADARMARK_ANDREW:
HUD_RadarMark_StarWolf_Draw(); { //This won't compile without braces, for some reason.
break; CALL_CANCELLABLE_EVENT(DrawRadarMarkWolfenEvent) {
HUD_RadarMark_StarWolf_Draw();
}
break;
}
case RADARMARK_KATT: case RADARMARK_KATT:
HUD_RadarMark_Katt_Draw(); HUD_RadarMark_Katt_Draw();
break; break;

View File

@ -974,6 +974,10 @@ void Player_ApplyDamage(Player* player, s32 direction, s32 damage) {
Vec3f sp38; Vec3f sp38;
f32 sp34 = 20.0f; f32 sp34 = 20.0f;
if (CVarGetInteger("gInvincible", 0)) {
damage = 0;
}
player->dmgType = damage; player->dmgType = damage;
player->hitDirection = direction; player->hitDirection = direction;
@ -6945,7 +6949,9 @@ void Play_UpdateLevel(void) {
} }
if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && ((gGameFrameCount & cycleMask) == 0)) { if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) && ((gGameFrameCount & cycleMask) == 0)) {
gPlayer[0].shields--; if (!CVarGetInteger("gInvincible", 0)) {
gPlayer[0].shields--;
}
if (gPlayer[0].shields <= 0) { if (gPlayer[0].shields <= 0) {
gPlayer[0].shields = 0; gPlayer[0].shields = 0;
} }
@ -7161,8 +7167,9 @@ void Play_Main(void) {
} }
gDrawMode = DRAW_PLAY; gDrawMode = DRAW_PLAY;
CALL_CANCELLABLE_EVENT(PlayUpdateEvent){
Play_Update(); Play_Update();
}
if ((gControllerPress[gMainController].button & START_BUTTON) && if ((gControllerPress[gMainController].button & START_BUTTON) &&
(gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) && (gPlayer[0].state == PLAYERSTATE_LEVEL_INTRO) &&

View File

@ -18,6 +18,7 @@
#include "assets/ast_area_6.h" #include "assets/ast_area_6.h"
#include "assets/ast_title.h" #include "assets/ast_title.h"
#include "assets/ast_zoness.h" #include "assets/ast_zoness.h"
#include "port/hooks/Events.h"
u16** gRadioMsgList; u16** gRadioMsgList;
s32 gRadioMsgListIndex; s32 gRadioMsgListIndex;
@ -174,7 +175,7 @@ void func_radio_800BAAE8(void) {
sRadioUseRedBox = false; sRadioUseRedBox = false;
mirror = false; mirror = false;
CALL_EVENT(PreSetupRadioMsgEvent, &sRadioUseRedBox);
switch (gCurrentRadioPortrait) { switch (gCurrentRadioPortrait) {
case RCID_FOX_RED: case RCID_FOX_RED:
sRadioUseRedBox = true; sRadioUseRedBox = true;

View File

@ -16,6 +16,8 @@ std::unordered_map<std::string, std::string> mGameList = {
{ "d064229a32cc05ab85e2381ce07744eb3ffaf530", "Star Fox 64 (J) (V1.0) (Uncompressed)" }, { "d064229a32cc05ab85e2381ce07744eb3ffaf530", "Star Fox 64 (J) (V1.0) (Uncompressed)" },
{ "05b307b8804f992af1a1e2fbafbd588501fdf799", "Star Fox 64 (E) (V1.0)" }, { "05b307b8804f992af1a1e2fbafbd588501fdf799", "Star Fox 64 (E) (V1.0)" },
{ "09f5d5c14219fc77a36c5a6ad5e63f7abd8b3385", "Star Fox 64 (E) (V1.0) (Uncompressed)" }, { "09f5d5c14219fc77a36c5a6ad5e63f7abd8b3385", "Star Fox 64 (E) (V1.0) (Uncompressed)" },
{ "c8a10699dea52f4bb2e2311935c1376dfb352e7a", "Star Fox 64 (C) (V1.1)" },
{ "3a05aba5549fa71e8b16a0c6e2c8481b070818a9", "Star Fox 64 (C) (V1.1) (Uncompressed)" },
}; };
bool GameExtractor::SelectGameFromUI() { bool GameExtractor::SelectGameFromUI() {

View File

@ -9,13 +9,18 @@ DEFINE_EVENT(DisplayPostUpdateEvent);
DEFINE_EVENT(GamePreUpdateEvent); DEFINE_EVENT(GamePreUpdateEvent);
DEFINE_EVENT(GamePostUpdateEvent); DEFINE_EVENT(GamePostUpdateEvent);
DEFINE_EVENT(PlayUpdateEvent);
DEFINE_EVENT(PlayerPreUpdateEvent, Player* player;); DEFINE_EVENT(PlayerPreUpdateEvent, Player* player;);
DEFINE_EVENT(PlayerPostUpdateEvent, Player* player;); DEFINE_EVENT(PlayerPostUpdateEvent, Player* player;);
DEFINE_EVENT(DrawRadarHUDEvent); DEFINE_EVENT(DrawRadarHUDEvent);
DEFINE_EVENT(DrawRadarMarkArwingEvent, s32 colorIdx;);
DEFINE_EVENT(DrawRadarMarkWolfenEvent);
DEFINE_EVENT(DrawBoostGaugeHUDEvent); DEFINE_EVENT(DrawBoostGaugeHUDEvent);
DEFINE_EVENT(DrawBombCounterHUDEvent); DEFINE_EVENT(DrawBombCounterHUDEvent);
DEFINE_EVENT(DrawIncomingMsgHUDEvent); DEFINE_EVENT(DrawIncomingMsgHUDEvent);
DEFINE_EVENT(PreSetupRadioMsgEvent, s32* radioRedBox;);
DEFINE_EVENT(DrawGoldRingsHUDEvent); DEFINE_EVENT(DrawGoldRingsHUDEvent);
DEFINE_EVENT(DrawLivesCounterHUDEvent); DEFINE_EVENT(DrawLivesCounterHUDEvent);
DEFINE_EVENT(DrawTrainingRingPassCountHUDEvent); DEFINE_EVENT(DrawTrainingRingPassCountHUDEvent);

View File

@ -3,6 +3,7 @@
#include "hit64.h" #include "hit64.h"
#include "mods.h" #include "mods.h"
#include "hud.h" #include "hud.h"
#include "assets/ast_star_wolf.h"
#define INIT_EVENT_IDS #define INIT_EVENT_IDS
#include "port/hooks/Events.h" #include "port/hooks/Events.h"
@ -163,6 +164,10 @@ void OnGameUpdatePost(IEvent* event) {
} }
} }
void OnPlayUpdateEvent(IEvent* event){
event->cancelled = CVarGetInteger("gDebugPause", 0);
}
void RefillBoostMeter(Player* player) { void RefillBoostMeter(Player* player) {
if (player->boostMeter > 1.0f) { if (player->boostMeter > 1.0f) {
player->boostMeter = 1.0f; player->boostMeter = 1.0f;
@ -295,6 +300,83 @@ void OnBombCounterDraw(IEvent* ev){
HUD_BombCounter_Draw(253.0f, 18.0f); HUD_BombCounter_Draw(253.0f, 18.0f);
} }
void OnPreSetupRadioMsgEvent(PreSetupRadioMsgEvent* ev){
bool enemyRedRadio = CVarGetInteger("gEnemyRedRadio", 0);
if (!enemyRedRadio)
{
return;
}
if (gRadioMsgRadioId == RCID_BOSS_CORNERIA || gRadioMsgRadioId == RCID_BOSS_CORNERIA2 ||
gRadioMsgRadioId == RCID_BOSS_METEO || gRadioMsgRadioId == RCID_BOSS_SECTORX ||
gRadioMsgRadioId == RCID_BOSS_SECTORY || gRadioMsgRadioId == RCID_BOSS_MACBETH ||
gRadioMsgRadioId == RCID_BOSS_ZONESS || gRadioMsgRadioId == RCID_BOSS_AREA6 ||
gRadioMsgRadioId == RCID_CAIMAN_AREA6 || gRadioMsgRadioId == RCID_WOLF ||
gRadioMsgRadioId == RCID_PIGMA || gRadioMsgRadioId == RCID_LEON ||
gRadioMsgRadioId == RCID_ANDREW || gRadioMsgRadioId == RCID_WOLF_2 ||
gRadioMsgRadioId == RCID_PIGMA_2 || gRadioMsgRadioId == RCID_LEON_2 ||
gRadioMsgRadioId == RCID_ANDREW_2) {
*ev->radioRedBox = true;
}
}
void OnRadarMarkArwingDraw(DrawRadarMarkArwingEvent* ev){
bool outlines = CVarGetInteger("gFighterOutlines", 0);
if (!outlines){
return;
}
ev->event.cancelled = true;
s32 arwingMarkColor[][4] = {
{ 177, 242, 12, 255 }, { 89, 121, 6, 128 }, { 90, 90, 255, 255 }, { 45, 45, 128, 128 },
{ 0, 179, 67, 255 }, { 0, 90, 34, 128 }, { 255, 30, 0, 255 }, { 128, 15, 0, 128 },
};
f32 var_fv1;
f32 var_fv2;
if (gCamCount != 1) {
var_fv1 = 38.0f;
var_fv2 = 38.0f;
} else {
var_fv1 = 54.0f;
var_fv2 = 54.0f;
}
RCP_SetupDL(&gMasterDisp, SETUPDL_62);
gDPSetPrimColor(gMasterDisp++, 0, 0,0,0,0,255);
Matrix_Scale(gGfxMatrix, var_fv1, var_fv2, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aRadarMarkArwingDL);
gDPSetPrimColor(gMasterDisp++, 0, 0, arwingMarkColor[ev->colorIdx][0], arwingMarkColor[ev->colorIdx][1],
arwingMarkColor[ev->colorIdx][2], arwingMarkColor[ev->colorIdx][3]);
Matrix_Translate(gGfxMatrix, 0.0f, 1.0f, 0.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.8f, 0.7f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aRadarMarkArwingDL);
}
void OnRadarMarkWolfenDraw(IEvent* ev) {
bool outlines = CVarGetInteger("gFighterOutlines", 0);
if (!outlines){
return;
}
ev->cancelled = true;
gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255);
Matrix_Scale(gGfxMatrix, 54.0f, 54.0f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aStarWolfRadarMarkDL);
gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, 255);
Matrix_Translate(gGfxMatrix, 0.0f, -1.2f, 0.0f, MTXF_APPLY);
Matrix_Scale(gGfxMatrix, 0.9f, 0.8f, 1.0f, MTXF_APPLY);
Matrix_SetGfxMtx(&gMasterDisp);
gSPDisplayList(gMasterDisp++, aStarWolfRadarMarkDL);
}
void OnLivesCounterDraw(IEvent* ev){ void OnLivesCounterDraw(IEvent* ev){
bool restore = CVarGetInteger("gRestoreBetaBoostGauge", 0) == 1; bool restore = CVarGetInteger("gRestoreBetaBoostGauge", 0) == 1;
if(!restore){ if(!restore){
@ -318,10 +400,14 @@ void PortEnhancements_Init() {
// Register event listeners // Register event listeners
REGISTER_LISTENER(DisplayPostUpdateEvent, OnDisplayUpdatePost, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(DisplayPostUpdateEvent, OnDisplayUpdatePost, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(GamePostUpdateEvent, OnGameUpdatePost, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(GamePostUpdateEvent, OnGameUpdatePost, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(PlayUpdateEvent, OnPlayUpdateEvent, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(PlayerPostUpdateEvent, OnPlayerUpdatePost, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(PlayerPostUpdateEvent, OnPlayerUpdatePost, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(DrawBoostGaugeHUDEvent, OnBoostGaugeDraw, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(DrawBoostGaugeHUDEvent, OnBoostGaugeDraw, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(DrawLivesCounterHUDEvent, OnLivesCounterDraw, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(DrawLivesCounterHUDEvent, OnLivesCounterDraw, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(DrawBombCounterHUDEvent, OnBombCounterDraw, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(DrawBombCounterHUDEvent, OnBombCounterDraw, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(PreSetupRadioMsgEvent, OnPreSetupRadioMsgEvent, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(DrawRadarMarkArwingEvent, OnRadarMarkArwingDraw, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(DrawRadarMarkWolfenEvent, OnRadarMarkWolfenDraw, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(ObjectUpdateEvent, OnItemGoldRingUpdate, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(ObjectUpdateEvent, OnItemGoldRingUpdate, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(ObjectDrawPostSetupEvent, OnItemGoldRingDraw, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(ObjectDrawPostSetupEvent, OnItemGoldRingDraw, EVENT_PRIORITY_NORMAL);
@ -331,6 +417,9 @@ void PortEnhancements_Init() {
REGISTER_LISTENER(PlayerActionBrakeEvent, OnPlayerBrake, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(PlayerActionBrakeEvent, OnPlayerBrake, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(PlayerActionPostShootEvent, OnPlayerShootPost, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(PlayerActionPostShootEvent, OnPlayerShootPost, EVENT_PRIORITY_NORMAL);
REGISTER_LISTENER(PlayerActionPreShootChargedEvent, OnPlayerShootChargedPre, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(PlayerActionPreShootChargedEvent, OnPlayerShootChargedPre, EVENT_PRIORITY_NORMAL);
//If we close the game while debug pause is active, we want it to be deactivated when we run again.
CVarSetInteger("gDebugPause", 0);
} }
void PortEnhancements_Register() { void PortEnhancements_Register() {
@ -341,13 +430,18 @@ void PortEnhancements_Register() {
REGISTER_EVENT(GamePreUpdateEvent); REGISTER_EVENT(GamePreUpdateEvent);
REGISTER_EVENT(GamePostUpdateEvent); REGISTER_EVENT(GamePostUpdateEvent);
REGISTER_EVENT(PlayUpdateEvent);
REGISTER_EVENT(PlayerPreUpdateEvent); REGISTER_EVENT(PlayerPreUpdateEvent);
REGISTER_EVENT(PlayerPostUpdateEvent); REGISTER_EVENT(PlayerPostUpdateEvent);
REGISTER_EVENT(DrawRadarHUDEvent); REGISTER_EVENT(DrawRadarHUDEvent);
REGISTER_EVENT(DrawRadarMarkArwingEvent);
REGISTER_EVENT(DrawRadarMarkWolfenEvent);
REGISTER_EVENT(DrawBoostGaugeHUDEvent); REGISTER_EVENT(DrawBoostGaugeHUDEvent);
REGISTER_EVENT(DrawBombCounterHUDEvent); REGISTER_EVENT(DrawBombCounterHUDEvent);
REGISTER_EVENT(DrawIncomingMsgHUDEvent); REGISTER_EVENT(DrawIncomingMsgHUDEvent);
REGISTER_EVENT(PreSetupRadioMsgEvent);
REGISTER_EVENT(DrawGoldRingsHUDEvent); REGISTER_EVENT(DrawGoldRingsHUDEvent);
REGISTER_EVENT(DrawLivesCounterHUDEvent); REGISTER_EVENT(DrawLivesCounterHUDEvent);
REGISTER_EVENT(DrawTrainingRingPassCountHUDEvent); REGISTER_EVENT(DrawTrainingRingPassCountHUDEvent);

View File

@ -473,6 +473,7 @@ void DrawEnhancementsMenu() {
.tooltip = "Character heads are displayed inside Arwings in all cutscenes", .tooltip = "Character heads are displayed inside Arwings in all cutscenes",
.defaultValue = true .defaultValue = true
}); });
UIWidgets::CVarCheckbox("Use red radio backgrounds for enemies.", "gEnemyRedRadio");
UIWidgets::CVarSliderInt("Cockpit Glass Opacity: %d", "gCockpitOpacity", 0, 255, 120); UIWidgets::CVarSliderInt("Cockpit Glass Opacity: %d", "gCockpitOpacity", 0, 255, 120);
@ -566,6 +567,10 @@ void DrawEnhancementsMenu() {
.tooltip = "Gorgon flashes the screen repeatedly when firing its beam or when teleporting, which causes eye pain for some players and may be harmful to those with photosensitivity.", .tooltip = "Gorgon flashes the screen repeatedly when firing its beam or when teleporting, which causes eye pain for some players and may be harmful to those with photosensitivity.",
.defaultValue = false .defaultValue = false
}); });
UIWidgets::CVarCheckbox("Add outline to Arwing and Wolfen in radar", "gFighterOutlines", {
.tooltip = "Increases visibility of ships in the radar.",
.defaultValue = false
});
ImGui::EndMenu(); ImGui::EndMenu();
} }
@ -713,6 +718,10 @@ void DrawDebugMenu() {
.tooltip = "Jump to credits at the main menu" .tooltip = "Jump to credits at the main menu"
}); });
if (gGameState == GSTATE_PLAY){
UIWidgets::CVarCheckbox("Debug Pause", "gDebugPause");
}
if (CVarGetInteger(StringHelper::Sprintf("gCheckpoint.%d.Set", gCurrentLevel).c_str(), 0)) { if (CVarGetInteger(StringHelper::Sprintf("gCheckpoint.%d.Set", gCurrentLevel).c_str(), 0)) {
if (UIWidgets::Button("Clear Checkpoint")) { if (UIWidgets::Button("Clear Checkpoint")) {
CVarClear(StringHelper::Sprintf("gCheckpoint.%d.Set", gCurrentLevel).c_str()); CVarClear(StringHelper::Sprintf("gCheckpoint.%d.Set", gCurrentLevel).c_str());