@@ -11,6 +11,8 @@ unsigned char pal1[] = {0x2A, 0x3F, 0x0F, 0x00, 0x01, 0x02, 0x03, 0x17,
11
11
unsigned char pal2 [] = {0x2A , 0x3F , 0x0F , 0x00 , 0x10 , 0x20 , 0x30 , 0x35 ,
12
12
0x15 , 0x35 , 0x1D , 0x3D , 0x17 , 0x10 , 0x20 , 0x03 };
13
13
14
+ unsigned char * pal [] = {& pal1 [4 ], & pal2 [4 ]};
15
+
14
16
unsigned int road_pattern [] = {0x0001 , 0x0002 ,
15
17
0x0000 , 0x0000 };
16
18
@@ -34,9 +36,9 @@ int rand_speed() {
34
36
}
35
37
36
38
void main () {
37
- int x = 0 ;
38
- int y = 0 ;
39
- int i , j ;
39
+ unsigned char x = 0 ;
40
+ unsigned char y = 0 ;
41
+ unsigned char i , j ;
40
42
int ply_x = 120 ;
41
43
int ply_y = 92 ;
42
44
int ply_tile = 'H' ;
@@ -95,26 +97,23 @@ void main() {
95
97
while (y < 176 ) {
96
98
while (get_vcount () < y ) {
97
99
}
98
- // load_palette() is too slow for this to work
99
- if (j & 0x01 ) {
100
- load_palette (& pal1 [4 ], 4 , 4 );
101
- } else {
102
- load_palette (& pal2 [4 ], 4 , 4 );
103
- }
100
+
101
+ load_palette (pal [j ], 4 , 4 );
102
+
104
103
scroll_bkg (x , 0 );
105
104
(* p ) += (* p2 );
106
105
p ++ ;
107
106
p2 ++ ;
108
107
x = (* p ) >> 4 ;
109
- y += 13 ;
110
- j ++ ;
108
+ y += 14 ;
109
+ j ^= 1 ;
111
110
112
111
while (get_vcount () < y ) {
113
112
}
114
113
scroll_bkg (0 , 0 );
115
- y += 3 ;
114
+ y += 2 ;
116
115
}
117
- load_palette (& pal1 [ 4 ], 4 , 4 );
116
+ load_palette (pal [ 0 ], 4 , 4 );
118
117
scroll_bkg (0 , 0 );
119
118
}
120
119
}
0 commit comments