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
2 changes: 1 addition & 1 deletion src/BRBmenu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ brb_menu_timer_clear:
brb_menu_cycle_timer:
%cm_numfield_word("Cycle Timer (seconds)", !ram_cm_brb_set_cycle, 1, 512, 1, 10, .routine)
.routine
LDA !ram_cm_brb_set_cycle : BNE .setTime
TAX : BNE .setTime
LDA #$0009 ; default to ~10s
.setTime
ASL #6 : STA !ram_cm_brb_cycle_time
Expand Down
54 changes: 39 additions & 15 deletions src/defines.asm
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@
!ram_cm_brb_set_cycle = !WRAM_MENU_START+$AC
!ram_cm_brb_cycle_time = !WRAM_MENU_START+$AE

!ram_cm_grapple = !WRAM_MENU_START+$90
!ram_cm_xray = !WRAM_MENU_START+$92
!ram_cm_manage_slots = !WRAM_MENU_START+$90
!ram_cm_selected_slot = !WRAM_MENU_START+$92
!ram_cm_preset_elevator = !WRAM_MENU_START+$94
Expand Down Expand Up @@ -472,7 +474,7 @@
; SRAM
; -----

!SRAM_VERSION = #$001A
!SRAM_VERSION = #$001B

!SRAM_START = $702000
!SRAM_SIZE = #$1000
Expand Down Expand Up @@ -573,6 +575,22 @@
!sram_loadstate_rando_supers = !SRAM_START+$116
!sram_loadstate_rando_powerbombs = !SRAM_START+$118
!sram_loadstate_rando_enable = !SRAM_START+$11A
!sram_categoryadjust_item_equip = !SRAM_START+$11C
!sram_categoryadjust_item_unequip = !SRAM_START+$11E
!sram_categoryadjust_item_remove = !SRAM_START+$120
!sram_categoryadjust_beam_equip = !SRAM_START+$122
!sram_categoryadjust_beam_unequip = !SRAM_START+$124
!sram_categoryadjust_beam_remove = !SRAM_START+$126
!sram_categoryadjust_energy = !SRAM_START+$128
!sram_categoryadjust_etanks = !SRAM_START+$12A
!sram_categoryadjust_reserves = !SRAM_START+$12C
!sram_categoryadjust_rtanks = !SRAM_START+$12E
!sram_categoryadjust_missiles = !SRAM_START+$130
!sram_categoryadjust_maxmissiles = !SRAM_START+$132
!sram_categoryadjust_supers = !SRAM_START+$134
!sram_categoryadjust_maxsupers = !SRAM_START+$136
!sram_categoryadjust_pbs = !SRAM_START+$138
!sram_categoryadjust_maxpbs = !SRAM_START+$13A

; ^ FREE SPACE ^ up to +$13E

Expand Down Expand Up @@ -1203,20 +1221,22 @@ endif
!ACTION_NUMFIELD_HEX = #$000A
!ACTION_NUMFIELD_WORD = #$000C
!ACTION_NUMFIELD_HEX_WORD = #$000E
!ACTION_NUMFIELD_READONLY = #$0010
!ACTION_NUMFIELD_COLOR = #$0012
!ACTION_NUMFIELD_SOUND = #$0014
!ACTION_CHOICE = #$0016
!ACTION_CHOICE_JSL_TEXT = #$0018
!ACTION_CTRL_SHORTCUT = #$001A
!ACTION_CTRL_INPUT = #$001C
!ACTION_JSL = #$001E
!ACTION_JSL_SUBMENU = #$0020
!ACTION_CUSTOM_PRESET = #$0022
!ACTION_RAM_WATCH = #$0024
!ACTION_DYNAMIC = #$0026
!ACTION_MANAGE_PRESETS = #$0028
!ACTION_CATEGORY_PRESET = #$002A
!ACTION_NUMFIELD_SIGNED = #$0010
!ACTION_NUMFIELD_READONLY = #$0012
!ACTION_NUMFIELD_COLOR = #$0014
!ACTION_NUMFIELD_SOUND = #$0016
!ACTION_CHOICE = #$0018
!ACTION_CHOICE_JSL_TEXT = #$001A
!ACTION_CTRL_SHORTCUT = #$001C
!ACTION_CTRL_INPUT = #$001E
!ACTION_JSL = #$0020
!ACTION_JSL_SUBMENU = #$0022
!ACTION_CUSTOM_PRESET = #$0024
!ACTION_RAM_WATCH = #$0026
!ACTION_DYNAMIC = #$0028
!ACTION_MANAGE_PRESETS = #$002A
!ACTION_CATEGORY_PRESET = #$002C
!ACTION_ADJUST_ITEM = #$002E

