mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-03 22:30:09 +00:00
commit
e933f70312
146
mainmem.init.s
146
mainmem.init.s
@ -18,79 +18,79 @@ A2IRQ2 PHP ; Fake things to look like IRQ
|
||||
* BRK handler in main memory. Used on Apple IIgs only.
|
||||
GSBRK >>> XF2AUX,GSBRKAUX
|
||||
|
||||
* Set prefix if not already set
|
||||
SETPRFX LDA #GPFXCMD
|
||||
STA :OPC7 ; Initialize cmd byte to $C7
|
||||
:L1 JSR MLI
|
||||
:OPC7 DB $00
|
||||
DW GSPFXPL
|
||||
LDX DRVBUF1 ; was $0300
|
||||
BNE RTSINST
|
||||
LDA DEVNUM
|
||||
STA ONLNPL+1 ; Device number
|
||||
JSR MLI
|
||||
DB ONLNCMD
|
||||
DW ONLNPL
|
||||
LDA DRVBUF2 ; was $0301
|
||||
AND #$0F
|
||||
TAX
|
||||
INX
|
||||
STX DRVBUF1 ; was $0300
|
||||
LDA #'/'
|
||||
STA DRVBUF2 ; was $0301
|
||||
DEC :OPC7
|
||||
BNE :L1
|
||||
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
|
||||
* Stolen from Beagle Bros Extra K
|
||||
DISCONN LDA MACHID
|
||||
AND #$30
|
||||
CMP #$30
|
||||
BNE :S1
|
||||
LDA DEVADR32
|
||||
CMP DEVADR01
|
||||
BNE :S2
|
||||
LDA DEVADR32+1
|
||||
CMP DEVADR01+1
|
||||
BEQ :S1
|
||||
:S2 LDY DEVCNT
|
||||
:L1 LDA DEVLST,Y
|
||||
AND #$F3
|
||||
CMP #$B3
|
||||
BEQ :S3
|
||||
DEY
|
||||
BPL :L1
|
||||
BMI :S1
|
||||
:S3 LDA DEVLST,Y
|
||||
STA DRVBUF2+1 ; was $0302
|
||||
:L2 LDA DEVLST+1,Y
|
||||
STA DEVLST,Y
|
||||
BEQ :S4
|
||||
INY
|
||||
BNE :L2
|
||||
:S4 LDA DEVADR32
|
||||
STA DRVBUF1 ; was $0300
|
||||
LDA DEVADR32+1
|
||||
STA DRVBUF2 ; was $0301
|
||||
LDA DEVADR01
|
||||
STA DEVADR32
|
||||
LDA DEVADR01+1
|
||||
STA DEVADR32+1
|
||||
DEC DEVCNT
|
||||
:S1 RTS
|
||||
|
||||
** Set prefix if not already set
|
||||
*SETPRFX LDA #GPFXCMD
|
||||
* STA :OPC7 ; Initialize cmd byte to $C7
|
||||
*:L1 JSR MLI
|
||||
*:OPC7 DB $00
|
||||
* DW GSPFXPL
|
||||
* LDX DRVBUF1 ; was $0300
|
||||
* BNE RTSINST
|
||||
* LDA DEVNUM
|
||||
* STA ONLNPL+1 ; Device number
|
||||
* JSR MLI
|
||||
* DB ONLNCMD
|
||||
* DW ONLNPL
|
||||
* LDA DRVBUF2 ; was $0301
|
||||
* AND #$0F
|
||||
* TAX
|
||||
* INX
|
||||
* STX DRVBUF1 ; was $0300
|
||||
* LDA #'/'
|
||||
* STA DRVBUF2 ; was $0301
|
||||
* DEC :OPC7
|
||||
* BNE :L1
|
||||
*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
|
||||
** Stolen from Beagle Bros Extra K
|
||||
*DISCONN LDA MACHID
|
||||
* AND #$30
|
||||
* CMP #$30
|
||||
* BNE :S1
|
||||
* LDA DEVADR32
|
||||
* CMP DEVADR01
|
||||
* BNE :S2
|
||||
* LDA DEVADR32+1
|
||||
* CMP DEVADR01+1
|
||||
* BEQ :S1
|
||||
*:S2 LDY DEVCNT
|
||||
*:L1 LDA DEVLST,Y
|
||||
* AND #$F3
|
||||
* CMP #$B3
|
||||
* BEQ :S3
|
||||
* DEY
|
||||
* BPL :L1
|
||||
* BMI :S1
|
||||
*:S3 LDA DEVLST,Y
|
||||
* STA DRVBUF2+1 ; was $0302
|
||||
*:L2 LDA DEVLST+1,Y
|
||||
* STA DEVLST,Y
|
||||
* BEQ :S4
|
||||
* INY
|
||||
* BNE :L2
|
||||
*:S4 LDA DEVADR32
|
||||
* STA DRVBUF1 ; was $0300
|
||||
* LDA DEVADR32+1
|
||||
* STA DRVBUF2 ; was $0301
|
||||
* LDA DEVADR01
|
||||
* STA DEVADR32
|
||||
* LDA DEVADR01+1
|
||||
* STA DEVADR32+1
|
||||
* DEC DEVCNT
|
||||
*:S1 RTS
|
||||
*
|
||||
* Reset handler - invoked on Ctrl-Reset
|
||||
* XFER to AUXMOS ($C000) in aux, AuxZP on, LC on
|
||||
RESET TSX
|
||||
|
@ -42,8 +42,80 @@ SUPPORTED LDA #$DF ; Protect pages $0,$1,and $3-$7
|
||||
STA P8BMAP282F
|
||||
STA P8BMAP3037
|
||||
STA P8BMAP383F
|
||||
|
||||
* Set prefix if not already set
|
||||
SETPRFX LDA #GPFXCMD
|
||||
STA :OPC7 ; Initialize cmd byte to $C7
|
||||
:L1 JSR MLI
|
||||
:OPC7 DB $00
|
||||
DW GSPFXPL
|
||||
LDX DRVBUF1 ; was $0300
|
||||
BNE RTSINST
|
||||
LDA DEVNUM
|
||||
STA ONLNPL+1 ; Device number
|
||||
JSR MLI
|
||||
DB ONLNCMD
|
||||
DW ONLNPL
|
||||
LDA DRVBUF2 ; was $0301
|
||||
AND #$0F
|
||||
TAX
|
||||
INX
|
||||
STX DRVBUF1 ; was $0300
|
||||
LDA #'/'
|
||||
STA DRVBUF2 ; was $0301
|
||||
DEC :OPC7
|
||||
BNE :L1
|
||||
RTSINST LDA CMDPATH
|
||||
BEQ :GETPFX ; CMDPATH empty
|
||||
LDA CMDPATH+1
|
||||
CMP #'/'
|
||||
BEQ DISCONN ; CMDPATH already absolute path
|
||||
:GETPFX JSR MLI
|
||||
DB $C7 ; Get Prefix
|
||||
DW GETPFXPARM
|
||||
|
||||
* Disconnect /RAM ramdrive to avoid aux corruption
|
||||
* Stolen from Beagle Bros Extra K
|
||||
DISCONN LDA MACHID
|
||||
AND #$30
|
||||
CMP #$30
|
||||
BNE :S1
|
||||
LDA DEVADR32
|
||||
CMP DEVADR01
|
||||
BNE :S2
|
||||
LDA DEVADR32+1
|
||||
CMP DEVADR01+1
|
||||
BEQ :S1
|
||||
:S2 LDY DEVCNT
|
||||
:L1 LDA DEVLST,Y
|
||||
AND #$F3
|
||||
CMP #$B3
|
||||
BEQ :S3
|
||||
DEY
|
||||
BPL :L1
|
||||
BMI :S1
|
||||
:S3 LDA DEVLST,Y
|
||||
STA DRVBUF2+1 ; was $0302
|
||||
:L2 LDA DEVLST+1,Y
|
||||
STA DEVLST,Y
|
||||
BEQ :S4
|
||||
INY
|
||||
BNE :L2
|
||||
:S4 LDA DEVADR32
|
||||
STA DRVBUF1 ; was $0300
|
||||
LDA DEVADR32+1
|
||||
STA DRVBUF2 ; was $0301
|
||||
LDA DEVADR01
|
||||
STA DEVADR32
|
||||
LDA DEVADR01+1
|
||||
STA DEVADR32+1
|
||||
DEC DEVCNT
|
||||
:S1
|
||||
JMP START
|
||||
|
||||
GETPFXPARM HEX 01 ; One parameter
|
||||
DW CMDPATH ; Get prefix to CMDPATH
|
||||
|
||||
UNSUPPORTED JSR HOME
|
||||
LDX #$00
|
||||
UNSUPLP LDA UNSUPMSG,X
|
||||
@ -71,10 +143,7 @@ PADDING ASC '***THISISPROTOTYPECODE***'
|
||||
|
||||
; Original APPLECORN.BIN code starts here
|
||||
|
||||
START JSR CROUT
|
||||
JSR SETPRFX
|
||||
JSR DISCONN
|
||||
|
||||
START
|
||||
JSR ROMMENU
|
||||
* LDA #>AUXADDR ; Address in aux
|
||||
* LDX #<AUXADDR
|
||||
|
34
memmap.txt
34
memmap.txt
@ -24,37 +24,33 @@ MOSFILE2 EQU $0341 ; $0341 length
|
||||
* ; $03C4 EXEC EXEC COUNT
|
||||
* ; $03C8 SIZE START OFFSET
|
||||
* ; $03CC ATTR END
|
||||
* ; $03D0-$03FF: ProDOS vectors, etc.
|
||||
* ; $03D0-$03D2 JMP WARM
|
||||
* ; $03D3-$03D5 JMP WARM
|
||||
* ; $03D6-$03EC ProDOS
|
||||
* ; $03ED-$03DE XFER address
|
||||
* ; $03EF ProDOS
|
||||
* ; $03F0-$03D1 BRKV
|
||||
* ; $03F2-$03D3 RESETV
|
||||
* ; $03F4 RESETV ACK
|
||||
* ; $03F5-$03F7 JMP AMP
|
||||
* ; $03F8-$03FA JMP USER
|
||||
* ; $03FB-$03FD JMP MON
|
||||
* ; $03D0-$03EF: ProDOS - reserved for .SYSTEM programs
|
||||
* ; $03D0-$03EC Undefined, available
|
||||
* ; $03ED-$03EE XFER address
|
||||
* ; $03EF ProDOS reserved
|
||||
* ; $03F0-$3FF: Monitor/Applesoft locations
|
||||
* ; $03F0-$03F1 BRKV
|
||||
* ; $03F2-$03F3 RESETV
|
||||
* ; $03F4 PWDRUP
|
||||
* ; $03F5-$03F7 AMPERV
|
||||
* ; $03F8-$03FA USERV (^Y)
|
||||
* ; $03FB-$03FD NMIV
|
||||
* ; $03FE-$03FF IRQV
|
||||
*
|
||||
* EQU $0400 ; $0400- Can't use as ProDOS uses 'hidden' bytes
|
||||
* ; -$07FF within screen for workspace
|
||||
SCREEN EQU $0800 ; $0800-$0BFF Half 80-col screen or 40-col screen
|
||||
* EQU $0400 ; $0400-$07FF Text Page 1 & screen holes - not for general use
|
||||
SCREEN EQU $0800 ; $0800-$0BFF Text Page 2
|
||||
IOBUF0 EQU $0C00 ; $0C00-$0FFF For loading ROM, OSFILE, *.
|
||||
IOBUF1 EQU $1000 ; $1000-$13FF Four open files for langs
|
||||
IOBUF2 EQU $1400 ; $1400-$17FF
|
||||
IOBUF3 EQU $1800 ; $1800-$1BFF
|
||||
IOBUF4 EQU $1C00 ; $1C00-$1FFF
|
||||
* ; $2000-$3FFF Hi-Res screen 1
|
||||
* ; $2000-$3FFF Hi-Res screen 1 - used for transient .SYSTEM loader code
|
||||
* ; $4000- Code, to do: make code move itself
|
||||
* -$6FFF
|
||||
BLKBUF EQU $7000 ; $7000-$73FF 512-byte buffer plus channel data
|
||||
BLKBUFEND EQU $7200
|
||||
*
|
||||
* ; $9600-$BDFF ProDOS buffers
|
||||
* ; $BE00-$BEFF MLI Global workspace
|
||||
* ; $BF00-$BFFF MLI API interface
|
||||
* ; $BF00-$BFFF ProDOS Global Page - reserved
|
||||
|
||||
|
||||
Memory layout in aux memory (Acorn environment)
|
||||
|
Loading…
Reference in New Issue
Block a user