From f5a8a65e969a7d7d618338ec9be8e8eb0b952c4a Mon Sep 17 00:00:00 2001 From: Bobbi Webber-Manners Date: Sun, 5 Sep 2021 14:00:31 -0400 Subject: [PATCH] Added support for *FREE (prints blks used atm) --- applecorn.po | Bin 819200 -> 819200 bytes auxmem.hostfs.s | 31 ++++++++++++++++++++- auxmem.misc.s | 71 +++++++++++++++++++++++++++++------------------- mainmem.s | 57 ++++++++++++++++++++------------------ 4 files changed, 104 insertions(+), 55 deletions(-) diff --git a/applecorn.po b/applecorn.po index 051b2b5701c902e0625fe9a989073da127ad8fc9..11cae02a466b089b21a90f72098f832c6287c426 100644 GIT binary patch delta 6191 zcma)A3tUvyy5A2LFD3DnfMyF5q2K7mE7v!U@3y4!+SRJ*a8Iz$YWpze)1R<&3wfD*6_4*Z@)Wx&t7YN>-)a- zt^fB}dxqyjc|O#z(;-#s;Ke-emU_X#hcxD)#ud$;{}eSZg7OJ`-fb>rrl1ovk)eXa zH^jai`7#$39krfYM^O&{O*v6dxZ2rLW6`W>I_hz%&40Yu0=Lw?Xcp0(f$U3EAfMMq zl|JdnP=4yw;VUE85`FfMLp6;kU#Br8vjZ1SVJM2B94P;n!=s{!1;fk^b@W22ByNn? zCvd`q)ELKEp~Fi&5%@F+`iIBFs3Rj*uZo&{ zufM06YxL=xf1ZJ~Wfh7x`*jyO#NETx*4NR~iI1057Z+o5e{V001sI46Jm?ITbecWr zP`9G$pXADtDuGNDi?cjw4pmkaS67SCp7er$vv;-SMfKYJAL|RsFKf@^f}Vc!^;`J% zth(J37tXy=^^1^CeZ)g~gTSg0{N0 zM#%omlm5UX)t%uoLTSd~o3!+AGZrHn2oEwA(i7=J*~|+1S2}wzg5K+XJ@S z11;TsEoaXdPPg>7nY+6CI$O;B9i766^)%P#<Wv5Ln3*{AO=P+p&%zyCs@VnVm{APbS6FN%73tcy^guG`@zO%>GL*yOnT^!67Nzbp?8g5w}MopX_f}A)lEuN{eer!hn;Z*HR*v7q^gc_P{3O#r~hOi#8+c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o!dJLI{8i`%qlw@I@>#McK+NM+%>x^t}D1Jx$EgJ zeb?6Ny$#4l=a+ToJe|3_tUG<(f0cD-WUkD58z||SDNm*EE9)lz-Md%z{KarA~k!m>G z^JMyZxTmLTvkd2Z+=Z^){U*vtedJ1rUz0x+Ww)vD`tC-X0^#D6>F^x!rn#{`}j1wfdz?zL1>Oj!EJodu7u!e_5y`G1(2uP0M2Iq_;#ss1b$F(Z$CoN z;-z-82w;~AcND9SFU6glNpW}oXz8r6E7ZZ{`Fi-WIVnkiwJ5|+W~!fF{U zV4AyyS7o$DwW}*(R_!j~D;eR)!%j(MNC<@fC;A%=P!I65Q}oxxIVR=oB4KJ1nx(F> z84>=Rsx8G9X?k9%>j_hZ|&KcgzMaXdAQ1n8{B3ricA(%E~o;xc$3i{c6| z#ls0@chT0~ce$?<&UQHO_Wt_(`cl)S2^w;!96$F>ajbQwTpjEi?z;zP*u~)sX%{@A z{tm(#?1=S@6Jqy2oxRlEH@$C5-)o-p^*(dor9R=cZ&2#PfxQJk9-rDvf3uX^)R*hKy21Za`JzY1v~1ldq317ofY zEeH$h+s=ylHI2xr)|;k5_`cVRzcadY@JcSSp|^6sHM&TOHn|{6;nMZH0vj$~Jb&?o zk-F?^b;)o(-(AuBe(w&)VF!J=yXC!>oR-vnwgi;6O!@5p0B4ha Aq5uE@ diff --git a/auxmem.hostfs.s b/auxmem.hostfs.s index 0a625b1..a8eab17 100644 --- a/auxmem.hostfs.s +++ b/auxmem.hostfs.s @@ -344,7 +344,7 @@ FSCHND FSCDRIVE JMP DRIVE -FSCFREE +FSCFREE JMP FREE FSCACCESS @@ -615,6 +615,35 @@ CHDIRRET BRK :EXIT RTS +* Handle *FREE command +FREE LDA (OSLPTR),Y ; First char + CMP #$3A ; Colon + BNE :ERR + JSR PARSLPTR ; Copy arg->MOSFILE + CMP #$03 ; Check 3 char arg + BEQ :HASPARM +:ERR BRK + DB $DC + ASC 'Syntax: FREE :sd (eg: DRIVE :61)' + BRK +:HASPARM >>> XF2MAIN,DRVINFO + +FREERET + >>> ENTAUX + JSR CHKERROR + CMP #$00 + BEQ :NOERR + BRK + DB $CE ; Bad directory + ASC 'Bad dir' + BRK +:NOERR LDX AUXBLK ; Blocks used + LDY AUXBLK+1 + JSR PRDECXY ; Print in decimal + JSR FORCENL + RTS + + * Parse filename pointed to by XY * Write filename to MOSFILE in main memory * Returns length in A diff --git a/auxmem.misc.s b/auxmem.misc.s index a9c4839..c8ce140 100644 --- a/auxmem.misc.s +++ b/auxmem.misc.s @@ -74,30 +74,6 @@ BEEP PHA PLA RTS -** Delay approx 1/100 sec -************************* -** Enter at DELAY with CS to test keyboard -** Enter at CENTI to ignore keyboard -** -*CENTI CLC ; Don't test keyboard -*DELAY PHX ; 3cy -* PHY ; 3cy -* LDY #10 ; 2cy 10 * 1/1000s -**------------------------------------------------ -*:L1 LDX #$48 ; 2cy $48 gives about 1/1000s -*:L2 BCC :L3 ; 2cy/3cy Don't test kbd -* LDA $C000 ; 4cy -* BMI :L5 ; 2cy keypress, exit early -*:L3 DEX ; 2cy -* BNE :L2 ; 3cy/2cy -> 72*(2+2+4+2+2+3)-1 -** ; = 1079 -> 0.00105s -**------------------------------------------------ -*:L4 DEY ; 2cy -* BNE :L1 ; 3cy/2cy -*:L5 PLY ; 4cy -* PLX ; 4cy -* RTS ; 6cy - * Print string pointed to by X,Y to the screen OUTSTR TXA @@ -146,6 +122,49 @@ PRNIB CMP #$0A :S1 ADC #'0' ; < $0A JMP OSWRCH +* 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 +:LP1 LDX #$FF + SEC +:LP2 LDA :NUM+0 + SBC :TENS+0,Y + STA :NUM+0 + LDA :NUM+1 + SBC :TENS+1,Y + STA :NUM+1 + INX + BCS :LP2 + LDA :NUM+0 + ADC :TENS+0,Y + STA :NUM+0 + LDA :NUM+1 + ADC :TENS+1,Y + STA :NUM+1 + TXA + BNE :DIGIT + LDA :PAD + BNE :PRINT + BEQ :NEXT +:DIGIT LDX #'0' + STX :PAD + 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 ************************************************ @@ -445,7 +464,3 @@ MOSVEND AUXBLK ASC '**ENDOFCODE**' DS $200-13 - - - - diff --git a/mainmem.s b/mainmem.s index 5d4fc8f..aa958f6 100644 --- a/mainmem.s +++ b/mainmem.s @@ -143,7 +143,6 @@ RESET TSX * Copy 512 bytes from BLKBUF to AUXBLK in aux LC COPYAUXBLK - SEI >>> ALTZP ; Alt ZP & Alt LC on LDY #$00 @@ -167,7 +166,6 @@ COPYAUXBLK BRA :L2 :S2 >>> MAINZP ; Alt ZP off, ROM back in - CLI RTS * TO DO: All OSFILE calls combined and dispatch in here @@ -194,21 +192,8 @@ DELFILE >>> ENTMAIN BCC :DELETED PLX ; Drop object JSR CHKNOTFND -* CMP #$44 ; Path not found -* BEQ :NOTFND -* CMP #$45 ; Volume dir not found -* BEQ :NOTFND -* CMP #$46 ; File not found -* BNE :EXIT -*:NOTFND LDA #$00 ; 'Not found' -* BRA :EXIT PHA :DELETED PLA ; Get object back -* LDA #$02 ; Prepare A=2, it was a dir -* LDX GINFOPL+7 ; Storage type -* CPX #$0D -* BEQ :EXIT ; It was a directory -* LDA #$01 ; A=1, it was a file :EXIT >>> XF2AUX,OSFILERET DESTROY LDA #>> ENTMAIN STA GINFOPL+1 LDA #>MOSFILE STA GINFOPL+2 - JSR MLI ; Call GET_FILE_INFO - DB GINFOCMD - DW GINFOPL + JSR GETINFO ; GET_FILE_INFO BCS :READERR LDA GINFOPL+5 ; Aux type LSB STA FBLOAD+0 @@ -614,9 +597,7 @@ EXISTS LDA #MOSFILE STA GINFOPL+2 - JSR MLI ; GET_FILE_INFO - DB GINFOCMD - DW GINFOPL + JSR GETINFO ; GET_FILE_INFO BCS :NOEXIST LDA GINFOPL+7 ; Storage type CMP #$0D @@ -808,9 +789,7 @@ UPDFB LDA #MOSFILE STA OPENPL+2 STA GINFOPL+2 - JSR MLI ; Call GET_FILE_INFO - DB GINFOCMD - DW GINFOPL + JSR GETINFO ; Call GET_FILE_INFO BCC :UPDFB1 JMP CHKNOTFND @@ -1038,6 +1017,34 @@ SETPFX >>> ENTMAIN :ERR LDA #$40 ; Invalid pathname syn BRA :EXIT +* Obtain info on blocks used/total blocks +DRVINFO >>> ENTMAIN + JSR PREPATH + BCS :ERR + LDA #MOSFILE + STA GINFOPL+2 + JSR GETINFO ; GET_FILE_INFO + BCS :EXIT + PHA + >>> ALTZP ; Alt ZP & Alt LC on + LDA GINFOPL+8 ; Blcks used LSB + STA AUXBLK + LDA GINFOPL+9 ; Blks used MSB + STA AUXBLK+1 + >>> MAINZP ; ALt ZP off, ROM back in + PLA +:EXIT >>> XF2AUX,FREERET +:ERR LDA #$40 ; Invalid pathname syn + BRA :EXIT + +* Geyt file info +GETINFO JSR MLI + DB GINFOCMD + DW GINFOPL + RTS + * Create disk file CRTFILE JSR MLI DB CREATCMD @@ -1381,5 +1388,3 @@ QUITPL HEX 04 ; Number of parameters MFTEMP DS 65 ; Temp copy of MOSFILE PREFIX DS 65 ; Buffer for ProDOS prefix - -