-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.z80
More file actions
73 lines (59 loc) · 2.03 KB
/
main.z80
File metadata and controls
73 lines (59 loc) · 2.03 KB
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
INCLUDE "System.lbl" ; Generated by make
SEEK $0000
ORG $0000
RST00:
JP ROMBoot
SEEK $0010
ORG $0010
RST10:
JP SyscallExec
SEEK $0020
ORG $0020
RST20:
JP Monitor.DebugHandler
SEEK $0100
ORG $0100
ROMBoot:
; Set up the stack pointer
LD HL, SystemRAMBase ; SP address is at the bottom of the system in RAM
LD SP, HL ; Set the stack pointer
; Copy system template to top of RAM
LD BC, SysTemplateEnd - SysTemplateStart ; Get the system size
LD DE, SystemBase ; Set the system destination address
LD HL, SysTemplateStart ; Point HL to the source address
LDIR ; Copy everything
; Copy reset vectors to temp space at $8000
LD BC, $0100
LD HL, $0000
LD DE, $8000
LDIR
IM 2
LD A, $FF
LD I, A
EI ; Enable interrupts for hardware detection
; Find and load hardware drivers
CALL VDP.Initialize
CALL OPL.Initialize
CALL FDC.Initialize
JP ColdBoot
INCLUDE "VDP/Init.z80"
INCLUDE "OPL/Init.z80"
INCLUDE "FDC/Init.z80"
VDPDriverStart:
INCLUDE "VDPDriver.lbl" ; Generated by make
INCBIN "VDPDriver.bin" ; Generated by make
VDPDriverEnd:
OPLDriverStart:
INCLUDE "OPLDriver.lbl" ; Generated by make
INCBIN "OPLDriver.bin" ; Generated by make
OPLDriverEnd:
FDCDriverStart:
INCLUDE "FDCDriver.lbl" ; Generated by make
INCBIN "FDCDriver.bin" ; Generated by make
FDCDriverEnd:
SysTemplateStart:
INCBIN "System.bin" ; Generated by make
SysTemplateEnd:
; Pad out our file to 32k
SEEK $7FFF
DB $00