forked from bboxy/bitfire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink_macros_c6510.inc
105 lines (91 loc) · 1.59 KB
/
link_macros_c6510.inc
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
;if def link_c6510_inc == 0
;const link_c6510_inc = 1
include "word.s"
include "irq.s"
macro m_link_load_next_raw_jmp n:16
{
lda #(n-1)>>8
pha
lda #(n-1)&255
pha
jmp link_load_next_raw
}
macro m_link_load_next_comp_jmp n:16
{
lda #(n-1)>>8
pha
lda #(n-1)&255
pha
jmp link_load_next_comp
}
macro m_link_decomp_jmp n:16
{
lda #(n-1)>>8
pha
lda #(n-1)&255
pha
jmp link_decomp
}
macro m_link_load_next_double_jmp n:16
{
lda #(n-1)>>8
pha
lda #(n-1)&255
pha
jmp link_load_next_double
}
macro m_link_load_next_raw_decomp_jmp n:16
{
lda #(n-1)>>8
pha
lda #(n-1)&256
pha
jmp link_load_next_raw_decomp
}
macro m_link_player_irq
{
sei
lda #link_player&255
sta $fffe
lda #link_player>>8
sta $ffff
lda #$ff
sta $d012
cli
}
macro m_request_disk n:8
{
lda #n + $f0
jsr bitfire.sendbyte
lda #$3f
sta $dd02
}
macro m_wait_syncpoint part:16
{
.w:
lda link_syncpoint
cmp #part
bcc .w
}
macro m_wait_frame_count cnt:16
{
.w:
lda link_frame_count+0
cmp #(cnt & 255)
bcc .w
.v:
lda link_frame_count+1
cmp #(cnt >> 8)
bcc .v
}
macro bus_lock {
lda #$c7
sta $dd02
}
macro bus_unlock bank:8 {
lda #(bank & 3) | $c0
sta $dd00
lda #$3f
sta $dd02
}
;endif