Skip to content
Open
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
47 changes: 47 additions & 0 deletions common/dwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,51 @@ static void skip_vanilla_credits(dw_rom *rom)
}
}


static void forfeit_trigger(dw_rom *rom)
{

/* After the status screen is opened it waits for any input at all before closing. */
/* We're jumping off at that point to do almost the same thing, but with a twist. */
vpatch(rom, 0xcfa4, 3,
0x20, 0x00, 0xc9); /* JSR 0xC900 */


/* After you open the status screen before anything else can happen you have to let */
/* go of every button on the controller. This is vanilla behavior. Used to be that */
/* pressing any button would then close the window. Now, any button that isn't */
/* select or start will close the window. If you push select and start together at */
/* the same time it takes you straight to the credits. */
vpatch(rom, 0xc900, 40,
0x20, 0x74, 0xff, /* These first two sections */
0x20, 0x08, 0xc6, /* are just rehashing the */
0xa5, 0x47, /* "let go of all buttons...*/
0xd0, 0xf6,

0x20, 0x74, 0xff, /* ...then press any button"*/
0x20, 0x08, 0xc6, /* code that's used in the */
0xa5, 0x47, /* status screen as well as */
0xf0, 0xf6, /* a couple other places. */

0x29, 0xf3, /* AND 11110011 (bitwise code for every button that isn't start or select) */
0xf0, 0x01, /* BEQ 1 */
0x60, /* RTS (close the window) */

0xa5, 0x47, /* LDA $47 (load button presses) */
0x29, 0x04, /* AND select_button */
0xf0, 0xeb, /* BEQ -21 (start the loop over */
/* if only one is pressed)*/
0xa5, 0x47, /* LDA $47 (load button presses) */
0x29, 0x08, /* AND start_button */
0xf0, 0xe5, /* BEQ -27 (same as above) */

0x4c, 0xed, 0xcc /* JMP 0xCCED (start credits) */

);


}

/**
* Sets up the extra expansion banks
*
Expand Down Expand Up @@ -2107,6 +2152,8 @@ uint64_t dwr_randomize(const char* input_file, uint64_t seed, char *flags,

crc = crc64(0, rom.content, 0x10000);

forfeit_trigger(&rom);

update_title_screen(&rom);
no_screen_flash(&rom);

Expand Down
1 change: 1 addition & 0 deletions notes/free_space.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ C475 | C4BC | 71 | 3 | Torch/FW use in battle
C4BC | C4CE | 18 | 3 | Three's Company
C4CE | C4E8 | 26 | 3 | Cursed Princess
C4E8 | C4F5 | 13 | 3 | Scared Metal Slimes
C900 | C927 | 40 | 3 | Forfeit Trigger
E158 | E16E | 22 | 3 | Scaled Metal Slime XP
FF7D | FF8E | 17 | 3 | Fighter's Ring fix
FF54 | FF57 | 3 | 3 | Fighter's Ring fix
Expand Down