KeyCode =y?*S\+ Z*O\##s#r !5y !"\0 K 0 K!;\^ >2A\( :\ : \*Y\+#~ "(s(z@8[0"\*\ 6ʤ( 0# (   #~ ( #>+ RKB~ (# r##~"(#####[a\R!y[C[!KyRamDisk "l$ (+:( 4 s*]\!M0"]\5 Kv\G!b~#(##^#V7aА I789.# !"6!" >ͮ!ͱ>(: 7>)> :G>??>ͼ: 0> >(ͼ> ͼͳ!~(#>ͱ~(>L%> ^#V͌ > 6+! 0#!"~#(" "͟O~͟(0 %+7*+7#+`!~>J ~#>  OfLoaRuExeChChChChK freeOption) RamDisk Program. Version 1.00 1986 J.G.Harston .Y0J.Y8>J# ͳ> !~#(%ͥ.Y0Jͤ~(>J N#F+%! *էR#*B"ͮ.Y#0Jͱ+~^#V#^#V#^#V#> ~(>L> Rz{> ????0:8d+ +08x(070: { ͮ{){=\!I!t7t&" \Ͱn  File not founFile existFile lockeMERGE erroCODE erroDisk fulFiles opeWrong file typ! 4x2ͥ.:w(W(?ʮ ͙͂q p66*Y\[S\7Ru t *K\Rutð6 6 !@u t6͉ ͂,(  :͙͂q p ͙q p`i6ð ͤ:8(sN F x >JxA0* |8>JY8: J N#F| #^#V++~(*Y\[S\+"_\U*_\#NF "K\f( n "B\6 :( ͮ#( A(LAͮ> ͼ͂,(͔͔͂( Ч(_!px2 222.Y0JL >G>wS/Charmakea?c ; CHARMAKER ; ========= ; April 1986, Graham Harston (; Make a thicker Spectrum character set 2 < ORG #FF00 ; Loadable to any address F PUSH BC ; Get start address from the BC register and P POP DE ; decrease it by 768 to get the start of the Z DEC D ; character set d DEC D n DEC D x PUSH DE LD HL,15616 ; Start of the character set in ROM LD B,3 ; Loop round for 3 sets of 256 LOOP1 LD C,0 ; Loop round 226 times LOOP LD A,(HL) ; Get the byte from the ROM PUSH BC ; Save the counters LD B,A ; Put the byte in B ADD A,A ; Shift A along one bit to the left OR B ; Superimpose the original value LD (DE),A ; and store in the RAM POP BC ; Get the counters back INC HL ; Increment the address pointers INC DE DEC C ; Decrement the first counter  JR NZ,LOOP ; Loop back if it's not zero  DJNZ LOOP1 ; Decrement the second counter and loop back  POP DE ; Get the start of the character set back " DEC D ; Decrease by 256 to get the right value , LD (IY-3),D ; Store the high byte 6 LD (IY-4),E ; then the low byte in CHARS @ RET ; and return. S/JSWPRINT>:˴ ; SCREEN PRINTER FOR JSW ; ======================  (; 23296-23299 contain attributes for characters 2; UDG 'A'-'D' defined to room characters < F ORG 23300 PPR_SCR LD A,0 ; 23302 set to room number Z ADD A,192 ; Convert to room address d LD H,A n LD L,0 xLOOP LD A,(HL) LD C,A LD B,4 LOOP2 CALL CHAR DJNZ LOOP2 INC L BIT 7,L JR Z,LOOP LD A,71 LD (23694),A LD B,32 LOOP3 LD A,(HL) CALL PRINT INC HL  DJNZ LOOP3  RET CHAR RLC C " RLC C , LD A,C 6 AND 3 @ PUSH AF J LD E,A T LD D,#5B ^ LD A,(DE) h LD (23694),A r POP AF | ADD A,144  RST #10  RET PRINT AND 127  CP 32  JR NC,PR_2  LD A,143 PR_2 RST #10  RET +S/RamDisk >?> ; RAMDISK PROGRAM BY J.G.HARSTON ; ============================== ; VERSION 1.00, 16 JUNE 1986, 5:50PM (; 2; EXECUTED WITH: <; RAND USR FS: F; PSEED EQU #5C76 ZEXPT_1 EQU #1C82 dFIND_2 EQU #1E99 nSTKTOA EQU #1E94 xUSE_ZER EQU #1CE6 ERR_SP EQU #5C3D PROG EQU #5C53 E_LINE EQU #5C59 VARS EQU #5C4B CHADD EQU #5C5D EXPT_EX EQU #1C8C STK_FCH EQU #2BF1 CHANS EQU #5C4F STRM_0 EQU 23574 DISKBEG EQU #8000 ; Start of ramdisk OPT_NO EQU #800A ; Disk option CYCLE EQU #800B ; Disk cycle number DISKEND EQU #800E ; Pointer to end of ramdisk PR_MSG EQU #0C0A RECLAIM EQU #19E5 MKROOM EQU #1655 "NEWPPC EQU 23618 ,NSPPC EQU 10 6X_PTR EQU 23647 @TOP EQU #F6 JSAVEMAX EQU 65 T ^ ORG 63000 hFS RST #18 r CP 13 | JR Z,FS_END  CP #3A  JR Z,FS_1  RST 8  DEFB 11 FS_1 INC (IY+13)  LD (FS_SP),SP  LD HL,(CHADD)  PUSH HL  RST #20  LD HL,FS  EX (SP),HL  PUSH HL  CALL TAB_CHK  POP HL  JR NC,NOT_CMD  PUSH HL & RST #20 0 POP HL : EX DE,HL D LD B,0 N JP (HL) XNOT_CMD LD (CHADD),HL ; Not on of my commands b DEC (IY+13) ; Restore CHADD, NSPPC l POP HL ; Balance stack vFS_END LD BC,(SEED) ; Makes RAND USR FS a null operation  RET ; TAB_CHK LD B,A  LD HL,COM_TAB T_CH_2 LD A,(HL)  INC HL  CP B  JR Z,T_FND  CP 0  RET Z  INC HL  INC HL  JR T_CH_2 T_FND LD E,(HL)  INC HL  LD D,(HL)  SCF * RET 4 >COM_TAB DEFB 248 H DEFW SAVE R DEFB 239 \ DEFW LOAD f DEFB 214 p DEFW VERIFY z DEFB 213  DEFW MERGE  DEFB 210  DEFW ERASE  DEFB 207  DEFW CAT  DEFB 208  DEFW FORMAT  DEFB 209  DEFW MOVE  DEFB 245  DEFW PRINT  DEFB 240  DEFW LST  DEFB 234  DEFW REM  DEFB 247 $ DEFW RUN . DEFB 211 8 DEFW OPEN B DEFB 212 L DEFW CLOSE V DEFB 238 ` DEFW INPUT j DEFB 0 t; ~; ; FORMAT "name" - Format ramdisk FORMAT CALL GET_NAME ; Get name  PUSH IX  POP HL ; HL points to name  LD DE,#8000 ; Copy name to start of disk  INC HL  LD BC,10  LDIR  LD HL,#8010 ; Empty disk ends at #8010  LD (DISKEND),HL ; Set end of disk  LD (HL),255 ; Set end of disk marker  LD HL,0  LD (OPT_NO),HL ; Set option to zero  RET ; OP_CHN LD A,2 ( JP #1601 2 <; Print catalogue header FCAT_HDR CALL OP_CHN ; Open 'S' P LD HL,#8000 Z CALL PR_NAME ; Print disk name d LD A,"(" n RST #10 x LD A,(CYCLE)  EX AF,AF'  SCF  EX AF,AF'  CALL PR_DEC ; Print cycle number  LD A,")"  RST #10  LD A,13  RST #10  LD A,(DISKEND+1) ; Get high byte of DISKEND  LD B,A  LD A,TOP ; Get top of ramdisk  SUB B ; Free space  SRL A  SRL A ; Free space in K  EX AF,AF'  AND A " EX AF,AF' , CALL PR_DEC ; Print free space 6 LD A,8 @ CALL PR_TEXT ; Print 'K free' J LD A,(OPT_NO) T AND 7 ^ PUSH AF h ADD A,48 r RST #10 ; Print option | LD A,32  RST #10  LD A,"("  RST #10  POP AF  CALL PR_TEXT ; Print option string  LD A,9  CALL PR_TEXT  RET ; ; CAT - Print disk catalogue CAT CALL CAT_HDR ; Print catalogue header  LD HL,#8010 ; Point to start of disk CAT_LP LD A,(HL) ; Get file type  CP 255 ; 255=end of disk  JR Z,CAT_END ; No more files  INC HL ; Point to filename & LD A,6 0 RST #10 ; Print comma to next field : CALL PR_NAME ; Print filename D PUSH HL N LD DE,6 X ADD HL,DE ; Point to file flags b BIT 7,(HL) ; Is file locked? l JR Z,CAT_1 v LD A,"L" ; Print 'L' for locked  RST #10 CAT_1 POP HL  CALL NXT_NAME ; Find next file  JR CAT_LP ; Loop for all files CAT_END LD A,13 ; Print a final  RST #10  RET  ; Find next file, HL=>file length NXT_NAME  LD E,(HL) ; Get file length  INC HL  LD D,(HL)  ADD HL,DE ; Step past file data  LD DE,8  ADD HL,DE ; Step past file header  RET * 4GET_NAME > CALL EXPT_EX H LD BC,20 R RST #30 ; Get 20 bytes of workspace \ PUSH DE f POP IX p LD B,11 z LD A,32 GET_1 LD (DE),A ; Fill filename with spaces  INC DE  DJNZ GET_1  LD (IX+1),255 ; Set NULL name  CALL STK_FCH ; Get string  LD HL,#FFF6 ; Check length <=10  DEC BC  ADD HL,BC  INC BC  JR NC,GET_2  RST 8  DEFB 14 ; Bad filename GET_2 PUSH IX  POP HL  INC HL  EX DE,HL $ LDIR ; Copy name to workspace . RET 8 B ; Look for a filename L FND_NAME V LD HL,#8010 ; Point to start of disk ` LD (LAST),HL j PUSH IX t POP DE ~ INC DE FND_LP LD A,(HL) ; Get filetype INC HL ; Point to filename CP 255 JR Z,FND_END ; No more files LD B,10 ; Check ten characters LD (LAST),HL PUSH HL PUSH DE FND_L2 LD A,(DE) ; Get filename CALL ADJUST ; Ensure upper case LD C,A LD A,(HL) ; Get name from disk CALL ADJUST ; Ensure upper case CP C  JR Z,SAME ; They match, check whole name  JR NC,INSERT ; disk>file, insert here ( POP DE ; disk ; MOVE "name","name" - rename a file H MOVE CALL GET_NAME ; Get string R CALL FND_NAME ; Check file exists \ JR NC,MOVE_2 ; Exists, so jump ahead f XOR A p JP ERROR ; File not found z MOVE_2 PUSH HL ; Save pointer to entry RST #20 ; Skip comma CALL GET_NAME ; Get string PUSH IX CALL FND_NAME ; Check does not exist JR C,MOVE_3 ; No file, jump to continue LD A,1 JP ERROR ; File exists MOVE_3 POP HL ; Get address of new name POP DE ; Get address of entry INC HL INC DE LD BC,10 ; Ten characters LDIR ; Copy in new name  JP INC_C ; Increment cycle and exit ; ; LIST - list full catalogue information $LST CALL CAT_HDR ; Print catalogue header . LD A,13 8 RST #10 B LD HL,#8010 ; Point to start of disk LLST_LP LD A,(HL) ; Get filetype V INC HL ; Point to filename ` CP 255 ; End marker? j JR Z,LST_END ; Exit when no more t CALL PR_INFO ; Print full info ~ CALL NXT_NAME ; Step to next entry  JR LST_LP ; Loop to do all entries LST_END RET ; ; ERASE "name" - erase a file ERASE CALL O_CHK ; Check no files open  CALL GET_NAME ; Get string  CALL FND_NAME ; Look for this file  JR NC,ERA_1 ; File exists, jump to continue  XOR A  JP ERROR ; File not found ERA_1 PUSH HL  POP IX  CALL MESSAGE ; Print any messages ERA_S PUSH HL  LD DE,17  ADD HL,DE ; Point to lock flag ( BIT 7,(HL) 2 POP HL < JR Z,ERA_2 ; File not locked, continue F LD A,2 P JP ERROR ; File locked ZERA_2 PUSH HL d LD DE,11 n ADD HL,DE ; Point to file length x LD C,(HL)  INC HL  LD B,(HL) ; BC=file length  DEC HL  CALL NXT_NAME ; Find address of next entry  PUSH HL  LD HL,20  ADD HL,BC ; Add header length  PUSH HL  POP BC ; BC=length to remove  LD HL,(DISKEND) ; Find end of disk  POP DE  PUSH DE ; DE=>next entry  AND A  SBC HL,DE  INC HL  PUSH HL " LD HL,(DISKEND) ; Update end of disk , AND A 6 SBC HL,BC @ LD (DISKEND),HL J POP BC ; BC=length to remove T POP HL ; HL=>next entry ^ POP DE ; DE=>this entry h LDIR ; Compact disk to remove entry r JP INC_C ; Update cycles and exit |; ; PRINT "name" - Print information on a file PRINT CALL OP_CHN ; Open channel 'S'  CALL GET_NAME ; Get a string  CALL FND_NAME ; Look for file  INC HL ; Point to filename  JR NC,PR_INFO ; File found, print info  XOR A  JP ERROR ; File not found  PR_INFO PUSH HL ; Save address of filename  CALL PR_NAME ; Print filename  EX (SP),HL ; Get address filename back  DEC HL ; Point to filetype  LD A,(HL)  CALL P_HEX1 ; Print filetype  POP HL ; Get address of file addresses & LD E,(HL) 0 INC HL : LD D,(HL) D CALL PR_HEX ; Print file length N INC HL X LD E,(HL) b INC HL l LD D,(HL) v CALL PR_HEX ; Print file start  INC HL  LD E,(HL)  INC HL  LD D,(HL)  CALL PR_HEX ; Print file extra  INC HL  LD A,32 ; Prepare to print space  BIT 7,(HL) ; Check Locked flag  JR Z,PR_I2  LD A,"L" ; Print 'L' if locked PR_I2 RST #10  LD A,13 ; Final  RST #10  LD DE,6  AND A  SBC HL,DE ; Point back to file length  RET *; 4PR_HEX LD A,D ; Print DE in hex > CALL P_HEX2 H LD A,E RP_HEX1 CALL P_HEX2 \ LD A,32 f RST #10 p RET zP_HEX2 PUSH AF ; Print A in hex  SRL A  SRL A  SRL A  SRL A  CALL P_HEX3  POP AF P_HEX3 AND 15  ADD A,48  CP ":"  JR C,P_HEX4  ADD A,7 P_HEX4 RST #10  RET  PR_DEC PUSH BC ; Print B in decimal  LD C,100 $ CALL P_DEC1 . LD C,10 8 CALL P_DEC1 B ADD A,48 L RST #10 V POP BC ` RET jP_DEC1 LD B,0 tP_DEC2 SUB C ~ JR C,P_DEC3  INC B  JR P_DEC2 P_DEC3 ADD A,C  PUSH AF  LD A,B  AND A  JR Z,P_DEC5 P_DEC4 ADD A,48  RST #10  POP AF  EX AF,AF'  SCF  EX AF,AF'  RET P_DEC5 EX AF,AF'  JR NC,P_DEC6 ( EX AF,AF' 2 JR P_DEC4 <P_DEC6 EX AF,AF' F POP AF P RET Z dERROR PUSH AF ; Report an error n LD A,(O_3) ; Get option 3 x CP 2  JR NZ,ERR_2  LD SP,(FS_SP) ; If equals 2, just exit  RET ERR_2 CP 1  JR NZ,ERR_3  CALL OP_CHN ; Option3=1, print error  POP AF ; and exit  LD SP,(FS_SP)  JR ERR_6 ERR_3 POP AF ; Option3=0, report error  LD SP,(ERR_SP) ; Repeat main ROM error routine  LD HL,#1349  EX (SP),HL  PUSH AF  XOR A  CALL #1601 " RES 2,(IY+1) , LD HL,0 6 LD (IY+55),H @ LD (IY+38),H J LD (23563),HL T CALL #16B0 ^ CALL #0D6E h SET 5,(IY+2) r POP AF |ERR_6 LD DE,ERR_M  JP PR_MSG ERR_M DEFB 128  DEFM "File not foun"  DEFB "d"+128  DEFM "File exist"  DEFB "s"+128  DEFM "File locke"  DEFB "d"+128  DEFM "MERGE erro"  DEFB "r"+128  DEFM "CODE erro"  DEFB "r"+128  DEFM "Disk ful"  DEFB "l"+128  DEFM "Files ope"  DEFB "n"+128 & DEFM "Wrong file typ" 0 DEFB "e"+128 :FLAG DEFB 0 ; b7=files open DLAST DEFW 0 NS_FLAG DEFB 0 ; save/load/verify/merge XO_1 DEFB 0 ; display messages bO_2 DEFB 0 ; b7=lock saved files, b0=don't overwrite lO_3 DEFB 0 ; errors reported, printed, ignored vFS_SP DEFW 0  INC_C PUSH HL ; Increment cycle number  LD HL,CYCLE  INC (HL)  POP HL  RET ; MERGE INC B ; B=3 - MERGE VERIFY INC B ; B=2 - VERIFY LOAD INC B ; B=1 - LOAD SAVE LD A,B ; B=0 - SAVE  LD (S_FLAG),A  CALL O_CHK  CALL GET_NAME ; Get string  LD A,(O_2)  AND 128  LD (IX+17),A ; Set 'L'ocked flag from option 2 * RST #18 ; Repeat tape code 4 CP 175 > JR Z,SA_CODE H CP 170 R JR Z,SA_SCRN \ CP 228 f JP Z,SA_DATA p CP 202 z JR NZ,TYPE_0  RST #20  CALL EXPT_1  CALL FIND_2  LD (IX+13),C  LD (IX+14),B  JR TYPE0 TYPE_0 LD (IX+14),255 TYPE0 LD (IX+0),0  LD HL,(E_LINE)  LD DE,(PROG)  SCF  SBC HL,DE  LD (IX+11),L  LD (IX+12),H  LD HL,(VARS)  SBC HL,DE $ LD (IX+15),L . LD (IX+16),H 8 EX DE,HL B JP SA_ALL LSA_SCRN RST #20 V LD (IX+11),0 ` LD (IX+12),#1B j LD HL,#4000 t LD (IX+13),L ~ LD (IX+14),H  JR TYPE_3 SA_CODE RST #20  CALL ST_END  JR NZ,CODE_1  CALL USE_ZER  JR CODE_2 CODE_1 CALL EXPT_1  RST #18  CP ","  JR Z,CODE_3 CODE_2 CALL USE_ZER  JR CODE_4 ST_END CP 13  RET Z  CP ":"  RET (CODE_3 RST #20 2 CALL EXPT_1 <CODE_4 CALL FIND_2 F LD (IX+11),C P LD (IX+12),B Z CALL FIND_2 d LD (IX+13),C n LD (IX+14),B x LD H,B  LD L,C TYPE_3 LD (IX+0),3  JP SA_ALL SA_DATA RST 8  DEFB 11 SA_ALL CALL MESSAGE  LD A,(S_FLAG)  CP 1  JR C,SAVER  JR Z,LOADER  RET  SAVER PUSH HL ; Save data  LD C,(IX+11)  LD B,(IX+12)  LD A,B " OR C , JR NZ,SAVE_1 6SA_ERR LD A,4 @ JP ERROR JSAVE_1 LD A,B T CP SAVEMAX ^ JR NC,SA_ERR h LD DE,20 r LD HL,(DISKEND) | ADD HL,DE  ADD HL,BC  LD A,H  CP TOP  JR C,SAVE_2  LD A,5  JP ERROR SAVE_2 EX DE,HL  PUSH DE  PUSH BC  CALL FND_NAME  POP BC  POP DE  JR C,SAVE_3  LD A,(O_2)  AND 1  JR NZ,SA_DEL & INC A 0 JP ERROR :SA_DEL PUSH HL D PUSH DE N CALL ERA_S X POP DE b POP HL lSAVE_3 PUSH BC v PUSH HL  LD HL,20  ADD HL,BC  PUSH HL  POP BC  LD HL,(DISKEND)  LD (DISKEND),DE  PUSH HL  POP DE  POP BC  PUSH BC  AND A  SBC HL,BC  INC HL  PUSH HL  POP BC  LD HL,(DISKEND)  EX DE,HL * LDDR 4 POP DE > PUSH IX H POP HL R LD BC,20 \ LDIR f POP BC p POP HL z LDIR  JP INC_C ; LOADER PUSH HL ; Load data  CALL FND_NAME  JR NC,LOAD_2  XOR A  JP ERROR ; File not found LOAD_2 LD A,(HL)  CP (IX+0)  JR Z,LOAD_3  LD A,7  JP ERROR LOAD_3 LD DE,11  ADD HL,DE  LD C,(HL)  INC HL $ LD B,(HL) . EX (SP),HL 8 LD A,H B OR L L JR NZ,LOAD_4 V POP HL ` INC HL j LD E,(HL) t INC HL ~ LD D,(HL)  PUSH DE  DEC HL  DEC HL  EX (SP),HL LOAD_4 EX (SP),HL  LD DE,8  ADD HL,DE  LD A,(IX+0)  AND A  JR Z,LD_PROG LOAD_5 POP DE  LDIR  RET LD_PROG PUSH HL  PUSH BC  LD HL,(E_LINE) ( LD DE,(PROG) 2 DEC HL < LD (X_PTR),IX F POP BC P PUSH BC Z PUSH BC d CALL RECLAIM n POP BC x CALL MKROOM  LD IX,(X_PTR)  INC HL  LD C,(IX+15)  LD B,(IX+16)  ADD HL,BC  LD (VARS),HL  LD H,(IX+14)  CP 255  JR Z,LOAD_6  LD L,(IX+13)  LD (NEWPPC),HL  LD (IY+NSPPC),0 LOAD_6 POP BC  POP HL  JR LOAD_5 ; "MESSAGE PUSH HL ; Print status message , LD A,(O_1) 6 AND A @ JR Z,MESS_2 J CALL OP_CHN T PUSH IX ^ POP HL h INC HL r CALL PR_INFO |MESS_2 POP HL  RET ; ; REM - extra commands ; REM (C) - Display copyright information ; REM A - Set file access REM RST #18  CP 127  JR Z,C_RIGHT  AND #DF  CP "A"  JR Z,ACCESS REM_2 EX DE,HL  JP NOT_CMD  C_RIGHT PUSH DE ; Print copyright message  CALL OP_CHN  LD A,10 & CALL PR_TEXT 0 POP DE : JR REM_2 D N ; INPUT opt,num - Set disk options X INPUT CALL EXPT_1 b RST #18 l CP "," v JR Z,OPT_2 CALL USE_ZER JR OPT_3 OPT_2 RST #20 CALL EXPT_1 OPT_3 CALL STKTOA PUSH AF CALL STKTOA POP BC CP 4 JR Z,OPT_4 RET NC AND A JR Z,OPT0 ! LD E,A ! LD D,0 ! LD HL,O_1-1 ! ADD HL,DE ; Point to options *! LD (HL),B 4! RET >!OPT_4 LD A,B ; Set disk option H! LD (OPT_NO),A R! JP INC_C \!OPT0 XOR A ; Clear all options f! LD (O_1),A p! LD (O_2),A z! LD (O_3),A ! RET ! !ACCESS RST #20 ! CALL GET_NAME ; Get a string ! CALL FND_NAME ; Look for entry ! JR NC,ACC_2 ; File found, jump to continue ! XOR A ! JP ERROR ; File not found !ACC_2 PUSH HL ! RST #18 ; Get current character ! AND #DF ! CP "L" ! JR NZ,ACC_3 ; Not 'L', jump to unlock file " RST #20 ; Move past 'L' " LD A,128 ; Set b7=1 for locked " JR ACC_4 $"ACC_3 XOR A ; Set b7=0 for unlocked ."ACC_4 LD DE,17 8" POP HL B" ADD HL,DE ; Point to locked flag L" LD B,A V" LD A,127 `" AND (HL) ; Get b6-b0 from flag j" OR B ; Copy 'L' into b7 t" LD (HL),A ; Store back into flag ~" JP REM_2 ; Exit " "RUN RET ; Not yet "OPEN RET ; Not yet "CLOSE RET ; Not yet S/Tapeblk >?P2@ ; TAPEBLOCK 1.00 ; J.G.HARSTON ; (; 'Format' a tape by writing block headers with 2; incrementing block numbers. Tape can then be <; overwirtten with normal files. Cataloging will F; list files with block numbers P ZSCR_CT EQU 23692 dVER_NO EQU 3 nDFCC EQU 23684 x ORG 65000 ; Catalogue a tape CATALOG JP CAT ; Format a tape FORMAT LD HL,VERSION-1 ; Print header CALL PR_NAME ; Print version string LD HL,FORM-1 CALL PR_NAME ; Print 'Formatting' LD HL,T_BYTES CALL PR_NAME ; Print 'Tape count' LD A,13  RST #10  LD HL,0 ; Start at block zero  LD A,6 " LD (T_BYTES),A ; Set filetype to 6 ,F_LOOP LD (COUNT),HL ; Save block number 6 LD (T_BYTES+11),HL ; Set block number @ LD A,VER_NO J LD (T_BYTES+13),A ; Set version number T CALL SAVER ; Save a header ^ LD HL,(COUNT) ; Get block number back h LD A,#FF r LD (SCR_CT),A ; Prevent scroll prompting | CALL PR_SPC ; Print a space  LD A,L  CALL PR_HEX ; Print low byte of block number  CALL PR_SPC ; Print a space  INC HL ; Update block number  LD A,H  OR L  JR NZ,F_LOOP ; Loop until block wraps to zero  RET  SAVER CALL S_REG ; Get header address,length  LD HL,#053F  PUSH HL ; Stack SALD_RET  LD HL,#0800 ; 1.5s leader  JP #04D0 ; Save a header  PREG_1 CALL P_REG ; Print HL in hex, then a space &PR_SPC LD A,32 0 RST #10 : RET DP_REG LD A,H ; Print HL in hex N CALL PR_HEX X LD A,L bPR_HEX PUSH AF ; Print A in hex l RRCA v RRCA  RRCA  RRCA  CALL P_HEX2  POP AF P_HEX2 AND 15  ADD A,48  CP #3A  JR C,P_HEX3  ADD A,7 P_HEX3 RST #10  RET  S_REG XOR A ; Get header address and length  SCF  LD IX,T_BYTES  LD DE,17  RET * 4PR_NAME LD B,10 ; Print name at HL >PR_LOOP INC HL H LD A,(HL) R CP 32 \ JR NC,PR_N_2 ; Jump to print normal chars f PUSH HL ; Print control chars inverted p LD HL,(DFCC) ; Save DFCC z PUSH HL  ADD A,64 ; Print control char plus '@'  RST #10  POP HL ; Get old DFCC  PUSH BC  LD B,8 PNLOOP LD A,(HL) ; Invert printed character  CPL  LD (HL),A  INC H  DJNZ PNLOOP  POP BC  POP HL  JR P_N_NXT PR_N_2 RST #10 P_N_NXT DJNZ PR_LOOP ; Loop for ten characters  JR PR_SPC ; Finish with a space $ .CAT_P PUSH HL 8 LD A,(HL) ; Get filetype B CP 6 L JR NZ,CAT_P2 ; If not block, print title string V PUSH HL ; Block found, so print cassette name ` LD HL,T_MESS-1 ; Print 'Cassette:' j CALL PR_NAME t POP HL ~ CALL PR_NAME ; Print cassette name  LD A,13  RST #10 CAT_P2 LD HL,C_MESS-1 ; Point to catalog title  LD B,32  CALL PR_LOOP ; Print message  LD A,13  LD (FLAG),A ; Flag that title has been printed  RST #10  POP HL  RET  ; Catalog a tape CAT XOR A  LD (FLAG),A ; Clear flag  JR CAT_L2 ; Jump to main loop CAT_LP LD A,13 ; Move to column 0 ( RST #10 2CAT_L2 CALL S_REG ; Get header address, length < CALL #0556 ; Load a header F JR NC,CAT_L2 ; Loop until loaded P LD HL,T_BYTES ; Point to loaded header Z LD A,(FLAG) d AND A n CALL Z,CAT_P ; Print title if none printed yet x LD A,(HL) ; Get filetype  CP 6  JR NZ,PR_INFO ; Not block header, print standard header  CALL PR_NAME ; Print header name  LD HL,(T_BYTES+11) ; Get block number  LD (COUNT),HL  CALL PREG_1 ; Print block number  LD B,32 CAT_4 LD A,8 ; Move up a line to overwrite  RST #10  DJNZ CAT_4  JR CAT_LP ; Jump to wait for another block  PR_INFO LD HL,(COUNT) ; Print standard header  CALL PREG_1 ; Print last block encountered  LD HL,T_BYTES  LD A,(HL) " CALL P_HEX2 ; Print filetype , CALL PR_SPC 6 CALL PR_NAME ; Print filename @ LD HL,(T_BYTES+11) J CALL PREG_1 ; Print length T LD HL,(T_BYTES+13) ^ CALL PREG_1 ; Print start h LD HL,(T_BYTES+15) r CALL P_REG ; Print extra | JR CAT_LP ; Jump to wait for another header  COUNT DEFW 0 T_BYTES DEFB 0 ; Type  DEFM "Tape Count" ; Filename  DEFW 0,0,0 ; Length, Start, Extra  VERSION DEFM "Version "  DEFB VER_NO+48  DEFB 32 FORM DEFM "Formatting" C_MESS DEFM " No. ? Name Len. Strt Prog" FLAG DEFB 0 T_MESS DEFM " Cassette:" S/ThickChrN_x ; THICKCHARS 1.00 ; =============== ; May 1986, Graham Harston (; Make a thicker Spectrum character set 2; Based on original Charmaker < F; Runnable command, puts character set underneath RAMTOP P ZCHARS EQU #5C36 dSTKEND EQU #5C65 nRAMTOP EQU #5CB2 x ORG #5B00 ; Load to transient command space START LD HL,(CHARS) ; Get pointer to font LD A,H INC H ; Point to ' ' character CP #40 ; Is font already in RAM? JR NC,SETFONT ; Jump to update font in RAM LD HL,(STKEND) ; Top of BASIC data LD DE,1024 ; Check for 768 + 256 bytes ADD HL,DE JR C,OUTMEM ; >FFFF, not enough free memory SBC HL,SP ; Find space  JR C,COPYSTK ; Enough free space, continue OUTMEM RST #08 ; Generate an error  DEFB #03 ; Out of memory " ,COPYSTK LD HL,(RAMTOP) 6 AND A @ SBC HL,SP ; HL=stack length J LD B,H T LD C,L ; BC=stack length ^ LD HL,0 h ADD HL,SP ; HL=stack bottom r EX DE,HL ; DE=old stack bottom | LD HL,#FD00 ; Subtract 768  ADD HL,SP ; HL=new stack bottom  LD SP,HL ; Move SP to new position  EX DE,HL  LDIR ; Copy stack to new position  LD HL,(RAMTOP)  DEC H  DEC H  DEC H  LD (RAMTOP),HL ; Drop RAMTOP down 768 bytes  SETFONT EX DE,HL ; DE=start of new font  PUSH DE  LD HL,#3D00 ; Start of the character set in ROM  LD B,3 ; Loop round for 3 sets of 256 LOOP1 LD C,0 ; Loop round 226 times LOOP LD A,(HL) ; Get the byte from the ROM & PUSH BC ; Save the counters 0 LD B,A ; Put the byte in B : ADD A,A ; Shift A along one bit to the left D OR B ; Superimpose the original value N LD (DE),A ; and store in the RAM X POP BC ; Get the counters back b INC HL ; Increment the address pointers l INC DE v DEC C ; Decrement the first counter  JR NZ,LOOP ; Loop back if it's not zero  DJNZ LOOP1 ; Decrement the second counter and loop back  POP DE ; Get the start of the character set back  DEC D ; Decrease by 256 to get the right value  LD (CHARS),DE ; Point CHARS to new font  RET ; and return. S/XtnKeybdn?P p ; ASCII KEYBOARD ROUTINE FOR ; ZX BASIC NON-KEYWORD ENTRY ; ROUTINE (; 2; 7 SEPTEMBER 1986 <; F; VER=1 P; Z; EQUs dREPPER EQU 23562 nREPDEL EQU 23561 x; ORG #F1CA CALL #10A8 ; SCAN ZX KEYBOARD RET C ; KEY PRESSED, EXIT HALT ; SYNC WITH ASCII KBD IN A,(253) ; READ KEYPRESS CP 255 ; NO KEY PRESSED? JR NZ,KEY_1 KEY_X LD A,255 LD (LAST_K),A ; SET NO KEY PRESSED RET KEY_1 LD B,A ; B=KEYPRESS IN A,(251) ; GET KBD STATUS LD C,A ; C=STATUS  LD HL,COUNTER  LD A,(LAST_K) ; GET CURRENT KEYPRESS  CP B ; IS IT THE SAME " JR Z,KEY_2 ; JUMP TO DEAL WITH REPEATS , LD A,(REPDEL) 6 LD (HL),A ; INIT REPEAT DELAY @ JR KEY_33 ; PROCESS NEW KEYPRESS JKEY_2 DEC (HL) ; DEC REPEAT DELAY T JR Z,KEY_3 ; REACHED ZERO, PROCESS KEYPRESS ^ CP A ; NO KEY PRESSED h RET ; EXIT r |KEY_3 LD A,(REPPER)  LD (HL),A ; INIT REPEAT KEY_33 LD A,B  LD (LAST_K),A ; SET CURRENT KEYPRESS  CP 127  JR C,KEY_4 ; <127, CHECK CONTROLS  JR NZ,KEY_PAD ; >127, CHECK KEYPAD  LD A,12 ; =127, CONVERT TO DELETE KEY_END AND A  SCF ; KEY PRESSED  RET ; EXIT KEY_4 CP 32  JR NC,KEY_END ; NOT CONTROL, RETURN KEYPRESS  BIT 1,C ; IS CONTROL KEY PRESSED?  JR Z,KEY_7 ; JUMP WITH SPECIAL KEYS  AND A ; IS IT CTRL-@?  JR NZ,KEY_5 & LD A,127 ; CTRL-@ RETURNS (C) 0 JR KEY_END :KEY_5 CP 27 ; CHECK FOR CTRL-LETTER D JR NC,KEY_6 ; NOT CTRL-LETTER N ADD A,143 ; CONVERT TO GRAPHICS CHARS X JR KEY_END bKEY_6 CP 28 ; CONVERT [ | ] ^ _ l ADC A,171 ; TO <= <= >= <> LINE v JR KEY_END KEY_7 LD HL,TABLE-8 ; POINT TO CONVERSION TABLE  CP 20  JR C,KEY_8  LD HL,TABLE-15 KEY_8 LD E,A  LD D,0  ADD HL,DE ; INDEX TO CONVERTED BYTE  LD A,(HL) ; GET CONVERTED KEYPRESS  JR KEY_END ; RETURN KEYPRESS TABLE DEFB 9,9,8,9 ; -> -> <- ->  DEFB 251,13,8,22 ; CLS NL <- (AT)  DEFB 23,253,10,11 ; (TAB) CLEAR DN UP  DEFB 7 ; EDIT KEY_PAD AND 143 ; CONVERT TO BLOCK CHARACTER  BIT 0,C ; IS SHIFT PRESSED?  JR Z,KEY_END ; NOT PRESSED, RETURN KEYPRESS  XOR 15 ; INVERT BLOCK CHARACTER * JR KEY_END 4COUNTER DEFB 5 >LAST_K DEFB 255 T/RamDisk N SPECTRUM RAMDISK PROGRAM BY J.G.HARSTON ======================================= VERSION 1.00, 16 JUNE 1986, 5:50PM Provides a 30K RAM disk in memory from 32768 to 62999. Load with the following: CLEAR 32767:LOAD "RamDisk"CODE:LET FS=63000 All RAM disk commands are prefixed with 'RANDOMISE USR FS' with FS set to 63000. The RAM disk starts at 32768 and works upwards in memory to 62999. Files are stored in alphabetical order, and the disk is compacted whenever a file is deleted. RANDOMISE USR FS:FORMAT "name" ------------------------------ Formats the RAM disk by blanking it out and sets the disk name. The RAM disk must be formatted before use. RANDOMISE USR FS:SAVE "name"[options] -------------------------------------- Save data to the RAM disk. The standard file options can be used, eg 'SCREEN$', 'CODE start,length', etc. If a file already exists with the specified name a 'File exists' error will be given unless option x is set, when it will be silently overwritten. If there isn't enough space to save the file a 'Disk full' error will be given. RANDOMISE USR FS:LOAD "name"[options] ------------------------------------- Load data from the RAM disk. The standard file options can be used, eg 'SCREEN$', 'CODE start,length', etc. If the file does not exist a 'File not found' error will be given. If the filetypes do not match a 'Type mismatch' error will be given. RANDOMISE USR FS:VERIFY "name"[options] --------------------------------------- Verifies data. RANDOMISE USR FS:MERGE "name" ----------------------------- Merges data RANDOMISE USR FS:CAT -------------------- This catalogs the RAM disk listing the files present. The catalog displays the disk name and free space followed by the files in alphabetical order, as in the following example: RAMDISK (00) 23K free Option 0 (Off) Demo L Intro If a file is locked to prevent deletion, it will be followed by a 'L'. RANDOMISE USR FS:PRINT "name" ----------------------------- This prints full information on the specified file in the form Filename TT LLLL SSSS EEEE L TT is the filetype 0=Basic, 1=Character data, 2=Number data, 3=Code. LLLL is the file length, SSSS is the file start, EEEE is the extra field. RANDOMISE USR FS:LIST --------------------- This lists the RAM disk by displaying full information on all the files, for instance: RAMDISK (00) 23K free Option 0 (Off) Demo 00 02AF 000A 02AF L Intro 03 1B00 4000 4000 L RANDOMISE USR FS:MOVE "name","name" ----------------------------------- The renames a file from the first name to the second name. RANDOMISE USR FS:ERASE "name" ----------------------------- This deletes the specified file. If the file is locked, a 'File locked' error will be given. RANDOMISE USR FS:REM A "name" [L] --------------------------------- This locks or unlocks the specified file. RANDOMISE USR FS:INPUT opt,num ------------------------------ Sets various options: Option 0 - Sets options 1, 2 and 3 to zero Option 1 - Display file information. If set to zero, no file information is displayed. If set to 1, then file information is displayed on LOAD, SAVE and ERASE. Option 2 - If b0=0 then SAVE does not overwrite files. If b0=1 then SAVE overwrites files. If b7=0 then SAVEd files are not locked. If b7=1 then SAVEd files are automatically locked. Option 3 - Sets error handling: 0 = errors stop the program and return via ERR_SP 1 = errors are displayed, and the program continues 2 = errors are ignored totally, and the program continues Option 4 - Set disk option. RANDOMISE USR FS:RUN -------------------- Not implemented, ignored RANDOMISE USR FS:OPEN -------------------- Not implemented, ignored RANDOMISE USR FS:CLOSE -------------------- Not implemented, ignored RANDOMISE USR FS:REM (C) ------------------------ Displays a copyright and version string.