annotate bootman/mach_coco3.a @ 2647:99b7caa4c88a

Moved to github for Liber809 Project
author Boisy Pitre <boisy.pitre@nuance.com>
date Tue, 06 Mar 2012 13:49:14 -0600
parents d280490500a8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2163
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
1 NAM mach_coco
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
2 TTL CoCo machine routines
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
3
2191
d280490500a8 dw3 target added to makefile
boisy
parents: 2163
diff changeset
4 PSECT mach_coco3,0,0,0,0,mach_init
2163
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
5
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
6 VSECT
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
7 ENDSECT
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
8
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
9 PIA0Base equ $FF00
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
10 PIA1Base equ $FF20
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
11 DAT.Regs equ $FFA0
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
12
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
13 mach_init:
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
14 * CoCo 3 Initialization Code
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
15 clr $FFD9 go into fast mode
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
16
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
17 * Setup MMU
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
18 ldx #DAT.Regs
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
19 leay MMUTbl,pcr
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
20 ldb #16
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
21 MMULoop lda ,y+
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
22 sta ,x+
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
23 decb
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
24 bne MMULoop
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
25
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
26 * Setup video
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
27 leau CC3Regs,pcr point to video setup data
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
28 ldx #$FF90
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
29 Loop1 ldd ,u++ get the bytes
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
30 std ,x++ save in the hardware
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
31 cmpx #$FFA0
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
32 bcs Loop1
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
33
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
34 * Set palettes up
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
35 leau PalTbl,pcr
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
36 ldy #$FFB0 palette register
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
37 ldb #16
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
38 lbsr CopyRtn
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
39
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
40 * Initialize PIAs
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
41 ldx #PIA1Base RG - Initialize the PIA 1
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
42 ldd #$FF34
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
43 clr 1,x cassette motor off, 0,x is DDR
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
44 clr 3,x 2,x is DDR
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
45 deca A = $FE
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
46 sta ,x cassette bit 0 input, all others output
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
47 lda #$F8 bits 7-3 output, bits 2-0 input
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
48 sta 2,x set DDR
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
49 stb 1,x 0,x not DDR
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
50 stb 3,x 2,x not DDR
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
51 clr 2,x
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
52 lda #$02 RS-232 bit hi
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
53 sta ,x set it
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
54
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
55 lda #$FF all outputs
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
56 ldx #PIA0Base
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
57 clr 1,x 0,x is DDR
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
58 clr 3,x 2,x is DDR
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
59 clr ,x all inputs
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
60 sta 2,x all outputs
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
61 stb 1,x 0,x is not DDR
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
62 stb 3,x 2,x is not DDR
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
63 clr 2,x
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
64
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
65 rts
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
66
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
67 CopyRtn clra
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
68 tfr d,x
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
69 Copy1 ldb ,u+
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
70 stb ,y+
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
71 leax -1,x
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
72 bne Copy1
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
73 rts
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
74
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
75 * MMU
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
76 MMUTbl
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
77 fcb $38,$39,$3A,$3B,$3C,$3D,$3E,$3F
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
78 fcb $38,$39,$3A,$3B,$3C,$3D,$3E,$3F
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
79
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
80 * GIME register default values
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
81 CC3Regs fcb $EC CC2, MMU, IRQ, Vector page, SCS
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
82 fcb $00 map type 0
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
83 fcb $00 no FIRQ
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
84 fcb $00 no IRQ
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
85 fdb $0900 timer
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
86 fcb $00 unused
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
87 fcb $00 unused
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
88 fcb $00
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
89 fcb $00
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
90 fcb $00
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
91 fcb $00
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
92 fdb $0FE0
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
93 fcb $00
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
94 fcb $00
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
95
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
96 * Palette register default colors
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
97 PalTbl
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
98 fcb $12 green
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
99 fcb $36
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
100 fcb $09 blue
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
101 fcb $24 red
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
102 fcb $3F white
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
103 fcb $1B cyan
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
104 fcb $2D magenta
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
105 fcb $26
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
106 fcb $00 black
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
107 fcb $12 green
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
108 fcb $00 black
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
109 fcb $3F white
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
110 fcb $00 black
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
111 fcb $12 green
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
112 fcb $00 black
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
113 fcb $26
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
114
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
115
2db06bc0742a Start of BootMan
boisy
parents:
diff changeset
116 endsect