git @ Cat's Eye Technologies SixtyPical / 1bd765d
Begin using static in the demo game. Chris Pressey 3 years ago
3 changed file(s) with 3 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
88 as `ld a, [ptr] + y` and `st a, [ptr] + y`.
99 * Implements the "union rule for trashes" when analyzing `if` blocks.
1010 * Even if we `goto` another routine, we can't trash an output.
11 * `static` storage locations local to routines can now be defined within routines.
1112 * Fixed bug where `trash` was not marking the location as being virtually altered.
1213
1314 0.11
5858 Range-checking buffers might be too difficult. Range checking tables will be easier.
5959 If a value is ANDed with 15, its range must be 0-15, etc.
6060
61 ### Routine-local static memory locations
62
63 These would not need to appear in the inputs/outputs/trashes sets of the routines
64 that call this routine.
65
66 These might be forced to specify an initial value so that they can always be
67 assumed to be meaningful.
68
6961 ### Re-order routines and optimize tail-calls to fallthroughs
7062
7163 Not because it saves 3 bytes, but because it's a neat trick. Doing it optimally
3636 outputs button_down, dispatch_game_state,
3737 actor_pos, actor_delta, actor_logic,
3838 screen, screen1, screen2, screen3, screen4, colormap1, colormap2, colormap3, colormap4
39 trashes a, x, y, c, z, n, v, pos, new_pos, delta, ptr, save_x, compare_target, dispatch_logic
39 trashes a, x, y, c, z, n, v, pos, new_pos, delta, ptr, compare_target, dispatch_logic
4040 game_state_routine
4141
4242 //
9292 byte button_down : 0 // effectively static-local to check_button
9393 byte table[32] press_fire_msg: "PRESS`FIRE`TO`PLAY"
9494
95 byte save_x
9695 word compare_target
9796
9897 //
409408 }
410409
411410 define game_state_play game_state_routine
411 static byte save_x : 0
412412 {
413413 ld x, 0
414414 repeat {