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: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ jobs:
- name: Build practice hack patches
run: |
cp ./asar/asar-1.81/asar/asar-standalone ./tools/asar
chmod +x ./build_presets.sh
chmod +x ./build.sh
chmod +x ./build_PAL.sh
./build_presets.sh
./build.sh
./build_PAL.sh
mkdir ./web/public/patches
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ jobs:
- name: Build practice hack patches
run: |
cp ./asar/asar-1.81/asar/asar-standalone ./tools/asar
chmod +x ./build_presets.sh
chmod +x ./build_dev.sh
chmod +x ./build.sh
chmod +x ./build_PAL.sh
./build_presets.sh
./build_dev.sh
./build.sh -DPRERELEASE=$(git rev-parse --short HEAD)
./build_PAL.sh -DPRERELEASE=$(git rev-parse --short HEAD)
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN mkdir -p /app/build \
COPY build.sh /app/build.sh
COPY build_dev.sh /app/build_dev.sh
COPY build_PAL.sh /app/build_PAL.sh
COPY build_presets.sh /app/build_presets.sh

ARG now

Expand All @@ -44,6 +45,7 @@ COPY resources/ resources/
RUN rm -rf src
COPY src/ src/

RUN ./build_presets.sh
RUN ./build_dev.sh
RUN ./build_PAL.sh
RUN ./build.sh
Expand Down
10 changes: 10 additions & 0 deletions build_presets.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off

echo Building Combined Preset Data
cd src\presets
if exist combined_map_preset_data.asm del combined_map_preset_data.asm
if exist combined_preset_data.asm del combined_preset_data.asm
python combine_map_preset_data.py
python combine_preset_data.py
cd ..\..

10 changes: 10 additions & 0 deletions build_presets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

echo "Building Combined Preset Data"
cd src/presets
rm -f combined_map_preset_data.asm
rm -f combined_preset_data.asm
python3 combine_map_preset_data.py
python3 combine_preset_data.py
cd ../..

Binary file modified resources/cm_gfx.bin
Binary file not shown.
Binary file modified resources/cm_gfx2.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion resources/sort_debug_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
elif in_source_files:
if new_file:
new_file.write(row)
parts = re.split(" |\.|\/", row)
parts = re.split(" |\\.|\\/", row)
if len(parts) > 3:
named_source = parts[len(parts) - 2]
if named_source in sources_dict.values():
Expand Down
13 changes: 8 additions & 5 deletions src/BRBmenu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ brb_menu_timer_mode:
db #$FF

