2017-08-12 15:56:49 +00:00
|
|
|
|
1 ********************************
2 *
3 * Apple][Sd Firmware
4 * Version 0.5
5 *
6 * (c) Florian Reitz, 2017
7 *
8 * X register usually contains SLOT16
9 * Y register iss used for counting or SLOT
10 *
11 ********************************
12
12-AUG-17 15::51
14
15 XC ; enable 65C02 code
16 DEBUG = 0
17 DO DEBUG
18 ORG $8000
19 ELSE
20 ORG $C800 ; Expansion ROM
21 FIN
22
23 * Memory defines
24
25 SLOT16 = $2B ; $s0 -> slot * 16
26 WORK = $3C
27 SLOT = $3D ; $0s
28 CMDLO = $40
29 CMDHI = $41
30
31 CURSLOT = $07F8 ; $Cs
32 DATA = $C080
33 CTRL = DATA+1
34 DIV = DATA+2
35 SS = DATA+3
36 R30 = $0478
37 R31 = $04F8
38 R32 = $0578
39 R33 = $05F8
40 INITED = $0678
41
42 * Constants
43
44 SSNONE = $0F
45 SS0 = $0E
46 DUMMY = $FF
47
48
49 ********************************
50 *
51 * Install SD card driver
52 *
53 ********************************
54
55 * signature bytes
56
C800: A2 20 57 LDX #$20
C802: A0 00 58 LDY #$00
C804: A2 03 59 LDX #$03
===== Page 2 =====
C806: 86 3C 60 STX WORK
61
62 * find slot nr
63
64 DO DEBUG
65 LDA #$04
66 STA SLOT
67 LDA #$C4
68 STA CURSLOT
69 LDA #$40
70 STA SLOT16
71 ELSE
C808: 20 58 FF 72 JSR $FF58
C80B: BA 73 TSX
C80C: BD 00 01 74 LDA $0100,X
C80F: 8D F8 07 75 STA CURSLOT ; $Cs
C812: 29 0F 76 AND #$0F
C814: 85 3D 77 STA SLOT ; $0s
C816: 0A 78 ASL A
C817: 0A 79 ASL A
C818: 0A 80 ASL A
C819: 0A 81 ASL A
C81A: 85 2B 82 STA SLOT16 ; $s0
83 FIN
C81C: AA 84 TAX ; X holds now SLOT16
85
C81D: 2C FF CF 86 BIT $CFFF
C820: 20 00 C9 87 JSR INIT
88
89 DO 0
90 *
91 * TODO: check for init error
92 *
93
94 * see if slot has a driver already
95
96 LDX
|