Merge PR 147 'Startup reads prefix to CMDBUF'

This commit is contained in:
Bobbi Webber-Manners 2021-11-14 17:28:48 -05:00
parent cdf229f612
commit 66bb51c646
4 changed files with 130 additions and 170 deletions

Binary file not shown.

View File

@ -204,7 +204,7 @@ BYTE00 BEQ BYTE00A ; OSBYTE 0,0 - generate error
RTS ; %000x1xxx host type, 'A'pple RTS ; %000x1xxx host type, 'A'pple
BYTE00A BRK BYTE00A BRK
DB $F7 DB $F7
HELLO ASC 'Applecorn MOS 2021-11-13' HELLO ASC 'Applecorn MOS 2021-11-14'
DB $00 ; Unify MOS messages DB $00 ; Unify MOS messages

View File

@ -4,6 +4,9 @@
* Initialization, interrupt handling and reset handling code * Initialization, interrupt handling and reset handling code
* that resides in main memory. * that resides in main memory.
* 14-Nov-2021 If started from CSD, gets prefix to CMDBUF.
* Trampoline in main memory used by aux memory IRQ handler * Trampoline in main memory used by aux memory IRQ handler
* to invoke Apple II / ProDOS IRQs in main memory * to invoke Apple II / ProDOS IRQs in main memory
A2IRQ >>> IENTMAIN ; IENTMAIN does not do CLI A2IRQ >>> IENTMAIN ; IENTMAIN does not do CLI
@ -37,7 +40,18 @@ SETPRFX LDA #GPFXCMD
STA DRVBUF2 ; was $0301 STA DRVBUF2 ; was $0301
DEC :OPC7 DEC :OPC7
BNE :L1 BNE :L1
RTSINST RTS RTSINST LDA CMDPATH
BEQ :GETPFX ; CMDPATH empty
LDA CMDPATH+1
CMP #'/'
BEQ :GETPFXDONE ; CMDPATH already absolute path
:GETPFX JSR MLI
DB $C7 ; Get Prefix
DW :GETADDR
:GETPFXDONE RTS
:GETADDR HEX 01 ; One parameter
DW CMDPATH ; Get prefix to CMDPATH
* Disconnect /RAM ramdrive to avoid aux corruption * Disconnect /RAM ramdrive to avoid aux corruption
* Stolen from Beagle Bros Extra K * Stolen from Beagle Bros Extra K
@ -90,55 +104,3 @@ RESET TSX
>>> XF2AUX,AUXMOS >>> XF2AUX,AUXMOS
RTS RTS

View File

