git @ Cat's Eye Technologies SixtyPical / b395dbc
Spiff up the demo game source a little bit. Chris Pressey 7 years ago
1 changed file(s) with 41 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
0 // ****************************
1 // * Demo Game for SixtyPical *
2 // ****************************
3
4 // ----------------------------------------------------------------
5 // Variables
6 // ----------------------------------------------------------------
7
08 buffer[2048] screen @ 1024
19 byte joy2 @ $dc00
210
2634 inputs joy2, pos
2735 outputs delta, pos, screen
2836 trashes a, x, y, c, z, n, v, ptr
37
38 // (This one is less fibby.)
39
40 vector dispatch_game_state
41 inputs joy2, pos
42 outputs delta, pos, screen
43 trashes a, x, y, c, z, n, v, ptr
44
45 // ----------------------------------------------------------------
46 // Routines
47 // ----------------------------------------------------------------
2948
3049 routine read_stick
3150 inputs joy2
6079 }
6180 }
6281
63 routine our_cinv
82 // ----------------------------------------------------------------
83 // Game States
84 // ----------------------------------------------------------------
85
86 routine game_state_play
6487 inputs joy2, pos
6588 outputs delta, pos, screen
6689 trashes a, x, y, c, z, n, v, ptr
80103 goto save_cinv
81104 }
82105
106 // *************************
107 // * Main Game Loop Driver *
108 // *************************
109
110 routine our_cinv
111 inputs joy2, pos
112 outputs delta, pos, screen
113 trashes a, x, y, c, z, n, v, ptr
114 {
115 goto dispatch_game_state
116 }
117
83118 routine main
84119 inputs cinv
85 outputs cinv, save_cinv, pos
120 outputs cinv, save_cinv, pos, dispatch_game_state
86121 trashes a, n, z
87122 {
123 // jsr clear_screen
124 copy game_state_play, dispatch_game_state
125
88126 copy word 0, pos
89127 with interrupts off {
90128 copy cinv, save_cinv
91129 copy our_cinv, cinv
92130 }
131 // repeat forever {}
93132 }