More conversion.
Chris Pressey
6 years ago
6 | 6 |
byte ds_lores @ $C056
|
7 | 7 |
byte ds_hires @ $C057
|
8 | 8 |
|
9 | |
routine main
|
|
9 |
define main routine
|
10 | 10 |
inputs a
|
11 | 11 |
outputs ds_lores, ds_page1, ds_split, ds_graphics
|
12 | 12 |
trashes a, z, n
|
0 | 0 |
// Write ">AB>" to "standard output"
|
1 | 1 |
|
2 | |
routine cout
|
|
2 |
define cout routine
|
3 | 3 |
inputs a
|
4 | 4 |
trashes a
|
5 | 5 |
@ $FDED
|
6 | 6 |
|
7 | |
routine main
|
8 | |
inputs a
|
|
7 |
define main routine
|
9 | 8 |
trashes a, z, n
|
10 | 9 |
{
|
11 | 10 |
ld a, 62
|
120 | 120 |
// Utility Routines
|
121 | 121 |
// ----------------------------------------------------------------
|
122 | 122 |
|
123 | |
routine read_stick
|
|
123 |
define read_stick routine
|
124 | 124 |
inputs joy2
|
125 | 125 |
outputs delta
|
126 | 126 |
trashes a, x, z, n
|
|
185 | 185 |
}
|
186 | 186 |
}
|
187 | 187 |
|
188 | |
routine clear_screen
|
|
188 |
define clear_screen routine
|
189 | 189 |
outputs screen1, screen2, screen3, screen4, colormap1, colormap2, colormap3, colormap4
|
190 | 190 |
trashes a, y, c, n, z
|
191 | 191 |
{
|
|
208 | 208 |
} until z
|
209 | 209 |
}
|
210 | 210 |
|
211 | |
routine calculate_new_position
|
|
211 |
define calculate_new_position routine
|
212 | 212 |
inputs pos, delta
|
213 | 213 |
outputs new_pos
|
214 | 214 |
trashes a, c, n, z, v
|
|
242 | 242 |
}
|
243 | 243 |
}
|
244 | 244 |
|
245 | |
routine init_game
|
|
245 |
define init_game routine
|
246 | 246 |
inputs actor_pos, actor_delta, actor_logic
|
247 | 247 |
outputs actor_pos, actor_delta, actor_logic, player_died
|
248 | 248 |
trashes pos, a, y, z, n, c, v
|
2 | 2 |
// Define where the screen starts in memory:
|
3 | 3 |
byte table[256] screen @ 1024
|
4 | 4 |
|
5 | |
routine main
|
|
5 |
define main routine
|
6 | 6 |
// These are the values that will be written to by this routine:
|
7 | 7 |
trashes a, x, z, n, screen
|
8 | 8 |
{
|
23 | 23 |
trashes z, n
|
24 | 24 |
save_cinv
|
25 | 25 |
|
26 | |
routine our_cinv
|
|
26 |
define our_cinv routine
|
27 | 27 |
inputs vic_border
|
28 | 28 |
outputs vic_border
|
29 | 29 |
trashes z, n
|
|
32 | 32 |
goto save_cinv
|
33 | 33 |
}
|
34 | 34 |
|
35 | |
routine main
|
|
35 |
define main routine
|
36 | 36 |
inputs cinv
|
37 | 37 |
outputs cinv, save_cinv
|
38 | 38 |
trashes a, n, z
|
2 | 2 |
|
3 | 3 |
word delta
|
4 | 4 |
|
5 | |
routine read_stick
|
|
5 |
define read_stick routine
|
6 | 6 |
inputs joy2
|
7 | 7 |
outputs delta
|
8 | 8 |
trashes a, x, z, n
|
|
35 | 35 |
}
|
36 | 36 |
}
|
37 | 37 |
|
38 | |
routine main
|
|
38 |
define main routine
|
39 | 39 |
inputs joy2
|
40 | 40 |
outputs delta
|
41 | 41 |
trashes a, x, z, n, screen
|
0 | 0 |
byte screen @ 1024
|
1 | 1 |
|
2 | |
routine main
|
|
2 |
define main routine
|
3 | 3 |
trashes a, z, n, screen
|
4 | 4 |
{
|
5 | 5 |
ld a, 83
|