1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-06-06 15:29:30 +00:00

Begin using static in the demo game.

This commit is contained in:
Chris Pressey 2018-02-09 16:46:53 +00:00
parent 31a16ed37c
commit 1bd765dbce
3 changed files with 3 additions and 10 deletions

View File

@ -9,6 +9,7 @@ History of SixtyPical
as `ld a, [ptr] + y` and `st a, [ptr] + y`.
* Implements the "union rule for trashes" when analyzing `if` blocks.
* Even if we `goto` another routine, we can't trash an output.
* `static` storage locations local to routines can now be defined within routines.
* Fixed bug where `trash` was not marking the location as being virtually altered.
0.11

View File

@ -59,14 +59,6 @@ This should be tracked in the abstract interpretation.
Range-checking buffers might be too difficult. Range checking tables will be easier.
If a value is ANDed with 15, its range must be 0-15, etc.
### Routine-local static memory locations
These would not need to appear in the inputs/outputs/trashes sets of the routines
that call this routine.
These might be forced to specify an initial value so that they can always be
assumed to be meaningful.
### Re-order routines and optimize tail-calls to fallthroughs
Not because it saves 3 bytes, but because it's a neat trick. Doing it optimally

View File

@ -37,7 +37,7 @@ typedef routine
outputs button_down, dispatch_game_state,
actor_pos, actor_delta, actor_logic,
screen, screen1, screen2, screen3, screen4, colormap1, colormap2, colormap3, colormap4
trashes a, x, y, c, z, n, v, pos, new_pos, delta, ptr, save_x, compare_target, dispatch_logic
trashes a, x, y, c, z, n, v, pos, new_pos, delta, ptr, compare_target, dispatch_logic
game_state_routine
//
@ -93,7 +93,6 @@ vector logic_routine dispatch_logic
byte button_down : 0 // effectively static-local to check_button
byte table[32] press_fire_msg: "PRESS`FIRE`TO`PLAY"
byte save_x
word compare_target
//
@ -410,6 +409,7 @@ define game_state_title_screen game_state_routine
}
define game_state_play game_state_routine
static byte save_x : 0
{
ld x, 0
repeat {