From 1b99a0ed965c4406553131a3cd23ab5644acfdd6 Mon Sep 17 00:00:00 2001 From: nstbayless Date: Tue, 30 Jul 2024 10:05:26 -0700 Subject: [PATCH] assembly export --- _common.asm | 15 ++++++++++- _hooks.asm | 13 +++++----- build.sh | 64 +++++++++++++++++++++++++++++++---------------- offsets-jp.asm | 7 +----- offsets-us.asm | 4 +-- pkg_readme.md | 3 ++- test_protocol.txt | 16 +++++++----- 7 files changed, 76 insertions(+), 46 deletions(-) diff --git a/_common.asm b/_common.asm index 3a70158..51f212f 100644 --- a/_common.asm +++ b/_common.asm @@ -1,2 +1,15 @@ VSP_CONTROL_ZERO_VSPEED=$1C -MINIMUM_VSP_CANCEL=$0E \ No newline at end of file +MINIMUM_VSP_CANCEL=$0E + +; these don't really need to be powers of 2 +ifdef INERTIA_64 + INERTIA=64 +endif + +ifdef INERTIA_0 + INERTIA=0 +endif + +ifdef INERTIA_32 + INERTIA=32 +endif \ No newline at end of file diff --git a/_hooks.asm b/_hooks.asm index e5ce1d7..7b13de3 100644 --- a/_hooks.asm +++ b/_hooks.asm @@ -6,6 +6,12 @@ FROM detour_to_custom_knockback NOP JSR custom_knockback +FROM attack + jsr jumping_attack + +FROM jump_attack_step + jsr jumping_attack + ; in Trevor state jump table ($9376) FROM trevor_jump_table SKIP $8 @@ -13,12 +19,6 @@ SKIP $8 ; jump replacement DW custom_jump_then_standard_jump -FROM attack - jsr jumping_attack - -FROM jump_attack_step - jsr jumping_attack - FROM set_fall_state ; go to jump state (instead of falling state) lda #$08 @@ -62,7 +62,6 @@ FROM standard_stair_walk JSR stair_jumping FROM sypha_jumptable - SKIP $8 ; jump DW custom_jump_then_standard_jump diff --git a/build.sh b/build.sh index 4897bd6..2373128 100755 --- a/build.sh +++ b/build.sh @@ -4,6 +4,7 @@ OUT=out builds=("us" "jp") vcancel_cfgs=("vcancel" "no-vcancel") +inertia_cfgs=("none" "light" "heavy") export="cv3-controls" set -e @@ -29,32 +30,51 @@ for build in "${builds[@]}"; do fi echo "INCNES \"$BASE-$build.nes\"" > inc-base.asm mkdir $export/$build + mkdir $export/$build/inertia for vcancel in "${vcancel_cfgs[@]}"; do - defines="" - - suffix="$build" - if [ "$vcancel" == "vcancel" ]; then - suffix="$build-$vcancel" - defines="$defines -dVCANCEL" - fi - - echo "building $suffix" - - asm6f -c -n -i "-dUSEBASE" "-dBUILD_${build^^}" $defines "$SRC-$build.asm" "$OUT-$suffix.nes" + for inertia in "${inertia_cfgs[@]}"; do + defines="" + + suffix="$build" + subpath="$build" + if [ "$vcancel" == "vcancel" ]; then + suffix="$suffix-$vcancel" + defines="$defines -dVCANCEL" + fi + + if [ "$inertia" == "none" ]; then + defines="$defines -dINERTIA_64" + true + elif [ "$inertia" == "light" ]; then + defines="$defines -dINERTIA_0" + suffix="$suffix-light" + subpath="$subpath/inertia" + elif [ "$inertia" == "heavy" ]; then + defines="$defines -dINERTIA_32" + suffix="$suffix-heavy" + subpath="$subpath/inertia" + fi + + echo "building $suffix" + + set -x + asm6f -c -n -i "-dUSEBASE" "-dBUILD_${build^^}" $defines "$SRC-$build.asm" "$OUT-$suffix.nes" + set +x - if [ $? != 0 ] - then - echo "error building." - exit - fi - - cp "$OUT-$suffix.ips" "$export/$build/$export-$suffix.ips" - - if command -v ipsnect >/dev/null 2>&1; then - ipsnect "$OUT-$suffix.ips" > "$OUT-$suffix.map" - fi + if [ $? != 0 ] + then + echo "error building." + exit + fi + + cp "$OUT-$suffix.ips" "$export/$subpath/$export-$suffix.ips" + + if command -v ipsnect >/dev/null 2>&1; then + ipsnect "$OUT-$suffix.ips" > "$OUT-$suffix.map" + fi + done done done diff --git a/offsets-jp.asm b/offsets-jp.asm index 0918997..86d7501 100644 --- a/offsets-jp.asm +++ b/offsets-jp.asm @@ -17,9 +17,4 @@ empty_bank_e=$BF90 ; actually $BF39 empty_bank_jump=$BED0 ; actually can go a bit earlier setAndSaveLowerBank=$E2D0 PLAYER_UPDATE_BANK=$E -CUSTOM_JUMP_BANK=$1 - -; if $0, disabled -; otherwise, between $1 and $255 enabled -; higher values are actually less inertia, with $1 being the weightiest. -INERTIA=$40 \ No newline at end of file +CUSTOM_JUMP_BANK=$1 \ No newline at end of file diff --git a/offsets-us.asm b/offsets-us.asm index 7844335..43cc5cb 100644 --- a/offsets-us.asm +++ b/offsets-us.asm @@ -17,6 +17,4 @@ empty_bank_e=$BFAB empty_bank_jump=$BED0 ; we actually can go a bit earlier setAndSaveLowerBank=$E2E6 PLAYER_UPDATE_BANK=$E -CUSTOM_JUMP_BANK=$0 - -INERTIA=$40 \ No newline at end of file +CUSTOM_JUMP_BANK=$0 \ No newline at end of file diff --git a/pkg_readme.md b/pkg_readme.md index 99c02cf..105f70b 100644 --- a/pkg_readme.md +++ b/pkg_readme.md @@ -11,13 +11,14 @@ Source code and build instructions available [here](https://github.com/nstbayles Some of these are optional, and depend on the specific patch. - Enables all characters to control their x-velocity in mid-air while jumping (including while jump attacking) + - inertia options (standard/`light`/`heavy`) to adjust to preference. - (Optional) When releasing the jump button, one immediately starts falling again; this allows the player to make smaller hops if desired. - apply `vcancel` hack for this (Recommended). - After being knocked back, the player regains control after a split second and can angle their fall. - When walking off an edge, the player retains control instead of dropping straight down. - All characters can jump off of stairs at any point in the climb (however, it is still impossible to land on stairs, so be careful jumping from long flights of stairs over pits) -Note that Grant's controls remain mostly unaltered. +Note that Grant remain mostly unaltered. ## Compatability diff --git a/test_protocol.txt b/test_protocol.txt index de1beb9..ff0f4fb 100644 --- a/test_protocol.txt +++ b/test_protocol.txt @@ -2,12 +2,16 @@ for us and jp versions: - grant plays as normal for vcancel/no-vcancel versions: - for sypha, alucard, and trevor (use passwords): - - can turn around in mid-air - - falling off a cliff results in jumping instead (retain control) - - knockback is forgiving, directional input restored after a moment - - it's possible to die from enemy damage - - can jump off stairs - - (vcancel only) it's possible let go of the jump button in order to stop rising. + - for light/standard (no need to test heavy really): + - can turn around in mid-air (inertia seems appropriate for light/heavy) + - falling off a cliff results in jumping instead (retain control) + - knockback is forgiving, directional input restored after a moment + - it's possible to die from enemy damage + - can jump off stairs + - (vcancel only) it's possible let go of the jump button in order to stop rising. + - for heavy: + can turn around in mid-air, an + knockback is forgiving - (use passwords for these, and only test the vcancel rom): - 6B: post-bone dragon cutscene will complete even if the dragon is defeated from the LEFTMOST platform.