ref: aacc3d4de6c8535102ef2110e3f1692320fe129b
parent: 7f01b37e0ca3d8d56140a971eb2bcb95a3a66522
author: Snesrev <snesrev@protonmail.com>
date: Sun Sep 4 08:56:48 EDT 2022
Put all variables in one file
--- a/ancilla.c
+++ b/ancilla.c
@@ -1,10 +1,5 @@
#include "ancilla.h"
#include "variables.h"
-#include "variables_weathervane.h"
-#include "variables_happiness_pond.h"
-#include "variables_blastwall.h"
-#include "variables_skullwoodsfire.h"
-#include "variables_breaktowerseal.h"
#include "sprite.h"
#include "hud.h"
#include "load_gfx.h"
--- a/attract.c
+++ b/attract.c
@@ -1,6 +1,5 @@
#include "zelda_rtl.h"
#include "variables.h"
-#include "variables_attract.h"
#include "snes/snes_regs.h"
#include "load_gfx.h"
#include "dungeon.h"
--- a/select_file.c
+++ b/select_file.c
@@ -3,7 +3,6 @@
#include "load_gfx.h"
#include "select_file.h"
#include "snes/snes_regs.h"
-#include "variables_attract.h"
#include "overworld.h"
#include "messaging.h"
--- a/variables.h
+++ b/variables.h
@@ -1235,3 +1235,112 @@
#define beamos_x_hi ((uint8*)(g_ram+0x1FE00))
#define beamos_y_lo ((uint8*)(g_ram+0x1FE80))
#define beamos_y_hi ((uint8*)(g_ram+0x1FF00))
+
+#define attract_var12 (*(uint16*)(g_ram+0x20))
+#define attract_state (*(uint8*)(g_ram+0x22))
+#define attract_sequence (*(uint8*)(g_ram+0x23))
+#define attract_var10 (*(uint8*)(g_ram+0x25))
+#define attract_next_legend_gfx (*(uint8*)(g_ram+0x26))
+#define attract_legend_flag (*(uint8*)(g_ram+0x27))
+#define attract_x_base (*(uint8*)(g_ram+0x28))
+#define attract_y_base (*(uint8*)(g_ram+0x29))
+#define attract_oam_idx (*(uint8*)(g_ram+0x2A))
+#define attract_var9 (*(uint8*)(g_ram+0x2B))
+#define attract_var13 (*(uint8*)(g_ram+0x2C))
+#define attract_var7 (*(uint16*)(g_ram+0x2D))
+#define attract_vram_dst (*(uint16*)(g_ram+0x30))
+#define attract_var1 (*(uint8*)(g_ram+0x32))
+#define attract_var3 (*(uint8*)(g_ram+0x33))
+#define attract_var4 (*(uint8*)(g_ram+0x34))
+#define attract_x_base_hi (*(uint8*)(g_ram+0x40))
+#define attract_var17 (*(uint8*)(g_ram+0x50))
+#define attract_var21 (*(uint8*)(g_ram+0x51))
+#define attract_var15 (*(uint8*)(g_ram+0x52))
+#define attract_var22 (*(uint8*)(g_ram+0x5D))
+#define attract_var18 (*(uint8*)(g_ram+0x5F))
+#define attract_var5 (*(uint8*)(g_ram+0x60))
+#define attract_var11 (*(uint8*)(g_ram+0x61))
+#define attract_var19 (*(uint8*)(g_ram+0x62))
+#define attract_var20 (*(uint8*)(g_ram+0x63))
+#define selectfile_arr1 ((uint16*)(g_ram+0xBF))
+#define selectfile_arr2 ((uint8*)(g_ram+0xCA))
+#define selectfile_var6 (*(uint8*)(g_ram+0xCC))
+#define attract_room_index (*(uint8*)(g_ram+0x10E))
+#define attract_legend_ctr (*(uint16*)(g_ram+0x200))
+#define selectfile_var8 (*(uint16*)(g_ram+0x630))
+#define selectfile_var3 (*(uint8*)(g_ram+0xB10))
+#define selectfile_var7 (*(uint8*)(g_ram+0xB11))
+#define selectfile_var4 (*(uint8*)(g_ram+0xB12))
+#define selectfile_var9 (*(uint8*)(g_ram+0xB13))
+#define selectfile_var11 (*(uint8*)(g_ram+0xB14))
+#define selectfile_var5 (*(uint8*)(g_ram+0xB15))
+#define selectfile_var10 (*(uint8*)(g_ram+0xB16))
+#define selectfile_var2 (*(uint8*)(g_ram+0xB9D))
+
+#define blastwall_var5 ((uint8*)(g_ram+0x10000))
+#define blastwall_var6 ((uint8*)(g_ram+0x10008))
+#define blastwall_var1 (*(uint8*)(g_ram+0x10010))
+#define blastwall_var4 (*(uint8*)(g_ram+0x10011))
+#define blastwall_var8 (*(uint16*)(g_ram+0x10018))
+#define blastwall_var9 (*(uint16*)(g_ram+0x1001A))
+#define blastwall_var7 (*(uint8*)(g_ram+0x1001C))
+#define blastwall_var10 ((uint16*)(g_ram+0x10020))
+#define blastwall_var11 ((uint16*)(g_ram+0x10030))
+#define blastwall_var12 ((uint8*)(g_ram+0x10040))
+
+#define breaktowerseal_var3 ((uint8*)(g_ram+0x15800))
+#define breaktowerseal_var4 (*(uint8*)(g_ram+0x15808))
+#define breaktowerseal_x (*(uint16*)(g_ram+0x1580E))
+#define breaktowerseal_y (*(uint16*)(g_ram+0x15810))
+#define breaktowerseal_var5 (*(uint8*)(g_ram+0x15812))
+#define breaktowerseal_base_sparkle_y_lo ((uint8*)(g_ram+0x15817))
+#define breaktowerseal_base_sparkle_y_hi ((uint8*)(g_ram+0x1581F))
+#define breaktowerseal_base_sparkle_x_lo ((uint8*)(g_ram+0x15827))
+#define breaktowerseal_base_sparkle_x_hi ((uint8*)(g_ram+0x1582F))
+#define breaktowerseal_sparkle_var1 ((uint8*)(g_ram+0x15837))
+#define breaktowerseal_sparkle_y_lo ((uint8*)(g_ram+0x1584F))
+#define breaktowerseal_sparkle_y_hi ((uint8*)(g_ram+0x15867))
+#define breaktowerseal_sparkle_x_lo ((uint8*)(g_ram+0x1587F))
+#define breaktowerseal_sparkle_x_hi ((uint8*)(g_ram+0x15897))
+#define breaktowerseal_sparkle_var2 ((uint8*)(g_ram+0x158AF))
+
+#define happiness_pond_y_vel ((uint8*)(g_ram+0x15800))
+#define happiness_pond_x_vel ((uint8*)(g_ram+0x1580C))
+#define happiness_pond_z_vel ((uint8*)(g_ram+0x15818))
+#define happiness_pond_y_lo ((uint8*)(g_ram+0x15824))
+#define happiness_pond_y_hi ((uint8*)(g_ram+0x15830))
+#define happiness_pond_x_lo ((uint8*)(g_ram+0x1583C))
+#define happiness_pond_x_hi ((uint8*)(g_ram+0x15848))
+#define happiness_pond_z ((uint8*)(g_ram+0x15854))
+#define happiness_pond_timer ((uint8*)(g_ram+0x15860))
+#define happiness_pond_arr1 ((uint8*)(g_ram+0x1586C))
+#define happiness_pond_item_to_link ((uint8*)(g_ram+0x1587A))
+#define happiness_pond_y_subpixel ((uint8*)(g_ram+0x15886))
+#define happiness_pond_x_subpixel ((uint8*)(g_ram+0x15892))
+#define happiness_pond_z_subpixel ((uint8*)(g_ram+0x1589E))
+#define happiness_pond_step ((uint8*)(g_ram+0x158AA))
+
+#define skullwoodsfire_var0 ((uint8*)(g_ram+0x10000))
+#define skullwoodsfire_var5 ((uint8*)(g_ram+0x10008))
+#define skullwoodsfire_var4 (*(uint8*)(g_ram+0x10010))
+#define skullwoodsfire_var9 (*(uint16*)(g_ram+0x10018))
+#define skullwoodsfire_var11 (*(uint16*)(g_ram+0x1001A))
+#define skullwoodsfire_y_arr ((uint16*)(g_ram+0x10020))
+#define skullwoodsfire_var10 (*(uint16*)(g_ram+0x10026))
+#define skullwoodsfire_x_arr ((uint16*)(g_ram+0x10030))
+#define skullwoodsfire_var12 (*(uint16*)(g_ram+0x10036))
+
+#define weathervane_arr3 ((uint8*)(g_ram+0x15800))
+#define weathervane_arr4 ((uint8*)(g_ram+0x1580C))
+#define weathervane_arr5 ((uint8*)(g_ram+0x15818))
+#define weathervane_arr6 ((uint8*)(g_ram+0x15824))
+#define weathervane_arr7 ((uint8*)(g_ram+0x15830))
+#define weathervane_arr8 ((uint8*)(g_ram+0x1583C))
+#define weathervane_arr9 ((uint8*)(g_ram+0x15848))
+#define weathervane_arr10 ((uint8*)(g_ram+0x15854))
+#define weathervane_arr11 ((uint8*)(g_ram+0x15860))
+#define weathervane_arr12 ((uint8*)(g_ram+0x1586C))
+#define weathervane_var13 (*(uint8*)(g_ram+0x15878))
+#define weathervane_var14 (*(uint8*)(g_ram+0x15879))
+#define weathervane_var2 (*(uint16*)(g_ram+0x158B6))
+#define weathervane_var1 (*(uint8*)(g_ram+0x158B8))
--- a/variables_attract.h
+++ /dev/null
@@ -1,40 +1,0 @@
-#define attract_var12 (*(uint16*)(g_ram+0x20))
-#define attract_state (*(uint8*)(g_ram+0x22))
-#define attract_sequence (*(uint8*)(g_ram+0x23))
-#define attract_var10 (*(uint8*)(g_ram+0x25))
-#define attract_next_legend_gfx (*(uint8*)(g_ram+0x26))
-#define attract_legend_flag (*(uint8*)(g_ram+0x27))
-#define attract_x_base (*(uint8*)(g_ram+0x28))
-#define attract_y_base (*(uint8*)(g_ram+0x29))
-#define attract_oam_idx (*(uint8*)(g_ram+0x2A))
-#define attract_var9 (*(uint8*)(g_ram+0x2B))
-#define attract_var13 (*(uint8*)(g_ram+0x2C))
-#define attract_var7 (*(uint16*)(g_ram+0x2D))
-#define attract_vram_dst (*(uint16*)(g_ram+0x30))
-#define attract_var1 (*(uint8*)(g_ram+0x32))
-#define attract_var3 (*(uint8*)(g_ram+0x33))
-#define attract_var4 (*(uint8*)(g_ram+0x34))
-#define attract_x_base_hi (*(uint8*)(g_ram+0x40))
-#define attract_var17 (*(uint8*)(g_ram+0x50))
-#define attract_var21 (*(uint8*)(g_ram+0x51))
-#define attract_var15 (*(uint8*)(g_ram+0x52))
-#define attract_var22 (*(uint8*)(g_ram+0x5D))
-#define attract_var18 (*(uint8*)(g_ram+0x5F))
-#define attract_var5 (*(uint8*)(g_ram+0x60))
-#define attract_var11 (*(uint8*)(g_ram+0x61))
-#define attract_var19 (*(uint8*)(g_ram+0x62))
-#define attract_var20 (*(uint8*)(g_ram+0x63))
-#define selectfile_arr1 ((uint16*)(g_ram+0xBF))
-#define selectfile_arr2 ((uint8*)(g_ram+0xCA))
-#define selectfile_var6 (*(uint8*)(g_ram+0xCC))
-#define attract_room_index (*(uint8*)(g_ram+0x10E))
-#define attract_legend_ctr (*(uint16*)(g_ram+0x200))
-#define selectfile_var8 (*(uint16*)(g_ram+0x630))
-#define selectfile_var3 (*(uint8*)(g_ram+0xB10))
-#define selectfile_var7 (*(uint8*)(g_ram+0xB11))
-#define selectfile_var4 (*(uint8*)(g_ram+0xB12))
-#define selectfile_var9 (*(uint8*)(g_ram+0xB13))
-#define selectfile_var11 (*(uint8*)(g_ram+0xB14))
-#define selectfile_var5 (*(uint8*)(g_ram+0xB15))
-#define selectfile_var10 (*(uint8*)(g_ram+0xB16))
-#define selectfile_var2 (*(uint8*)(g_ram+0xB9D))
--- a/variables_blastwall.h
+++ /dev/null
@@ -1,10 +1,0 @@
-#define blastwall_var5 ((uint8*)(g_ram+0x10000))
-#define blastwall_var6 ((uint8*)(g_ram+0x10008))
-#define blastwall_var1 (*(uint8*)(g_ram+0x10010))
-#define blastwall_var4 (*(uint8*)(g_ram+0x10011))
-#define blastwall_var8 (*(uint16*)(g_ram+0x10018))
-#define blastwall_var9 (*(uint16*)(g_ram+0x1001A))
-#define blastwall_var7 (*(uint8*)(g_ram+0x1001C))
-#define blastwall_var10 ((uint16*)(g_ram+0x10020))
-#define blastwall_var11 ((uint16*)(g_ram+0x10030))
-#define blastwall_var12 ((uint8*)(g_ram+0x10040))
--- a/variables_breaktowerseal.h
+++ /dev/null
@@ -1,15 +1,0 @@
-#define breaktowerseal_var3 ((uint8*)(g_ram+0x15800))
-#define breaktowerseal_var4 (*(uint8*)(g_ram+0x15808))
-#define breaktowerseal_x (*(uint16*)(g_ram+0x1580E))
-#define breaktowerseal_y (*(uint16*)(g_ram+0x15810))
-#define breaktowerseal_var5 (*(uint8*)(g_ram+0x15812))
-#define breaktowerseal_base_sparkle_y_lo ((uint8*)(g_ram+0x15817))
-#define breaktowerseal_base_sparkle_y_hi ((uint8*)(g_ram+0x1581F))
-#define breaktowerseal_base_sparkle_x_lo ((uint8*)(g_ram+0x15827))
-#define breaktowerseal_base_sparkle_x_hi ((uint8*)(g_ram+0x1582F))
-#define breaktowerseal_sparkle_var1 ((uint8*)(g_ram+0x15837))
-#define breaktowerseal_sparkle_y_lo ((uint8*)(g_ram+0x1584F))
-#define breaktowerseal_sparkle_y_hi ((uint8*)(g_ram+0x15867))
-#define breaktowerseal_sparkle_x_lo ((uint8*)(g_ram+0x1587F))
-#define breaktowerseal_sparkle_x_hi ((uint8*)(g_ram+0x15897))
-#define breaktowerseal_sparkle_var2 ((uint8*)(g_ram+0x158AF))
--- a/variables_happiness_pond.h
+++ /dev/null
@@ -1,15 +1,0 @@
-#define happiness_pond_y_vel ((uint8*)(g_ram+0x15800))
-#define happiness_pond_x_vel ((uint8*)(g_ram+0x1580C))
-#define happiness_pond_z_vel ((uint8*)(g_ram+0x15818))
-#define happiness_pond_y_lo ((uint8*)(g_ram+0x15824))
-#define happiness_pond_y_hi ((uint8*)(g_ram+0x15830))
-#define happiness_pond_x_lo ((uint8*)(g_ram+0x1583C))
-#define happiness_pond_x_hi ((uint8*)(g_ram+0x15848))
-#define happiness_pond_z ((uint8*)(g_ram+0x15854))
-#define happiness_pond_timer ((uint8*)(g_ram+0x15860))
-#define happiness_pond_arr1 ((uint8*)(g_ram+0x1586C))
-#define happiness_pond_item_to_link ((uint8*)(g_ram+0x1587A))
-#define happiness_pond_y_subpixel ((uint8*)(g_ram+0x15886))
-#define happiness_pond_x_subpixel ((uint8*)(g_ram+0x15892))
-#define happiness_pond_z_subpixel ((uint8*)(g_ram+0x1589E))
-#define happiness_pond_step ((uint8*)(g_ram+0x158AA))
--- a/variables_skullwoodsfire.h
+++ /dev/null
@@ -1,9 +1,0 @@
-#define skullwoodsfire_var0 ((uint8*)(g_ram+0x10000))
-#define skullwoodsfire_var5 ((uint8*)(g_ram+0x10008))
-#define skullwoodsfire_var4 (*(uint8*)(g_ram+0x10010))
-#define skullwoodsfire_var9 (*(uint16*)(g_ram+0x10018))
-#define skullwoodsfire_var11 (*(uint16*)(g_ram+0x1001A))
-#define skullwoodsfire_y_arr ((uint16*)(g_ram+0x10020))
-#define skullwoodsfire_var10 (*(uint16*)(g_ram+0x10026))
-#define skullwoodsfire_x_arr ((uint16*)(g_ram+0x10030))
-#define skullwoodsfire_var12 (*(uint16*)(g_ram+0x10036))
--- a/variables_weathervane.h
+++ /dev/null
@@ -1,14 +1,0 @@
-#define weathervane_arr3 ((uint8*)(g_ram+0x15800))
-#define weathervane_arr4 ((uint8*)(g_ram+0x1580C))
-#define weathervane_arr5 ((uint8*)(g_ram+0x15818))
-#define weathervane_arr6 ((uint8*)(g_ram+0x15824))
-#define weathervane_arr7 ((uint8*)(g_ram+0x15830))
-#define weathervane_arr8 ((uint8*)(g_ram+0x1583C))
-#define weathervane_arr9 ((uint8*)(g_ram+0x15848))
-#define weathervane_arr10 ((uint8*)(g_ram+0x15854))
-#define weathervane_arr11 ((uint8*)(g_ram+0x15860))
-#define weathervane_arr12 ((uint8*)(g_ram+0x1586C))
-#define weathervane_var13 (*(uint8*)(g_ram+0x15878))
-#define weathervane_var14 (*(uint8*)(g_ram+0x15879))
-#define weathervane_var2 (*(uint16*)(g_ram+0x158B6))
-#define weathervane_var1 (*(uint8*)(g_ram+0x158B8))