mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-02-17 22:30:27 +00:00
The "union rule" lets us clean up some of these redundant trashes.
This commit is contained in:
parent
b20b664748
commit
3bee722900
@ -307,18 +307,14 @@ define player_logic logic_routine
|
|||||||
st off, c
|
st off, c
|
||||||
} else {
|
} else {
|
||||||
st on, c
|
st on, c
|
||||||
trash n
|
|
||||||
trash a
|
|
||||||
trash z
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME these trashes, strictly speaking, probably shouldn't be needed,
|
// FIXME these trashes, strictly speaking, probably shouldn't be needed,
|
||||||
// but currently the compiler cares too much about values that are
|
// but currently the compiler cares a little too much about values that are
|
||||||
// initialized in one branch of an `if`, but not the other, but trashed
|
// initialized in one branch of an `if`, but not the other, but are trashed
|
||||||
// at the end of the routine anyway.
|
// at the end of the routine anyway.
|
||||||
trash ptr
|
trash ptr
|
||||||
trash y
|
trash y
|
||||||
trash a
|
|
||||||
trash v
|
trash v
|
||||||
} else {
|
} else {
|
||||||
st off, c
|
st off, c
|
||||||
@ -360,9 +356,6 @@ define enemy_logic logic_routine
|
|||||||
st off, c
|
st off, c
|
||||||
} else {
|
} else {
|
||||||
st on, c
|
st on, c
|
||||||
trash n
|
|
||||||
trash a
|
|
||||||
trash z
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME these trashes, strictly speaking, probably shouldn't be needed,
|
// FIXME these trashes, strictly speaking, probably shouldn't be needed,
|
||||||
@ -371,7 +364,6 @@ define enemy_logic logic_routine
|
|||||||
// at the end of the routine anyway.
|
// at the end of the routine anyway.
|
||||||
trash ptr
|
trash ptr
|
||||||
trash y
|
trash y
|
||||||
trash a
|
|
||||||
} else {
|
} else {
|
||||||
copy delta, compare_target
|
copy delta, compare_target
|
||||||
st on, c
|
st on, c
|
||||||
@ -412,18 +404,6 @@ define game_state_title_screen game_state_routine
|
|||||||
call clear_screen
|
call clear_screen
|
||||||
call init_game
|
call init_game
|
||||||
copy forward game_state_play, dispatch_game_state
|
copy forward game_state_play, dispatch_game_state
|
||||||
|
|
||||||
// FIXME these trashes, strictly speaking, probably shouldn't be needed,
|
|
||||||
// but currently the compiler cares too much about values that are
|
|
||||||
// initialized in one branch of an `if`, but not the other, but trashed
|
|
||||||
// at the end of the routine anyway.
|
|
||||||
trash a
|
|
||||||
trash n
|
|
||||||
trash z
|
|
||||||
} else {
|
|
||||||
trash y
|
|
||||||
trash c
|
|
||||||
trash v
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goto save_cinv
|
goto save_cinv
|
||||||
@ -448,7 +428,6 @@ define game_state_play game_state_routine
|
|||||||
ld x, 15
|
ld x, 15
|
||||||
} else {
|
} else {
|
||||||
ld x, save_x
|
ld x, save_x
|
||||||
trash c
|
|
||||||
}
|
}
|
||||||
|
|
||||||
copy pos, actor_pos + x
|
copy pos, actor_pos + x
|
||||||
@ -470,18 +449,6 @@ define game_state_game_over game_state_routine
|
|||||||
call clear_screen
|
call clear_screen
|
||||||
call init_game
|
call init_game
|
||||||
copy game_state_title_screen, dispatch_game_state
|
copy game_state_title_screen, dispatch_game_state
|
||||||
|
|
||||||
// FIXME these trashes, strictly speaking, probably shouldn't be needed,
|
|
||||||
// but currently the compiler cares too much about values that are
|
|
||||||
// initialized in one branch of an `if`, but not the other, but trashed
|
|
||||||
// at the end of the routine anyway.
|
|
||||||
trash a
|
|
||||||
trash n
|
|
||||||
trash z
|
|
||||||
} else {
|
|
||||||
trash y
|
|
||||||
trash c
|
|
||||||
trash v
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goto save_cinv
|
goto save_cinv
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "X$X64" = "X" ]; then
|
||||||
|
X64=x64
|
||||||
|
fi
|
||||||
SRC=$1
|
SRC=$1
|
||||||
if [ "X$1" = "X" ]; then
|
if [ "X$1" = "X" ]; then
|
||||||
echo "Usage: ./loadngo.sh <source.60p>"
|
echo "Usage: ./loadngo.sh <source.60p>"
|
||||||
@ -8,8 +11,8 @@ fi
|
|||||||
OUT=/tmp/a-out.prg
|
OUT=/tmp/a-out.prg
|
||||||
bin/sixtypical --traceback --basic-prelude $SRC > $OUT || exit 1
|
bin/sixtypical --traceback --basic-prelude $SRC > $OUT || exit 1
|
||||||
if [ -e vicerc ]; then
|
if [ -e vicerc ]; then
|
||||||
x64 -config vicerc $OUT
|
$X64 -config vicerc $OUT
|
||||||
else
|
else
|
||||||
x64 $OUT
|
$X64 $OUT
|
||||||
fi
|
fi
|
||||||
rm -f $OUT
|
rm -f $OUT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user