-
Notifications
You must be signed in to change notification settings - Fork 0
/
x16.inc
66 lines (55 loc) · 1.41 KB
/
x16.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
.ifndef X16_INC
X16_INC=1
; Zero Page address variables
ZP_PTR_1 = $FB
ZP_PTR_2 = $FD
; Banked RAM addresses
RAM_BANK = $9F61
RAM_WIN = $A000
; VERA addresses
VERA_base = $9F20
VERA_addr_low = VERA_base+0
VERA_addr_high = VERA_base+1
VERA_addr_bank = VERA_base+2
VERA_data = VERA_base+3
VERA_data2 = VERA_base+4
VERA_ctrl = VERA_base+5
VERA_irq_ctrl = VERA_base+6
VERA_irq = VERA_base+7
VRAM_composer = $F0000
VRAM_palette = $F1000
VRAM_layer0 = $F2000
VRAM_layer1 = $F3000
VRAM_sprinfo = $F4000
VRAM_sprdata = $F5800
VRAM_palette0 = $F1000 + (2*16)*0
VRAM_palette1 = $F1000 + (2*16)*1
VRAM_palette2 = $F1000 + (2*16)*2
VRAM_palette3 = $F1000 + (2*16)*3
VRAM_palette4 = $F1000 + (2*16)*4
VRAM_palette5 = $F1000 + (2*16)*5
VRAM_palette6 = $F1000 + (2*16)*6
VRAM_palette7 = $F1000 + (2*16)*7
VRAM_palette8 = $F1000 + (2*16)*8
VRAM_palette9 = $F1000 + (2*16)*9
VRAM_palette10 = $F1000 + (2*16)*10
VRAM_palette11 = $F1000 + (2*16)*11
VRAM_palette12 = $F1000 + (2*16)*12
VRAM_palette13 = $F1000 + (2*16)*13
VRAM_palette14 = $F1000 + (2*16)*14
VRAM_palette15 = $F1000 + (2*16)*15
VROM_petscii = $1F000
; Macros
.macro VERA_SET_ADDR addr, stride
.ifnblank stride
lda #((^addr) | (stride << 4))
.else
lda #(^addr) | $10
.endif
sta VERA_addr_bank
lda #(>addr)
sta VERA_addr_high
lda #(<addr)
sta VERA_addr_low
.endmacro
.endif ; X16_INC