~zanneth/ddr-extreme-clarity

3c7c3a2f0b8362936a1bfde578e67b8a9dc0a987 — Charles Magahern 2 years ago 88093fe
Add feature that locks player on '2nd Stage' forever on EVENT mode
3 files changed, 34 insertions(+), 3 deletions(-)

M src/game-code/Makefile
A src/game-code/music_select_init_hook.s
M src/scripts/add_clarity.py
M src/game-code/Makefile => src/game-code/Makefile +4 -3
@@ 6,16 6,17 @@ SRCS      		:= init_player_stats_hook.s \
				   vertex_hook.s \
				   results_load_hook.s \
				   results_texcoord_hook.s \
				   results_main_hook.s
				   results_main_hook.s \
				   music_select_init_hook.s

BUILD_DIR 		:= ./build
OBJS      		:= ${SRCS:%.s=${BUILD_DIR}/%.o}
BINS      		:= ${SRCS:%.s=${BUILD_DIR}/%.bin}

CC              = mips-mti-elf-gcc
CC              = mips-img-elf-gcc
CCFLAGS         = -Os -nostartfiles -nostdlib -march=r3000 -EL -fPIC -mabicalls

OBJCOPY         = mips-mti-elf-objcopy
OBJCOPY         = mips-img-elf-objcopy
OBJCOPYFLAGS    = -j .text -O binary

MANIFEST_SCRIPT = ./genmanifest.sh

A src/game-code/music_select_init_hook.s => src/game-code/music_select_init_hook.s +29 -0
@@ 0,0 1,29 @@
#
# music_select_init_hook.s
#
# hook into the routine that runs before showing the music select screen. in 
# event mode, write '1' instead of '0' into the current stage address so that we
# are always at second stage.
#
# written by zanneth <root@zanneth.com>
#

# jump to me from 80027C64

li      $t1, 0x800f003b # event mode?
lb      $t1, 0($t1)
beqz    $t1, ddr_game_state_init_break

li      $t1, 0x800f0030
li      $t2, 0x00010003
sw      $t2, 0($t1)

li      $t2, 1
sb      $t2, 4($t1)

li      $t2, 0
sb      $t2, 5($t1)
sb      $t2, 6($t1)

ddr_game_state_init_break:
jr      $ra             # jump to original location

M src/scripts/add_clarity.py => src/scripts/add_clarity.py +1 -0
@@ 49,6 49,7 @@ GAME_EXECUTABLE_HOOKS               = [
    ("results_load_hook",       0x80061154,  PatchType.UNCONDITIONAL_JUMP),
    ("results_texcoord_hook",   0x8006C9DC,  PatchType.UNCONDITIONAL_JUMP),
    ("results_main_hook",       0x800D8B70,  PatchType.ADDRESS_TRANSPOSITION),
    ("music_select_init_hook",  0x80027C64,  PatchType.UNCONDITIONAL_JUMP),
]

# ------------------------------------------------------------------------------