diff --git a/Makefile b/Makefile index 68e2ef5..243fe8e 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ all: prodos_snippits.po -prodos_snippits.po: bitsy.boot.bin setup.system.bin +prodos_snippits.po: bitsy.boot.bin setup.system.bin quit.system.bin @ProDOS-Utilities -d prodos_snippits.po -c create \ -s 280 -v PRODOS.SNIPPITS @ProDOS-Utilities -d prodos_snippits.po -c put \ -p BITSY.BOOT -i bitsy.boot.bin -t 0xFF -a 0x2000 @ProDOS-Utilities -d prodos_snippits.po -c put \ -p SETUP.SYSTEM -i setup.system.bin -t 0xFF -a 0x2000 + @ProDOS-Utilities -d prodos_snippits.po -c put \ + -p QUIT.SYSTEM -i quit.system.bin -t 0xFF -a 0x2000 @ProDOS-Utilities -c ls -d prodos_snippits.po %.bin: %.s diff --git a/quit.system.s b/quit.system.s new file mode 100644 index 0000000..d513091 --- /dev/null +++ b/quit.system.s @@ -0,0 +1,26 @@ +; QUIT.SYSTEM from ProDOS-2.4.2 + +PRODOS_MLI := $BF00 +INIT := $FB2F +HOME := $FC58 +SETKBD := $FE89 +SETVID := $FE93 + +CLR80COL := $C000 +CLR80VID := $C00C + +.macpack apple2 +.setcpu "6502" +.org $2000 + + sta CLR80VID + sta CLR80COL + jsr SETVID + jsr SETKBD + jsr INIT + jsr HOME + jsr PRODOS_MLI + .byte $65 ; quit + .word THING + scrcode "By John Brooks. 9/15/2016" +THING: .byte $04, $00, $00, $00, $00, $00, $00 diff --git a/setup.system.s b/setup.system.s index 3169bd1..d031451 100644 --- a/setup.system.s +++ b/setup.system.s @@ -24,8 +24,6 @@ .macpack apple2 -.org $BD00 ;load at $2000, but run at $BD00 - ; equates CH := $24 IN2 := $280 @@ -46,10 +44,11 @@ SETKBD := $FE89 SETNORM := $FE84 ; boot code +.org $BD00 ;load at $2000, but run at $BD00 VOLNAME = * ;The first 17 bytes are overwritten with the ;name of the volume from which this was run. - LDX #1 ;mark page $BD as free in the system bitmap + LDX #%00000001 ;mark page $BD as free in the system bitmap STX BITMAP+23 ;so we can put Online result in our code. DEX ;relocate this program to $BD00-BEFF LOOP1: LDA $2000,X @@ -72,14 +71,15 @@ ENTER: LDA DEVNUM ;get name of last volume accessed .byte $C5 ;ONLINE .word ONLINEP +.ifdef OLDANDBUSTED ; this maybe worked with old ProDOS? -; LDA VOLNAME+1 ; 3 -; AND #$0F ; 2 -; TAX ; 1 -; INX ; 1 -; STX VOLNAME ; 3 -; STA VOLNAME+1 ; 3 = 13 - + LDA VOLNAME+1 ; 3 + AND #$0F ; 2 + TAX ; 1 + INX ; 1 + STX VOLNAME ; 3 + STA VOLNAME+1 ; 3 = 13 +.else ; this does what it was documented as trying to do LDX VOLNAME+1 ; 3 INX ; 1 @@ -87,6 +87,7 @@ ENTER: LDA DEVNUM ;get name of last volume accessed LDA #'/' ; 2 STA VOLNAME+1 ; 3 NOP ; 1 -- for binary-size compatibility +.endif LDA QUITVECT+1 ;save original quit vector STA QUITMOD1+1 @@ -156,7 +157,7 @@ VOLOK: JSR NEXTFILE ;get name of next file at IN2 ; Load and call setup file JSR PRODOS ;set prefix to SETUPS - .byte $C6 ;SET PREFIX + .byte $C6 ;SET PREFIX .word PFX1P JSR READFILE ;read in file whose name is at IN@ ;and call it if there was no error.