Skip to content

Commit

Permalink
assembly export
Browse files Browse the repository at this point in the history
  • Loading branch information
nstbayless committed Jul 30, 2024
1 parent d40c4de commit 1b99a0e
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 46 deletions.
15 changes: 14 additions & 1 deletion _common.asm
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
VSP_CONTROL_ZERO_VSPEED=$1C
MINIMUM_VSP_CANCEL=$0E
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
13 changes: 6 additions & 7 deletions _hooks.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ 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
; state 8 (jumping)
; 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
Expand Down Expand Up @@ -62,7 +62,6 @@ FROM standard_stair_walk
JSR stair_jumping

FROM sypha_jumptable

SKIP $8
; jump
DW custom_jump_then_standard_jump
Expand Down
64 changes: 42 additions & 22 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ OUT=out

builds=("us" "jp")
vcancel_cfgs=("vcancel" "no-vcancel")
inertia_cfgs=("none" "light" "heavy")

export="cv3-controls"
set -e
Expand All @@ -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

Expand Down
7 changes: 1 addition & 6 deletions offsets-jp.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
CUSTOM_JUMP_BANK=$1
4 changes: 1 addition & 3 deletions offsets-us.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
CUSTOM_JUMP_BANK=$0
3 changes: 2 additions & 1 deletion pkg_readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 10 additions & 6 deletions test_protocol.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1b99a0e

Please sign in to comment.