Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions resources/create_ram_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
symbols_file.write(" ;")
symbols_file.write(parts[1])
last_line_was_new_line = False
elif line.startswith("if"):
symbols_file.write(line)
last_line_was_new_line = False
elif line.startswith("else"):
symbols_file.write(line)
last_line_was_new_line = False
elif line.startswith("elseif"):
symbols_file.write(line)
last_line_was_new_line = False
elif line.startswith("endif"):
symbols_file.write(line)
last_line_was_new_line = False

symbols_file.close()

101 changes: 51 additions & 50 deletions src/defines.asm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

!ram_metronome_counter = !WRAM_START+$30
!ram_armed_shine_duration = !WRAM_START+$32
!ram_auto_save_state = !WRAM_START+$34
!ram_activated_shine_duration = !WRAM_START+$34
!ram_watch_left_hud = !WRAM_START+$36
!ram_watch_right_hud = !WRAM_START+$38

Expand All @@ -111,7 +111,6 @@
!ram_load_preset_low_word = !WRAM_START+$5C
!ram_load_preset_high_word = !WRAM_START+$5D ; Load preset is three bytes
!ram_room_has_set_rng = !WRAM_START+$5E ; Room set RNG only uses the most significant bit
!ram_activated_shine_duration = !WRAM_START+$60

; ^ FREE SPACE ^ up to +$8C

Expand Down Expand Up @@ -192,9 +191,8 @@
!ram_quickboot_spc_state = !WRAM_PERSIST_START+$1E
!ram_display_backup = !WRAM_PERSIST_START+$20
!ram_slowdown_mode = !WRAM_PERSIST_START+$22
!ram_update_timers_flag = !WRAM_PERSIST_START+$24

; ^ FREE SPACE ^ up to +$26
!ram_auto_save_state = !WRAM_PERSIST_START+$24
!ram_last_save_state_type = !WRAM_PERSIST_START+$26

!ram_itempickups_all = !WRAM_PERSIST_START+$28
!ram_itempickups_visible = !WRAM_PERSIST_START+$2A
Expand All @@ -218,6 +216,8 @@
!ram_watch_edit_lock_left = !WRAM_PERSIST_START+$4A
!ram_watch_edit_lock_right = !WRAM_PERSIST_START+$4C

!ram_update_timers_flag = !WRAM_PERSIST_START+$4E

; ^ FREE SPACE ^ up to +$5E (!WRAM_START+$FE - !WRAM_PERSIST_START)

; ---------
Expand Down Expand Up @@ -488,7 +488,7 @@
; SRAM
; -----

!SRAM_VERSION = #$0021
!SRAM_VERSION = #$0022

!SRAM_START = $702000
!SRAM_SIZE = #$1000
Expand Down Expand Up @@ -634,19 +634,21 @@
!sram_ctrl_1_shortcut_inputs = !SRAM_START+$140 ; 96 bytes
!sram_ctrl_2_shortcut_inputs = !SRAM_START+$1A0 ; 96 bytes

; ^ FREE SPACE ^ up to +$B8E (normal) / +$DFE (tinystates)

!sram_read_only_locks_tinystates = !SRAM_START+$B8A ; $6 bytes
!sram_streamer_name_normal = !SRAM_START+$B90 ; $18 bytes
!sram_custom_header_normal = !SRAM_START+$BA8 ; $18 bytes
!sram_custom_preset_safewords_normal = !SRAM_START+$BC0 ; $50 bytes
!sram_custom_preset_names_normal = !SRAM_START+$C10 ; $3C0 bytes
; ^ FREE SPACE ^ up to +$B88 (normal) / +$DF8 (tinystates)

!sram_read_only_locks_normal = !SRAM_START+$DFA ; $6 bytes
!sram_streamer_name_tinystates = !SRAM_START+$E00 ; $18 bytes
!sram_custom_header_tinystates = !SRAM_START+$E18 ; $18 bytes
!sram_custom_preset_safewords_tinystates = !SRAM_START+$E30 ; $20 bytes
!sram_custom_preset_names_tinystates = !SRAM_START+$E50 ; $180 bytes
if !FEATURE_TINYSTATES
!sram_read_only_locks = !SRAM_START+$DFA ; $6 bytes
!sram_streamer_name = !SRAM_START+$E00 ; $18 bytes
!sram_custom_header = !SRAM_START+$E18 ; $18 bytes
!sram_custom_preset_safewords = !SRAM_START+$E30 ; $20 bytes
!sram_custom_preset_names = !SRAM_START+$E50 ; $180 bytes
else
!sram_read_only_locks = !SRAM_START+$B8A ; $6 bytes
!sram_streamer_name = !SRAM_START+$B90 ; $18 bytes
!sram_custom_header = !SRAM_START+$BA8 ; $18 bytes
!sram_custom_preset_safewords = !SRAM_START+$BC0 ; $50 bytes
!sram_custom_preset_names = !SRAM_START+$C10 ; $3C0 bytes
endif

