-
Notifications
You must be signed in to change notification settings - Fork 0
/
ram.asm
52 lines (43 loc) · 1.14 KB
/
ram.asm
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
; RAM
; zeropage
.segment "ZEROPAGE"
temp: .res 16 ; temp memory, also used by FDS BIOS
NMIRunning: .res 1
NMIReady: .res 1
NeedDraw: .res 1
NeedPPUMask: .res 1
BGMode: .res 1
StringStatus: .res 1
FileHeader: .res 17
FileNum: .res 1
IPLPtr: .res 2
testcrc: .res 4
; BIOS zeropage variables
.segment "BIOSZP": zeropage
; controller states
ExpTransitions: .res 4 ; up->down transitions for Pad1, Pad2, Exp1, Exp2 (used by ReadDownExpPads)
Buttons: .res 4 ; Usage depends on polling routine
; FDS BIOS register mirrors
FDS_EXT_MIRROR: .res 1
FDS_CTRL_MIRROR: .res 1
JOY1_MIRROR: .res 1
PPU_Y_SCROLL_MIRROR: .res 1
PPU_X_SCROLL_MIRROR: .res 1
PPU_MASK_MIRROR: .res 1
PPU_CTRL_MIRROR: .res 1
; stack
; FDS BIOS vector flags
.segment "STACK"
NMI_FLAG: .res 1 ; (bits 6 & 7)
IRQ_FLAG: .res 1 ; (bits 6 & 7)
RST_FLAG: .res 1 ; $35 = skip BIOS
RST_TYPE: .res 1 ; $ac = first boot, $53 = soft-reset
; OAM buffer
.segment "OAM"
oam: .res 256
; FDS BIOS VRAM buffer
.segment "RAM"
VRAM_BUFFER_SIZE: .res 1 ; default = $7d, max = $fd
VRAM_BUFFER_END: .res 1 ; holds end index of the buffer
VRAM_BUFFER: .res $fd ; actual buffer
; rest of memory