!SAFEWORD = #$5AFE

Expand All @@ -1243,6 +1263,9 @@ endif
!SUIT_PROPERTIES_MASK = #$0007
!SUIT_PROPRETIES_PAL_DEBUG_FLAG = #$0008

!FRAME_COUNTER_USE_IGT = #$0001
!FRAME_COUNTER_ADJUST_REALTIME = #$0002

!ROOM_LAYOUT_NO_MAGNET_STAIRS = #$0001
!ROOM_LAYOUT_AREA_RANDO = #$0002
!ROOM_LAYOUT_ANTISOFTLOCK = #$0004
Expand Down Expand Up @@ -1286,6 +1309,7 @@ endif
!PRESETS_COMPRESSED_GRAPHICS = #$0001
!PRESETS_COMPRESSED_PALETTES = #$0002
!PRESETS_COMPRESSED_TABLES = #$0004
!PRESETS_COMPRESSED = #$0007
!PRESETS_CLOSE_BLUE_DOORS = #$0008
!PRESETS_PRESERVE_ENEMIES = #$0010
!PRESETS_CLEAR_MAP_TILES = #$0020
Expand Down
6 changes: 3 additions & 3 deletions src/flagmenu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ eq_currentmissiles:
eq_setmissiles:
%cm_numfield_word("Missiles", !SAMUS_MISSILES_MAX, 0, 325, 5, 20, .routine)
.routine
LDA !SAMUS_MISSILES_MAX : STA !SAMUS_MISSILES
STA !SAMUS_MISSILES
RTL

eq_currentsupers:
Expand All @@ -129,7 +129,7 @@ eq_currentsupers:
eq_setsupers:
%cm_numfield_word("Super Missiles", !SAMUS_SUPERS_MAX, 0, 65, 5, 5, .routine)
.routine
LDA !SAMUS_SUPERS_MAX : STA !SAMUS_SUPERS
STA !SAMUS_SUPERS
RTL

eq_currentpbs:
Expand All @@ -138,7 +138,7 @@ eq_currentpbs:
eq_setpbs:
%cm_numfield_word("Power Bombs", !SAMUS_PBS_MAX, 0, 70, 5, 5, .routine)
.routine
LDA !SAMUS_PBS_MAX : STA !SAMUS_PBS
STA !SAMUS_PBS
RTL


Expand Down
4 changes: 2 additions & 2 deletions src/gamemenu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ game_demo_wait_timer:
game_ceres_escape_timer:
%cm_numfield_word("Ceres Timer (seconds)", !ram_cm_ceres_seconds, 1, 5999, 1, 20, .routine)
.routine
LDA !ram_cm_ceres_seconds : STA $4204
STA $4204
%a8()
LDA.b #$0A : STA $4206
%a16()
Expand Down Expand Up @@ -86,7 +86,7 @@ game_ceres_escape_timer:
game_zebes_escape_timer:
%cm_numfield_word("Zebes Timer (seconds)", !ram_cm_zebes_seconds, 1, 5999, 1, 20, .routine)
.routine
LDA !ram_cm_zebes_seconds : STA $4204
STA $4204
%a8()
LDA.b #$0A : STA $4206
%a16()
Expand Down
98 changes: 87 additions & 11 deletions src/gamemode.asm
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ endif