; ^ FREE SPACE ^ up to +$FFE

Expand Down Expand Up @@ -1266,46 +1268,45 @@ endif
; Save/Load
; ----------

if !FEATURE_SD2SNES
if !FEATURE_TINYSTATES
!SRAM_DMA_BANK = $737000
!SRAM_SAVED_SP = $737F00
!SRAM_SAVED_STATE = $737F02
!SRAM_SAVED_MINIMAP = $737F86
!SRAM_SEG_TIMER_F = $737F88
!SRAM_SEG_TIMER_S = $737F8A
!SRAM_SEG_TIMER_M = $737F8C
else
!SRAM_DMA_BANK = $770000
!SRAM_SAVED_SP = $774004
!SRAM_SAVED_STATE = $774006
!SRAM_SAVED_MINIMAP = $774008
!SRAM_SEG_TIMER_F = $77400A
!SRAM_SEG_TIMER_S = $77400C
!SRAM_SEG_TIMER_M = $77400E
endif
!SRAM_DMA_BANK = $737F00
!SRAM_SAVED_SP = $737F80
!SRAM_SAVED_STATE = $737F82
!SRAM_SAVED_MINIMAP = $737F84
!SRAM_SEG_TIMER_F = $737F86
!SRAM_SEG_TIMER_S = $737F88
!SRAM_SEG_TIMER_M = $737F8A
elseif !FEATURE_SD2SNES
!SRAM_DMA_BANK = $777D00
!SRAM_SAVED_SP = $777D80
!SRAM_SAVED_STATE = $777D82
!SRAM_SAVED_MINIMAP = $777D84
!SRAM_SEG_TIMER_F = $777D86
!SRAM_SEG_TIMER_S = $777D88
!SRAM_SEG_TIMER_M = $777D8A

!SRAM_1ST_DMA_BANK = $777E00
!SRAM_1ST_SAVED_SP = $777E80
!SRAM_1ST_SAVED_STATE = $777E82
!SRAM_1ST_SAVED_MINIMAP = $777E84
!SRAM_1ST_SEG_TIMER_F = $777E86
!SRAM_1ST_SEG_TIMER_S = $777E88
!SRAM_1ST_SEG_TIMER_M = $777E8A

!SRAM_2ND_DMA_BANK = $777F00
!SRAM_2ND_SAVED_SP = $777F80
!SRAM_2ND_SAVED_STATE = $777F82
!SRAM_2ND_SAVED_MINIMAP = $777F84
!SRAM_2ND_SEG_TIMER_F = $777F86
!SRAM_2ND_SEG_TIMER_S = $777F88
!SRAM_2ND_SEG_TIMER_M = $777F8A
endif


; --------------------
; Aliases and Bitmasks
; --------------------

; this is moved here to prevent symbols.asm from having duplicate labels
if !FEATURE_TINYSTATES
!sram_read_only_locks = !sram_read_only_locks_tinystates
!sram_streamer_name = !sram_streamer_name_normal
!sram_custom_header = !sram_custom_header_tinystates
!sram_custom_preset_safewords = !sram_custom_preset_safewords_tinystates
!sram_custom_preset_names = !sram_custom_preset_names_tinystates
else
!sram_read_only_locks = !sram_read_only_locks_normal
!sram_streamer_name = !sram_streamer_name_tinystates
!sram_custom_header = !sram_custom_header_normal
!sram_custom_preset_safewords = !sram_custom_preset_safewords_normal
!sram_custom_preset_names = !sram_custom_preset_names_normal
endif

!DP_MenuIndices = $00 ; 0x4
!DP_CurrentMenu = $04 ; 0x4
!DP_Address = $08 ; 0x4
Expand Down
Loading
Loading