mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-01 09:32:09 +00:00
commit
6b6023cd1a
@ -7,18 +7,18 @@
|
|||||||
* BBC Micro 'virtual machine' in Apple //e aux memory
|
* BBC Micro 'virtual machine' in Apple //e aux memory
|
||||||
***********************************************************
|
***********************************************************
|
||||||
|
|
||||||
MAXROM EQU $F9 ; Max sideways ROM number
|
MAXROM EQU $F9 ; Max sideways ROM number
|
||||||
|
|
||||||
ZP1 EQU $90 ; $90-$9f are spare Econet space
|
ZP1 EQU $90 ; $90-$9f are spare Econet space
|
||||||
; so safe to use
|
; so safe to use
|
||||||
ZP2 EQU $92
|
ZP2 EQU $92
|
||||||
ZP3 EQU $94
|
ZP3 EQU $94
|
||||||
|
|
||||||
STRTBCKL EQU $9D ; *TO DO* don't need to preserve
|
STRTBCKL EQU $9D ; *TO DO* No longer needed to preserve
|
||||||
STRTBCKH EQU $9E
|
STRTBCKH EQU $9E
|
||||||
|
|
||||||
MOSSHIM
|
MOSSHIM
|
||||||
ORG AUXMOS ; MOS shim implementation
|
ORG AUXMOS ; MOS shim implementation
|
||||||
|
|
||||||
*
|
*
|
||||||
* Shim code to service Acorn MOS entry points using
|
* Shim code to service Acorn MOS entry points using
|
||||||
@ -28,8 +28,8 @@ MOSSHIM
|
|||||||
*
|
*
|
||||||
* Initially executing at $3000 until copied to $D000
|
* Initially executing at $3000 until copied to $D000
|
||||||
|
|
||||||
MOSINIT SEI ; Disable IRQ while initializing
|
MOSINIT SEI ; Ensure IRQs disabled
|
||||||
LDX #$FF ; Initialize Alt SP to $1FF
|
LDX #$FF ; Initialize Alt SP to $1FF
|
||||||
TXS
|
TXS
|
||||||
|
|
||||||
STA WRCARDRAM ; Make sure we are writing aux
|
STA WRCARDRAM ; Make sure we are writing aux
|
||||||
@ -105,11 +105,11 @@ MOSINIT SEI ; Disable IRQ while initializing
|
|||||||
|
|
||||||
:NORELOC
|
:NORELOC
|
||||||
:S8 STA SET80VID ; 80 col on
|
:S8 STA SET80VID ; 80 col on
|
||||||
STA CLRALTCHAR ; Alt charset off (?)
|
STA CLRALTCHAR ; Alt charset off
|
||||||
STA PAGE2 ; PAGE2
|
STA PAGE2 ; PAGE2
|
||||||
JMP MOSHIGH ; Ensure executing in high memory here
|
JMP MOSHIGH ; Ensure executing in high memory here
|
||||||
|
|
||||||
MOSHIGH SEI ; Disable IRQ while initializing
|
MOSHIGH SEI ; Ensure IRQs disabled
|
||||||
LDX #$FF
|
LDX #$FF
|
||||||
TXS ; Initialise stack
|
TXS ; Initialise stack
|
||||||
INX ; X=$00
|
INX ; X=$00
|
||||||
@ -137,70 +137,70 @@ MOSHIGH SEI ; Disable IRQ while initializing
|
|||||||
LDA #7
|
LDA #7
|
||||||
JSR OSWRCH
|
JSR OSWRCH
|
||||||
JSR OSNEWL
|
JSR OSNEWL
|
||||||
LDX MAXROM ; TEMP X=language to enter
|
LDX MAXROM ; *TEMP* X=language to enter
|
||||||
CLC
|
CLC
|
||||||
|
|
||||||
* OSBYTE $8E - Enter language ROM
|
* OSBYTE $8E - Enter language ROM
|
||||||
|
*********************************
|
||||||
* X=ROM number to select
|
* X=ROM number to select
|
||||||
*
|
*
|
||||||
BYTE8E PHP ; Save CLC=RESET, SEC=Not RESET
|
BYTE8E PHP ; Save CLC=RESET, SEC=Not RESET
|
||||||
JSR ROMSELECT ; Bring ROM X into memory
|
JSR ROMSELECT ; Bring ROM X into memory
|
||||||
STX BYTEVARBASE+$FC ; Set current language ROM
|
STX BYTEVARBASE+$FC ; Set current language ROM
|
||||||
LDA #$00
|
LDA #$00
|
||||||
STA FAULT+0
|
STA FAULT+0
|
||||||
LDA #$80
|
LDA #$80
|
||||||
STA FAULT+1
|
STA FAULT+1
|
||||||
LDY #$09
|
LDY #$09
|
||||||
JSR PRERRLP ; Print ROM name with PRERR to set
|
JSR PRERRLP ; Print ROM name with PRERR to set
|
||||||
STY FAULT+0 ; FAULT pointing to version string
|
STY FAULT+0 ; FAULT pointing to version string
|
||||||
JSR OSNEWL
|
JSR OSNEWL
|
||||||
JSR OSNEWL
|
JSR OSNEWL
|
||||||
PLP ; Get entry type back
|
PLP ; Get entry type back
|
||||||
LDA #$01
|
LDA #$01 ; $01=Entering code with a header
|
||||||
JMP ROMAUXADDR
|
JMP ROMAUXADDR
|
||||||
|
|
||||||
|
|
||||||
* OSBYTE $8F - Issue service call
|
* OSBYTE $8F - Issue service call
|
||||||
|
*********************************
|
||||||
* X=service call, Y=parameter
|
* X=service call, Y=parameter
|
||||||
*
|
*
|
||||||
SERVICE TAX ; Enter here with A=Service Num
|
SERVICE TAX ; Enter here with A=Service Num
|
||||||
BYTE8F
|
BYTE8F
|
||||||
SERVICEX LDA $F4
|
SERVICEX LDA $F4
|
||||||
PHA ; Save current ROM
|
PHA ; Save current ROM
|
||||||
|
|
||||||
* LDA $E0 ; *DEBUG*
|
|
||||||
* AND #$20
|
|
||||||
* BEQ :SERVDEBUG
|
|
||||||
* TXA
|
|
||||||
* JSR PRHEX
|
|
||||||
* LDA OSLPTR+1
|
|
||||||
* JSR PRHEX
|
|
||||||
* LDA OSLPTR+0
|
|
||||||
* JSR PRHEX ; *DEBUG*
|
|
||||||
*:SERVDEBUG
|
|
||||||
|
|
||||||
|
*DEBUG
|
||||||
|
LDA $E0
|
||||||
|
AND #$20 ; Test debug *OPT255,32
|
||||||
|
BEQ :SERVDEBUG
|
||||||
|
CPX #$06
|
||||||
|
BEQ :SERVDONE ; If debug on, ignore SERV06
|
||||||
|
:SERVDEBUG
|
||||||
|
*DEBUG
|
||||||
TXA
|
TXA
|
||||||
LDX MAXROM ; Start at highest ROM
|
LDX MAXROM ; Start at highest ROM
|
||||||
:SERVLP JSR ROMSELECT ; Bring it into memory
|
:SERVLP JSR ROMSELECT ; Bring it into memory
|
||||||
BIT $8006
|
BIT $8006
|
||||||
BPL :SERVSKIP ; No service entry
|
BPL :SERVSKIP ; No service entry
|
||||||
JSR $8003 ; Call service entry
|
JSR $8003 ; Call service entry
|
||||||
TAX
|
TAX
|
||||||
BEQ :SERVDONE
|
BEQ :SERVDONE
|
||||||
:SERVSKIP LDX $F4 ; Restore X=current ROM
|
:SERVSKIP LDX $F4 ; Restore X=current ROM
|
||||||
DEX ; Step down to next
|
DEX ; Step down to next
|
||||||
BPL :SERVLP ; Loop until ROM 0 done
|
BPL :SERVLP ; Loop until ROM 0 done
|
||||||
:SERVDONE PLA ; Get caller's ROM back
|
:SERVDONE PLA ; Get caller's ROM back
|
||||||
PHX ; Save return from service call
|
PHX ; Save return from service call
|
||||||
TAX
|
TAX
|
||||||
JSR ROMSELECT ; Restore caller's ROM
|
JSR ROMSELECT ; Restore caller's ROM
|
||||||
PLX ; Get return value back
|
PLX ; Get return value back
|
||||||
TXA ; Return in A and X and set EQ/NE
|
TXA ; Return in A and X and set EQ/NE
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
|
||||||
PRHELLO LDA #<HELLO
|
PRHELLO LDX #<HELLO
|
||||||
LDY #>HELLO
|
LDY #>HELLO
|
||||||
JSR PRSTR
|
JSR OSPRSTR
|
||||||
JMP OSNEWL
|
JMP OSNEWL
|
||||||
|
|
||||||
BYTE00XX
|
BYTE00XX
|
||||||
@ -211,12 +211,6 @@ BYTE00A BRK
|
|||||||
DB $F7
|
DB $F7
|
||||||
HELLO ASC 'Applecorn MOS 2022-10-15'
|
HELLO ASC 'Applecorn MOS 2022-10-15'
|
||||||
DB $00 ; Unify MOS messages
|
DB $00 ; Unify MOS messages
|
||||||
|
* TO DO: Move into RAM
|
||||||
GSSPEED DB $00 ; $80 if GS is fast, $00 for slow
|
GSSPEED DB $00 ; $80 if GS is fast, $00 for slow
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
113
auxmem.misc.s
113
auxmem.misc.s
@ -9,7 +9,7 @@
|
|||||||
* 26-Oct-2021 Corrected entry parameters to OSRDRM.
|
* 26-Oct-2021 Corrected entry parameters to OSRDRM.
|
||||||
* 03-Nov-2021 Temp'y fix, if can't find SROM, ignores it.
|
* 03-Nov-2021 Temp'y fix, if can't find SROM, ignores it.
|
||||||
* 13-Nov-2021 ROMSELECT calls mainmem to load ROM.
|
* 13-Nov-2021 ROMSELECT calls mainmem to load ROM.
|
||||||
* 08-Oct-2022 ROMSEL doesn't call loder if already paged in.
|
* 08-Oct-2022 ROMSEL doesn't call loader if already paged in.
|
||||||
|
|
||||||
|
|
||||||
* OSBYTE $80 - ADVAL
|
* OSBYTE $80 - ADVAL
|
||||||
@ -35,18 +35,14 @@ ADVALBUF INX
|
|||||||
BEQ :ADVALOK ; Serial input, return 0
|
BEQ :ADVALOK ; Serial input, return 0
|
||||||
LDX #$01 ; For outputs, return 1 char free
|
LDX #$01 ; For outputs, return 1 char free
|
||||||
RTS
|
RTS
|
||||||
:ADVALKBD BIT KEYBOARD ; Test keyboard data/strobe
|
:ADVALKBD BIT KBDDATA ; Test keyboard data/strobe
|
||||||
BPL :ADVALOK ; No Strobe, return 0
|
BPL :ADVALOK ; No Strobe, return 0
|
||||||
INX ; Strobe, return 1
|
INX ; Strobe, return 1
|
||||||
:ADVALOK RTS
|
:ADVALOK RTS
|
||||||
|
|
||||||
|
|
||||||
******************
|
|
||||||
* Helper functions
|
|
||||||
******************
|
|
||||||
|
|
||||||
* Beep
|
* Beep
|
||||||
*
|
******
|
||||||
* Sound measurement shows the tone formula is:
|
* Sound measurement shows the tone formula is:
|
||||||
* 1.230 MHz
|
* 1.230 MHz
|
||||||
* ------------- = cycles
|
* ------------- = cycles
|
||||||
@ -61,7 +57,7 @@ ADVALBUF INX
|
|||||||
* (------------- - 10 ) / 5
|
* (------------- - 10 ) / 5
|
||||||
* (8 * frequency )
|
* (8 * frequency )
|
||||||
|
|
||||||
* BEEPX EQU #57 ; note=C5
|
* BEEPX EQU #57 ; note=C5
|
||||||
BEEPX EQU #116 ; note=C4
|
BEEPX EQU #116 ; note=C4
|
||||||
BEEP PHA
|
BEEP PHA
|
||||||
PHX
|
PHX
|
||||||
@ -79,23 +75,26 @@ BEEP PHA
|
|||||||
PLY ;
|
PLY ;
|
||||||
PLX
|
PLX
|
||||||
PLA
|
PLA
|
||||||
RTS
|
PRSTROK RTS
|
||||||
|
|
||||||
|
|
||||||
* Print string pointed to by X,Y to the screen
|
* OSPRSTR - Print string at XY
|
||||||
|
******************************
|
||||||
|
* On exit, X,Y preserved, A=$00
|
||||||
OUTSTR TXA
|
OUTSTR TXA
|
||||||
|
|
||||||
* Print string pointed to by A,Y to the screen
|
* Print string pointed to by A,Y to the screen
|
||||||
PRSTR STA OSTEXT+0 ; String in A,Y
|
PRSTR STA OSTEXT+0 ; String in A,Y
|
||||||
STY OSTEXT+1
|
STY OSTEXT+1
|
||||||
:L1 LDA (OSTEXT) ; Ptr to string in OSTEXT
|
:L1 LDA (OSTEXT) ; Ptr to string in OSTEXT
|
||||||
BEQ PRSTROK
|
PHP ; Save EQ
|
||||||
JSR OSASCI
|
|
||||||
INC OSTEXT
|
INC OSTEXT
|
||||||
BNE :L1
|
BNE :L2
|
||||||
INC OSTEXT+1
|
INC OSTEXT+1
|
||||||
|
:L2 PLP ; Get EQ back
|
||||||
|
BEQ PRSTROK ; End of string
|
||||||
|
JSR OSASCI
|
||||||
BRA :L1
|
BRA :L1
|
||||||
PRSTROK RTS
|
|
||||||
|
|
||||||
* Print NL if not already at column 0
|
* Print NL if not already at column 0
|
||||||
FORCENL LDA #$86
|
FORCENL LDA #$86
|
||||||
@ -104,12 +103,14 @@ FORCENL LDA #$86
|
|||||||
BEQ PRSTROK
|
BEQ PRSTROK
|
||||||
JMP OSNEWL
|
JMP OSNEWL
|
||||||
|
|
||||||
* Print XY in hex
|
* OSPR2HEX - Print XY in hex
|
||||||
|
****************************
|
||||||
OUT2HEX TYA
|
OUT2HEX TYA
|
||||||
JSR OUTHEX
|
JSR OUTHEX
|
||||||
TXA ; Continue into OUTHEX
|
TXA ; Continue into OUTHEX
|
||||||
|
|
||||||
* Print hex byte in A
|
* OSPR1HEX - Print hex byte in A
|
||||||
|
********************************
|
||||||
OUTHEX PHA
|
OUTHEX PHA
|
||||||
LSR
|
LSR
|
||||||
LSR
|
LSR
|
||||||
@ -130,19 +131,8 @@ PRNIB CMP #$0A
|
|||||||
:S1 ADC #'0' ; < $0A
|
:S1 ADC #'0' ; < $0A
|
||||||
JMP OSWRCH
|
JMP OSWRCH
|
||||||
|
|
||||||
* TEMP ENTRY *
|
* OSPRDEC - Print up to 32-bit decimal number
|
||||||
* Print 16-bit value in XY in decimal
|
*********************************************
|
||||||
OSNUM EQU OSTEXT+0
|
|
||||||
OSPAD EQU OSTEXT+4
|
|
||||||
*PRDECXY
|
|
||||||
*PRDECPAD STX OSNUM+0
|
|
||||||
* STY OSNUM+1
|
|
||||||
* STZ OSNUM+2
|
|
||||||
* STZ OSNUM+3
|
|
||||||
*:PRDEC16 LDY #$05 ; 5 digits
|
|
||||||
* LDX #OSNUM ; number stored in OSNUM
|
|
||||||
|
|
||||||
* Print up to 32-bit decimal number
|
|
||||||
* See forum.6502.org/viewtopic.php?f=2&t=4894
|
* See forum.6502.org/viewtopic.php?f=2&t=4894
|
||||||
* and groups.google.com/g/comp.sys.apple2/c/_y27d_TxDHA
|
* and groups.google.com/g/comp.sys.apple2/c/_y27d_TxDHA
|
||||||
*
|
*
|
||||||
@ -318,27 +308,31 @@ GSREADOK INY ; Step to next character
|
|||||||
* VC=not control character
|
* VC=not control character
|
||||||
|
|
||||||
|
|
||||||
* Read a byte from sideways ROM
|
* OSRDROM - Read a byte from sideways ROM
|
||||||
|
*****************************************
|
||||||
* On entry, Y=ROM to read from
|
* On entry, Y=ROM to read from
|
||||||
|
* (ROMPTR)=>byte to read
|
||||||
* On exit, A=byte read, X=current ROM, Y=$00
|
* On exit, A=byte read, X=current ROM, Y=$00
|
||||||
RDROM LDA ROMID
|
RDROM LDA ROMID
|
||||||
PHA ; Save current ROM
|
PHA ; Save current ROM
|
||||||
TYA
|
TYA
|
||||||
TAX ; X=ROM to read from
|
TAX ; X=ROM to read from
|
||||||
JSR ROMSELECT ; Page in the required ROM
|
JSR ROMSELECT ; Page in the required ROM
|
||||||
LDY #$00
|
LDY #$00 ; NOTE BBC sets Y=0, Master preserves
|
||||||
LDA (ROMPTR),Y ; Read the byte
|
LDA (ROMPTR),Y ; Read the byte
|
||||||
PLX
|
PLX
|
||||||
|
|
||||||
* Select a sideways ROM
|
* ROMSELECT - Select a sideways ROM
|
||||||
* X=ROM to select
|
***********************************
|
||||||
* All registers must be preserved
|
* On entry, X=ROM to select
|
||||||
|
* On exit, All registers must be preserved
|
||||||
|
*
|
||||||
ROMSELECT
|
ROMSELECT
|
||||||
* Insert code here for faking sideways ROMs by loading or otherwise
|
* Insert code here for faking sideways ROMs by loading or otherwise
|
||||||
* fetching code to $8000. All registers must be preserved.
|
* fetching code to $8000. All registers must be preserved.
|
||||||
PHP
|
PHP
|
||||||
CPX ROMID ; Speed up by checking if
|
CPX ROMID ; Speed up by checking if
|
||||||
* BEQ ROMSELOK ; already paged in
|
BEQ ROMSELOK ; already paged in
|
||||||
* BUG: This needs ROMID an invalid value on startup so first access works
|
* BUG: This needs ROMID an invalid value on startup so first access works
|
||||||
PHA
|
PHA
|
||||||
PHX
|
PHX
|
||||||
@ -354,11 +348,6 @@ ROMSELDONE >>> ENTAUX
|
|||||||
ROMSELOK PLP
|
ROMSELOK PLP
|
||||||
RTS
|
RTS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EVENT RTS
|
|
||||||
|
|
||||||
|
|
||||||
* Initialize ROMTAB according to user selection in menu
|
* Initialize ROMTAB according to user selection in menu
|
||||||
ROMINIT STZ MAXROM ; One sideways ROM only
|
ROMINIT STZ MAXROM ; One sideways ROM only
|
||||||
STA RDMAINRAM ; Read main mem
|
STA RDMAINRAM ; Read main mem
|
||||||
@ -371,7 +360,12 @@ ROMINIT STZ MAXROM ; One sideways ROM only
|
|||||||
:X1 CMP #7
|
:X1 CMP #7
|
||||||
BNE :X2
|
BNE :X2
|
||||||
STA MAXROM
|
STA MAXROM
|
||||||
:X2 RTS
|
:X2 LDA #$FF
|
||||||
|
STA ROMID ; Ensure set to invalid value
|
||||||
|
RTS
|
||||||
|
|
||||||
|
|
||||||
|
EVENT RTS
|
||||||
|
|
||||||
|
|
||||||
**********************************************************
|
**********************************************************
|
||||||
@ -384,6 +378,7 @@ GSBRKAUX >>> IENTAUX ; IENTAUX does not do CLI
|
|||||||
* TO DO: Check, IENTAUX modifies X
|
* TO DO: Check, IENTAUX modifies X
|
||||||
|
|
||||||
* IRQ/BRK handler
|
* IRQ/BRK handler
|
||||||
|
*****************
|
||||||
IRQBRKHDLR PHA
|
IRQBRKHDLR PHA
|
||||||
* Mustn't enable IRQs within the IRQ handler
|
* Mustn't enable IRQs within the IRQ handler
|
||||||
* Do not use WRTMAIN/WRTAUX macros
|
* Do not use WRTMAIN/WRTAUX macros
|
||||||
@ -428,6 +423,20 @@ IRQBRKRET
|
|||||||
PLA
|
PLA
|
||||||
NULLRTI RTI
|
NULLRTI RTI
|
||||||
|
|
||||||
|
* Default BRK handler
|
||||||
|
*********************
|
||||||
|
MOSBRKHDLR LDX #<MSGBRK
|
||||||
|
LDY #>MSGBRK
|
||||||
|
JSR OSPRSTR
|
||||||
|
JSR PRERR
|
||||||
|
* JSR OSNEWL
|
||||||
|
* JSR OSNEWL
|
||||||
|
STOP JMP STOP ; Cannot return from a BRK
|
||||||
|
|
||||||
|
MSGBRK DB $0D
|
||||||
|
ASC 'ERROR: '
|
||||||
|
DB $00
|
||||||
|
|
||||||
PRERR LDY #$01
|
PRERR LDY #$01
|
||||||
PRERRLP LDA (FAULT),Y
|
PRERRLP LDA (FAULT),Y
|
||||||
BEQ PRERR1
|
BEQ PRERR1
|
||||||
@ -437,20 +446,9 @@ PRERRLP LDA (FAULT),Y
|
|||||||
NULLRTS
|
NULLRTS
|
||||||
PRERR1 RTS
|
PRERR1 RTS
|
||||||
|
|
||||||
MOSBRKHDLR LDA #<MSGBRK
|
|
||||||
LDY #>MSGBRK
|
|
||||||
JSR PRSTR
|
|
||||||
JSR PRERR
|
|
||||||
JSR OSNEWL
|
|
||||||
JSR OSNEWL
|
|
||||||
STOP JMP STOP ; Cannot return from a BRK
|
|
||||||
|
|
||||||
MSGBRK DB $0D
|
|
||||||
ASC 'ERROR: '
|
|
||||||
DB $00
|
|
||||||
|
|
||||||
|
|
||||||
* Default page 2 contents
|
* Default page 2 contents
|
||||||
|
*************************
|
||||||
DEFVEC DW NULLRTS ; $200 USERV
|
DEFVEC DW NULLRTS ; $200 USERV
|
||||||
DW MOSBRKHDLR ; $202 BRKV
|
DW MOSBRKHDLR ; $202 BRKV
|
||||||
DW NULLRTI ; $204 IRQ1V
|
DW NULLRTI ; $204 IRQ1V
|
||||||
@ -500,7 +498,8 @@ OSSCANDEC JMP SCANDEC ; FF9E SCANDEC
|
|||||||
OSSCANHEX JMP SCANHEX ; FFA1 SCANHEX
|
OSSCANHEX JMP SCANHEX ; FFA1 SCANHEX
|
||||||
OSFFA4 JMP NULLRTS ; FFA4 (DISKACC)
|
OSFFA4 JMP NULLRTS ; FFA4 (DISKACC)
|
||||||
OSFFA7 JMP NULLRTS ; FFA7 (DISKCCP)
|
OSFFA7 JMP NULLRTS ; FFA7 (DISKCCP)
|
||||||
PRHEX JMP OUTHEX ; FFAA PRHEX
|
PRHEX
|
||||||
|
PR1HEX JMP OUTHEX ; FFAA PRHEX
|
||||||
PR2HEX JMP OUT2HEX ; FFAD PR2HEX
|
PR2HEX JMP OUT2HEX ; FFAD PR2HEX
|
||||||
OSFFB0 JMP PRINTDEC ; FFB0 (USERINT)
|
OSFFB0 JMP PRINTDEC ; FFB0 (USERINT)
|
||||||
OSWRRM JMP NULLRTS ; FFB3 OSWRRM
|
OSWRRM JMP NULLRTS ; FFB3 OSWRRM
|
||||||
@ -544,8 +543,6 @@ MOSVEND
|
|||||||
|
|
||||||
* Buffer for one 512 byte disk block in aux mem
|
* Buffer for one 512 byte disk block in aux mem
|
||||||
AUXBLK
|
AUXBLK
|
||||||
;ASC '**ENDOFCODE**'
|
; ASC '**ENDOFCODE**'
|
||||||
; DS $200-13
|
; DS $200-13
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,34 +17,36 @@
|
|||||||
* $EF-$FF MOS API workspace
|
* $EF-$FF MOS API workspace
|
||||||
|
|
||||||
* DEBUG EQU $00 ; $00=*OPT 255 debug code removed
|
* DEBUG EQU $00 ; $00=*OPT 255 debug code removed
|
||||||
DEBUG EQU $E0 ; $E0=*OPT 255 debug code included
|
DEBUG EQU $E0 ; $E0=*OPT 255 debug code included
|
||||||
* ; $E1
|
* GSSPEED EQU $E1 ; $E1 **TEMP**
|
||||||
FSFLAG1 EQU $E2 ; $E2
|
FSFLAG1 EQU $E2 ; $E2
|
||||||
FSFLAG2 EQU $E3 ; $E3 HOSTFS *OPT settings
|
FSFLAG2 EQU $E3 ; $E3 HOSTFS *OPT settings
|
||||||
GSFLAG EQU $E4 ; $E4 GSREAD processing flags
|
GSFLAG EQU $E4 ; $E4 GSREAD processing flags
|
||||||
GSCHAR EQU $E5 ; $E5 GSREAD accumulator
|
GSCHAR EQU $E5 ; $E5 GSREAD accumulator
|
||||||
OSTEXT EQU $E6 ; $E6 => text string $E6 OSNUM+0
|
OSTEXT EQU $E6 ; $E6 => text string $E6 OSNUM+0
|
||||||
MAXLEN EQU OSTEXT+2 ; $E8 $E8 OSNUM+2
|
MAXLEN EQU OSTEXT+2 ; $E8 $E8 OSNUM+2
|
||||||
MINCHAR EQU OSTEXT+3 ; $E9 $E9 OSNUM+3
|
MINCHAR EQU OSTEXT+3 ; $E9 $E9 OSNUM+3
|
||||||
MAXCHAR EQU OSTEXT+4 ; $EA $EA OSPAD
|
MAXCHAR EQU OSTEXT+4 ; $EA $EA OSPAD
|
||||||
OSTEMP EQU $EB ; $EB $EB OSTEMP
|
OSNUM EQU OSTEXT ; $E6
|
||||||
OSKBD1 EQU $EC ; $EC kbd ws
|
OSPAD EQU OSNUM+4 ; $EA
|
||||||
OSKBD2 EQU OSKBD1+1 ; $ED kbd ws
|
OSTEMP EQU $EB ; $EB
|
||||||
OSKBD3 EQU OSKBD1+2 ; $EE kbd ws
|
OSKBD1 EQU $EC ; $EC kbd ws
|
||||||
OSAREG EQU $EF ; $EF A register
|
OSKBD2 EQU OSKBD1+1 ; $ED kbd ws
|
||||||
OSXREG EQU OSAREG+1 ; $F0 X register
|
OSKBD3 EQU OSKBD1+2 ; $EE kbd ws
|
||||||
OSYREG EQU OSXREG+1 ; $F1 Y register
|
OSAREG EQU $EF ; $EF A register
|
||||||
OSCTRL EQU OSXREG ; $F0 (XY)=>control block
|
OSXREG EQU OSAREG+1 ; $F0 X register
|
||||||
OSLPTR EQU $F2 ; $F2 => command line
|
OSYREG EQU OSXREG+1 ; $F1 Y register
|
||||||
ROMID EQU $F4 ; $F4 current ROM
|
OSCTRL EQU OSXREG ; $F0 (XY)=>control block
|
||||||
ROMTMP EQU $F5 ; $F5
|
OSLPTR EQU $F2 ; $F2 => command line
|
||||||
ROMPTR EQU $F6 ; $F6 =>
|
ROMID EQU $F4 ; $F4 current ROM
|
||||||
* ; $F8 *TEMP* pseudo-SROM settings
|
ROMTMP EQU $F5 ; $F5
|
||||||
* ; $F9 *TEMP* pseudo-SROM settings
|
ROMPTR EQU $F6 ; $F6 => ROM addresses
|
||||||
OSINTWS EQU $FA ; $FA IRQ ZP pointer, use when IRQs off
|
* ; $F8 pseudo-SROM settings
|
||||||
OSINTA EQU $FC ; $FC IRQ register A store
|
ROMMAX EQU $F9 ; $F9 pseudo-SROM settings: maximum ROM number
|
||||||
FAULT EQU $FD ; $FD Error message pointer
|
OSINTWS EQU $FA ; $FA IRQ ZP pointer, use when IRQs off
|
||||||
ESCFLAG EQU $FF ; $FF Escape status
|
OSINTA EQU $FC ; $FC IRQ register A store
|
||||||
|
FAULT EQU $FD ; $FD Error message pointer
|
||||||
|
ESCFLAG EQU $FF ; $FF Escape status
|
||||||
|
|
||||||
|
|
||||||
* $0200-$0235 Vectors
|
* $0200-$0235 Vectors
|
||||||
@ -52,31 +54,25 @@ ESCFLAG EQU $FF ; $FF Escape status
|
|||||||
* $0290-$02ED
|
* $0290-$02ED
|
||||||
* $02EE-$02FF MOS control block
|
* $02EE-$02FF MOS control block
|
||||||
|
|
||||||
USERV EQU $200 ; USER vector
|
USERV EQU $200 ; USER vector
|
||||||
BRKV EQU $202 ; BRK vector
|
BRKV EQU $202 ; BRK vector
|
||||||
CLIV EQU $208 ; OSCLI vector
|
CLIV EQU $208 ; OSCLI vector
|
||||||
BYTEV EQU $20A ; OSBYTE vector
|
BYTEV EQU $20A ; OSBYTE vector
|
||||||
WORDV EQU $20C ; OSWORD vector
|
WORDV EQU $20C ; OSWORD vector
|
||||||
WRCHV EQU $20E ; OSWRCH vector
|
WRCHV EQU $20E ; OSWRCH vector
|
||||||
RDCHV EQU $210 ; OSRDCH vector
|
RDCHV EQU $210 ; OSRDCH vector
|
||||||
FILEV EQU $212 ; OSFILE vector
|
FILEV EQU $212 ; OSFILE vector
|
||||||
ARGSV EQU $214 ; OSARGS vector
|
ARGSV EQU $214 ; OSARGS vector
|
||||||
BGETV EQU $216 ; OSBGET vector
|
BGETV EQU $216 ; OSBGET vector
|
||||||
BPUTV EQU $218 ; OSBPUT vector
|
BPUTV EQU $218 ; OSBPUT vector
|
||||||
GBPBV EQU $21A ; OSGBPB vector
|
GBPBV EQU $21A ; OSGBPB vector
|
||||||
FINDV EQU $21C ; OSFIND vector
|
FINDV EQU $21C ; OSFIND vector
|
||||||
FSCV EQU $21E ; FSCV misc file ops
|
FSCV EQU $21E ; FSCV misc file ops
|
||||||
|
|
||||||
BYTEVARBASE EQU $190 ; Base of OSBYTE variables
|
BYTEVARBASE EQU $190 ; Base of OSBYTE variables
|
||||||
OSFILECB EQU $2EE ; OSFILE control block
|
OSFILECB EQU $2EE ; OSFILE control block
|
||||||
OSGBPBCB EQU OSFILECB+1 ; OSGBPB control block
|
OSGBPBCB EQU OSFILECB+1 ; OSGBPB control block
|
||||||
|
|
||||||
|
|
||||||
* $0300-$03DF
|
* $0300-$03DF
|
||||||
* $03E0-$03FF Used for interfacing with ProDOS XFER
|
* $03E0-$03FF Used for interfacing with ProDOS XFER
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,9 +176,10 @@ MAININS >>> ENTMAIN
|
|||||||
|
|
||||||
|
|
||||||
* Remove value from buffer or examine buffer (API same as Acorn MOS REMV)
|
* Remove value from buffer or examine buffer (API same as Acorn MOS REMV)
|
||||||
|
* NOTE OS1.20 has a bug in the EXAMINE path
|
||||||
* On entry: X is buffer number, V=1 if only examination is requested
|
* On entry: X is buffer number, V=1 if only examination is requested
|
||||||
* On exit: If examination, A next byte, X preserved, Y=offset to next char
|
* On exit: If examination, A next byte, X preserved, Y=next byte
|
||||||
* If removal, A undef, X preserved, Y value of byte removed
|
* If removal, A undef, X preserved, Y=value of byte removed
|
||||||
* If buffer already empty C=1, else C=0
|
* If buffer already empty C=1, else C=0
|
||||||
REM PHP ; Save flags, turn off interrupts
|
REM PHP ; Save flags, turn off interrupts
|
||||||
SEI
|
SEI
|
||||||
@ -201,6 +202,7 @@ REM PHP ; Save flags, turn off interrupts
|
|||||||
CLC ; Success
|
CLC ; Success
|
||||||
RTS
|
RTS
|
||||||
:EXAM PLA ; Char read from buffer
|
:EXAM PLA ; Char read from buffer
|
||||||
|
TAY ; BUGFIX: Omitted on OS1.20
|
||||||
PLP
|
PLP
|
||||||
CLC ; Success
|
CLC ; Success
|
||||||
RTS
|
RTS
|
||||||
|
Loading…
Reference in New Issue
Block a user