aboutsummaryrefslogtreecommitdiff
path: root/src-z80/core/vars.z80
blob: 321d55245d49a9e0e8802d0b32493d9aa360028d (plain)
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
;****************************************************************************
; Player variables
;****************************************************************************

    ds $100-($&$FF), $FF
RAM_PSGData:        ds 4*16         ; PSG envelope data
                                      ; ds 1 ... Channel volume
                                      ; ds 1 ... Global volume
                                      ; ds 3 ... Current address
                                      ; ds 3 ... Looping address
                                      ; ds 3 ... Start address
                                      ; ds 1 ... Semitone ($FF if void)
                                      ; ds 3 ... BGM instrument address
                                      ; ds 1 ... BGM channel volume

RAM_BGMFMInstr:     ds 8            ; FM instruments used by BGM
RAM_BGMFMVol:       ds 8            ; FM volumes used by BGM
RAM_BGMFMPan:       ds 8, $C0       ; FM panning used by BGM

RAM_FMVol:          ds 8            ; FM volume of each channel
RAM_FMData:         ds 8*5          ; FM info (for volume handling)
                                      ; ds 8*1 ... Register $B0
                                      ; ds 8*1 ... Register $40
                                      ; ds 8*1 ... Register $44
                                      ; ds 8*1 ... Register $48
                                      ; ds 8*1 ... Register $4C

RAM_Locked:         ds 12           ; Locked channels
RAM_PSGNote:        ds 4            ; Current PSG notes

RAM_LastBank:       ds 1            ; Last accessed bank

RAM_BGMData:                        ; Where BGM data starts
RAM_BGMPlaying:     ds 1              ; Set if a BGM is playing
RAM_BGMDelay:       ds 1              ; How many ticks to wait
RAM_BGMBank:        ds 1              ; Current BGM bank
RAM_BGMAddress:     ds 2              ; Current BGM address
RAM_BGMLoopPoint:   ds 3              ; BGM loop point

RAM_SFXData:                        ; Where SFX data starts
RAM_SFXPlaying:     ds 1              ; Set if a SFX is playing
RAM_SFXDelay:       ds 1              ; How many ticks to wait
RAM_SFXBank:        ds 1              ; Current SFX bank
RAM_SFXAddress:     ds 2              ; Current SFX address
RAM_SFXLoopPoint:   ds 3              ; SFX loop point

RAM_Paused:         ds 1            ; Set if BGM stream is paused
RAM_Mono:           ds 1            ; Set if panning is disabled

RAM_PCMBank1:       db 1            ; (not implemented yet)
RAM_PCMAddr1:       dw 1            ; (not implemented yet)
RAM_PCMBank2:       db 1            ; (not implemented yet)
RAM_PCMAddr2:       dw 1            ; (not implemented yet)

RAM_Scratch:        ds 32           ; Scratch bytes, may be useful when
                                      ; buffering to speed up to avoid bank
                                      ; switching conflicts

    ds $F0-($&$FF), $FF
RAM_PCMBuffer:      ds 0            ; PCM buffer
RAM_PCMBuffer1:     ds 8            ; (not implemented yet)
RAM_PCMBuffer2:     ds 8            ; (not implemented yet)

;****************************************************************************
; Pointer list starts being stored from here
; $300 (768) bytes are needed to store the pointer list
;
; Format for a pointer list entry is as follows:
;   RAM_PointerList[$000+n] = address high
;   RAM_PointerList[$100+n] = address low
;   RAM_PointerList[$200+n] = bank
;****************************************************************************

RAM_PointerList: equ $1C00

;****************************************************************************
; 68000 communication variables
;****************************************************************************

RAM_Stack:          equ $1FE0       ; Where stack starts

RAM_GlobalVol:      equ $1FE0       ; Global volume for all channels
RAM_Status:         equ $1FF0       ; Current playback status
RAM_RefreshVol:     equ $1FF1       ; Set to refresh all volumes
RAM_Flags:          equ $1FF2       ; Track flags

RAM_Command:        equ $1FFF       ; Command type
RAM_ComAddr:        equ $1FFD       ; Command address parameter
RAM_ComBank:        equ $1FFC       ; Command bank parameter

RAM_Command2:       equ $1FFB       ; (second slot for all the above)
RAM_ComAddr2:       equ $1FF9
RAM_ComBank2:       equ $1FF8