-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathraster3.c
63 lines (49 loc) · 770 Bytes
/
raster3.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
void main()
{
word f = ptr( int1 );
uint g = 0x32;
irq( ptr(int1), 0x32, 1 );
printf( f );
return;
}
void int1()
{
uint x = peek( 0x00C5 );
uint L = x & 0x0F;
uint H = lsr(lsr(lsr(lsr(x) )));
H = H & 0x0F;
if( H < 0x0A )
{
H = H + 0x30;
}
else
{
H = H - 0x09;
}
if( L < 0x0A )
{
L = L + 0x30;
}
else
{
L = L - 0x09;
}
// $
poke( 0x0400, 0x24 );
poke( 0x0401, H );
poke( 0x0402, L );
// ack the int
poke( 0xD019, 0x01 );
// partially return control to the CPU
//jmp( 0xEA7E );
// return control to the CPU
jmp( 0xEA31 );
return;
}
void turnoff()
{
// irq( int1, 0x00, -1 );
irq( int1, 0x32, 255 );
irq( 0xEA31, 0x32, 255 );
return;
}