@ -6,17 +6,17 @@
* 13-Nov-2021 List of selected ROMs kept locally. * 13-Nov-2021 List of selected ROMs kept locally.
ROMMAX EQU $0382 ROMMAX EQU $0382
ROMTHIS EQU $0383 ROMTHIS EQU $0383
ROMADDRS EQU $0384 ; List of ROM filename addresses ROMADDRS EQU $0384 ; List of ROM filename addresses
ROMMENU JSR HOME ; Clear screen ROMMENU JSR HOME ; Clear screen
LDX #0 LDX #0
:LP0 LDA TITLE1,X ; Print title :LP0 LDA TITLE1,X ; Print title
BEQ :LP1 BEQ :LP1
JSR COUT1 JSR COUT1
INX INX
BNE :LP0 BNE :LP0
:LP1 :LP1
* LDA #<TITLE1 ; Print title * LDA #<TITLE1 ; Print title
@ -24,10 +24,10 @@ ROMMENU JSR HOME ; Clear screen
* LDA #>TITLE1 * LDA #>TITLE1
* STA A1H * STA A1H
* JSR PRSTRA1 * JSR PRSTRA1
JSR CROUT JSR CROUT
* TEMP * TEMP
* LDA #$00 ; LDA #$00
* JMP :KEYOK ; JMP :KEYOK
* TEMP * TEMP
* JSR CROUT * JSR CROUT
* LDA #<TITLE2 * LDA #<TITLE2
@ -53,72 +53,72 @@ ROMMENU JSR HOME ; Clear screen
* BEQ :KEYIN * BEQ :KEYIN
* BRA :L1 * BRA :L1
:KEYIN LDA $C000 ; Kdb data / strobe :KEYIN LDA $C000 ; Kdb data / strobe
BPL :KEYIN ; Wait for keystroke BPL :KEYIN ; Wait for keystroke
STA $C010 ; Clear strobe STA $C010 ; Clear strobe
AND #$7F AND #$7F
SEC SEC
SBC #'1' ; '1'->0, '2'->1 etc. SBC #'1' ; '1'->0, '2'->1 etc.
CMP #8 CMP #8
BCC :KEYOK BCC :KEYOK
JSR BELL ; Invalid - beep JSR BELL ; Invalid - beep
BRA :KEYIN ; Go again BRA :KEYIN ; Go again
:KEYOK STA USERSEL ; Record selection :KEYOK STA USERSEL ; Record selection
* Make list of ROMs * Make list of ROMs
LDX #63 LDX #63
LDA #0 LDA #0
:INITLP1 STA ROMADDRS,X :INITLP1 STA ROMADDRS,X
DEX DEX
BPL :INITLP1 BPL :INITLP1
STX ROMTHIS ; Current ROM=none STX ROMTHIS ; Current ROM=none
LDY USERSEL ; Index to ROM to load LDY USERSEL ; Index to ROM to load
LDA #0 ; Load it to bank 0 LDA #0 ; Load it to bank 0
CPY #6 CPY #6
BCC :INITROM2 ; <6, single ROM BCC :INITROM2 ; <6, single ROM
LDA #1 ; Load to bank 1 and 0 LDA #1 ; Load to bank 1 and 0
CPY #7 CPY #7
BCC :INITROM2 ; =7, two ROMs BCC :INITROM2 ; =7, two ROMs
LDA #7 ; Load to bank 7 to 0 LDA #7 ; Load to bank 7 to 0
LDY #0 ; Starting at ROM 0 LDY #0 ; Starting at ROM 0
:INITROM2 STA ROMMAX :INITROM2 STA ROMMAX
ASL A ASL A
TAX ; X=>ROM address table TAX ; X=>ROM address table
TYA TYA
ASL A ASL A
TAY ; Y=>ROM addresses TAY ; Y=>ROM addresses
:INITROM3 LDA ROMLIST+0,Y :INITROM3 LDA ROMLIST+0,Y
STA ROMADDRS+0,X STA ROMADDRS+0,X
LDA ROMLIST+1,Y LDA ROMLIST+1,Y
STA ROMADDRS+1,X STA ROMADDRS+1,X
INY INY
INY INY
DEX DEX
DEX DEX
BPL :INITROM3 BPL :INITROM3
RTS RTS
SELECTROM >>> ENTMAIN SELECTROM >>> ENTMAIN
CMP ROMTHIS CMP ROMTHIS
BEQ :SELECTDONE ; Already selected BEQ :SELECTDONE ; Already selected
CMP ROMMAX CMP ROMMAX
BCC :GETROM BCC :GETROM
BNE :SELECTDONE ; Out of range BNE :SELECTDONE ; Out of range
:GETROM PHA :GETROM PHA
ASL A ASL A
TAX TAX
LDA ROMADDRS+0,X ; ROM filename LDA ROMADDRS+0,X ; ROM filename
STA OPENPL+1 STA OPENPL+1
LDA ROMADDRS+1,X LDA ROMADDRS+1,X
STA OPENPL+2 STA OPENPL+2
LDA #$80 ; Load address $8000 LDA #$80 ; Load address $8000
LDX #$00 LDX #$00
SEC ; Aux memory SEC ; Aux memory
JSR LOADCODE ; Try and fetch it JSR LOADCODE ; Try and fetch it
PLA ; Get bank back PLA ; Get bank back
BCS :SELECTDONE ; Failed BCS :SELECTDONE ; Failed
STA ROMTHIS ; It is paged in STA ROMTHIS ; It is paged in
:SELECTDONE >>> XF2AUX,ROMSELDONE :SELECTDONE >>> XF2AUX,ROMSELDONE
** Print a string pointed to by A1L/A1H ** Print a string pointed to by A1L/A1H
@ -133,10 +133,10 @@ SELECTROM >>> ENTMAIN
*:NULL PLY *:NULL PLY
* RTS * RTS
TITLE1 ASC "** APPLECORN **" TITLE1 ASC "** APPLECORN **"
DB $8D,$8D DB $8D,$8D
TITLE2 ASC "Choose a BBC Micro ROM:" TITLE2 ASC "Choose a BBC Micro ROM:"
DB $8D,$8D DB $8D,$8D
*MSGTBL DW MSG1 *MSGTBL DW MSG1
* DW MSG2 * DW MSG2
@ -147,46 +147,44 @@ TITLE2 ASC "Choose a BBC Micro ROM:"
* DW MSG7 * DW MSG7
* DW MSG8 * DW MSG8
MSG1 ASC " 1. BBC BASIC" MSG1 ASC " 1. BBC BASIC"
DB $8D,$8D DB $8D,$8D
MSG2 ASC " 2. Acornsoft COMAL" MSG2 ASC " 2. Acornsoft COMAL"
DB $8D,$8D DB $8D,$8D
MSG3 ASC " 3. Acornsoft Lisp" MSG3 ASC " 3. Acornsoft Lisp"
DB $8D,$8D DB $8D,$8D
MSG4 ASC " 4. Acornsoft Forth" MSG4 ASC " 4. Acornsoft Forth"
DB $8D,$8D DB $8D,$8D
MSG5 ASC " 5. Acornsoft MicroProlog" MSG5 ASC " 5. Acornsoft MicroProlog"
DB $8D,$8D DB $8D,$8D
MSG6 ASC " 6. Acornsoft BCPL" MSG6 ASC " 6. Acornsoft BCPL"
DB $8D,$8D DB $8D,$8D
MSG7 ASC " 7. Acornsoft ISO Pascal (2 ROMs)" MSG7 ASC " 7. Acornsoft ISO Pascal (2 ROMs)"
DB $8D,$8D DB $8D,$8D
MSG8 ASC " 8. Everything! (8 ROMs)" MSG8 ASC " 8. Everything! (8 ROMs)"
DB $8D DB $8D
DB $00 DB $00
ROMLIST DW ROM1 ROMLIST DW ROM1
DW ROM2 DW ROM2
DW ROM3 DW ROM3
DW ROM4 DW ROM4
DW ROM5 DW ROM5
DW ROM6 DW ROM6
DW ROM7 DW ROM7
DW ROM8 DW ROM8
ROM1 STR "BASIC2.ROM"
ROM2 STR "COMAL.ROM"
ROM3 STR "LISP501.ROM"
ROM4 STR "FORTH103.ROM"
ROM5 STR "MPROLOG310.ROM"
ROM6 STR "BCPL700.ROM"
ROM7 STR "PASCAL110A.ROM"
ROM8 STR "PASCAL110B.ROM"
USERSEL DB $00
ROM1 STR "BASIC2.ROM"
ROM2 STR "COMAL.ROM"
ROM3 STR "LISP501.ROM"
ROM4 STR "FORTH103.ROM"
ROM5 STR "MPROLOG310.ROM"
ROM6 STR "BCPL700.ROM"
ROM7 STR "PASCAL110A.ROM"
ROM8 STR "PASCAL110B.ROM"
USERSEL DB $00