0
|
1 ********************************************************************
|
|
2 * ROMInfo - OS-9 Level Two ROM Relocation Code
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Executed at $8015 from ROM
|
|
7 *
|
|
8 * Additional annotation Robert Gault 6/9/98
|
|
9 *
|
|
10 * Ed. Comments Who YY/MM/DD
|
|
11 * ------------------------------------------------------------------
|
|
12 * 1 Created BGP 98/05/03
|
|
13
|
|
14 nam ROMInfo
|
|
15 ttl OS-9 Level Two ROM boot module
|
|
16
|
|
17 ifp1
|
|
18 use defsfile
|
|
19 endc
|
|
20
|
|
21 tylg set Systm+Objct
|
|
22 atrv set ReEnt+rev
|
|
23 rev set $01
|
|
24 edition set 1
|
|
25
|
37
|
26 ifne ROMPak
|
|
27 jmp $C000+start
|
|
28 endc
|
|
29
|
0
|
30 mod eom,name,tylg,atrv,start,size
|
|
31
|
|
32 size equ .
|
|
33
|
|
34 name fcs /ROMInfo/
|
|
35 fcb edition
|
|
36
|
|
37 start equ *
|
|
38
|
|
39 * Bring the CoCo 3 to sanity
|
|
40 orcc #IntMasks disable FIRQ, IRQ
|
|
41 clr $FFD9 go into fast mode
|
|
42 lda #$0A CC3 Mode, No MMU, 32K Int. ROM
|
|
43 sta $FF90
|
|
44 clr $FFDE RAM/ROM mode (upper 16K ROM at $C000)
|
|
45
|
|
46 * Setup MMU
|
|
47 ldx #DAT.Regs
|
|
48 leay MMUTbl,pcr
|
|
49 ldb #16
|
|
50
|
|
51 MMULoop lda ,y+
|
|
52 sta ,x+
|
|
53 decb
|
|
54 bne MMULoop
|
|
55
|
|
56 * Set up CoCo 3 Video Registers at $FF98-$FF9F
|
|
57 ldd #$0000
|
|
58 std $FF98
|
|
59 std $FF9A
|
|
60 std $FF9E
|
|
61 ldd #$0FE0
|
|
62 std $FF9C
|
|
63
|
|
64 * Initialize PIAs
|
|
65 ldx #PIA1Base RG - Initialize the PIA 1
|
|
66 ldd #$FF34
|
|
67 clr 1,x
|
|
68 clr 3,x
|
|
69 deca
|
|
70 sta ,x
|
|
71 lda #$F8
|
|
72 sta 2,x
|
|
73 stb 1,x
|
|
74 stb 3,x
|
|
75 clr 2,x
|
|
76 lda #$02
|
|
77 sta ,x
|
|
78
|
|
79 lda #$FF RG - Initialize the PIA 0
|
|
80 ldx #PIA0Base
|
|
81 clr 1,x
|
|
82 clr 3,x
|
|
83 clr ,x
|
|
84 sta 2,x
|
|
85 stb 1,x
|
|
86 stb 3,x
|
|
87
|
|
88 tfr b,dp
|
|
89 clr 2,x
|
|
90
|
|
91
|
|
92 lda #$CA RG - CC2 mode, MMU, constant DRAM, 32K internal ROM
|
|
93 sta $FF90
|
|
94
|
|
95 bra RelROM
|
|
96
|
|
97 * MMU
|
|
98 MMUTbl
|
|
99 fcb $38,$39,$3A,$3B,$3C,$3D,$3E,$3F
|
|
100 fcb $38,$39,$3A,$3B,$3C,$3D,$3E,$3F
|
|
101
|
|
102
|
|
103 * ROM relocation code -- copies the boot track into $2600 and JMPs to it
|
|
104 RelROM ldx #$EC00 src address (boot track in ROM)
|
|
105 ldy #$2600 dst address (RAM)
|
|
106 copyloop ldd ,x++ get 2 bytes from src
|
|
107 std ,y++ put 2 bytes to dst
|
|
108 cmpx #$EC00+$1200 at end?
|
|
109 blo copyloop nope, copy more...
|
|
110 jmp $2602 jump to OS rel code
|
|
111
|
|
112 emod
|
|
113 eom equ *
|
|
114 end
|