-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.z80
110 lines (92 loc) · 3.82 KB
/
base.z80
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
106
107
108
109
110
; Standard SAM Coupé Ports
; ------------------------
;
; Author: Simon Cooke ([email protected])
; Licensed under the MIT license (see LICENSE file).
; Colour lookup table (Palette) ports [WO]
CLUT: EQU 248
PALETTE_ENTRY_0: EQU CLUT + (0*256)
PALETTE_ENTRY_1: EQU CLUT + (1*256)
PALETTE_ENTRY_2: EQU CLUT + (2*256)
PALETTE_ENTRY_3: EQU CLUT + (3*256)
PALETTE_ENTRY_4: EQU CLUT + (4*256)
PALETTE_ENTRY_5: EQU CLUT + (5*256)
PALETTE_ENTRY_6: EQU CLUT + (6*256)
PALETTE_ENTRY_7: EQU CLUT + (7*256)
PALETTE_ENTRY_8: EQU CLUT + (8*256)
PALETTE_ENTRY_9: EQU CLUT + (9*256)
PALETTE_ENTRY_10: EQU CLUT + (10*256)
PALETTE_ENTRY_11: EQU CLUT + (11*256)
PALETTE_ENTRY_12: EQU CLUT + (12*256)
PALETTE_ENTRY_13: EQU CLUT + (13*256)
PALETTE_ENTRY_14: EQU CLUT + (14*256)
PALETTE_ENTRY_15: EQU CLUT + (15*256)
; Colour bit settings
COLOUR_BLU_0: EQU %00000001
COLOUR_RED_0: EQU %00000010
COLOUR_GRN_0: EQU %00000100
COLOUR_HALF_BRIGHT: EQU %00001000
COLOUR_BLU_1: EQU %00010000
COLOUR_RED_1: EQU %00100000
COLOUR_GRN_1: EQU %01000000
COLOUR_MASK: EQU %01111111
; Interrupt Status port [RO]
STATUS: EQU 249
STATUS_LINE_INT: EQU %00000001
STATUS_LINE_INT_BIX: EQU 0
; While this was named the MOUSE interrupt, it's currently used exclusively by
; the SAM Comms Interface for RS232 controller interrupts.
; The MOUSE doesn't use this, and instead has its own counters that are read out
; serially by the user.
;STATUS_MOUSE_INT: EQU %00000010 ; OBSOLETE
STATUS_COMMS_INT: EQU %00000010
STATUS_COMMS_INT_BIX: EQU 1
STATUS_MIDI_IN_INT: EQU %00000100
STATUS_MIDI_IN_INT_BIX: EQU 2
STATUS_FRAME_INT: EQU %00001000
STATUS_FRAME_INT_BIX: EQU 3
STATUS_MIDI_OUT_INT: EQU %00010000
STATUS_MIDI_OUT_INT_BIX: EQU 4
STATUS_KBD_BITS: EQU %11100000
; Line Interrupt setting port [WO]
LINE_INT: EQU 249
; Low Memory (0-16383) and ROM Overlay [R/W]
LMPR: EQU 250
LMPR_PAGE_MASK: EQU %00011111
LMPR_RAM_IN_0: EQU %00100000 ; AKA "RAM0"
LMPR_ROM_IN_1: EQU %01000000 ; AKA "ROM1"
LMPR_WPROTECT_RAM: EQU %10000000 ; AKA "WPRAM"
; High Memory (32768-65535) Port [R/W]
HMPR: EQU 251
HMPR_PAGE_MASK: EQU %00011111
HMPR_MODE3_CLR_BIT2: EQU %00100000 ; AKA "MD3S0"
HMPR_MODE3_CLR_BIT3: EQU %01000000 ; AKA "MD3S1"
HMPR_EXTERNAL_MEM: EQU %10000000 ; AKA "MCNTRL"
HMPR_XMEM_BIX: EQU 7 ; The bit index for HMPR_EXTERNAL_MEM
; Video Port [R/W]
VMPR: EQU 252
VMPR_PAGE_MASK: EQU %00011111
VMPR_MODE_MASK: EQU %01100000
VMPR_MODE_1: EQU 0 ; ZX Spectrum compatible, one attribute per 8 pixel column and row
VMPR_MODE_2: EQU %00100000 ; ZX Spectrum with linear layout, one attribute per 8 pixel column, but per-line
VMPR_MODE_3: EQU %01000000 ; 512x192, 2-bit color mode
VMPR_MODE_4: EQU %01100000 ; 256x192, 4-bit color mode
VMPR_TXRXMIDI: EQU %10000000
; Border Port [WO]
BORDER: EQU 254
BORDER_COLOR_MASK: EQU %00100111
BORDER_COLOR_LOMASK: EQU %00000111
BORDER_COLOR_HIBIT: EQU %00100000
BORDER_MIC: EQU %00001000
BORDER_BEEP: EQU %00010000
BORDER_MIDI_THRU: EQU %01000000 ; AKA "THROM"
BORDER_SCREEN_OFF: EQU %10000000 ; AKA "SCREEN OFF"
; Keyboard Port [RO]
KEYBOARD: EQU 254
KEYBOARD_BITS_MASK: EQU %00011111
KEYBOARD_SPEN: EQU %00100000
KEYBOARD_EAR: EQU %01000000
KEYBOARD_SCREEN_OFF: EQU %10000000
; Midi Ports
MIDI_OUT: EQU 253 ; [WO]
MIDI_IN: EQU 253 ; [RO]