git @ Cat's Eye Technologies SixtyPical / e9d9c71
More statics in demo game. Chris Pressey 3 years ago
3 changed file(s) with 11 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
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, compare_target, dispatch_logic
39 trashes a, x, y, c, z, n, v, pos, new_pos, delta, ptr, dispatch_logic
4040 game_state_routine
4141
4242 //
5050 typedef routine
5151 inputs pos, delta, joy2, screen
5252 outputs pos, delta, new_pos, screen, c
53 trashes a, x, y, z, n, v, ptr, compare_target
53 trashes a, x, y, z, n, v, ptr
5454 logic_routine
5555
5656 // ----------------------------------------------------------------
9191
9292 byte button_down : 0 // effectively static-local to check_button
9393 byte table[32] press_fire_msg: "PRESS`FIRE`TO`PLAY"
94
95 word compare_target
9694
9795 //
9896 // Points to the routine that implements the current game state.
216214 add new_pos, delta
217215 }
218216
219 routine check_new_position_in_bounds
217 define check_new_position_in_bounds routine
220218 inputs new_pos
221219 outputs c
222 trashes compare_target, a, z, n, v
220 trashes a, z, n, v
221 static word compare_target : 0
223222 {
224223 copy 1000, compare_target
225224 st on, c
320319 }
321320
322321 define enemy_logic logic_routine
322 static word compare_target : 0
323323 {
324324 call calculate_new_position
325325 call check_new_position_in_bounds
371371 } else {
372372 copy $ffd8, delta
373373 }
374 trash compare_target
375374 }
376375
377376 st off, c
99 fi
1010 OUT=/tmp/a-out.prg
1111 bin/sixtypical --traceback --basic-prelude $SRC > $OUT || exit 1
12 ls -la $OUT
1213 if [ -e vicerc ]; then
1314 $X64 -config vicerc $OUT
1415 else
5555 def routine_has_static(routine, ref):
5656 if not hasattr(routine, 'statics'):
5757 return False
58 return ref in [static.location for static in routine.statics]
58 for static in routine.statics:
59 if static.location == ref:
60 return True
61 return False
5962
6063
6164 class Context(object):