mirror of
https://github.com/tjboldt/Apple2-IO-RPi.git
synced 2024-06-08 19:29:31 +00:00
Add slot detection for Shell
This commit is contained in:
parent
91fa35bf0f
commit
23b7a69acb
|
@ -11,13 +11,10 @@ IOError = $27
|
||||||
NoDevice = $28
|
NoDevice = $28
|
||||||
WriteProtect = $2B
|
WriteProtect = $2B
|
||||||
|
|
||||||
; hard code slot to 7 for now, will make it auto-detect later
|
InputByte = $c08e
|
||||||
SLOT = 7
|
OutputByte = $c08d
|
||||||
|
InputFlags = $c08b
|
||||||
InputByte = $c08e+SLOT*$10
|
OutputFlags = $c087
|
||||||
OutputByte = $c08d+SLOT*$10
|
|
||||||
InputFlags = $c08b+SLOT*$10
|
|
||||||
OutputFlags = $c087+SLOT*$10
|
|
||||||
|
|
||||||
ResetCommand = $00
|
ResetCommand = $00
|
||||||
ReadBlockCommand = $01
|
ReadBlockCommand = $01
|
||||||
|
@ -49,11 +46,46 @@ htab80 = $057b
|
||||||
BasCalc = $fbc1
|
BasCalc = $fbc1
|
||||||
|
|
||||||
LastChar = $06
|
LastChar = $06
|
||||||
|
SlotL = $fe
|
||||||
|
SlotH = $ff
|
||||||
ESC = $9b
|
ESC = $9b
|
||||||
|
|
||||||
.org $2000
|
.org $2000
|
||||||
|
ldx #$07 ; start at slot 7
|
||||||
|
DetectSlot:
|
||||||
|
ldy #$00
|
||||||
|
lda #$fc
|
||||||
|
sta SlotL
|
||||||
|
txa
|
||||||
|
ora #$c0
|
||||||
|
sta SlotH
|
||||||
|
lda (SlotL),y
|
||||||
|
bne nextSlot
|
||||||
|
iny
|
||||||
|
lda (SlotL),y
|
||||||
|
bne nextSlot
|
||||||
|
iny
|
||||||
|
lda (SlotL),y
|
||||||
|
cmp #$17
|
||||||
|
bne nextSlot
|
||||||
|
iny
|
||||||
|
lda (SlotL),y
|
||||||
|
cmp #$14
|
||||||
|
bne nextSlot
|
||||||
|
txa
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
asl
|
||||||
|
tax
|
||||||
|
clc
|
||||||
|
bcc Start
|
||||||
|
nextSlot:
|
||||||
|
dex
|
||||||
|
bne DetectSlot
|
||||||
|
rts
|
||||||
Start:
|
Start:
|
||||||
|
lda #$8d
|
||||||
jsr $c300 ; force 80 columns
|
jsr $c300 ; force 80 columns
|
||||||
lda LastChar
|
lda LastChar
|
||||||
pha
|
pha
|
||||||
|
@ -134,46 +166,46 @@ moveUp:
|
||||||
SendByte:
|
SendByte:
|
||||||
pha
|
pha
|
||||||
waitWrite:
|
waitWrite:
|
||||||
lda InputFlags
|
lda InputFlags,x
|
||||||
rol
|
rol
|
||||||
rol
|
rol
|
||||||
bcs waitWrite
|
bcs waitWrite
|
||||||
pla
|
pla
|
||||||
sta OutputByte
|
sta OutputByte,x
|
||||||
lda #$1e ; set bit 0 low to indicate write started
|
lda #$1e ; set bit 0 low to indicate write started
|
||||||
sta OutputFlags
|
sta OutputFlags,x
|
||||||
finishWrite:
|
finishWrite:
|
||||||
lda InputFlags
|
lda InputFlags,x
|
||||||
rol
|
rol
|
||||||
rol
|
rol
|
||||||
bcc finishWrite
|
bcc finishWrite
|
||||||
lda #$1f
|
lda #$1f
|
||||||
sta OutputFlags
|
sta OutputFlags,x
|
||||||
rts
|
rts
|
||||||
|
|
||||||
GetByte:
|
GetByte:
|
||||||
bit Keyboard ; skip byte read if key pressed
|
bit Keyboard ; skip byte read if key pressed
|
||||||
bcc keyPressed
|
bcc keyPressed
|
||||||
lda #$1d ;set read flag low
|
lda #$1d ;set read flag low
|
||||||
sta OutputFlags
|
sta OutputFlags,x
|
||||||
waitRead:
|
waitRead:
|
||||||
lda InputFlags
|
lda InputFlags,x
|
||||||
rol
|
rol
|
||||||
bcc readByte
|
bcc readByte
|
||||||
bit Keyboard ;keypress will abort waiting to read
|
bit Keyboard ;keypress will abort waiting to read
|
||||||
bpl waitRead
|
bpl waitRead
|
||||||
keyPressed:
|
keyPressed:
|
||||||
lda #$1f ;set all flags high and exit
|
lda #$1f ;set all flags high and exit
|
||||||
sta OutputFlags
|
sta OutputFlags,x
|
||||||
sec ;failure
|
sec ;failure
|
||||||
rts
|
rts
|
||||||
readByte:
|
readByte:
|
||||||
lda InputByte
|
lda InputByte,x
|
||||||
pha
|
pha
|
||||||
lda #$1f ;set all flags high
|
lda #$1f ;set all flags high
|
||||||
sta OutputFlags
|
sta OutputFlags,x
|
||||||
finishRead:
|
finishRead:
|
||||||
lda InputFlags
|
lda InputFlags,x
|
||||||
rol
|
rol
|
||||||
bcc finishRead
|
bcc finishRead
|
||||||
pla
|
pla
|
||||||
|
|
BIN
Apple2/Shell.bin
BIN
Apple2/Shell.bin
Binary file not shown.
394
Apple2/Shell.lst
394
Apple2/Shell.lst
|
@ -15,13 +15,10 @@ Current file: Shell.asm
|
||||||
000000r 1 NoDevice = $28
|
000000r 1 NoDevice = $28
|
||||||
000000r 1 WriteProtect = $2B
|
000000r 1 WriteProtect = $2B
|
||||||
000000r 1
|
000000r 1
|
||||||
000000r 1 ; hard code slot to 7 for now, will make it auto-detect later
|
000000r 1 InputByte = $c08e
|
||||||
000000r 1 SLOT = 7
|
000000r 1 OutputByte = $c08d
|
||||||
000000r 1
|
000000r 1 InputFlags = $c08b
|
||||||
000000r 1 InputByte = $c08e+SLOT*$10
|
000000r 1 OutputFlags = $c087
|
||||||
000000r 1 OutputByte = $c08d+SLOT*$10
|
|
||||||
000000r 1 InputFlags = $c08b+SLOT*$10
|
|
||||||
000000r 1 OutputFlags = $c087+SLOT*$10
|
|
||||||
000000r 1
|
000000r 1
|
||||||
000000r 1 ResetCommand = $00
|
000000r 1 ResetCommand = $00
|
||||||
000000r 1 ReadBlockCommand = $01
|
000000r 1 ReadBlockCommand = $01
|
||||||
|
@ -53,180 +50,215 @@ Current file: Shell.asm
|
||||||
000000r 1 BasCalc = $fbc1
|
000000r 1 BasCalc = $fbc1
|
||||||
000000r 1
|
000000r 1
|
||||||
000000r 1 LastChar = $06
|
000000r 1 LastChar = $06
|
||||||
000000r 1
|
000000r 1 SlotL = $fe
|
||||||
|
000000r 1 SlotH = $ff
|
||||||
000000r 1 ESC = $9b
|
000000r 1 ESC = $9b
|
||||||
000000r 1
|
000000r 1
|
||||||
000000r 1 .org $2000
|
000000r 1 .org $2000
|
||||||
002000 1 Start:
|
002000 1 A2 07 ldx #$07 ; start at slot 7
|
||||||
002000 1 20 00 C3 jsr $c300 ; force 80 columns
|
002002 1 DetectSlot:
|
||||||
002003 1 A5 06 lda LastChar
|
002002 1 A0 00 ldy #$00
|
||||||
002005 1 48 pha
|
002004 1 A9 FC lda #$fc
|
||||||
002006 1 2C 10 C0 bit ClearKeyboard
|
002006 1 85 FE sta SlotL
|
||||||
002009 1 A9 00 lda #ResetCommand
|
002008 1 8A txa
|
||||||
00200B 1 20 9F 20 jsr SendByte
|
002009 1 09 C0 ora #$c0
|
||||||
00200E 1 A9 09 lda #ShellCommand
|
00200B 1 85 FF sta SlotH
|
||||||
002010 1 20 9F 20 jsr SendByte
|
00200D 1 B1 FE lda (SlotL),y
|
||||||
002013 1 20 1A 20 jsr DumpOutput
|
00200F 1 D0 1C bne nextSlot
|
||||||
002016 1 68 pla
|
002011 1 C8 iny
|
||||||
002017 1 85 06 sta LastChar
|
002012 1 B1 FE lda (SlotL),y
|
||||||
002019 1 60 rts
|
002014 1 D0 17 bne nextSlot
|
||||||
00201A 1
|
002016 1 C8 iny
|
||||||
00201A 1 DumpOutput:
|
002017 1 B1 FE lda (SlotL),y
|
||||||
00201A 1 20 BD 20 jsr GetByte
|
002019 1 C9 17 cmp #$17
|
||||||
00201D 1 B0 2A bcs checkInput
|
00201B 1 D0 10 bne nextSlot
|
||||||
00201F 1 C9 00 cmp #$00
|
00201D 1 C8 iny
|
||||||
002021 1 F0 39 beq endOutput
|
00201E 1 B1 FE lda (SlotL),y
|
||||||
002023 1 48 pha
|
002020 1 C9 14 cmp #$14
|
||||||
002024 1 20 1C 21 jsr ClearCursor
|
002022 1 D0 09 bne nextSlot
|
||||||
002027 1 68 pla
|
002024 1 8A txa
|
||||||
002028 1 C9 48 cmp #'H'
|
002025 1 0A asl
|
||||||
00202A 1 F0 3A beq setColumn
|
002026 1 0A asl
|
||||||
00202C 1 C9 56 cmp #'V'
|
002027 1 0A asl
|
||||||
00202E 1 F0 44 beq setRow
|
002028 1 0A asl
|
||||||
002030 1 C9 43 cmp #'C'
|
002029 1 AA tax
|
||||||
002032 1 F0 29 beq clearScreen
|
00202A 1 18 clc
|
||||||
002034 1 C9 54 cmp #'T'
|
00202B 1 90 04 bcc Start
|
||||||
002036 1 F0 4A beq setTop
|
00202D 1 nextSlot:
|
||||||
002038 1 C9 42 cmp #'B'
|
00202D 1 CA dex
|
||||||
00203A 1 F0 4E beq setBottom
|
00202E 1 D0 D2 bne DetectSlot
|
||||||
00203C 1 C9 55 cmp #'U'
|
002030 1 60 rts
|
||||||
00203E 1 F0 52 beq moveUp
|
002031 1 Start:
|
||||||
002040 1 20 ED FD jsr PrintChar
|
002031 1 A9 8D lda #$8d
|
||||||
002043 1 20 EB 20 jsr SetCursor
|
002033 1 20 00 C3 jsr $c300 ; force 80 columns
|
||||||
002046 1 4C 1A 20 jmp DumpOutput
|
002036 1 A5 06 lda LastChar
|
||||||
002049 1 checkInput:
|
002038 1 48 pha
|
||||||
002049 1 2C 00 C0 bit Keyboard ;check for keypress
|
002039 1 2C 10 C0 bit ClearKeyboard
|
||||||
00204C 1 10 CC bpl DumpOutput ;keep dumping output if no keypress
|
00203C 1 A9 00 lda #ResetCommand
|
||||||
00204E 1 AD 00 C0 lda Keyboard ;send keypress to RPi
|
00203E 1 20 D2 20 jsr SendByte
|
||||||
002051 1 29 7F and #$7f
|
002041 1 A9 09 lda #ShellCommand
|
||||||
002053 1 20 9F 20 jsr SendByte
|
002043 1 20 D2 20 jsr SendByte
|
||||||
002056 1 2C 10 C0 bit ClearKeyboard
|
002046 1 20 4D 20 jsr DumpOutput
|
||||||
002059 1 4C 1A 20 jmp DumpOutput
|
002049 1 68 pla
|
||||||
00205C 1 endOutput:
|
00204A 1 85 06 sta LastChar
|
||||||
00205C 1 60 rts
|
00204C 1 60 rts
|
||||||
00205D 1 clearScreen:
|
00204D 1
|
||||||
00205D 1 20 58 FC jsr Home
|
00204D 1 DumpOutput:
|
||||||
002060 1 20 EB 20 jsr SetCursor
|
00204D 1 20 F0 20 jsr GetByte
|
||||||
002063 1 4C 1A 20 jmp DumpOutput
|
002050 1 B0 2A bcs checkInput
|
||||||
002066 1 setColumn:
|
002052 1 C9 00 cmp #$00
|
||||||
002066 1 20 BD 20 jsr GetByte
|
002054 1 F0 39 beq endOutput
|
||||||
002069 1 85 24 sta htab
|
002056 1 48 pha
|
||||||
00206B 1 8D 7B 05 sta htab80
|
002057 1 20 4F 21 jsr ClearCursor
|
||||||
00206E 1 20 EB 20 jsr SetCursor
|
00205A 1 68 pla
|
||||||
002071 1 4C 1A 20 jmp DumpOutput
|
00205B 1 C9 48 cmp #'H'
|
||||||
002074 1 setRow:
|
00205D 1 F0 3A beq setColumn
|
||||||
002074 1 20 BD 20 jsr GetByte
|
00205F 1 C9 56 cmp #'V'
|
||||||
002077 1 85 25 sta vtab
|
002061 1 F0 44 beq setRow
|
||||||
002079 1 20 C1 FB jsr BasCalc
|
002063 1 C9 43 cmp #'C'
|
||||||
00207C 1 20 EB 20 jsr SetCursor
|
002065 1 F0 29 beq clearScreen
|
||||||
00207F 1 4C 1A 20 jmp DumpOutput
|
002067 1 C9 54 cmp #'T'
|
||||||
002082 1 setTop:
|
002069 1 F0 4A beq setTop
|
||||||
002082 1 20 BD 20 jsr GetByte
|
00206B 1 C9 42 cmp #'B'
|
||||||
002085 1 85 22 sta $22
|
00206D 1 F0 4E beq setBottom
|
||||||
002087 1 4C 1A 20 jmp DumpOutput
|
00206F 1 C9 55 cmp #'U'
|
||||||
00208A 1 setBottom:
|
002071 1 F0 52 beq moveUp
|
||||||
00208A 1 20 BD 20 jsr GetByte
|
002073 1 20 ED FD jsr PrintChar
|
||||||
00208D 1 85 23 sta $23
|
002076 1 20 1E 21 jsr SetCursor
|
||||||
00208F 1 4C 1A 20 jmp DumpOutput
|
002079 1 4C 4D 20 jmp DumpOutput
|
||||||
002092 1 moveUp:
|
00207C 1 checkInput:
|
||||||
002092 1 C6 25 dec vtab
|
00207C 1 2C 00 C0 bit Keyboard ;check for keypress
|
||||||
002094 1 A5 25 lda vtab
|
00207F 1 10 CC bpl DumpOutput ;keep dumping output if no keypress
|
||||||
002096 1 20 C1 FB jsr BasCalc
|
002081 1 AD 00 C0 lda Keyboard ;send keypress to RPi
|
||||||
002099 1 20 EB 20 jsr SetCursor
|
002084 1 29 7F and #$7f
|
||||||
00209C 1 4C 1A 20 jmp DumpOutput
|
002086 1 20 D2 20 jsr SendByte
|
||||||
00209F 1
|
002089 1 2C 10 C0 bit ClearKeyboard
|
||||||
00209F 1 SendByte:
|
00208C 1 4C 4D 20 jmp DumpOutput
|
||||||
00209F 1 48 pha
|
00208F 1 endOutput:
|
||||||
0020A0 1 waitWrite:
|
00208F 1 60 rts
|
||||||
0020A0 1 AD FB C0 lda InputFlags
|
002090 1 clearScreen:
|
||||||
0020A3 1 2A rol
|
002090 1 20 58 FC jsr Home
|
||||||
0020A4 1 2A rol
|
002093 1 20 1E 21 jsr SetCursor
|
||||||
0020A5 1 B0 F9 bcs waitWrite
|
002096 1 4C 4D 20 jmp DumpOutput
|
||||||
0020A7 1 68 pla
|
002099 1 setColumn:
|
||||||
0020A8 1 8D FD C0 sta OutputByte
|
002099 1 20 F0 20 jsr GetByte
|
||||||
0020AB 1 A9 1E lda #$1e ; set bit 0 low to indicate write started
|
00209C 1 85 24 sta htab
|
||||||
0020AD 1 8D F7 C0 sta OutputFlags
|
00209E 1 8D 7B 05 sta htab80
|
||||||
0020B0 1 finishWrite:
|
0020A1 1 20 1E 21 jsr SetCursor
|
||||||
0020B0 1 AD FB C0 lda InputFlags
|
0020A4 1 4C 4D 20 jmp DumpOutput
|
||||||
0020B3 1 2A rol
|
0020A7 1 setRow:
|
||||||
0020B4 1 2A rol
|
0020A7 1 20 F0 20 jsr GetByte
|
||||||
0020B5 1 90 F9 bcc finishWrite
|
0020AA 1 85 25 sta vtab
|
||||||
0020B7 1 A9 1F lda #$1f
|
0020AC 1 20 C1 FB jsr BasCalc
|
||||||
0020B9 1 8D F7 C0 sta OutputFlags
|
0020AF 1 20 1E 21 jsr SetCursor
|
||||||
0020BC 1 60 rts
|
0020B2 1 4C 4D 20 jmp DumpOutput
|
||||||
0020BD 1
|
0020B5 1 setTop:
|
||||||
0020BD 1 GetByte:
|
0020B5 1 20 F0 20 jsr GetByte
|
||||||
0020BD 1 2C 00 C0 bit Keyboard ; skip byte read if key pressed
|
0020B8 1 85 22 sta $22
|
||||||
0020C0 1 90 10 bcc keyPressed
|
0020BA 1 4C 4D 20 jmp DumpOutput
|
||||||
0020C2 1 A9 1D lda #$1d ;set read flag low
|
0020BD 1 setBottom:
|
||||||
0020C4 1 8D F7 C0 sta OutputFlags
|
0020BD 1 20 F0 20 jsr GetByte
|
||||||
0020C7 1 waitRead:
|
0020C0 1 85 23 sta $23
|
||||||
0020C7 1 AD FB C0 lda InputFlags
|
0020C2 1 4C 4D 20 jmp DumpOutput
|
||||||
0020CA 1 2A rol
|
0020C5 1 moveUp:
|
||||||
0020CB 1 90 0C bcc readByte
|
0020C5 1 C6 25 dec vtab
|
||||||
0020CD 1 2C 00 C0 bit Keyboard ;keypress will abort waiting to read
|
0020C7 1 A5 25 lda vtab
|
||||||
0020D0 1 10 F5 bpl waitRead
|
0020C9 1 20 C1 FB jsr BasCalc
|
||||||
0020D2 1 keyPressed:
|
0020CC 1 20 1E 21 jsr SetCursor
|
||||||
0020D2 1 A9 1F lda #$1f ;set all flags high and exit
|
0020CF 1 4C 4D 20 jmp DumpOutput
|
||||||
0020D4 1 8D F7 C0 sta OutputFlags
|
0020D2 1
|
||||||
0020D7 1 38 sec ;failure
|
0020D2 1 SendByte:
|
||||||
0020D8 1 60 rts
|
0020D2 1 48 pha
|
||||||
0020D9 1 readByte:
|
0020D3 1 waitWrite:
|
||||||
0020D9 1 AD FE C0 lda InputByte
|
0020D3 1 BD 8B C0 lda InputFlags,x
|
||||||
0020DC 1 48 pha
|
0020D6 1 2A rol
|
||||||
0020DD 1 A9 1F lda #$1f ;set all flags high
|
0020D7 1 2A rol
|
||||||
0020DF 1 8D F7 C0 sta OutputFlags
|
0020D8 1 B0 F9 bcs waitWrite
|
||||||
0020E2 1 finishRead:
|
0020DA 1 68 pla
|
||||||
0020E2 1 AD FB C0 lda InputFlags
|
0020DB 1 9D 8D C0 sta OutputByte,x
|
||||||
0020E5 1 2A rol
|
0020DE 1 A9 1E lda #$1e ; set bit 0 low to indicate write started
|
||||||
0020E6 1 90 FA bcc finishRead
|
0020E0 1 9D 87 C0 sta OutputFlags,x
|
||||||
0020E8 1 68 pla
|
0020E3 1 finishWrite:
|
||||||
0020E9 1 18 clc ;success
|
0020E3 1 BD 8B C0 lda InputFlags,x
|
||||||
0020EA 1 end:
|
0020E6 1 2A rol
|
||||||
0020EA 1 60 rts
|
0020E7 1 2A rol
|
||||||
0020EB 1
|
0020E8 1 90 F9 bcc finishWrite
|
||||||
0020EB 1 SetCursor:
|
0020EA 1 A9 1F lda #$1f
|
||||||
0020EB 1 AD 7B 05 lda htab80 ;get horizontal location / 2
|
0020EC 1 9D 87 C0 sta OutputFlags,x
|
||||||
0020EE 1 4A lsr
|
0020EF 1 60 rts
|
||||||
0020EF 1 A8 tay
|
0020F0 1
|
||||||
0020F0 1 AD 55 C0 lda TextPage2
|
0020F0 1 GetByte:
|
||||||
0020F3 1 90 03 bcc setChar
|
0020F0 1 2C 00 C0 bit Keyboard ; skip byte read if key pressed
|
||||||
0020F5 1 AD 54 C0 lda TextPage1
|
0020F3 1 90 10 bcc keyPressed
|
||||||
0020F8 1 setChar:
|
0020F5 1 A9 1D lda #$1d ;set read flag low
|
||||||
0020F8 1 B1 28 lda (BasL),y
|
0020F7 1 9D 87 C0 sta OutputFlags,x
|
||||||
0020FA 1 85 06 sta LastChar ; save so ClearCursor will pick it up
|
0020FA 1 waitRead:
|
||||||
0020FC 1 C9 E0 cmp #$e0
|
0020FA 1 BD 8B C0 lda InputFlags,x
|
||||||
0020FE 1 10 0C bpl lowerCase
|
0020FD 1 2A rol
|
||||||
002100 1 C9 C0 cmp #$c0
|
0020FE 1 90 0C bcc readByte
|
||||||
002102 1 10 0D bpl upperCase
|
002100 1 2C 00 C0 bit Keyboard ;keypress will abort waiting to read
|
||||||
002104 1 C9 A0 cmp #$a0
|
002103 1 10 F5 bpl waitRead
|
||||||
002106 1 10 04 bpl symbol
|
002105 1 keyPressed:
|
||||||
002108 1 C9 80 cmp #$80
|
002105 1 A9 1F lda #$1f ;set all flags high and exit
|
||||||
00210A 1 10 0A bpl noop
|
002107 1 9D 87 C0 sta OutputFlags,x
|
||||||
00210C 1 symbol:
|
00210A 1 38 sec ;failure
|
||||||
00210C 1 lowerCase:
|
00210B 1 60 rts
|
||||||
00210C 1 invert:
|
00210C 1 readByte:
|
||||||
00210C 1 49 80 eor #$80
|
00210C 1 BD 8E C0 lda InputByte,x
|
||||||
00210E 1 4C 16 21 jmp storeChar
|
00210F 1 48 pha
|
||||||
002111 1 upperCase:
|
002110 1 A9 1F lda #$1f ;set all flags high
|
||||||
002111 1 29 1F and #$1f
|
002112 1 9D 87 C0 sta OutputFlags,x
|
||||||
002113 1 4C 16 21 jmp storeChar
|
002115 1 finishRead:
|
||||||
002116 1 noop:
|
002115 1 BD 8B C0 lda InputFlags,x
|
||||||
002116 1 storeChar:
|
002118 1 2A rol
|
||||||
002116 1 91 28 sta (BasL),y
|
002119 1 90 FA bcc finishRead
|
||||||
002118 1 AD 54 C0 lda TextPage1
|
00211B 1 68 pla
|
||||||
00211B 1 60 rts
|
00211C 1 18 clc ;success
|
||||||
00211C 1
|
00211D 1 end:
|
||||||
00211C 1 ClearCursor:
|
00211D 1 60 rts
|
||||||
00211C 1 AD 7B 05 lda htab80 ;get horizontal location / 2
|
00211E 1
|
||||||
00211F 1 4A lsr
|
00211E 1 SetCursor:
|
||||||
002120 1 A8 tay
|
00211E 1 AD 7B 05 lda htab80 ;get horizontal location / 2
|
||||||
002121 1 AD 55 C0 lda TextPage2
|
002121 1 4A lsr
|
||||||
002124 1 90 03 bcc restoreChar
|
002122 1 A8 tay
|
||||||
002126 1 AD 54 C0 lda TextPage1
|
002123 1 AD 55 C0 lda TextPage2
|
||||||
002129 1 restoreChar:
|
002126 1 90 03 bcc setChar
|
||||||
002129 1 A5 06 lda LastChar
|
002128 1 AD 54 C0 lda TextPage1
|
||||||
00212B 1 91 28 sta (BasL),y
|
00212B 1 setChar:
|
||||||
00212D 1 AD 54 C0 lda TextPage1
|
00212B 1 B1 28 lda (BasL),y
|
||||||
002130 1 60 rts
|
00212D 1 85 06 sta LastChar ; save so ClearCursor will pick it up
|
||||||
002130 1
|
00212F 1 C9 E0 cmp #$e0
|
||||||
|
002131 1 10 0C bpl lowerCase
|
||||||
|
002133 1 C9 C0 cmp #$c0
|
||||||
|
002135 1 10 0D bpl upperCase
|
||||||
|
002137 1 C9 A0 cmp #$a0
|
||||||
|
002139 1 10 04 bpl symbol
|
||||||
|
00213B 1 C9 80 cmp #$80
|
||||||
|
00213D 1 10 0A bpl noop
|
||||||
|
00213F 1 symbol:
|
||||||
|
00213F 1 lowerCase:
|
||||||
|
00213F 1 invert:
|
||||||
|
00213F 1 49 80 eor #$80
|
||||||
|
002141 1 4C 49 21 jmp storeChar
|
||||||
|
002144 1 upperCase:
|
||||||
|
002144 1 29 1F and #$1f
|
||||||
|
002146 1 4C 49 21 jmp storeChar
|
||||||
|
002149 1 noop:
|
||||||
|
002149 1 storeChar:
|
||||||
|
002149 1 91 28 sta (BasL),y
|
||||||
|
00214B 1 AD 54 C0 lda TextPage1
|
||||||
|
00214E 1 60 rts
|
||||||
|
00214F 1
|
||||||
|
00214F 1 ClearCursor:
|
||||||
|
00214F 1 AD 7B 05 lda htab80 ;get horizontal location / 2
|
||||||
|
002152 1 4A lsr
|
||||||
|
002153 1 A8 tay
|
||||||
|
002154 1 AD 55 C0 lda TextPage2
|
||||||
|
002157 1 90 03 bcc restoreChar
|
||||||
|
002159 1 AD 54 C0 lda TextPage1
|
||||||
|
00215C 1 restoreChar:
|
||||||
|
00215C 1 A5 06 lda LastChar
|
||||||
|
00215E 1 91 28 sta (BasL),y
|
||||||
|
002160 1 AD 54 C0 lda TextPage1
|
||||||
|
002163 1 60 rts
|
||||||
|
002163 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user