Skip to content

Commit

Permalink
Update Jack Bros. to v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vaguerant committed Apr 17, 2024
1 parent 364fa08 commit 4b3a33c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Here's a few assembly patches for Virtual Boy games.
* erase saves with the normal in-game menu under Individual Records
* `jackbros-save.asm`
* compatible with `Jack Bros. (USA).vb` **only**
* does not apply to the Japan ROM but adds the option to switch language (English/Japanese) by holding the **Start** button while booting the game. Defaults to English, but the language setting *is* saved
* does not apply to the Japan ROM but you can use the secret language-swap button code built into the original game (!). Hold **L**, **R** and **Left D-Pad Left** then press **Start** on the title screen; this will switch languages and save the new setting to SRAM
* saves the most recent password entered *or* received via gameplay. In line with this, the `PASSWORD` option on the title screen is now the `CONTINUE` option
* latest saved password can be loaded by pressing **Start** on the Continue screen. If a password is available, a prompt is added to the password entry screen
* enables the [debug mode and Japan-only sound test feature](https://www.virtual-boy.com/games/jack-bros/guides/)
Expand Down
25 changes: 16 additions & 9 deletions jackbros-save.asm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ FONT_CHECK:
ld.h 0x00f2[r25], r11
cmp r0, r11

; Secret language switch built into the game?! Hijack this to switch in SRAM
!ORG 0x0700461E
!SEEK 0x0461E
jr LANGUAGE_SWAP ; st.h r6, 0x00F2[r25]
LANGUAGE_SWAP_RETURN:

; Read language byte from save (0x600) instead of ROM (0x700) everywhere
!SEEK 0x0481A
movhi 0x600, r0, r1
Expand Down Expand Up @@ -153,16 +159,8 @@ CHECK_SRAM:
movhi 0x600, r0, r6
ld.w 0x0000[r6], r7
cmp r1, r7
be LANGUAGE_CHECK
jal CLEAR_SRAM
LANGUAGE_CHECK:
movhi 0x200, r0, r7
ld.b 0x0014[r7], r7
andi 0x10, r7, r0
be CLEAR_MEM
ld.b 0x0004[r6], r7
xori 0xFF, r7, r7
st.b r7, 0x0004[r6]
jal CLEAR_SRAM
CLEAR_MEM:
mov r25, r6
movea 0x4000, r0, r7
Expand All @@ -187,6 +185,15 @@ CLEAR_SRAM:
?pop r1, r6, r7
jmp [lp]

LANGUAGE_SWAP:
?push r7
movhi 0x600, r0, r1
ld.b 0x0004[r1], r7
xor r7, r6
st.h r6, 0x0004[r1]
?pop r7
jr LANGUAGE_SWAP_RETURN

CONTINUE:
?push r6
ld.h 0x0010[r25], r6
Expand Down

0 comments on commit 4b3a33c

Please sign in to comment.