brb_menu_timer_min:
%cm_numfield("Minutes on Timer", !ram_cm_brb_mins, 0, 99, 1, 2, #0)
%cm_numfield_word("Minutes on Timer", !ram_cm_brb_mins, 0, 99, 1, 2, #0)

brb_menu_timer_sec:
%cm_numfield("Seconds on Timer", !ram_cm_brb_secs, 0, 59, 1, 2, #0)
%cm_numfield_word("Seconds on Timer", !ram_cm_brb_secs, 0, 59, 1, 2, #0)

brb_menu_timer_clear:
%cm_jsl("Clear Timer", .routine, #0)
Expand Down Expand Up @@ -94,9 +94,12 @@ brb_menu_music_toggle:
db #$FF
.routine
; Clear music queue
STZ !MUSIC_QUEUE_TIMERS : STZ !MUSIC_QUEUE_TIMERS+$2 : STZ !MUSIC_QUEUE_TIMERS+$4 : STZ !MUSIC_QUEUE_TIMERS+$6
STZ !MUSIC_QUEUE_TIMERS+$8 : STZ !MUSIC_QUEUE_TIMERS+$A : STZ !MUSIC_QUEUE_TIMERS+$C : STZ !MUSIC_QUEUE_TIMERS+$E
STZ !MUSIC_QUEUE_NEXT : STZ !MUSIC_QUEUE_START : STZ !MUSIC_ENTRY : STZ !MUSIC_TIMER
STZ !MUSIC_QUEUE_TIMERS : STZ !MUSIC_QUEUE_TIMERS+$2
STZ !MUSIC_QUEUE_TIMERS+$4 : STZ !MUSIC_QUEUE_TIMERS+$6
STZ !MUSIC_QUEUE_TIMERS+$8 : STZ !MUSIC_QUEUE_TIMERS+$A
STZ !MUSIC_QUEUE_TIMERS+$C : STZ !MUSIC_QUEUE_TIMERS+$E
STZ !MUSIC_QUEUE_NEXT : STZ !MUSIC_QUEUE_START
STZ !MUSIC_ENTRY : STZ !MUSIC_TIMER
CMP #$0001 : BEQ .resume_music
STZ $2140
RTL
Expand Down
2 changes: 2 additions & 0 deletions src/crash.asm
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ CrashViewer:
%ai16()
JSL crash_next_frame
JSL crash_cgram_transfer
LDA $C1 : PHA : LDA $C3 : PHA
JSL cm_transfer_custom_tileset
PLA : STA $C3 : PLA : STA $C1

LDA #$0000 : STA !ram_crash_page : STA !ram_crash_palette : STA !ram_crash_cursor
STA !ram_crash_input : STA !ram_crash_input_new
Expand Down
2 changes: 1 addition & 1 deletion src/customizemenu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ mc_dummy_hexnum:
%cm_numfield_hex("Example Hex Number", !ram_cm_dummy_num, 0, 255, 1, 8, #0)

mc_dummy_num:
%cm_numfield("Example Number", !ram_cm_dummy_num, 0, 255, 1, 8, #0)
%cm_numfield_word("Example Number", !ram_cm_dummy_num, 0, 255, 1, 8, #0)


mc_custompalettes_test_menu:
Expand Down
18 changes: 10 additions & 8 deletions src/custompresets.asm
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ custom_preset_load:
LDA !PRESET_SLOTS+$88,X : STA $7ED90A ; Map Stations
LDA !PRESET_SLOTS+$8A,X : STA $7ED90C ; Map Stations
; set flag to load scrolls later
LDA !SAFEWORD : STA !ram_custom_preset
LDA !SAFEWORD : STA !ram_load_preset_low_word
; next available byte is !PRESET_SLOTS+$BE
; last two bytes of the first 100h are the map counter
LDA !PRESET_SLOTS+$FE,X : STA !MAP_COUNTER
Expand Down Expand Up @@ -363,7 +363,7 @@ custom_preset_load:
LDA !PRESET_SLOTS+$88,X : STA $7ED90A ; Map Stations
LDA !PRESET_SLOTS+$8A,X : STA $7ED90C ; Map Stations
; set flag to load scrolls later
LDA !SAFEWORD : STA !ram_custom_preset
LDA !SAFEWORD : STA !ram_load_preset_low_word
; next available byte is !PRESET_SLOTS+$BE
RTL
}
Expand Down Expand Up @@ -516,7 +516,7 @@ custom_preset_load:
LDA !PRESET_SLOTS+$1B6,X : STA !BG2_Y_OFFSET

LDA !PRESET_SLOTS+$02,X : CMP #$01BA : BMI .done_no_scrolls
LDA !SAFEWORD : STA !ram_custom_preset
LDA !SAFEWORD : STA !ram_load_preset_low_word

LDA !PRESET_SLOTS+$02,X : CMP #$01EC : BMI .done_with_scrolls
LDA !PRESET_SLOTS+$1EA,X : STA !SAMUS_X_SUBPX
Expand All @@ -528,7 +528,7 @@ custom_preset_load:
; next available byte is !PRESET_SLOTS+$1EE

.done_no_scrolls
TDC : STA !ram_custom_preset
TDC : STA !ram_load_preset_low_word
RTL
}
endif
Expand All @@ -543,7 +543,7 @@ preset_scroll_fixes:
PHB
%ai16()
STZ !BG2_X_OFFSET : STZ !BG2_Y_OFFSET
LDA !ram_custom_preset : CMP !SAFEWORD : BNE .category_presets
LDA !ram_load_preset_low_word : CMP !SAFEWORD : BNE .category_presets
JMP .custom_presets

.category_presets
Expand Down Expand Up @@ -964,7 +964,7 @@ endif
endif
LDY #$CD51 : LDA #$0031 ; Y = Destination, A = Size-1
MVP $707E ; srcBank, destBank
TDC : STA !ram_custom_preset
TDC : STA !ram_load_preset_low_word

%a8()
; X = room ID
Expand Down Expand Up @@ -1085,8 +1085,10 @@ LoadRandomPreset:

ASL : TAY
LDA [$16],Y : STA $16 ; random preset macro pointer in $16
LDY #$0004 : LDA [$16],Y ; finally reached the pointer to the preset
STA !ram_load_preset
LDY #$0002 : LDA [$16],Y ; finally reached the pointer to the preset
STA !ram_load_preset_low_word
INY : LDA [$16],Y
STA !ram_load_preset_high_word

; !FEATURE_DEV for crawling through preset categories in order
LDA !ram_random_preset_rng : BEQ .done
Expand Down
3 changes: 2 additions & 1 deletion src/cutscenes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ endif

.no_savestate
; reload last preset if it exists
LDA !sram_last_preset : BEQ .save_file : STA !ram_load_preset
LDA !sram_last_preset_low_word : BEQ .save_file : STA !ram_load_preset_low_word
LDA !sram_last_preset_high_word : STA !ram_load_preset_high_word
JSL preset_load
BRA .skip_gameplay

Expand Down
22 changes: 12 additions & 10 deletions src/defines.asm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
; on the game state. For variables that depend on user
; settings, place them below WRAM_PERSIST_START below.

!ram_load_preset = !WRAM_START+$00
!ram_vcounter_data = !WRAM_START+$00
!ram_gametime_room = !WRAM_START+$02
!ram_last_gametime_room = !WRAM_START+$04
!ram_realtime_room = !WRAM_START+$06
Expand Down Expand Up @@ -76,15 +76,15 @@
!ram_metronome_counter = !WRAM_START+$30
!ram_armed_shine_duration = !WRAM_START+$32
!ram_auto_save_state = !WRAM_START+$34
!ram_vcounter_data = !WRAM_START+$36
!ram_custom_preset = !WRAM_START+$38
!ram_watch_left_hud = !WRAM_START+$36
!ram_watch_right_hud = !WRAM_START+$38

!ram_magic_pants_state = !WRAM_START+$3A
!ram_magic_pants_pal1 = !WRAM_START+$3C
!ram_magic_pants_pal2 = !WRAM_START+$3E
!ram_magic_pants_pal3 = !WRAM_START+$40

!ram_room_has_set_rng = !WRAM_START+$42
!ram_print_segment_timer = !WRAM_START+$42
!ram_HUD_top = !WRAM_START+$44
!ram_HUD_middle = !WRAM_START+$46
!ram_infidoppler_active = !WRAM_START+$48
Expand All @@ -98,10 +98,10 @@

!ram_lag_counter = !WRAM_START+$58
!ram_kraid_adjust_timer = !WRAM_START+$5A
!ram_print_segment_timer = !WRAM_START+$5C
!ram_activated_shine_duration = !WRAM_START+$5E
!ram_watch_left_hud = !WRAM_START+$60
!ram_watch_right_hud = !WRAM_START+$62
!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 +$6C

Expand Down Expand Up @@ -488,8 +488,9 @@
!sram_frame_counter_mode = !SRAM_START+$26
!sram_display_mode = !SRAM_START+$28
!sram_music_toggle = !SRAM_START+$2A
!sram_last_preset = !SRAM_START+$2C
!sram_save_has_set_rng = !SRAM_START+$2E
!sram_last_preset_low_word = !SRAM_START+$2C
!sram_last_preset_high_word = !SRAM_START+$2D ; Last preset is three bytes
!sram_save_has_set_rng = !SRAM_START+$2E ; Room set RNG only uses the most significant bit
!sram_preset_category = !SRAM_START+$30
!sram_custom_preset_slot = !SRAM_START+$32
!sram_room_strat = !SRAM_START+$34
Expand Down Expand Up @@ -1212,6 +1213,7 @@ endif
!ACTION_RAM_WATCH = #$0024
!ACTION_DYNAMIC = #$0026
!ACTION_MANAGE_PRESETS = #$0028
!ACTION_CATEGORY_PRESET = #$002A

!SAFEWORD = #$5AFE

Expand Down
6 changes: 3 additions & 3 deletions src/enemy_rng.asm
Original file line number Diff line number Diff line change
Expand Up @@ -528,20 +528,20 @@ MenuRNG2:

hook_hopper_set_rng:
{
LDA #$0001 : STA !ram_room_has_set_rng
LDA !ram_room_has_set_rng : ORA #$8000 : STA !ram_room_has_set_rng
JML $808111
}

hook_lavarocks_set_rng:
{
LDA #$0001 : STA !ram_room_has_set_rng
LDA !ram_room_has_set_rng : ORA #$8000 : STA !ram_room_has_set_rng
LDA #$0011 : STA !CACHED_RANDOM_NUMBER
RTL
}

hook_beetom_set_rng:
{
LDA #$0001 : STA !ram_room_has_set_rng
LDA !ram_room_has_set_rng : ORA #$8000 : STA !ram_room_has_set_rng
LDA #$0017 : STA !CACHED_RANDOM_NUMBER
RTL
}
Expand Down
10 changes: 5 additions & 5 deletions src/flagmenu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,19 @@ eq_setmissiles:
RTL

eq_currentsupers:
%cm_numfield("Current Super Missiles", !SAMUS_SUPERS, 0, 65, 1, 5, #0)
%cm_numfield_word("Current Super Missiles", !SAMUS_SUPERS, 0, 65, 1, 5, #0)

eq_setsupers:
%cm_numfield("Super Missiles", !SAMUS_SUPERS_MAX, 0, 65, 5, 5, .routine)
%cm_numfield_word("Super Missiles", !SAMUS_SUPERS_MAX, 0, 65, 5, 5, .routine)
.routine
LDA !SAMUS_SUPERS_MAX : STA !SAMUS_SUPERS
RTL

eq_currentpbs:
%cm_numfield("Current Power Bombs", !SAMUS_PBS, 0, 70, 1, 5, #0)
%cm_numfield_word("Current Power Bombs", !SAMUS_PBS, 0, 70, 1, 5, #0)

eq_setpbs:
%cm_numfield("Power Bombs", !SAMUS_PBS_MAX, 0, 70, 5, 5, .routine)
%cm_numfield_word("Power Bombs", !SAMUS_PBS_MAX, 0, 70, 5, 5, .routine)
.routine
LDA !SAMUS_PBS_MAX : STA !SAMUS_PBS
RTL
Expand Down Expand Up @@ -2388,7 +2388,7 @@ misc_metronome:
%cm_toggle("Metronome", !ram_metronome, #$01, GameLoopExtras)

misc_metronome_tickrate:
%cm_numfield("Metronome Tickrate", !sram_metronome_tickrate, 1, 255, 1, 8, #.routine)
%cm_numfield_word("Metronome Tickrate", !sram_metronome_tickrate, 1, 255, 1, 8, #.routine)
.routine
TDC : STA !ram_metronome_counter
RTL
Expand Down
26 changes: 12 additions & 14 deletions src/gamemode.asm
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ gamemode_start:
.skip_gameplay_done_pause
; Don't load presets or decrement counters if we're in credits
LDA !GAMEMODE : CMP #$0027 : BEQ .skip_load

LDA !ram_custom_preset : BNE .preset_load
LDA !ram_load_preset : BEQ .dec_rta

.preset_load
LDA !ram_load_preset_low_word : BEQ .dec_rta
JSL preset_load

.skip_load
Expand Down Expand Up @@ -265,8 +261,9 @@ endif
gamemode_reload_preset:
{
; Choose a random preset if zero
LDA !sram_last_preset : BEQ gamemode_random_preset
STA !ram_load_preset
LDA !sram_last_preset_low_word : BEQ gamemode_random_preset
STA !ram_load_preset_low_word
LDA !sram_last_preset_high_word : STA !ram_load_preset_high_word

; Skip remaining shortcuts
PLA : PEA !CTRL_SHORTCUT_SKIP_REMAINING_PEA_VALUE
Expand Down Expand Up @@ -309,7 +306,8 @@ gamemode_load_custom_preset:
RTL

.safe
STA !ram_custom_preset
STA !ram_load_preset_low_word
XBA : AND #$00FF : STA !ram_load_preset_high_word
JML preset_load
}

Expand All @@ -323,8 +321,8 @@ if !FEATURE_VANILLAHUD
else
ASL : TAX : LDA.l NumberGFXTable,X : STA !HUD_TILEMAP+$7C
endif
LDA !sram_last_preset : BMI .done
TDC : STA !sram_last_preset
LDA !sram_last_preset_low_word : BMI .done
TDC : STA !sram_last_preset_low_word : STA !sram_last_preset_high_word
.done
%sfxnumber()
RTL
Expand All @@ -340,8 +338,8 @@ if !FEATURE_VANILLAHUD
else
ASL : TAX : LDA.l NumberGFXTable,X : STA !HUD_TILEMAP+$7C
endif
LDA !sram_last_preset : BMI .done
TDC : STA !sram_last_preset
LDA !sram_last_preset_low_word : BMI .done
TDC : STA !sram_last_preset_low_word : STA !sram_last_preset_high_word
.done
%sfxnumber()
RTL
Expand Down Expand Up @@ -1625,7 +1623,7 @@ CtrlShortcutMenu2:
dw #ctrlshortcut_reset_defaults
dw #$0000
%cm_header("CONTROLLER SHORTCUTS")
%cm_footer_ctrlshortcut("PRESS AND HOLD FOR 2 SEC", "TOGGLES EXACT MATCH")
%cm_footer_ctrlshortcut("PRESS AND HOLD FOR ONE SEC", "TOGGLES EXACT MATCH")

CtrlShortcutMenu3:
dw #ctrlshortcut_32
Expand All @@ -1649,7 +1647,7 @@ CtrlShortcutMenu3:
dw #ctrlshortcut_reset_defaults
dw #$0000
%cm_header("CONTROLLER SHORTCUTS")
%cm_footer_ctrlshortcut("PRESS AND HOLD FOR 2 SEC", "TOGGLES EXACT MATCH")
%cm_footer_ctrlshortcut("PRESS AND HOLD FOR ONE SEC", "TOGGLES EXACT MATCH")

%cm_ctrl_shortcut(00)
%cm_ctrl_shortcut(01)
Expand Down
Loading