if !FEATURE_VANILLAHUD
else
gamemode_toggle_igt_rta:
{
LDA !sram_frame_counter_mode : EOR !FRAME_COUNTER_USE_IGT
STA !sram_frame_counter_mode
; Fallthrough
}

gamemode_update_timers:
{
JML ih_update_hud_early
Expand Down Expand Up @@ -347,11 +354,11 @@ endif

gamemode_reset_segment_timer:
{
LDA !sram_frame_counter_mode : BEQ .rta
LDA !sram_frame_counter_mode : AND !FRAME_COUNTER_USE_IGT : BEQ .rta
STZ !IGT_FRAMES : STZ !IGT_SECONDS
STZ !IGT_MINUTES : STZ !IGT_HOURS
STZ !IGT_MINUTES : STZ !IGT_HOURS : TDC
.rta
TDC : STA !ram_seg_rt_frames
STA !ram_seg_rt_frames
STA !ram_seg_rt_seconds : STA !ram_seg_rt_minutes
%sfxconfirm()
if !FEATURE_VANILLAHUD
Expand Down Expand Up @@ -419,18 +426,15 @@ gamemode_reveal_damage:
; revert to prior mode
LDA !ram_display_backup : STA !sram_display_mode
%sfxreset()
JML init_print_segment_timer
BRA gamemode_reveal_hp_updateHUD

.revealRoomStrat
LDA !sram_display_mode
.reveal
STA !ram_display_backup
LDA !IH_MODE_COUNTDAMAGE_INDEX : STA !sram_display_mode
; set ram_HUD_check to some value that cannot match the damage counter
; conveniently the current value of A will work
STA !ram_HUD_check
%sfxconfirm()
JML init_print_segment_timer
BRA gamemode_reveal_hp_updateHUD

.checkRoomStrat
LDA !sram_room_strat : BNE .revealRoomStrat
Expand All @@ -439,16 +443,54 @@ gamemode_reveal_damage:
; revert to prior Super HUD mode
LDA !ram_display_backup : STA !sram_superhud_bottom
%sfxreset()
JML init_print_segment_timer
BRA gamemode_reveal_hp_updateHUD

.revealSuperHUD
STA !ram_display_backup
LDA !IH_SUPERHUD_COUNTDAMAGE_BOTTOM_INDEX : STA !sram_superhud_bottom
%sfxconfirm()
BRA gamemode_reveal_hp_updateHUD
}

gamemode_reveal_hp:
{
LDA !sram_display_mode : CMP !IH_MODE_ROOMSTRAT_INDEX : BEQ .checkRoomStrat
CMP !IH_MODE_COUNTHP_INDEX : BNE .reveal
; revert to prior mode
LDA !ram_display_backup : STA !sram_display_mode
%sfxreset()
.updateHUD
LDA #$FFFF : STA !ram_enemy_hp : STA !ram_HUD_check
STA !ram_xpos : STA !ram_ypos : STA !ram_subpixel_pos
STA !ram_HUD_top : STA !ram_HUD_middle
STA !ram_HUD_top_counter : STA !ram_HUD_middle_counter
JML init_print_segment_timer

.revealRoomStrat
LDA !sram_display_mode
.reveal
STA !ram_display_backup
LDA !IH_MODE_COUNTHP_INDEX : STA !sram_display_mode
%sfxconfirm()
BRA .updateHUD

.checkRoomStrat
LDA !sram_room_strat : BNE .revealRoomStrat
; handle Super HUD case
LDA !sram_superhud_bottom : CMP !IH_SUPERHUD_COUNTHP_BOTTOM_INDEX : BNE .revealSuperHUD
; revert to prior Super HUD mode
LDA !ram_display_backup : STA !sram_superhud_bottom
%sfxreset()
BRA .updateHUD

.revealSuperHUD
STA !ram_display_backup
LDA !IH_SUPERHUD_COUNTHP_BOTTOM_INDEX : STA !sram_superhud_bottom
; set ram_HUD_check to some value that cannot match the damage counter
; conveniently the current value of A will work
STA !ram_HUD_check
%sfxconfirm()
JML init_print_segment_timer
BRA .updateHUD
}
endif

Expand Down Expand Up @@ -593,7 +635,7 @@ gamemode_dev_shortcut:
endif

; Write a customized routine based on ctrl shortcut selections
!GAMEMODE_CTRL_SHORTCUT_COUNT = #$0021
!GAMEMODE_CTRL_SHORTCUT_COUNT = #$0023
cm_write_ctrl_routine:
{
; No bounds check on X is done as we shouldn't exceed our buffer.
Expand Down Expand Up @@ -1731,6 +1773,7 @@ endif
if !FEATURE_VANILLAHUD
else
dw #ctrl_add_update_timers
dw #ctrl_add_toggle_igt_rta
endif
dw #ctrl_add_reload_preset
dw #ctrl_add_random_preset
Expand All @@ -1754,6 +1797,7 @@ CtrlSelectShortcutTypeMenu2:
if !FEATURE_VANILLAHUD
else
dw #ctrl_add_reveal_damage
dw #ctrl_add_reveal_hp
endif
dw #ctrl_add_force_stand
dw #ctrl_add_toggle_spin_lock
Expand Down Expand Up @@ -1876,6 +1920,13 @@ if !FEATURE_DEV
else
dw #ctrl_add_empty_dm_text
endif
if !FEATURE_VANILLAHUD
dw #ctrl_add_empty_dm_text
dw #ctrl_add_empty_dm_text
else
dw #ctrl_add_reveal_hp_dm_text
dw #ctrl_add_toggle_igt_rta_dm_text
endif

ctrl_shortcut_cancel_gameplay_table:
db $00 ; Empty
Expand Down Expand Up @@ -1911,6 +1962,8 @@ ctrl_shortcut_cancel_gameplay_table:
db $00 ; Decrement Super HUD
db $01 ; Soft Reset
db $01 ; DEV Shortcut
db $00 ; Reveal HP
db $00 ; Toggle IGT/RTA

ctrl_shortcut_jsl_word_lsb_table:
db #gamemode_placeholder
Expand Down Expand Up @@ -1973,6 +2026,13 @@ if !FEATURE_DEV
else
db #gamemode_placeholder
endif
if !FEATURE_VANILLAHUD
db #gamemode_placeholder
db #gamemode_placeholder
else
db #gamemode_reveal_hp
db #gamemode_toggle_igt_rta
endif

ctrl_shortcut_jsl_word_msb_table:
db #gamemode_placeholder>>8
Expand Down Expand Up @@ -2035,6 +2095,13 @@ if !FEATURE_DEV
else
db #gamemode_placeholder>>8
endif
if !FEATURE_VANILLAHUD
db #gamemode_placeholder>>8
db #gamemode_placeholder>>8
else
db #gamemode_reveal_hp>>8
db #gamemode_toggle_igt_rta>>8
endif

ctrl_add_empty:
%cm_jsl("", #ctrl_add_shortcut_select, #$0000)
Expand Down Expand Up @@ -2146,6 +2213,15 @@ ctrl_add_soft_reset:
ctrl_add_dev_shortcut:
%cm_jsl("DEV Shortcut", #ctrl_add_shortcut_select, #$0020)

if !FEATURE_VANILLAHUD
else
ctrl_add_reveal_hp:
%cm_jsl("Toggle Boss HP", #ctrl_add_shortcut_select, #$0021)

ctrl_add_toggle_igt_rta:
%cm_jsl("Toggle IGT/RTA", #ctrl_add_shortcut_select, #$0022)
endif

ctrl_add_shortcut_select:
{
LDA !ram_cm_ctrl_add_shortcut_slot
Expand Down
Loading