shithub: zelda3

Download patch

ref: 6dfa7018710a2ac9f152f52261ed2cd7866fcb14
parent: aacc3d4de6c8535102ef2110e3f1692320fe129b
author: Snesrev <[email protected]>
date: Sun Sep 4 09:01:24 EDT 2022

Remove other_modules.c

--- a/ending.c
+++ b/ending.c
@@ -12,6 +12,8 @@
 #include "player_oam.h"
 #include "tables/generated_ending.h"
 #include "sprite_main.h"
+#include "ancilla.h"
+#include "hud.h"
 
 static const uint16 kPolyhedralPalette[8] = { 0, 0x14d, 0x1b0, 0x1f3, 0x256, 0x279, 0x2fd, 0x35f };
 
@@ -256,6 +258,87 @@
   INIDISP_copy = 0;
   submodule_index++;
   Credits_PrepAndLoadSprites();
+}
+
+void Module18_GanonEmerges() {  // 829edc
+  uint16 hofs2 = BG2HOFS_copy2;
+  uint16 vofs2 = BG2VOFS_copy2;
+  uint16 hofs1 = BG1HOFS_copy2;
+  uint16 vofs1 = BG1VOFS_copy2;
+
+  BG2HOFS_copy2 = BG2HOFS_copy = hofs2 + bg1_x_offset;
+  BG2VOFS_copy2 = BG2VOFS_copy = vofs2 + bg1_y_offset;
+  BG1HOFS_copy2 = BG1HOFS_copy = hofs1 + bg1_x_offset;
+  BG1VOFS_copy2 = BG1VOFS_copy = vofs1 + bg1_y_offset;
+  Sprite_Main();
+  BG1VOFS_copy2 = vofs1;
+  BG1HOFS_copy2 = hofs1;
+  BG2VOFS_copy2 = vofs2;
+  BG2HOFS_copy2 = hofs2;
+
+  switch (overworld_map_state) {
+  case 0:  // GetBirdForPursuit
+    Dungeon_HandleLayerEffect();
+    CallForDuckIndoors();
+    SaveDungeonKeys();
+    overworld_map_state++;
+    flag_is_link_immobilized++;
+    break;
+  case 1:  // PrepForPyramidLocation
+    Dungeon_HandleLayerEffect();
+    if (submodule_index == 10) {
+      overworld_screen_index = 91;
+      player_is_indoors = 0;
+      main_module_index = 24;
+      submodule_index = 0;
+      overworld_map_state = 2;
+    }
+    break;
+  case 2:  // FadeOutDungeonScreen
+    Dungeon_HandleLayerEffect();
+    if (--INIDISP_copy)
+      break;
+    EnableForceBlank();
+    overworld_map_state++;
+    Hud_RebuildIndoor();
+    link_x_vel = link_y_vel = 0;
+    break;
+  case 3:  // LOadPyramidArea
+    birdtravel_var1[0] = 8;
+    birdtravel_var1[1] = 0;
+    FluteMenu_LoadSelectedScreen();
+    LoadOWMusicIfNeeded();
+    music_control = 9;
+    break;
+  case 4:  // LoadAmbientOverlay
+    Overworld_LoadOverlayAndMap();
+    subsubmodule_index = 0;
+    break;
+  case 5:  // BrightenScreenThenSpawnBat
+    if (++INIDISP_copy == 15) {
+      dung_savegame_state_bits = 0;
+      flag_unk1 = 0;
+      Sprite_SpawnBatCrashCutscene();
+      link_direction_facing = 2;
+      saved_module_for_menu = 9;
+      player_is_indoors = 0;
+      overworld_map_state++;
+      subsubmodule_index = 128;
+      BYTE(cur_palace_index_x2) = 255;
+    }
+    break;
+  case 6:  // DelayForBatSmashIntoPyramid
+    break;
+  case 7:  // DelayPlayerDropOff
+    if (!--subsubmodule_index)
+      overworld_map_state++;
+    break;
+  case 8:  // DropOffPlayerAtPyramid
+    BirdTravel_Finish_Doit();
+    break;
+  }
+
+  LinkOam_Main();
 }
 
 void Module19_TriforceRoom() {  // 829fec
--- a/ending.h
+++ b/ending.h
@@ -14,6 +14,7 @@
 void Credits_OperateScrollingAndTileMap();
 void Credits_LoadCoolBackground();
 void Credits_LoadScene_Dungeon();
+void Module18_GanonEmerges();
 void Module19_TriforceRoom();
 void Intro_InitializeBackgroundSettings();
 void Polyhedral_InitializeThread();
--- a/misc.c
+++ b/misc.c
@@ -10,7 +10,6 @@
 #include "select_file.h"
 #include "tile_detect.h"
 #include "player.h"
-#include "other_modules.h"
 #include "player_oam.h"
 #include "messaging.h"
 #include "ending.h"
--- a/other_modules.c
+++ /dev/null
@@ -1,92 +1,0 @@
-#include "zelda_rtl.h"
-#include "variables.h"
-#include "dungeon.h"
-#include "ancilla.h"
-#include "load_gfx.h"
-#include "hud.h"
-#include "sprite.h"
-#include "messaging.h"
-#include "player_oam.h"
-#include "sprite_main.h"
-
-void Module18_GanonEmerges() {  // 829edc
-  uint16 hofs2 = BG2HOFS_copy2;
-  uint16 vofs2 = BG2VOFS_copy2;
-  uint16 hofs1 = BG1HOFS_copy2;
-  uint16 vofs1 = BG1VOFS_copy2;
-
-  BG2HOFS_copy2 = BG2HOFS_copy = hofs2 + bg1_x_offset;
-  BG2VOFS_copy2 = BG2VOFS_copy = vofs2 + bg1_y_offset;
-  BG1HOFS_copy2 = BG1HOFS_copy = hofs1 + bg1_x_offset;
-  BG1VOFS_copy2 = BG1VOFS_copy = vofs1 + bg1_y_offset;
-  Sprite_Main();
-  BG1VOFS_copy2 = vofs1;
-  BG1HOFS_copy2 = hofs1;
-  BG2VOFS_copy2 = vofs2;
-  BG2HOFS_copy2 = hofs2;
-
-  switch (overworld_map_state) {
-  case 0:  // GetBirdForPursuit
-    Dungeon_HandleLayerEffect();
-    CallForDuckIndoors();
-    SaveDungeonKeys();
-    overworld_map_state++;
-    flag_is_link_immobilized++;
-    break;
-  case 1:  // PrepForPyramidLocation
-    Dungeon_HandleLayerEffect();
-    if (submodule_index == 10) {
-      overworld_screen_index = 91;
-      player_is_indoors = 0;
-      main_module_index = 24;
-      submodule_index = 0;
-      overworld_map_state = 2;
-    }
-    break;
-  case 2:  // FadeOutDungeonScreen
-    Dungeon_HandleLayerEffect();
-    if (--INIDISP_copy)
-      break;
-    EnableForceBlank();
-    overworld_map_state++;
-    Hud_RebuildIndoor();
-    link_x_vel = link_y_vel = 0;
-    break;
-  case 3:  // LOadPyramidArea
-    birdtravel_var1[0] = 8;
-    birdtravel_var1[1] = 0;
-    FluteMenu_LoadSelectedScreen();
-    LoadOWMusicIfNeeded();
-    music_control = 9;
-    break;
-  case 4:  // LoadAmbientOverlay
-    Overworld_LoadOverlayAndMap();
-    subsubmodule_index = 0;
-    break;
-  case 5:  // BrightenScreenThenSpawnBat
-    if (++INIDISP_copy == 15) {
-      dung_savegame_state_bits = 0;
-      flag_unk1 = 0;
-      Sprite_SpawnBatCrashCutscene();
-      link_direction_facing = 2;
-      saved_module_for_menu = 9;
-      player_is_indoors = 0;
-      overworld_map_state++;
-      subsubmodule_index = 128;
-      BYTE(cur_palace_index_x2) = 255;
-    }
-    break;
-  case 6:  // DelayForBatSmashIntoPyramid
-    break;
-  case 7:  // DelayPlayerDropOff
-    if (!--subsubmodule_index)
-      overworld_map_state++;
-    break;
-  case 8:  // DropOffPlayerAtPyramid
-    BirdTravel_Finish_Doit();
-    break;
-  }
-
-  LinkOam_Main();
-}
-
--- a/other_modules.h
+++ /dev/null
@@ -1,4 +1,0 @@
-#pragma once
-#include "types.h"
-
-void Module18_GanonEmerges();
--- a/zelda3.vcxproj
+++ b/zelda3.vcxproj
@@ -153,7 +153,6 @@
     <ClCompile Include="messaging.c" />
     <ClCompile Include="misc.c" />
     <ClCompile Include="nmi.c" />
-    <ClCompile Include="other_modules.c" />
     <ClCompile Include="overlord.c" />
     <ClCompile Include="overworld.c" />
     <ClCompile Include="player.c" />
@@ -223,7 +222,6 @@
     <ClInclude Include="messaging.h" />
     <ClInclude Include="misc.h" />
     <ClInclude Include="nmi.h" />
-    <ClInclude Include="other_modules.h" />
     <ClInclude Include="overlord.h" />
     <ClInclude Include="overworld.h" />
     <ClInclude Include="player.h" />
--- a/zelda3.vcxproj.filters
+++ b/zelda3.vcxproj.filters
@@ -106,9 +106,6 @@
     <ClCompile Include="tile_detect.c">
       <Filter>Zelda</Filter>
     </ClCompile>
-    <ClCompile Include="other_modules.c">
-      <Filter>Zelda</Filter>
-    </ClCompile>
     <ClCompile Include="misc.c">
       <Filter>Zelda</Filter>
     </ClCompile>
@@ -202,9 +199,6 @@
       <Filter>Zelda</Filter>
     </ClInclude>
     <ClInclude Include="player.h">
-      <Filter>Zelda</Filter>
-    </ClInclude>
-    <ClInclude Include="other_modules.h">
       <Filter>Zelda</Filter>
     </ClInclude>
     <ClInclude Include="misc.h">