mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-03 22:30:09 +00:00
Merge JGH Sept 11: Fix Copy editor; enhance *HELP
This commit is contained in:
parent
a1087ddefe
commit
6acd3d5336
BIN
applecorn.po
BIN
applecorn.po
Binary file not shown.
@ -14,10 +14,6 @@
|
||||
*************************
|
||||
* OSBYTE DISPATCH TABLE *
|
||||
*************************
|
||||
|
||||
* Moved to AUXMEM.VDU.S for benefit of Merlin-8/-16
|
||||
*BYTEVARBASE EQU $190 ; Base of OSBYTE variables
|
||||
|
||||
BYTWRDADDR DW BYTE00XX ; OSBYTE 0 - Machine host
|
||||
DW BYTE01 ; OSBYTE 1 - User flag
|
||||
DW BYTE02 ; OSBYTE 2 - OSRDCH source
|
||||
@ -38,16 +34,16 @@ BYTWRDLOW
|
||||
BYTESZLO EQU BYTWRDLOW-BYTWRDADDR
|
||||
BYTELOW EQU BYTESZLO/2-1 ; Maximum low OSBYTE
|
||||
BYTEHIGH EQU $75 ; First high OSBYTE
|
||||
DW BYTE75 ; OSBYTE 117 - Read VDU status
|
||||
DW BYTE76 ; OSBYTE 118 - Update keyboard LEDs
|
||||
DW BYTE75 ; OSBYTE 117 - Read VDU status - VDU.s
|
||||
DW BYTE76 ; OSBYTE 118 - Update kbd LEDs - CHARIO.s
|
||||
DW BYTENULL ; OSBYTE 119
|
||||
DW BYTENULL ; OSBYTE 120
|
||||
DW BYTENULL ; OSBYTE 121
|
||||
DW BYTENULL ; OSBYTE 122
|
||||
DW BYTENULL ; OSBYTE 123
|
||||
DW BYTE7C ; OSBYTE 124 - Clear Escape
|
||||
DW BYTE7D ; OSBYTE 125 - Set Escape
|
||||
DW BYTE7E ; OSBYTE 126 - Ack. Escape
|
||||
DW BYTE7C ; OSBYTE 124 - Clear Escape - CHARIO.s
|
||||
DW BYTE7D ; OSBYTE 125 - Set Escape - CHARIO.s
|
||||
DW BYTE7E ; OSBYTE 126 - Ack. Escape - CHARIO.s
|
||||
DW BYTE7F ; OSBYTE 127 - Read EOF
|
||||
DW BYTE80 ; OSBYTE 128 - ADVAL - MISC.s
|
||||
DW BYTE81 ; OSBYTE 129 - INKEY - CHARIO.s
|
||||
@ -81,7 +77,7 @@ BYTEHIGH EQU $75 ; First high OSBYTE
|
||||
DW BYTENULL ; OSBYTE 157
|
||||
DW BYTENULL ; OSBYTE 158
|
||||
DW BYTENULL ; OSBYTE 159
|
||||
DW BYTEA0 ; OSBYTE 160 - Read VDU variable
|
||||
DW BYTEA0 ; OSBYTE 160 - Read VDU variable - VDU.s
|
||||
BYTWRDTOP
|
||||
DW BYTEVAR ; OSBYTE 166+ - Read/Write OSBYTE variable
|
||||
* Maximum high OSBYTE
|
||||
@ -211,22 +207,7 @@ BYTWRDEXIT ROR A ; Move Carry to A
|
||||
CLV ; Clear V = Actioned
|
||||
BYTENULL RTS
|
||||
|
||||
BYTWRDFAIL
|
||||
** TEST code for VIEW
|
||||
* CPX #$07
|
||||
* BNE BYTFAIL0
|
||||
* CMP #$76
|
||||
* BEQ BYTE76
|
||||
* CMP #$A0
|
||||
* BNE BYTFAIL0
|
||||
* LDY #79 ; Read VDU variable $09,$0A
|
||||
* LDX #23
|
||||
* BRA BYTWRDEXIT
|
||||
*BYTE76
|
||||
* LDX $00
|
||||
* BRA BYTWRDEXIT
|
||||
* TEST
|
||||
BYTFAIL0 PHX ; *DEBUG*
|
||||
BYTWRDFAIL PHX ; *DEBUG*
|
||||
JSR SERVICEX ; Offer to sideways ROMs as service X
|
||||
LDX OSXREG ; Get returned X, returned Y is in Y
|
||||
CMP #$01
|
||||
@ -291,8 +272,8 @@ WORD00 IF MAXLEN-OSTEXT-2
|
||||
* ROR A ; Move bit 1 into Carry
|
||||
* TXA ; Get character back
|
||||
* BCS :WORD00TEST ; VDU disabled, ignore
|
||||
* LDX FXVDUQLEN ; Get length of VDU queue
|
||||
* BNE :WORD00ECHO ; Not zero, just print
|
||||
LDX FXVDUQLEN ; Get length of VDU queue
|
||||
BNE :WORD00ECHO ; Not zero, just print
|
||||
:WORD00TEST CMP #$7F ; Delete
|
||||
BEQ :WORD00DEL
|
||||
CMP #$08 ; If KBD has no DELETE key
|
||||
@ -328,6 +309,7 @@ WORD00 IF MAXLEN-OSTEXT-2
|
||||
ROL A ; Carry=Escape state
|
||||
RTS
|
||||
|
||||
|
||||
* OSWORD &01 - Read elapsed time
|
||||
* OSWORD &02 - Write elapsed time
|
||||
* OSWORD &03 - Read countdown timer
|
||||
@ -395,13 +377,10 @@ GETADDR STA OSINTWS+0 ; (OSINTWS)=>byte to read/write
|
||||
CMP #$80 ; *TO DO* Needs an appropriate value
|
||||
RTS
|
||||
|
||||
|
||||
* OSBYTE routines
|
||||
*****************
|
||||
|
||||
** TO DO: move to init.s
|
||||
*BYTE00 LDX #$0A ; $00 = identify Host
|
||||
* RTS ; %000x1xxx host type, 'A'pple
|
||||
|
||||
BYTE88 LDA #$01 ; $88 = *CODE
|
||||
WORDE0 JMP (USERV) ; OSWORD &E0+
|
||||
|
||||
@ -429,17 +408,10 @@ BYTEVAR TAY ; offset to variable
|
||||
STA BYTEVARBASE+0,Y ; update variable
|
||||
LDA BYTEVARBASE+1,Y
|
||||
TAY ; Y=next value
|
||||
* Unimplemented
|
||||
*BYTE89 ; *MOTOR
|
||||
*BYTE8A ; Buffer insert
|
||||
*BYTE8C ; *TAPE
|
||||
*BYTE8D ; *ROM
|
||||
RTS
|
||||
|
||||
* Memory layout
|
||||
BYTE82 ; $82 = read high order address
|
||||
* LDY #$00
|
||||
* LDX #$00 ; $0000 for language processor
|
||||
* Should return $0000, but BCPL, Lisp and View try to move
|
||||
* up to $F800 overwriting Apple II stuff
|
||||
LDY #$FF ; $FFFF for I/O processor
|
||||
@ -465,40 +437,6 @@ BYTE7F AND #$01 ; &7F -> &01 - EOF
|
||||
CALLFSCV JMP (FSCV) ; Hand over to filing system
|
||||
|
||||
|
||||
* TO DO: Move this to AUXMEM.INIT.S
|
||||
***********************************
|
||||
|
||||
* OSBYTE $8E - Enter language ROM
|
||||
*
|
||||
BYTE8E PHP ; Save CLC=RESET, SEC=Not RESET
|
||||
LDA #$00
|
||||
STA FAULT+0
|
||||
LDA #$80
|
||||
STA FAULT+1
|
||||
LDY #$09
|
||||
JSR PRERRLP ; Print ROM name with PRERR to set
|
||||
STY FAULT+0 ; FAULT pointing to version string
|
||||
JSR OSNEWL
|
||||
JSR OSNEWL
|
||||
PLP ; Get entry type back
|
||||
LDA #$01
|
||||
JMP AUXADDR
|
||||
|
||||
* OSBYTE $8F - Issue service call
|
||||
* X=service call, Y=parameter
|
||||
*
|
||||
BYTE8F
|
||||
SERVICEX TXA
|
||||
SERVICE LDX #$0F
|
||||
BIT $8006
|
||||
BPL :SERVSKIP ; No service entry
|
||||
JSR $8003 ; Call service entry
|
||||
TAX
|
||||
BEQ :SERVDONE
|
||||
:SERVSKIP LDX #$FF
|
||||
:SERVDONE RTS
|
||||
|
||||
|
||||
* Test/Debug code
|
||||
UNSUPBYTWRD TAX
|
||||
LDA #<OSBYTEM
|
||||
@ -530,9 +468,3 @@ OSWORDM ASC 'OSWORD($'
|
||||
OSBM2 ASC ').'
|
||||
DB $00
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -23,15 +23,12 @@
|
||||
* 02-Sep-2021 INKEY-256 tests Apple IIe vs IIc.
|
||||
* 05-Sep-2021 KBDINIT returns startup value to pass to VDUINT.
|
||||
* 09-Sep-2021 Moved keyboard OSBYTEs to here.
|
||||
* 12-Sep-2021 COPY calls new VDU entry point.
|
||||
|
||||
|
||||
** Moved to VDU.S
|
||||
*FLASHER EQU $290
|
||||
*CURSOR EQU $291
|
||||
*CURSORED EQU $292
|
||||
*CURSORCP EQU $293
|
||||
*OLDCHAR EQU $294
|
||||
*COPYCHAR EQU $295
|
||||
OLDCHAR EQU OSKBD1 ; *TEMP* ; character under cursor
|
||||
COPYCHAR EQU OSKBD2 ; *TEMP* ; character under copy cursor
|
||||
FLASHER EQU BYTEVARBASE+193 ; flash counter for cursor
|
||||
|
||||
FXEXEC EQU BYTEVARBASE+198
|
||||
FXSPOOL EQU BYTEVARBASE+199
|
||||
@ -346,7 +343,7 @@ KEYCOPY LDA FXTABCHAR ; Prepare TAB if no copy cursor
|
||||
BVC KEYREADOK1 ; No copy cursor, return TAB
|
||||
LDA OLDCHAR ; Get the char under cursor
|
||||
PHA
|
||||
JSR OUTCHARGO ; Output it to restore and move cursor
|
||||
JSR OUTCHARCP ; Output it to restore and move cursor
|
||||
JSR GETCHRC ; Save char under cursor
|
||||
STA OLDCHAR
|
||||
PLA
|
||||
|
@ -7,21 +7,20 @@
|
||||
* BBC Micro 'virtual machine' in Apple //e aux memory
|
||||
***********************************************************
|
||||
|
||||
ZP1 EQU $90 ; $90-$9f are Econet space
|
||||
; so safe to use
|
||||
ZP1 EQU $90 ; $90-$9f are spare Econet space
|
||||
; so safe to use
|
||||
ZP2 EQU $92
|
||||
|
||||
ZP3 EQU $94
|
||||
|
||||
* COL,ROW needs to be in X,Y order
|
||||
* TO DO: will be moved to VDU space
|
||||
COL EQU $96 ; Cursor column
|
||||
ROW EQU $97 ; Cursor row
|
||||
STRTBCKL EQU $9D
|
||||
** COL,ROW needs to be in X,Y order
|
||||
** TO DO: will be moved to VDU space
|
||||
*COL EQU $96 ; Cursor column
|
||||
*ROW EQU $97 ; Cursor row
|
||||
STRTBCKL EQU $9D ; *TO DO* don't need to preserve
|
||||
STRTBCKH EQU $9E
|
||||
|
||||
MOSSHIM
|
||||
ORG AUXMOS ; MOS shim implementation
|
||||
ORG AUXMOS ; MOS shim implementation
|
||||
|
||||
*
|
||||
* Shim code to service Acorn MOS entry points using
|
||||
@ -31,23 +30,23 @@ MOSSHIM
|
||||
*
|
||||
* Initially executing at $3000 until copied to $D000
|
||||
|
||||
MOSINIT LDX #$FF ; Initialize Alt SP to $1FF
|
||||
MOSINIT LDX #$FF ; Initialize Alt SP to $1FF
|
||||
TXS
|
||||
|
||||
STA $C005 ; Make sure we are writing aux
|
||||
STA $C000 ; Make sure 80STORE is off
|
||||
STA $C005 ; Make sure we are writing aux
|
||||
STA $C000 ; Make sure 80STORE is off
|
||||
|
||||
LDA $C08B ; LC RAM Rd/Wt, 1st 4K bank
|
||||
LDA $C08B ; LC RAM Rd/Wt, 1st 4K bank
|
||||
LDA $C08B
|
||||
|
||||
:MODBRA BRA :RELOC ; NOPped out on first run
|
||||
:MODBRA BRA :RELOC ; NOPped out on first run
|
||||
BRA :NORELOC
|
||||
|
||||
LDA #$EA ; NOP opcode
|
||||
LDA #$EA ; NOP opcode
|
||||
STA :MODBRA
|
||||
STA :MODBRA+1
|
||||
|
||||
:RELOC LDA #<AUXMOS1 ; Relocate MOS shim
|
||||
:RELOC LDA #<AUXMOS1 ; Relocate MOS shim
|
||||
STA A1L
|
||||
LDA #>AUXMOS1
|
||||
STA A1H
|
||||
@ -106,49 +105,78 @@ MOSINIT LDX #$FF ; Initialize Alt SP to $1FF
|
||||
:S7 BRA :L2
|
||||
|
||||
:NORELOC
|
||||
:S8 STA $C00D ; 80 col on
|
||||
STA $C003 ; Alt charset off
|
||||
STA $C055 ; PAGE2
|
||||
JMP MOSHIGH ; Ensure executing in high memory here
|
||||
:S8 STA $C00D ; 80 col on
|
||||
STA $C003 ; Alt charset off
|
||||
STA $C055 ; PAGE2
|
||||
JMP MOSHIGH ; Ensure executing in high memory here
|
||||
|
||||
MOSHIGH SEI
|
||||
LDX #$FF
|
||||
TXS ; Initialise stack
|
||||
INX ; X=$00
|
||||
TXS ; Initialise stack
|
||||
INX ; X=$00
|
||||
TXA
|
||||
:SCLR STA $0000,X ; Clear Kernel memory
|
||||
:SCLR STA $0000,X ; Clear Kernel memory
|
||||
STA $0200,X
|
||||
STA $0300,X
|
||||
INX
|
||||
BNE :SCLR
|
||||
|
||||
LDX #ENDVEC-DEFVEC-1
|
||||
:INITPG2 LDA DEFVEC,X ; Set up vectors
|
||||
:INITPG2 LDA DEFVEC,X ; Set up vectors
|
||||
STA $200,X
|
||||
DEX
|
||||
BPL :INITPG2
|
||||
|
||||
JSR KBDINIT ; Returns A=startup MODE
|
||||
JSR VDUINIT ; Initialise VDU driver
|
||||
JSR KBDINIT ; Returns A=startup MODE
|
||||
JSR VDUINIT ; Initialise VDU driver
|
||||
JSR PRHELLO
|
||||
LDA #7
|
||||
JSR OSWRCH
|
||||
JSR OSNEWL
|
||||
CLC
|
||||
JMP BYTE8E
|
||||
* JMP BYTE8E
|
||||
|
||||
* OSBYTE $8E - Enter language ROM
|
||||
*
|
||||
BYTE8E PHP ; Save CLC=RESET, SEC=Not RESET
|
||||
LDA #$00
|
||||
STA FAULT+0
|
||||
LDA #$80
|
||||
STA FAULT+1
|
||||
LDY #$09
|
||||
JSR PRERRLP ; Print ROM name with PRERR to set
|
||||
STY FAULT+0 ; FAULT pointing to version string
|
||||
JSR OSNEWL
|
||||
JSR OSNEWL
|
||||
PLP ; Get entry type back
|
||||
LDA #$01
|
||||
JMP AUXADDR
|
||||
|
||||
* OSBYTE $8F - Issue service call
|
||||
* X=service call, Y=parameter
|
||||
*
|
||||
BYTE8F
|
||||
SERVICEX TXA
|
||||
SERVICE LDX #$0F
|
||||
BIT $8006
|
||||
BPL :SERVSKIP ; No service entry
|
||||
JSR $8003 ; Call service entry
|
||||
TAX
|
||||
BEQ :SERVDONE
|
||||
:SERVSKIP LDX #$FF
|
||||
:SERVDONE RTS
|
||||
|
||||
|
||||
PRHELLO LDA #<HELLO
|
||||
LDY #>HELLO
|
||||
JSR PRSTR
|
||||
JMP OSNEWL
|
||||
|
||||
BYTE00XX BEQ BYTE00A ; OSBYTE 0,0 - generate error
|
||||
LDX #$0A ; $00 = identify Host
|
||||
RTS ; %000x1xxx host type, 'A'pple
|
||||
BYTE00XX BEQ BYTE00A ; OSBYTE 0,0 - generate error
|
||||
LDX #$0A ; $00 = identify Host
|
||||
RTS ; %000x1xxx host type, 'A'pple
|
||||
BYTE00A BRK
|
||||
DB $F7
|
||||
HELLO ASC 'Applecorn MOS 2021-09-10 snapshot'
|
||||
DB $00 ; Unify MOS messages
|
||||
|
||||
|
||||
HELLO ASC 'Applecorn MOS 2021-09-11 snapshot'
|
||||
DB $00 ; Unify MOS messages
|
||||
|
||||
|
100
auxmem.misc.s
100
auxmem.misc.s
@ -3,6 +3,7 @@
|
||||
*
|
||||
* Misc functions and API entry block
|
||||
* 02-Sep-2021 Written GSINIT/GSREAD
|
||||
* 11-Sep-2021 PR16DEC uses OS workspace, added rest of default vectors/etc.
|
||||
|
||||
|
||||
* OSBYTE $80 - ADVAL
|
||||
@ -80,7 +81,7 @@ OUTSTR TXA
|
||||
* Print string pointed to by A,Y to the screen
|
||||
PRSTR STA OSTEXT+0 ; String in A,Y
|
||||
STY OSTEXT+1
|
||||
:L1 LDA (OSTEXT) ; Ptr to string in ZP3
|
||||
:L1 LDA (OSTEXT) ; Ptr to string in OSTEXT
|
||||
BEQ PRSTROK
|
||||
JSR OSASCI
|
||||
INC OSTEXT
|
||||
@ -122,50 +123,52 @@ PRNIB CMP #$0A
|
||||
:S1 ADC #'0' ; < $0A
|
||||
JMP OSWRCH
|
||||
|
||||
* Print 16 bit value in XY in decimal
|
||||
* Print 16-bit value in XY in decimal
|
||||
* beebwiki.mdfs.net/Number_output_in_6502_machine_code
|
||||
PRDECXY STX :NUM+0
|
||||
STY :NUM+1
|
||||
LDA #' '
|
||||
STA :PAD
|
||||
:PRDEC16 LDY #$08 ; Five digits
|
||||
OSNUM EQU OSTEXT+0
|
||||
OSPAD EQU OSTEXT+4
|
||||
|
||||
PRDECXY LDA #' '
|
||||
PRDECPAD STA OSPAD
|
||||
STX OSNUM+0
|
||||
STY OSNUM+1
|
||||
:PRDEC16 LDY #$08 ; Five digits (5-1)*2
|
||||
:LP1 LDX #$FF
|
||||
SEC
|
||||
:LP2 LDA :NUM+0
|
||||
:LP2 LDA OSNUM+0
|
||||
SBC :TENS+0,Y
|
||||
STA :NUM+0
|
||||
LDA :NUM+1
|
||||
STA OSNUM+0
|
||||
LDA OSNUM+1
|
||||
SBC :TENS+1,Y
|
||||
STA :NUM+1
|
||||
STA OSNUM+1
|
||||
INX
|
||||
BCS :LP2
|
||||
LDA :NUM+0
|
||||
LDA OSNUM+0
|
||||
ADC :TENS+0,Y
|
||||
STA :NUM+0
|
||||
LDA :NUM+1
|
||||
STA OSNUM+0
|
||||
LDA OSNUM+1
|
||||
ADC :TENS+1,Y
|
||||
STA :NUM+1
|
||||
STA OSNUM+1
|
||||
TXA
|
||||
BNE :DIGIT
|
||||
LDA :PAD
|
||||
LDA OSPAD
|
||||
BNE :PRINT
|
||||
BEQ :NEXT
|
||||
:DIGIT LDX #'0'
|
||||
STX :PAD
|
||||
STX OSPAD
|
||||
ORA #'0'
|
||||
:PRINT JSR OSWRCH
|
||||
:NEXT DEY
|
||||
DEY
|
||||
BPL :LP1
|
||||
RTS
|
||||
:PAD DB $00
|
||||
:NUM DW $0000
|
||||
:TENS DW 1
|
||||
DW 10
|
||||
DW 100
|
||||
DW 1000
|
||||
DW 10000
|
||||
|
||||
|
||||
* GSINIT - Initialise for GSTRANS string parsing
|
||||
************************************************
|
||||
* On entry,
|
||||
@ -208,8 +211,10 @@ GSINTGO1 ROR GSFLAG ; Rotate 'leading-quote' into flags
|
||||
* NE=not end of line, more words follow
|
||||
* CC = not end of string
|
||||
* Y =updated for future calls to GSREAD
|
||||
* VS=control character, <$20
|
||||
* VC=not control character >$1F
|
||||
* VS=7-bit control character, (char AND $7F)<$20
|
||||
* VC=not 7-bit control character (char AND $7F)>$1F
|
||||
* EQ= char=$00, NE= char>$00
|
||||
* PL= char<$80, MI= char>$7F
|
||||
*
|
||||
* No string present is checked for with:
|
||||
* JSR GSINIT:BEQ missingstring
|
||||
@ -238,7 +243,7 @@ GSREADLP STA GSCHAR ; Update accumulator
|
||||
BNE GSREAD2 ; No, check character
|
||||
BIT GSFLAG
|
||||
BPL GSREADEND ; We aren't waiting for a closing quote
|
||||
* ; End of line before closing quote
|
||||
* ; End of line before closing quote
|
||||
ERRBADSTR BRK
|
||||
DB $FD
|
||||
ASC 'Bad string'
|
||||
@ -249,7 +254,7 @@ GSREAD2 CMP #' '
|
||||
BNE GSREAD3 ; Not a space, process it
|
||||
BIT GSFLAG ; Can space terminate string?
|
||||
BMI GSREADCHAR ; We're waiting for a terminating quote
|
||||
* ; so return the space character
|
||||
* ; so return the space character
|
||||
BVC GSREADEND ; Space is a terminator, finish
|
||||
GSREAD3 CMP #$22 ; Is it a quote?
|
||||
BNE GSREADESC ; Not quote, check for escapes
|
||||
@ -268,7 +273,7 @@ GSREADEND JSR SKIPSPC ; Skip any spaces to next word
|
||||
* EQ=end of line
|
||||
* NE=not end of line, more words follow
|
||||
|
||||
GSREADESC CMP #$7C ; Is is '|' escape character
|
||||
GSREADESC CMP #$7C ; Is it '|' escape character
|
||||
BNE GSREADCHAR ; No, return as character
|
||||
INY ; Step to next character
|
||||
LDA (OSLPTR),Y
|
||||
@ -303,13 +308,13 @@ GSREADOK INY ; Step to next character
|
||||
RDROM LDX #$0F ; Returns X=current ROM, Y=0, A=byte
|
||||
LDY #$00 ; We haven't really got any ROMs
|
||||
LDA ($F6),Y ; so just read directly
|
||||
RTS
|
||||
EVENT RTS
|
||||
|
||||
EVENT LDA #<OSEVENM
|
||||
LDY #>OSEVENM
|
||||
JMP PRSTR
|
||||
OSEVENM ASC 'OSEVEN.'
|
||||
DB $00
|
||||
*EVENT LDA #<OSEVENM
|
||||
* LDY #>OSEVENM
|
||||
* JMP PRSTR
|
||||
*OSEVENM ASC 'OSEVEN.'
|
||||
* DB $00
|
||||
|
||||
|
||||
**********************************************************
|
||||
@ -396,6 +401,17 @@ DEFVEC DW NULLRTS ; $200 USERV
|
||||
DW GBPBHND ; $21A GBPBV
|
||||
DW FINDHND ; $21C FINDV
|
||||
DW FSCHND ; $21E FSCV
|
||||
DW NULLRTS ; $220 EVENTV
|
||||
DW NULLRTS ; $222
|
||||
DW NULLRTS ; $224
|
||||
DW NULLRTS ; $226
|
||||
DW NULLRTS ; $228
|
||||
DW NULLRTS ; $22A
|
||||
DW NULLRTS ; $22C
|
||||
DW NULLRTS ; $22E
|
||||
DW NULLRTS ; $230 SPARE1V
|
||||
DW NULLRTS ; $232 SPARE2V
|
||||
DW NULLRTS ; $234 SPARE3V
|
||||
ENDVEC
|
||||
|
||||
*
|
||||
@ -406,22 +422,22 @@ ENDVEC
|
||||
* Base of API entries here in loaded code
|
||||
MOSVEC
|
||||
* Real base of API entries in real memory
|
||||
MOSAPI EQU $FFB6
|
||||
MOSAPI EQU $FF95
|
||||
ORG MOSAPI
|
||||
|
||||
* OPTIONAL ENTRIES
|
||||
* ----------------
|
||||
*OSSERV JMP SERVICE ; FF95 OSSERV
|
||||
*OSCOLD JMP NULLRTS ; FF98 OSCOLD
|
||||
*OSPRSTR JMP OUTSTR ; FF9B OSPRSTR
|
||||
*OSFF9E JMP NULLRTS ; FF9E
|
||||
*OSSCANHEX JMP RDHEX ; FFA1 SCANHX
|
||||
*OSFFA4 JMP NULLRTS ; FFA4
|
||||
*OSFFA7 JMP NULLRTS ; FFA7
|
||||
*PRHEX JMP OUTHEX ; FFAA PRHEX
|
||||
*PR2HEX JMP OUT2HEX ; FFAD PR2HEX
|
||||
*OSFFB0 JMP NULLRTS ; FFB0
|
||||
*OSWRRM JMP NULLRTS ; FFB3 OSWRRM
|
||||
OSSERV JMP SERVICE ; FF95 OSSERV
|
||||
OSCOLD JMP NULLRTS ; FF98 OSCOLD
|
||||
OSPRSTR JMP OUTSTR ; FF9B OSPRSTR
|
||||
OSSCANDEC JMP SCANDEC ; FF9E SCANDEC
|
||||
OSSCANHEX JMP SCANHEX ; FFA1 SCANHEX
|
||||
OSFFA4 JMP NULLRTS ; FFA4 (DISKACC)
|
||||
OSFFA7 JMP NULLRTS ; FFA7 (DISKCCP)
|
||||
PRHEX JMP OUTHEX ; FFAA PRHEX
|
||||
PR2HEX JMP OUT2HEX ; FFAD PR2HEX
|
||||
OSFFB0 JMP NULLRTS ; FFB0 (USERINT)
|
||||
OSWRRM JMP NULLRTS ; FFB3 OSWRRM
|
||||
|
||||
* COMPULSARY ENTRIES
|
||||
* ------------------
|
||||
|
@ -16,55 +16,53 @@
|
||||
* $E0-$EE Internal MOS workspace
|
||||
* $EF-$FF MOS API workspace
|
||||
|
||||
FSFLAG1 EQU $E2
|
||||
FSFLAG2 EQU $E3
|
||||
GSFLAG EQU $E4
|
||||
GSCHAR EQU $E5
|
||||
OSTEXT EQU $E6 ; $E6 => text string
|
||||
MAXLEN EQU OSTEXT+2 ; $E8
|
||||
MINCHAR EQU OSTEXT+3 ; $E9
|
||||
MAXCHAR EQU OSTEXT+4 ; $EA
|
||||
OSTEMP EQU $EB ; $EB
|
||||
OSKBD1 EQU $EC ; $EC kbd ws
|
||||
OSKBD2 EQU OSKBD1+1 ; $ED kbd ws
|
||||
OSKBD3 EQU OSKBD1+2 ; $EE kbd ws
|
||||
OSAREG EQU $EF ; $EF A register
|
||||
OSXREG EQU OSAREG+1 ; $F0 X register
|
||||
OSYREG EQU OSXREG+1 ; $F1 Y register
|
||||
OSCTRL EQU OSXREG ; $F0 (XY)=>control block
|
||||
OSLPTR EQU $F2 ; $F2 => command line
|
||||
FSFLAG1 EQU $E2
|
||||
FSFLAG2 EQU $E3
|
||||
GSFLAG EQU $E4 ; $E4 GSREAD processing flags
|
||||
GSCHAR EQU $E5 ; $E5 GSREAD accumulator
|
||||
OSTEXT EQU $E6 ; $E6 => text string $E6 OSNUM+0
|
||||
MAXLEN EQU OSTEXT+2 ; $E8 $E8 OSNUM+2
|
||||
MINCHAR EQU OSTEXT+3 ; $E9 $E9 OSNUM+3
|
||||
MAXCHAR EQU OSTEXT+4 ; $EA $EA OSPAD
|
||||
OSTEMP EQU $EB ; $EB
|
||||
OSKBD1 EQU $EC ; $EC kbd ws
|
||||
OSKBD2 EQU OSKBD1+1 ; $ED kbd ws
|
||||
OSKBD3 EQU OSKBD1+2 ; $EE kbd ws
|
||||
OSAREG EQU $EF ; $EF A register
|
||||
OSXREG EQU OSAREG+1 ; $F0 X register
|
||||
OSYREG EQU OSXREG+1 ; $F1 Y register
|
||||
OSCTRL EQU OSXREG ; $F0 (XY)=>control block
|
||||
OSLPTR EQU $F2 ; $F2 => command line
|
||||
*
|
||||
OSINTWS EQU $FA ; $FA IRQ ZP pointer, use when IRQs off
|
||||
OSINTA EQU $FC ; $FC IRQ register A store
|
||||
FAULT EQU $FD ; $FD Error message pointer
|
||||
ESCFLAG EQU $FF ; $FF Escape status
|
||||
OSINTWS EQU $FA ; $FA IRQ ZP pointer, use when IRQs off
|
||||
OSINTA EQU $FC ; $FC IRQ register A store
|
||||
FAULT EQU $FD ; $FD Error message pointer
|
||||
ESCFLAG EQU $FF ; $FF Escape status
|
||||
|
||||
|
||||
* $0200-$0235 Vectors
|
||||
* $0236-$028F OSBYTE variables
|
||||
* $0236-$028F OSBYTE variables ($190+BYTENUM)
|
||||
* $0290-$02ED
|
||||
* $02EE-$02FF MOS control block
|
||||
|
||||
USERV EQU $200 ; USER vector
|
||||
BRKV EQU $202 ; BRK vector
|
||||
CLIV EQU $208 ; OSCLI vector
|
||||
BYTEV EQU $20A ; OSBYTE vector
|
||||
WORDV EQU $20C ; OSWORD vector
|
||||
WRCHV EQU $20E ; OSWRCH vector
|
||||
RDCHV EQU $210 ; OSRDCH vector
|
||||
FILEV EQU $212 ; OSFILE vector
|
||||
ARGSV EQU $214 ; OSARGS vector
|
||||
BGETV EQU $216 ; OSBGET vector
|
||||
BPUTV EQU $218 ; OSBPUT vector
|
||||
GBPBV EQU $21A ; OSGBPB vector
|
||||
FINDV EQU $21C ; OSFIND vector
|
||||
FSCV EQU $21E ; FSCV misc file ops
|
||||
|
||||
BYTEVARBASE EQU $190 ; Base of OSBYTE variables
|
||||
OSFILECB EQU $2EE ; OSFILE control block
|
||||
|
||||
|
||||
|
||||
USERV EQU $200 ; USER vector
|
||||
BRKV EQU $202 ; BRK vector
|
||||
CLIV EQU $208 ; OSCLI vector
|
||||
BYTEV EQU $20A ; OSBYTE vector
|
||||
WORDV EQU $20C ; OSWORD vector
|
||||
WRCHV EQU $20E ; OSWRCH vector
|
||||
RDCHV EQU $210 ; OSRDCH vector
|
||||
FILEV EQU $212 ; OSFILE vector
|
||||
ARGSV EQU $214 ; OSARGS vector
|
||||
BGETV EQU $216 ; OSBGET vector
|
||||
BPUTV EQU $218 ; OSBPUT vector
|
||||
GBPBV EQU $21A ; OSGBPB vector
|
||||
FINDV EQU $21C ; OSFIND vector
|
||||
FSCV EQU $21E ; FSCV misc file ops
|
||||
|
||||
BYTEVARBASE EQU $190 ; Base of OSBYTE variables
|
||||
OSFILECB EQU $2EE ; OSFILE control block
|
||||
|
||||
|
||||
* $0300-$03DF
|
||||
* $03E0-$03FF Used for interfacing with ProDOS XFER
|
||||
|
226
auxmem.oscli.s
226
auxmem.oscli.s
@ -7,6 +7,7 @@
|
||||
* Prepares parameters and hands on to API call
|
||||
* 24-Aug-2021 Combined *LOAD and *SAVE, full address parsing.
|
||||
* 02-Sep-2021 *LOAD/*SAVE now uses GSTRANS.
|
||||
* 12-Sep-2021 *HELP uses subject lookup, *HELP MOS, *HELP HOSTFS.
|
||||
|
||||
|
||||
* COMMAND TABLE
|
||||
@ -56,8 +57,8 @@ CMDTABLE ASC 'CAT' ; Must be first command so matches '*.'
|
||||
DB $80
|
||||
DW STARQUIT-1 ; QUIT -> (LPTR)=>params
|
||||
ASC 'HELP'
|
||||
DB $80
|
||||
DW STARHELP-1 ; HELP -> (LPTR)=>params
|
||||
DB $FF
|
||||
DW STARHELP-1 ; HELP -> XY=>params
|
||||
ASC 'BASIC'
|
||||
DB $80
|
||||
DW STARBASIC-1 ; BASIC -> (LPTR)=>params
|
||||
@ -73,6 +74,16 @@ CMDTABLE ASC 'CAT' ; Must be first command so matches '*.'
|
||||
* terminator
|
||||
DB $FF
|
||||
|
||||
* *HELP TABLE
|
||||
*************
|
||||
HLPTABLE ASC 'MOS'
|
||||
DB $80
|
||||
DW HELPMOS-1 ; *HELP MOS
|
||||
ASC 'HOSTFS'
|
||||
DB $80
|
||||
DW HELPHOSTFS-1 ; *HELP HOSTFS
|
||||
DB $FF
|
||||
|
||||
|
||||
* Command table lookup
|
||||
* On entry, (OSLPTR)=>command string
|
||||
@ -341,66 +352,55 @@ XYtoLPTR STX OSLPTR+0
|
||||
RTS
|
||||
|
||||
* Print *HELP text
|
||||
* These needs tidying a bit
|
||||
STARHELP PHY
|
||||
JSR PRHELLO ; Unifiy version message
|
||||
* LDA #<:MSG
|
||||
* LDY #>:MSG
|
||||
* JSR PRSTR
|
||||
PLY
|
||||
PHY
|
||||
LDA (OSLPTR),Y
|
||||
CMP #'.' ; *HELP .
|
||||
BEQ STARHELP1
|
||||
INY
|
||||
EOR (OSLPTR),Y
|
||||
INY
|
||||
EOR (OSLPTR),Y
|
||||
AND #$DF
|
||||
CMP #$51 ; *HELP MOS
|
||||
BNE STARHELP5
|
||||
STARHELP1 LDX #0
|
||||
LDA #32
|
||||
JSR OSWRCH
|
||||
JSR OSWRCH
|
||||
STARHELPLP1 LDY #10
|
||||
LDA CMDTABLE,X
|
||||
BMI STARHELP4
|
||||
STARHELPLP2 LDA CMDTABLE,X
|
||||
BMI STARHELP3
|
||||
JSR OSWRCH
|
||||
DEY
|
||||
INX
|
||||
BNE STARHELPLP2
|
||||
STARHELP3 LDA #32
|
||||
JSR OSWRCH
|
||||
DEY
|
||||
BNE STARHELP3
|
||||
INX
|
||||
INX
|
||||
INX
|
||||
BNE STARHELPLP1
|
||||
STARHELP4 LDA #$08
|
||||
JSR OSWRCH
|
||||
JSR OSWRCH
|
||||
JSR FORCENL
|
||||
STARHELP5 LDA $8006
|
||||
BMI STARHELP6 ; Use ROM's service entry
|
||||
STARHELP JSR XYtoLPTR ; (OSLPTR),Y=>parameters
|
||||
JSR PRHELLO ; Unify version message
|
||||
LDX #<HLPTABLE ; XY=>command table
|
||||
LDY #>HLPTABLE
|
||||
JSR CLILOOKUP ; Look for *HELP subject
|
||||
LDA $8006 ; Does ROM have service entry?
|
||||
BMI STARHELP6 ; Yes, send service call
|
||||
JSR OSNEWL
|
||||
LDA #$09 ; Language name
|
||||
LDY #$80 ; *TO DO* make this and BYTE8E
|
||||
JSR PRSTR ; use same code
|
||||
JSR OSNEWL
|
||||
* LDA #<:MSG2
|
||||
* LDY #>:MSG2
|
||||
* JSR PRSTR
|
||||
STARHELP6 PLY
|
||||
STARHELP6 LDY #0 ; (OSLPTR),Y=>parameters
|
||||
LDA #9
|
||||
JMP SERVICE ; Pass to sideways ROM(s)
|
||||
*:MSG DB $0D
|
||||
* ASC 'Applecorn MOS v0.01'
|
||||
* DB $0D,$00
|
||||
*:MSG2 DB $0D,$00
|
||||
|
||||
|
||||
HELPHOSTFS LDX #<FSCCOMMAND ; *HELP HOSTFS
|
||||
LDY #>FSCCOMMAND
|
||||
BNE HELPLIST
|
||||
HELPMOS LDX #<CMDTABLE ; *HELP MOS
|
||||
LDY #>CMDTABLE
|
||||
|
||||
HELPLIST STX OSTEXT+0 ; Start of command table
|
||||
STY OSTEXT+1
|
||||
LDX #0
|
||||
HELPLP1 LDA #32
|
||||
JSR OSWRCH
|
||||
JSR OSWRCH
|
||||
HELPLP2 LDY #10
|
||||
HELPLP3 LDA (OSTEXT,X)
|
||||
BMI HELPLP4
|
||||
JSR OSWRCH
|
||||
DEY
|
||||
JSR CLISTEP
|
||||
BPL HELPLP3
|
||||
HELPLP4 LDA #32
|
||||
JSR OSWRCH
|
||||
DEY
|
||||
BNE HELPLP4
|
||||
JSR CLISTEP
|
||||
JSR CLISTEP
|
||||
JSR CLISTEP
|
||||
BPL HELPLP2
|
||||
STARHELP4 LDA #$08
|
||||
JSR OSWRCH
|
||||
JSR OSWRCH
|
||||
JMP FORCENL
|
||||
|
||||
|
||||
* Handle *QUIT command
|
||||
STARQUIT >>> XF2MAIN,QUIT
|
||||
@ -411,23 +411,6 @@ STARLOAD PHA ; Entered with A=$FF - LOAD
|
||||
JSR XYtoLPTR ; OSLPTR=>filename
|
||||
JSR SKIPWORD ; Step past filename
|
||||
BNE STARLDSV3 ; filename followed by addr
|
||||
|
||||
** replace with with GSREAD
|
||||
* LDA (OSLPTR),Y
|
||||
* CMP #34
|
||||
* BEQ STARLDSVA
|
||||
* LDA #32
|
||||
*STARLDSVA STA OSTEMP
|
||||
*STARLDSV0 INY
|
||||
* LDA (OSLPTR),Y
|
||||
* CMP #13
|
||||
* BEQ STARLDSV1
|
||||
* CMP OSTEMP
|
||||
* BNE STARLDSV0 ; Step past filename
|
||||
* JSR SKIPSPC1 ; Skip following spaces
|
||||
* BNE STARLDSV3 ; *load/save name addr
|
||||
** ^^^^
|
||||
|
||||
*
|
||||
* filename followed by no address, must be *LOAD name
|
||||
STARLDSV1 LDA #$FF ; $FF=load to file's address
|
||||
@ -507,78 +490,37 @@ STARKEY
|
||||
STARDONE RTS
|
||||
|
||||
|
||||
** Code that calls this will need to be replaced with calls
|
||||
** to SKIPSPC and GSREAD
|
||||
**
|
||||
** Consume spaces in command line. Treat " as space!
|
||||
** Return C set if no space found, C clear otherwise
|
||||
** Command line pointer in (ZP1),Y
|
||||
EATSPC
|
||||
* LDA (ZP1),Y ; Check first char is ...
|
||||
* CMP #' ' ; ... space
|
||||
* BEQ :START
|
||||
* CMP #'"' ; Or quote mark
|
||||
* BEQ :START
|
||||
* BRA :NOTFND
|
||||
*:START INY
|
||||
*:L1 LDA (ZP1),Y ; Eat any additional ...
|
||||
* CMP #' ' ; ... spaces
|
||||
* BEQ :CONT
|
||||
* CMP #'"' ; Or quote marks
|
||||
* BNE :DONE
|
||||
*:CONT INY
|
||||
* BRA :L1
|
||||
*:DONE CLC
|
||||
* RTS
|
||||
*:NOTFND SEC
|
||||
RTS
|
||||
|
||||
|
||||
** TEST CODE **
|
||||
ECHO PHY
|
||||
CLC
|
||||
JSR ECHO0
|
||||
PLY
|
||||
* *ECHO <GSTRANS string>
|
||||
************************
|
||||
ECHO
|
||||
* PHY
|
||||
* CLC
|
||||
* JSR ECHO0
|
||||
* PLY
|
||||
SEC
|
||||
ECHO0 JSR GSINIT
|
||||
PHP
|
||||
PLA
|
||||
JSR OUTHEX
|
||||
* PHP
|
||||
* PLA
|
||||
* JSR OUTHEX
|
||||
ECHOLP1 JSR GSREAD
|
||||
BCS ECHO3
|
||||
CMP #$20
|
||||
BCC ECHO2
|
||||
CMP #$7F
|
||||
BCS ECHO2
|
||||
BCS STARDONE
|
||||
* BCS ECHO3
|
||||
* CMP #$20
|
||||
* BCC ECHO2
|
||||
* CMP #$7F
|
||||
* BCS ECHO2
|
||||
JSR OSWRCH
|
||||
JMP ECHOLP1
|
||||
ECHO2 PHA
|
||||
LDA #'<'
|
||||
JSR OSWRCH
|
||||
PLA
|
||||
JSR OUTHEX
|
||||
LDA #'>'
|
||||
JSR OSWRCH
|
||||
JMP ECHOLP1
|
||||
ECHO3 PHP
|
||||
PLA
|
||||
JSR OUTHEX
|
||||
JMP OSNEWL
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*ECHO2 PHA
|
||||
* LDA #'<'
|
||||
* JSR OSWRCH
|
||||
* PLA
|
||||
* JSR OUTHEX
|
||||
* LDA #'>'
|
||||
* JSR OSWRCH
|
||||
* JMP ECHOLP1
|
||||
*ECHO3
|
||||
* PHP
|
||||
* PLA
|
||||
* JSR OUTHEX
|
||||
* JMP OSNEWL
|
||||
|
32
auxmem.vdu.s
32
auxmem.vdu.s
@ -36,18 +36,10 @@ VDUADDR EQU VDUSTATUS+4 ; $D4 address of current char cell
|
||||
|
||||
* VDU DRIVER MAIN WORKSPACE
|
||||
***************************
|
||||
FXLINES EQU BYTEVARBASE+217 ; Pages scrolling line counter
|
||||
FXLINES EQU BYTEVARBASE+217 ; Paged scrolling line counter
|
||||
FXVDUQLEN EQU BYTEVARBASE+218 ; Length of pending VDU queue
|
||||
VDUVARS EQU $290
|
||||
|
||||
* *TEMP*
|
||||
FLASHER EQU $290 ; flash counter for cursor -> BYTEVARBASE+193 -> KBD
|
||||
CURSOR EQU $291 ; character used for cursor -> VDUVAR+??
|
||||
CURSORED EQU $292 ; character used for edit cursor -> VDUVAR+??
|
||||
CURSORCP EQU $293 ; character used for copy cursor -> VDUVAR+??
|
||||
OLDCHAR EQU $294 ; character under cursor -> KBD?
|
||||
COPYCHAR EQU $295 ; character under copy cursor -> KBD?
|
||||
|
||||
VDUTWINL EQU VDUVARS+$08 ; # text window left
|
||||
VDUTWINB EQU VDUVARS+$09 ; # text window bottom \ window
|
||||
VDUTWINR EQU VDUVARS+$0A ; # text window right / size
|
||||
@ -62,9 +54,11 @@ VDUTEXTX EQU VDUVARS+$18 ; absolute POS
|
||||
VDUTEXTY EQU VDUVARS+$19 ; absolute VPOS
|
||||
VDUCOPYX EQU VDUVARS+$1A ; absolute COPY cursor X posn
|
||||
VDUCOPYY EQU VDUVARS+$1B ; absolute COPY cursor Y posn
|
||||
* CURSOR
|
||||
* CURSORED
|
||||
* CURSORCP
|
||||
*
|
||||
CURSOR EQU VDUVARS+$20 ; *TEMP* character used for cursor
|
||||
CURSORED EQU VDUVARS+$21 ; *TEMP* character used for edit cursor
|
||||
CURSORCP EQU VDUVARS+$22 ; *TEMP* character used for copy cursor
|
||||
*
|
||||
VDUQ EQU VDUVARS+$27 ; *TEMP* $27..$2F
|
||||
|
||||
|
||||
@ -82,7 +76,7 @@ OUTCHAR LDX FXVDUQLEN
|
||||
BCC CTRLCHAR ; <$20 - control char
|
||||
BIT VDUSTATUS
|
||||
BMI OUTCHEXIT ; VDU disabled
|
||||
JSR PRCHRC ; Store char, checking keypress
|
||||
OUTCHARCP JSR PRCHRC ; Store char, checking keypress
|
||||
JSR VDU09 ; Move cursor right
|
||||
OUTCHEXIT LDA VDUSTATUS
|
||||
LSR A ; Return Cy=Printer Echo Enabled
|
||||
@ -153,9 +147,8 @@ VDU02
|
||||
BNE SETSTATUS
|
||||
|
||||
* VDU 5 - Text at graphics cursor
|
||||
VDU05 LDX VDUBYTES
|
||||
DEX
|
||||
BEQ SETEXIT ; 1 byte per char, text only
|
||||
VDU05 LDX VDUPIXELS
|
||||
BEQ SETEXIT ; 0 pixels per char, text only
|
||||
* Turn cursor off and other stuff
|
||||
LDA #$20 ; Set VDU 5 mode
|
||||
BNE SETSTATUS
|
||||
@ -626,10 +619,3 @@ BYTEA0 LDY #79 ; Read VDU variable $09,$0A
|
||||
LDX #23
|
||||
RTS
|
||||
* TEST
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user