RFS updates for SA-5510 Basic, added SD commands for Load,Save,Dir

This commit is contained in:
Philip Smart
2021-04-04 16:46:26 +01:00
parent 109aa310ee
commit 0ac888453c
47 changed files with 23355 additions and 1256 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,568 @@
----------------------------------------
-- dZ80 configuration file
----------------------------------------
----------------------------------------
-- Disassembly control
----------------------------------------
cpu="z80"
inputfile="SA-5510.bin"
outputfile="SA-5510.asm"
--fileheadersize=27
filebaseaddr=4605
disstart=0
disend=16946
--disstart=0
--disend=3584
--quiet=0
labelledoutput=1
----------------------------------------
-- Layout
----------------------------------------
labelreference=1
addresscolumn=1
opcodecolumn=1
relativejumpcomment=1
uppercase=1
autoblanklines=1
db="db"
comment="; "
radix=16
numprefix="0"
numsuffix="H"
----------------------------------------
-- Scripts
----------------------------------------
--script="scripts\\spectrum.lua"
----------------------------------------
-- References
----------------------------------------
referencefile="SA-5510.ref"
inportreference=1
outportreference=1
addressreference=1
indirectaddressreference=1
limitreferences=1
----------------------------------------
-- Opcode mapfile and code/data areas
----------------------------------------
--opmapfile="mayhem.map"
-- Code Region isnt required as v2.x sets the entire region to code unless a data region overrides it.
-- d_SetCodeRegion(4608, 2464)
-- Set the known data regions, either as a data region (byte), word or string. The type affects the assembly output definitions and word
-- regions will attempt to map to an address, ie. jump tables will be setup with labels rather than constants.
d_SetDataRegion( hex("1347"), 100) -- 0x1347
d_SetStringRegion(hex("1347"), 28)
d_SetStringRegion(hex("1364"), 31)
d_SetStringRegion(hex("1384"), 5)
d_SetStringRegion(hex("138A"), 6)
d_SetStringRegion(hex("1391"), 3)
d_SetStringRegion(hex("1395"), 6)
d_SetStringRegion(hex("139C"), 6)
d_SetDataRegion( hex("2FC2"), 30)
d_SetStringRegion(hex("2FC2"), 6)
d_SetStringRegion(hex("2FC9"), 8)
d_SetStringRegion(hex("2FD2"), 10)
d_SetStringRegion(hex("2FDD"), 2)
d_SetStringRegion(hex("1D44"), 9)
-- Reserved key words.
d_SetDataRegion( hex("15A8"), 402) -- 0x15A8 Start of tokens.
d_SetStringRegion(hex("15A8"), 2) -- 0 - REM
d_SetStringRegion(hex("15AB"), 3) -- 1 - DATA
d_SetStringRegion(hex("15AF"), 0) -- 2 - undefined
d_SetStringRegion(hex("15B0"), 0) -- 3 - undefined
d_SetStringRegion(hex("15B1"), 3) -- 4 - READ
d_SetStringRegion(hex("15B5"), 3) -- 5 - LIST
d_SetStringRegion(hex("15B9"), 2) -- 6 - RUN
d_SetStringRegion(hex("15BC"), 2) -- 7 - NEW
d_SetStringRegion(hex("15BF"), 4) -- 8 - PRINT
d_SetStringRegion(hex("15C4"), 2) -- 9 - LET
d_SetStringRegion(hex("15C7"), 2) -- 10 - FOR
d_SetStringRegion(hex("15CA"), 1) -- 11 - IF
d_SetStringRegion(hex("15CC"), 3) -- 12 - THEN
d_SetStringRegion(hex("15D0"), 3) -- 13 - GOTO
d_SetStringRegion(hex("15D4"), 4) -- 14 - GOSUB
d_SetStringRegion(hex("15D9"), 5) -- 15 - RETURN
d_SetStringRegion(hex("15DF"), 3) -- 16 - NEXT
d_SetStringRegion(hex("15E3"), 3) -- 17 - STOP
d_SetStringRegion(hex("15E7"), 2) -- 18 - END
d_SetStringRegion(hex("15EA"), 0) -- 19 - undefined
d_SetStringRegion(hex("15EB"), 1) -- 20 - ON
d_SetStringRegion(hex("15ED"), 3) -- 21 - LOAD
d_SetStringRegion(hex("15F1"), 3) -- 22 - SAVE
d_SetStringRegion(hex("15F5"), 5) -- 23 - VERIFY
d_SetStringRegion(hex("15FB"), 3) -- 24 - POKE
d_SetStringRegion(hex("15FF"), 2) -- 25 - DIM
d_SetStringRegion(hex("1602"), 5) -- 26 - DEF FN
d_SetStringRegion(hex("1608"), 4) -- 27 - INPUT
d_SetStringRegion(hex("160D"), 6) -- 28 - RESTORE
d_SetStringRegion(hex("1614"), 2) -- 29 - CLS
d_SetStringRegion(hex("1617"), 4) -- 30 - MUSIC
d_SetStringRegion(hex("161C"), 4) -- 31 - TEMPO
d_SetStringRegion(hex("1621"), 3) -- 32 - USRN
d_SetStringRegion(hex("1625"), 4) -- 33 - WOPEN
d_SetStringRegion(hex("162A"), 4) -- 34 - ROPEN
d_SetStringRegion(hex("162F"), 4) -- 35 - CLOSE
d_SetStringRegion(hex("1634"), 2) -- 36 - MON
d_SetStringRegion(hex("1637"), 4) -- 37 - LIMIT
d_SetStringRegion(hex("163C"), 3) -- 38 - CONT
d_SetStringRegion(hex("1640"), 2) -- 39 - GET
d_SetStringRegion(hex("1643"), 3) -- 40 - INP@
d_SetStringRegion(hex("1647"), 3) -- 41 - OUT@
d_SetStringRegion(hex("164B"), 5) -- 42 - CURSOR
d_SetStringRegion(hex("1651"), 2) -- 43 - SET
d_SetStringRegion(hex("1654"), 4) -- 44 - RESET
d_SetStringRegion(hex("1659"), 0) -- 45 - undefined
d_SetStringRegion(hex("165A"), 0) -- 46 - undefined
d_SetStringRegion(hex("165B"), 0) -- 47 - undefined
d_SetStringRegion(hex("165C"), 0) -- 48 - undefined
d_SetStringRegion(hex("165D"), 0) -- 49 - undefined
d_SetStringRegion(hex("165E"), 0) -- 59 - undefined
d_SetStringRegion(hex("165F"), 3) -- 51 - AUTO
d_SetStringRegion(hex("1663"), 0) -- 52 - undefined
d_SetStringRegion(hex("1664"), 0) -- 53 - undefined
d_SetStringRegion(hex("1665"), 5) -- 54 - COPY/P
d_SetStringRegion(hex("166B"), 5) -- 55 - PAGE/P
d_SetStringRegion(hex("1671"), 0) -- 56 - undefined
d_SetStringRegion(hex("1672"), 0) -- 57 - undefined
d_SetStringRegion(hex("1673"), 0) -- 58 - undefined
d_SetStringRegion(hex("1674"), 0) -- 59 - undefined
d_SetStringRegion(hex("1675"), 0) -- 60 - undefined
d_SetStringRegion(hex("1676"), 0) -- 61 - undefined
d_SetStringRegion(hex("1677"), 0) -- 62 - undefined
d_SetStringRegion(hex("1678"), 0) -- 63 - undefined
d_SetStringRegion(hex("1679"), 0) -- 64 - undefined
d_SetStringRegion(hex("167A"), 0) -- 65 - undefined
d_SetStringRegion(hex("167B"), 1) -- 66 - undefined
d_SetStringRegion(hex("167D"), 1) -- 67 - undefined
-- Functions
d_SetStringRegion(hex("167F"), 1) -- >=
d_SetStringRegion(hex("1681"), 1) -- <>
d_SetStringRegion(hex("1683"), 1) -- =<
d_SetStringRegion(hex("1685"), 1) -- <=
d_SetStringRegion(hex("1687"), 1) -- <=
d_SetStringRegion(hex("1689"), 1) -- <=
d_SetStringRegion(hex("168B"), 0) -- undefined
d_SetStringRegion(hex("168C"), 0) -- <=
d_SetStringRegion(hex("168D"), 0) -- <=
d_SetStringRegion(hex("168E"), 0) -- undefined
d_SetStringRegion(hex("168F"), 0) -- undefined
d_SetStringRegion(hex("1690"), 0) -- undefined
d_SetStringRegion(hex("1691"), 0) -- undefined
d_SetStringRegion(hex("1692"), 0) -- undefined
d_SetStringRegion(hex("1693"), 0) -- undefined
d_SetStringRegion(hex("1694"), 0) -- undefined
d_SetStringRegion(hex("1695"), 0) -- undefined
d_SetStringRegion(hex("1696"), 0) -- undefined
d_SetStringRegion(hex("1697"), 0) -- undefined
d_SetStringRegion(hex("1698"), 0) -- undefined
d_SetStringRegion(hex("1699"), 0) -- undefined
d_SetStringRegion(hex("169A"), 0) -- undefined
d_SetStringRegion(hex("169B"), 0) -- undefined
d_SetStringRegion(hex("169C"), 0) -- undefined
d_SetStringRegion(hex("169D"), 0) -- undefined
d_SetStringRegion(hex("168E"), 0) -- undefined
d_SetStringRegion(hex("168F"), 0) -- undefined
d_SetStringRegion(hex("16A0"), 1) -- TO
d_SetStringRegion(hex("16A2"), 3) -- STEP
d_SetStringRegion(hex("16A6"), 5) -- LEFT$(
d_SetStringRegion(hex("16AC"), 6) -- RIGHT$(
d_SetStringRegion(hex("16B3"), 4) -- MID$(
d_SetStringRegion(hex("16B8"), 3) -- LEN(
d_SetStringRegion(hex("16BC"), 4) -- CHR$(
d_SetStringRegion(hex("16C1"), 4) -- STR$(
d_SetStringRegion(hex("16C6"), 3) -- ASC(
d_SetStringRegion(hex("16CA"), 3) -- VAL(
d_SetStringRegion(hex("16CE"), 4) -- PEEK(
d_SetStringRegion(hex("16D3"), 3) -- TAB(
d_SetStringRegion(hex("16D7"), 6) -- SPACE$(
d_SetStringRegion(hex("16DE"), 3) -- SIZE
d_SetStringRegion(hex("16E2"), 2) -- undefined
d_SetStringRegion(hex("16E5"), 6) -- STRING$(
d_SetStringRegion(hex("16ED"), 0) -- undefined
d_SetStringRegion(hex("16EE"), 10) -- CHARACTER$(
d_SetStringRegion(hex("16F9"), 2) -- CSR
d_SetStringRegion(hex("16FC"), 12) -- undefined
d_SetStringRegion(hex("1709"), 3) -- RND(
d_SetStringRegion(hex("170D"), 3) -- SIN(
d_SetStringRegion(hex("1711"), 3) -- COS(
d_SetStringRegion(hex("1715"), 3) -- TAN(
d_SetStringRegion(hex("1719"), 3) -- ATN(
d_SetStringRegion(hex("171D"), 3) -- EXP(
d_SetStringRegion(hex("1721"), 3) -- INT(
d_SetStringRegion(hex("1725"), 3) -- LOG(
d_SetStringRegion(hex("1729"), 2) -- LN(
d_SetStringRegion(hex("172C"), 3) -- ABS(
d_SetStringRegion(hex("1730"), 3) -- SGN(
d_SetStringRegion(hex("1734"), 3) -- SQR(
d_SetStringRegion(hex("1738"), 2) -- End of Table
d_SetDataRegion( hex("13AB"), 77) -- 0x13AB
d_SetStringRegion(hex("4223"), 15) -- 0x4223 BASIC SA-5510
d_SetDataRegion( hex("1D15"), 2) -- 0x1D15 Data
d_SetDataRegion( hex("1C4C"), 1)
d_SetDataRegion( hex("1C63"), 1) -- 0x1C63 Data
d_SetWordRegion( hex("1BB2"), 128) -- 0x1BB2 Data
d_SetDataRegion( hex("3400"), 3) -- 0x3400 Data
d_SetDataRegion( hex("3404"), 1) -- 0x3404 Data
d_SetDataRegion( hex("2355"), 1) -- 0x2355 Data
d_SetDataRegion( hex("239F"), 1) -- 0x239f Data
d_SetWordRegion( hex("2691"), 34)
d_SetWordRegion( hex("26B3"), 40)
d_SetWordRegion( hex("26DB"), 24)
d_SetDataRegion( hex("26F3"), 6)
d_SetDataRegion( hex("27B2"), 2) -- 0x27B2 Data
d_SetDataRegion( hex("2884"), 1) -- 0x2885 Data
d_SetDataRegion( hex("2A83"), 25) -- 0x2A83 Data
--d_SetDataRegion( hex("2B3D"), 2) -- 0x2B3D Data
--d_SetDataRegion( hex("2D1D"), 2) -- 0x2D1D Data
-- Function table.
d_SetWordRegion( hex("22E1"), 18)
-- Function calls, CALL <Operation Byte> <Function>
d_SetDataRegion( hex("204A"), 2)
d_SetDataRegion( hex("12CE"), 1)
d_SetWordRegion( hex("12CF"), 2)
d_SetDataRegion( hex("1A78"), 1)
d_SetWordRegion( hex("1A79"), 2)
d_SetDataRegion( hex("1C54"), 1)
d_SetWordRegion( hex("1C55"), 2)
d_SetDataRegion( hex("1E23"), 1)
d_SetWordRegion( hex("1E24"), 2)
d_SetDataRegion( hex("20EB"), 1)
d_SetWordRegion( hex("20EC"), 2)
d_SetDataRegion( hex("21B3"), 1)
d_SetWordRegion( hex("21B4"), 2)
d_SetDataRegion( hex("287F"), 1)
d_SetWordRegion( hex("2880"), 2)
d_SetDataRegion( hex("2949"), 1)
d_SetWordRegion( hex("294A"), 2)
d_SetDataRegion( hex("29A2"), 1)
d_SetWordRegion( hex("29A3"), 2)
d_SetDataRegion( hex("2A3A"), 1)
d_SetWordRegion( hex("2A3B"), 2)
d_SetDataRegion( hex("2A4E"), 1)
d_SetWordRegion( hex("2A4F"), 2)
d_SetDataRegion( hex("2B10"), 1)
d_SetWordRegion( hex("2B11"), 2)
d_SetDataRegion( hex("2B32"), 1)
d_SetWordRegion( hex("2B33"), 2)
d_SetDataRegion( hex("2B6C"), 1)
d_SetWordRegion( hex("2B6D"), 2)
d_SetDataRegion( hex("2C05"), 1)
d_SetWordRegion( hex("2C06"), 2)
d_SetDataRegion( hex("2CFF"), 1)
d_SetWordRegion( hex("2D00"), 2)
d_SetDataRegion( hex("2D56"), 1)
d_SetWordRegion( hex("2D57"), 2)
d_SetDataRegion( hex("2D5C"), 1)
d_SetWordRegion( hex("2D5D"), 2)
d_SetDataRegion( hex("2CB2"), 1)
d_SetWordRegion( hex("2CB3"), 2)
d_SetDataRegion( hex("2D78"), 1)
d_SetWordRegion( hex("2D79"), 2)
d_SetDataRegion( hex("2D88"), 1)
d_SetWordRegion( hex("2D89"), 2)
d_SetDataRegion( hex("2D95"), 1)
d_SetWordRegion( hex("2D96"), 2)
d_SetDataRegion( hex("2DA2"), 1)
d_SetWordRegion( hex("2DA3"), 2)
d_SetDataRegion( hex("2DB0"), 1)
d_SetWordRegion( hex("2DB1"), 2)
d_SetDataRegion( hex("2E97"), 1)
d_SetWordRegion( hex("2E98"), 2)
d_SetDataRegion( hex("2FE7"), 1)
d_SetWordRegion( hex("2FE8"), 2)
d_SetDataRegion( hex("3323"), 1)
d_SetWordRegion( hex("3324"), 2)
d_SetDataRegion( hex("2D74"), 1)
d_SetDataRegion( hex("2E33"), 32)
d_SetDataRegion( hex("2EB0"), 3)
d_SetDataRegion( hex("2F8C"), 2)
d_SetDataRegion( hex("2FE8"), 2)
d_SetDataRegion( hex("37AE"), 269)
d_SetDataRegion( hex("3CE7"), 30)
d_SetDataRegion( hex("3F05"), 48)
d_SetDataRegion( hex("4041"), 35)
d_SetDataRegion( hex("406F"), 7)
d_SetDataRegion( hex("4121"), 56)
d_SetDataRegion( hex("18BE"), 3)
d_SetDataRegion( hex("18D7"), 3)
d_SetDataRegion( hex("1CAA"), 2)
d_SetWordRegion( hex("1D90"), 2)
d_SetDataRegion( hex("2104"), 3)
--d_SetDataRegion( hex("2221"), 3)
d_SetDataRegion( hex("2317"), 1)
d_SetDataRegion( hex("270F"), 3)
d_SetWordRegion( hex("2929"), 2)
d_SetDataRegion( hex("2A14"), 2)
d_SetDataRegion( hex("2A2A"), 2)
d_SetDataRegion( hex("2C8B"), 3)
d_SetWordRegion( hex("2CDE"), 2)
d_SetDataRegion( hex("2D10"), 2)
d_SetWordRegion( hex("2D90"), 2)
d_SetDataRegion( hex("30F4"), 3)
d_SetDataRegion( hex("3BE9"), 25)
d_SetDataRegion( hex("4118"), 3)
d_SetDataRegion( hex("3DED"), 5)
d_SetDataRegion( hex("3DF2"), 5)
d_SetDataRegion( hex("3DF7"), 5)
d_SetDataRegion( hex("3DFC"), 5)
d_SetDataRegion( hex("1B42"), 1)
d_SetDataRegion( hex("1C5A"), 1)
d_SetDataRegion( hex("1D02"), 1)
d_SetDataRegion( hex("1D89"), 1)
d_SetDataRegion( hex("1F31"), 1)
d_SetDataRegion( hex("204F"), 1)
d_SetDataRegion( hex("208F"), 1)
d_SetDataRegion( hex("2116"), 1)
d_SetDataRegion( hex("220F"), 1)
d_SetDataRegion( hex("221B"), 1)
d_SetDataRegion( hex("221F"), 1)
d_SetDataRegion( hex("245F"), 1)
d_SetDataRegion( hex("24FD"), 1)
d_SetDataRegion( hex("2715"), 1)
d_SetDataRegion( hex("284E"), 1)
d_SetDataRegion( hex("2855"), 1)
d_SetDataRegion( hex("288F"), 1)
d_SetDataRegion( hex("28C6"), 1)
d_SetDataRegion( hex("2AB3"), 1)
d_SetDataRegion( hex("2B75"), 1)
d_SetDataRegion( hex("2C21"), 1)
d_SetDataRegion( hex("2CEF"), 1)
d_SetDataRegion( hex("2D7E"), 1)
d_SetDataRegion( hex("2D8E"), 1)
d_SetDataRegion( hex("2D9B"), 1)
d_SetDataRegion( hex("2DA8"), 1)
d_SetDataRegion( hex("2DB6"), 1)
-- Create a mapping table of known Sharp I/O ports and 8 bit constants.
--
-- Format Addr IsAddr Label : IsAddr = 0, value is a constant, = 1, value is an address.
d_SetByteEquate(hex("FE") , 1, "PRTC" )
d_SetByteEquate(hex("FF") , 1, "PRTD" )
-- Create a mapping table of known Sharp MZ BIOS/Memory Mapped Hardware addresses which dz80
-- can use to replace an address with the label. The EQU list will also be output at the start
-- of the disassembly file so it can compile.
-- Format Addr IsAddr Label : IsAddr = 0, value is a constant, = 1, value is an address.
d_SetWordEquate(hex("0003"), 1, "GETL" )
d_SetWordEquate(hex("0006"), 1, "LETNL" )
d_SetWordEquate(hex("0009"), 1, "NL" )
d_SetWordEquate(hex("000C"), 1, "PRNTS" )
d_SetWordEquate(hex("000F"), 1, "PRNTT" )
d_SetWordEquate(hex("0012"), 1, "PRNT" )
d_SetWordEquate(hex("0015"), 1, "MSG" )
d_SetWordEquate(hex("0018"), 1, "MSGX" )
d_SetWordEquate(hex("001B"), 1, "GETKY" )
d_SetWordEquate(hex("001E"), 1, "BRKEY" )
d_SetWordEquate(hex("0021"), 1, "?WRI" )
d_SetWordEquate(hex("0024"), 1, "?WRD" )
d_SetWordEquate(hex("0027"), 1, "?RDI" )
d_SetWordEquate(hex("002A"), 1, "?RDD" )
d_SetWordEquate(hex("002D"), 1, "?VRFY" )
d_SetWordEquate(hex("0030"), 1, "MELDY" )
d_SetWordEquate(hex("0033"), 1, "?TMST" )
d_SetWordEquate(hex("003B"), 1, "TIMRD" )
d_SetWordEquate(hex("003E"), 1, "BELL" )
d_SetWordEquate(hex("0041"), 1, "XTEMP" )
d_SetWordEquate(hex("0044"), 1, "MSTA" )
d_SetWordEquate(hex("0047"), 1, "MSTP" )
d_SetWordEquate(hex("0000"), 1, "MONIT" )
d_SetWordEquate(hex("0089"), 1, "SS" )
d_SetWordEquate(hex("0095"), 1, "ST1" )
d_SetWordEquate(hex("0410"), 1, "HLHEX" )
d_SetWordEquate(hex("041F"), 1, "_2HEX" )
d_SetWordEquate(hex("074D"), 1, "?MODE" )
d_SetWordEquate(hex("08CA"), 1, "?KEY" )
d_SetWordEquate(hex("096C"), 1, "PRNT3" )
d_SetWordEquate(hex("0BB9"), 1, "?ADCN" )
d_SetWordEquate(hex("0BCE"), 1, "?DACN" )
d_SetWordEquate(hex("0DB5"), 1, "?DSP" )
d_SetWordEquate(hex("0DA6"), 1, "?BLNK" )
d_SetWordEquate(hex("0DDC"), 1, "?DPCT" )
d_SetWordEquate(hex("03BA"), 1, "PRTHL" )
d_SetWordEquate(hex("03C3"), 1, "PRTHX" )
d_SetWordEquate(hex("03DA"), 1, "ASC" )
d_SetWordEquate(hex("03F9"), 1, "HEX" )
d_SetWordEquate(hex("0DDC"), 1, "DPCT" )
d_SetWordEquate(hex("0DA7"), 1, "DLY12" )
d_SetWordEquate(hex("0DAA"), 1, "DLY12A" )
d_SetWordEquate(hex("0EE6"), 1, "?RSTR1" )
d_SetWordEquate(hex("06A3"), 1, "MOTOR" )
d_SetWordEquate(hex("071A"), 1, "CKSUM" )
d_SetWordEquate(hex("077A"), 1, "GAP" )
d_SetWordEquate(hex("0485"), 1, "WTAPE" )
d_SetWordEquate(hex("0700"), 1, "MSTOP" )
d_SetWordEquate(hex("11FD"), 1, "TAPECOPY" )
d_SetWordEquate(hex("1200"), 1, "COLDSTRT" )
d_SetWordEquate(hex("1250"), 1, "WARMSTRTMON")
d_SetWordEquate(hex("15A8"), 1, "CMDWORDTBL" )
d_SetWordEquate(hex("1BB2"), 1, "CMDJMPTBL" )
d_SetWordEquate(hex("2E33"), 1, "CMTBUF" )
d_SetWordEquate(hex("2E34"), 1, "CMTFNAME" )
d_SetWordEquate(hex("1C3C"), 1, "CMDREMDATA" )
d_SetWordEquate(hex("13AB"), 1, "SYNTAXERR" )
d_SetWordEquate(hex("2D12"), 1, "CMDREAD" )
d_SetWordEquate(hex("1C4D"), 1, "CMDLIST" )
d_SetWordEquate(hex("1E91"), 1, "CMDRUN" )
d_SetWordEquate(hex("1C42"), 1, "CMDNEW" )
d_SetWordEquate(hex("2B0D"), 1, "CMDPRINT" )
d_SetWordEquate(hex("1D6A"), 1, "CMDLET" )
d_SetWordEquate(hex("1F2B"), 1, "CMDFOR" )
d_SetWordEquate(hex("21AD"), 1, "CMDIF" )
d_SetWordEquate(hex("13AB"), 1, "CMDTHEN" )
d_SetWordEquate(hex("1EA6"), 1, "CMDGOTO" )
d_SetWordEquate(hex("1EC7"), 1, "CMDGOSUB" )
d_SetWordEquate(hex("1EF8"), 1, "CMDRETURN" )
d_SetWordEquate(hex("1FC0"), 1, "CMDNEXT" )
d_SetWordEquate(hex("1D2C"), 1, "CMDSTOP" )
d_SetWordEquate(hex("1D15"), 1, "CMDEND" )
d_SetWordEquate(hex("203E"), 1, "CMDON" )
d_SetWordEquate(hex("2D75"), 1, "CMDLOAD" )
d_SetWordEquate(hex("2D82"), 1, "CMDSAVE" )
d_SetWordEquate(hex("2EB3"), 1, "CMDVERIFY" )
d_SetWordEquate(hex("2191"), 1, "CMDPOKE" )
d_SetWordEquate(hex("2080"), 1, "CMDDIM" )
d_SetWordEquate(hex("2201"), 1, "CMDDEFFN" )
d_SetWordEquate(hex("2BFF"), 1, "CMDINPUT" )
d_SetWordEquate(hex("1D4D"), 1, "CMDRESTORE" )
d_SetWordEquate(hex("21A6"), 1, "CMDCLS" )
d_SetWordEquate(hex("2269"), 1, "CMDMUSIC" )
d_SetWordEquate(hex("2282"), 1, "CMDTEMPO" )
d_SetWordEquate(hex("2942"), 1, "CMDUSRN" )
d_SetWordEquate(hex("2D9F"), 1, "CMDWOPEN" )
d_SetWordEquate(hex("2D92"), 1, "CMDROPEN" )
d_SetWordEquate(hex("2DAD"), 1, "CMDCLOSE" )
d_SetWordEquate(hex("28B6"), 1, "CMDMON" )
d_SetWordEquate(hex("2967"), 1, "CMDLIMIT" )
d_SetWordEquate(hex("29CE"), 1, "CMDCONT" )
d_SetWordEquate(hex("2902"), 1, "CMDGET" )
d_SetWordEquate(hex("29FE"), 1, "CMDINP" )
d_SetWordEquate(hex("2A1C"), 1, "CMDOUT" )
d_SetWordEquate(hex("28B9"), 1, "CMDCURSOR" )
d_SetWordEquate(hex("2AA6"), 1, "CMDSET" )
d_SetWordEquate(hex("2AAA"), 1, "CMDRESET" )
d_SetWordEquate(hex("2A2F"), 1, "CMDAUTO" )
d_SetWordEquate(hex("33AB"), 1, "CMDCOPY" )
d_SetWordEquate(hex("32D4"), 1, "CMDPAGE" )
d_SetWordEquate(hex("13AE"), 1, "OVFLERR" )
d_SetWordEquate(hex("13B1"), 1, "ILDATERR" )
d_SetWordEquate(hex("13B4"), 1, "DATMISERR" )
d_SetWordEquate(hex("13B7"), 1, "STRLENERR" )
d_SetWordEquate(hex("13BA"), 1, "MEMERR" )
d_SetWordEquate(hex("13C0"), 1, "LINELENERR" )
d_SetWordEquate(hex("13C3"), 1, "GOSUBERR" )
d_SetWordEquate(hex("13C6"), 1, "FORNEXTERR" )
d_SetWordEquate(hex("13C9"), 1, "FUNCERR" )
d_SetWordEquate(hex("13CC"), 1, "NEXTFORERR" )
d_SetWordEquate(hex("13CF"), 1, "RETGOSBERR" )
d_SetWordEquate(hex("13D2"), 1, "UNDEFFNERR" )
d_SetWordEquate(hex("13D5"), 1, "LINEERR" )
d_SetWordEquate(hex("13D8"), 1, "CONTERR" )
d_SetWordEquate(hex("13DB"), 1, "BADWRERR" )
d_SetWordEquate(hex("13DE"), 1, "CMDSTMTERR" )
d_SetWordEquate(hex("13E1"), 1, "READDATAERR")
d_SetWordEquate(hex("13E4"), 1, "OPENERR" )
d_SetWordEquate(hex("13E7"), 1, "UNKNWNERR" )
d_SetWordEquate(hex("13EA"), 1, "OUTFILEERR" )
d_SetWordEquate(hex("13ED"), 1, "PRTNRDYERR" )
d_SetWordEquate(hex("13F0"), 1, "PRTHWERR" )
d_SetWordEquate(hex("13F3"), 1, "PRTPAPERERR")
d_SetWordEquate(hex("13F6"), 1, "CHKSUMERR" )
d_SetWordEquate(hex("1347"), 1, "TITLEMSG" )
d_SetWordEquate(hex("1364"), 1, "COPYRMSG" )
d_SetWordEquate(hex("1384"), 1, "READYMSG" )
d_SetWordEquate(hex("138A"), 1, "ERRORMSG" )
d_SetWordEquate(hex("1391"), 1, "INMSG" )
d_SetWordEquate(hex("1395"), 1, "BREAKMSG" )
d_SetWordEquate(hex("139C"), 1, "BYTESMSG" )
d_SetWordEquate(hex("13A3"), 1, "ERRCODE" )
d_SetWordEquate(hex("1332"), 1, "MSGNL" )
d_SetWordEquate(hex("167B"), 1, "UNUSEDTBL1" )
d_SetWordEquate(hex("167D"), 1, "UNUSEDTBL2" )
d_SetWordEquate(hex("124E"), 1, "WARMSTRT" )
d_SetWordEquate(hex("167F"), 1, "OPERATORTBL")
d_SetWordEquate(hex("17FC"), 1, "STRTONUM" )
d_SetWordEquate(hex("1E88"), 1, "GETNUM" )
d_SetWordEquate(hex("173F"), 1, "SKIPSPACE" )
d_SetWordEquate(hex("173E"), 1, "INCSKIPSPCE")
d_SetWordEquate(hex("177B"), 1, "EXECHL" )
d_SetWordEquate(hex("1795"), 1, "EXECNOTCHR" )
d_SetWordEquate(hex("17A3"), 1, "MATCHCHR" )
d_SetWordEquate(hex("490D"), 0, "LINEBUFR" )
d_SetComment( hex("1795"), "Scan for character after command" )
d_SetComment( hex("1779"), "Get address after call and jump to it via a RET command." )
d_SetComment( hex("2E1D"), "Compare loaded filename against name given by user." )
d_SetComment( hex("2B0D"), "Check to see if a stream, ie. /T = Tape is given. The 02FH below is / and the function after is called if it doesnt match /." )
d_SetComment( hex("1250"), "Sharp defined BASIC restart location from Monitor." )
-- Known Sharp Constants.
d_SetWordEquate(hex("10F0"), 0, "ATRB" ) -- ATTRIBUTE
d_SetWordEquate(hex("10F1"), 0, "NAME" ) -- FILE NAME
d_SetWordEquate(hex("1102"), 0, "SIZE" ) -- BYTESIZE
d_SetWordEquate(hex("1104"), 0, "DTADR" ) -- DATA ADDRESS
d_SetWordEquate(hex("1106"), 0, "EXADR" ) -- EXECUTION ADDRESS
d_SetWordEquate(hex("1108"), 0, "COMNT" ) -- COMMENT
d_SetWordEquate(hex("1164"), 0, "SWPW" ) -- SWEEP WORK
d_SetWordEquate(hex("116E"), 0, "KDATW" ) -- KEY WORK
d_SetWordEquate(hex("1170"), 0, "KANAF" ) -- KANA FLAG (01=GRAPHIC MODE)
d_SetWordEquate(hex("1171"), 0, "DSPXY" ) -- DISPLAY COORDINATES
d_SetWordEquate(hex("1173"), 0, "MANG" ) -- COLUMN MANAGEMENT
d_SetWordEquate(hex("1179"), 0, "MANGE" ) -- COLUMN MANAGEMENT END
d_SetWordEquate(hex("117A"), 0, "PBIAS" ) -- PAGE BIAS
d_SetWordEquate(hex("117B"), 0, "ROLTOP" ) -- ROLL TOP BIAS
d_SetWordEquate(hex("117C"), 0, "MGPNT" ) -- COLUMN MANAG. POINTER
d_SetWordEquate(hex("117D"), 0, "PAGETP" ) -- PAGE TOP
d_SetWordEquate(hex("117F"), 0, "ROLEND" ) -- ROLL END
d_SetWordEquate(hex("118E"), 0, "FLASH" ) -- FLASHING DATA
d_SetWordEquate(hex("118F"), 0, "SFTLK" ) -- SHIFT LOCK
d_SetWordEquate(hex("1190"), 0, "REVFLG" ) -- REVERSE FLAG
d_SetWordEquate(hex("1191"), 0, "SPAGE" ) -- PAGE CHANGE
d_SetWordEquate(hex("1192"), 0, "FLSDT" ) -- CURSOR DATA
d_SetWordEquate(hex("1193"), 0, "STRGF" ) -- STRING FLAG
d_SetWordEquate(hex("1194"), 0, "DPRNT" ) -- TAB COUNTER
d_SetWordEquate(hex("1195"), 0, "TMCNT" ) -- TAPE MARK COUNTER
d_SetWordEquate(hex("1197"), 0, "SUMDT" ) -- CHECK SUM DATA
d_SetWordEquate(hex("1199"), 0, "CSMDT" ) -- FOR COMPARE SUM DATA
d_SetWordEquate(hex("119B"), 0, "AMPM" ) -- AMPM DATA
d_SetWordEquate(hex("119C"), 0, "TIMFG" ) -- TIME FLAG
d_SetWordEquate(hex("119D"), 0, "SWRK" ) -- KEY SOUND FLAG
d_SetWordEquate(hex("119E"), 0, "TEMPW" ) -- TEMPO WORK
d_SetWordEquate(hex("119F"), 0, "ONTYO" ) -- ONTYO WORK
d_SetWordEquate(hex("11A0"), 0, "OCTV" ) -- OCTAVE WORK
d_SetWordEquate(hex("11A1"), 0, "RATIO" ) -- ONPU RATIO
d_SetWordEquate(hex("11A3"), 0, "BUFER" ) -- GET LINE BUFFER
----------------------------------------
-- End of configuration file
----------------------------------------

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
SA-5510.ini

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,875 @@
dZ80 2.1 Reference file from the disassembly of "XPATCH-5510.bin".
Direct address Reference (127 entries)
--------------------------------------
Direct address 00000H. 3 references:
------------------------------------
05098H: LD DE,00000H
05696H: LD BC,00000H
05a94H: LD HL,00000H
Direct address 00002H. 1 references:
------------------------------------
05729H: LD BC,00002H
Direct address 00003H. 1 references:
------------------------------------
056f4H: LD BC,00003H
Direct address 0000aH. 2 references:
------------------------------------
050d8H: LD DE,0000AH
050e5H: LD DE,0000AH
Direct address 00011H. 1 references:
------------------------------------
05b06H: LD BC,00011H
Direct address 00016H. 1 references:
------------------------------------
05a83H: LD BC,00016H
Direct address 0001cH. 1 references:
------------------------------------
05a69H: LD BC,0001CH
Direct address 0005bH. 1 references:
------------------------------------
05b45H: LD BC,0005BH
Direct address 00080H. 1 references:
------------------------------------
0515fH: LD BC,00080H
Direct address 000f8H. 1 references:
------------------------------------
05b4dH: LD BC,000F8H
Direct address 00100H. 1 references:
------------------------------------
05167H: LD BC,00100H
Direct address 00200H. 1 references:
------------------------------------
05c8fH: LD BC,00200H
Direct address ATRB. 1 references:
----------------------------------
05b5eH: LD HL,010F0H
Direct address SIZE. 3 references:
----------------------------------
05bbdH: LD BC,(01102H)
05c08H: LD BC,(01102H)
05c72H: LD BC,(01102H)
Direct address DTADR. 2 references:
-----------------------------------
05bc9H: LD (01104H),DE
05befH: LD DE,(01104H)
Direct address BUFER. 6 references:
-----------------------------------
05386H: LD DE,011A3H
053e6H: LD DE,011A3H
054b0H: LD DE,011A3H
054fbH: LD DE,011A3H
05569H: LD DE,011A3H
055ecH: LD DE,011A3H
Direct address 011ccH. 2 references:
------------------------------------
053afH: LD DE,011CCH
0552eH: LD HL,011CCH
Direct address 01211H. 1 references:
------------------------------------
055abH: LD DE,01211H
Direct address 01414H. 1 references:
------------------------------------
05c92H: LD DE,01414H
Direct address 015a8H. 1 references:
------------------------------------
0584eH: LD HL,015A8H
Direct address 0165eH. 1 references:
------------------------------------
05a7aH: LD DE,0165EH
Direct address 01b35H. 1 references:
------------------------------------
0506dH: LD BC,01B35H
Direct address 01c16H. 1 references:
------------------------------------
05a66H: LD DE,01C16H
Direct address 02035H. 1 references:
------------------------------------
058b6H: LD SP,02035H
Direct address 02305H. 1 references:
------------------------------------
05a80H: LD DE,02305H
Direct address 02a2fH. 1 references:
------------------------------------
05a06H: CPL
Direct address 02f6cH. 1 references:
------------------------------------
05aafH: LD HL,02F6CH
Direct address 032d4H. 1 references:
------------------------------------
05a0eH: CALL NC,06D32H
Direct address 03302H. 2 references:
------------------------------------
05a8eH: LD HL,03302H
05b42H: LD DE,03302H
Direct address 0330bH. 1 references:
------------------------------------
05abaH: LD HL,0330BH
Direct address 03311H. 1 references:
------------------------------------
05a9dH: LD HL,03311H
Direct address 03338H. 1 references:
------------------------------------
05a88H: LD HL,03338H
Direct address 033abH. 1 references:
------------------------------------
05a0cH: XOR E
Direct address 04224H. 1 references:
------------------------------------
05b03H: LD DE,04224H
Direct address 04806H. 2 references:
------------------------------------
05a12H: LD B,048H
05b4aH: LD DE,04806H
Direct address 0488eH. 1 references:
------------------------------------
05a16H: ADC A,(HL)
Direct address 048c1H. 1 references:
------------------------------------
05aa3H: LD HL,048C1H
Direct address LINEBUFR. 7 references:
--------------------------------------
05378H: LD DE,0490DH
0539fH: LD DE,0490DH
05427H: LD DE,0490DH
054d7H: LD HL,0490DH
05501H: LD HL,0490DH
0555cH: LD DE,0490DH
057b3H: LD DE,0490DH
Direct address 0490fH. 1 references:
------------------------------------
053e9H: LD HL,0490FH
Direct address 04a0eH. 2 references:
------------------------------------
053d6H: LD DE,04A0EH
059acH: LD HL,04A0EH
Direct address 04e84H. 1 references:
------------------------------------
0574fH: LD IX,04E84H
Direct address 04e86H. 1 references:
------------------------------------
056cbH: LD HL,04E86H
Direct address 0505cH. 1 references:
------------------------------------
05248H: LD DE,0505CH
Direct address 05063H. 7 references:
------------------------------------
0509bH: LD (05063H),DE
050afH: LD (05063H),DE
050c4H: LD (05063H),DE
050efH: LD BC,(05063H)
051a6H: LD BC,(05063H)
0527aH: LD DE,(05063H)
0591cH: LD BC,(05063H)
Direct address 05065H. 5 references:
------------------------------------
050a1H: LD (05065H),DE
050baH: LD (05065H),DE
050c8H: LD (05065H),DE
05118H: LD BC,(05065H)
05926H: LD BC,(05065H)
Direct address 05067H. 3 references:
------------------------------------
050dbH: LD (05067H),DE
051adH: LD BC,(05067H)
0528aH: LD DE,(05067H)
Direct address 05069H. 2 references:
------------------------------------
050e8H: LD (05069H),DE
0529eH: LD DE,(05069H)
Direct address 0506dH. 1 references:
------------------------------------
05a10H: LD L,L
Direct address 0507dH. 1 references:
------------------------------------
05077H: LD DE,0507DH
Direct address 05089H. 1 references:
------------------------------------
0512dH: LD DE,05089H
Direct address 05255H. 1 references:
------------------------------------
05216H: LD DE,05255H
Direct address 05257H. 1 references:
------------------------------------
05231H: LD DE,05257H
Direct address 0525cH. 1 references:
------------------------------------
05221H: LD DE,0525CH
Direct address 052f0H. 1 references:
------------------------------------
05a14H: RET P
Direct address 05363H. 1 references:
------------------------------------
05a18H: LD H,E
Direct address 05446H. 1 references:
------------------------------------
05392H: LD DE,05446H
Direct address 05453H. 1 references:
------------------------------------
054a5H: LD DE,05453H
Direct address 05469H. 2 references:
------------------------------------
054c2H: LD BC,(05469H)
05531H: LD DE,(05469H)
Direct address 0548eH. 1 references:
------------------------------------
05a1aH: ADC A,(HL)
Direct address 05499H. 1 references:
------------------------------------
05565H: LD BC,05499H
Direct address 055abH. 1 references:
------------------------------------
0558aH: LD DE,055ABH
Direct address 055b3H. 1 references:
------------------------------------
054e7H: LD DE,055B3H
Direct address 055c5H. 1 references:
------------------------------------
05a1cH: PUSH BC
Direct address 055f8H. 1 references:
------------------------------------
055dcH: LD DE,055F8H
Direct address 05614H. 2 references:
------------------------------------
056a1H: LD (05614H),DE
056d3H: LD DE,(05614H)
Direct address 05616H. 1 references:
------------------------------------
05a1eH: LD D,056H
Direct address 05807H. 2 references:
------------------------------------
05744H: LD DE,05807H
05772H: LD HL,05807H
Direct address 05820H. 1 references:
------------------------------------
0576bH: LD HL,05820H
Direct address 05838H. 1 references:
------------------------------------
05acbH: LD HL,05838H
Direct address 05849H. 1 references:
------------------------------------
05ac2H: LD HL,05849H
Direct address 0585dH. 2 references:
------------------------------------
05840H: LD DE,0585DH
05857H: LD HL,0585DH
Direct address 05899H. 1 references:
------------------------------------
05b39H: LD HL,05899H
Direct address 058a5H. 1 references:
------------------------------------
0589fH: LD DE,058A5H
Direct address 058b7H. 1 references:
------------------------------------
05af4H: LD HL,058B7H
Direct address 058e0H. 1 references:
------------------------------------
05adeH: LD HL,058E0H
Direct address 058ebH. 1 references:
------------------------------------
05a04H: EX DE,HL
Direct address 05907H. 1 references:
------------------------------------
05a08H: RLCA
Direct address 0590eH. 1 references:
------------------------------------
05a0aH: LD C,059H
Direct address 059c7H. 1 references:
------------------------------------
05969H: LD DE,059C7H
Direct address 05a04H. 2 references:
------------------------------------
05a63H: LD HL,05A04H
05b0bH: LD HL,05A04H
Direct address 05a20H. 1 references:
------------------------------------
05a72H: LD DE,05A20H
Direct address 05a3cH. 1 references:
------------------------------------
05a6eH: LD HL,05A3CH
Direct address 05a52H. 1 references:
------------------------------------
05b00H: LD HL,05A52H
Direct address 05a61H. 1 references:
------------------------------------
05af8H: LD HL,05A61H
Direct address 05b55H. 1 references:
------------------------------------
05b3fH: LD HL,05B55H
Direct address 0d753H. 1 references:
------------------------------------
05c6fH: LD DE,0D753H
Direct address 0e548H. 1 references:
------------------------------------
05bb9H: LD DE,0E548H
Direct address 0ffffH. 1 references:
------------------------------------
05bb3H: LD HL,0FFFFH
Indirect address Reference (120 entries)
----------------------------------------
Indirect address DTADR. 2 references:
-------------------------------------
05bd9H: LD HL,(01104H)
05c76H: LD HL,(01104H)
Indirect address DSPXY. 2 references:
-------------------------------------
0521bH: LD (01171H),A
05228H: LD (01171H),A
Indirect address DPRNT. 1 references:
-------------------------------------
0539bH: LD A,(01194H)
Indirect address 01201H. 1 references:
--------------------------------------
05b33H: LD (01201H),HL
Indirect address 01225H. 1 references:
--------------------------------------
05b3cH: LD (01225H),HL
Indirect address 01492H. 1 references:
--------------------------------------
05aceH: LD (01492H),A
Indirect address 01493H. 1 references:
--------------------------------------
05ad1H: LD (01493H),HL
Indirect address 0153eH. 1 references:
--------------------------------------
05ac5H: LD (0153EH),A
Indirect address 0153fH. 1 references:
--------------------------------------
05ac8H: LD (0153FH),HL
Indirect address 018b4H. 1 references:
--------------------------------------
05b11H: LD (018B4H),HL
Indirect address 01958H. 6 references:
--------------------------------------
05153H: LD HL,(01958H)
052bbH: LD HL,(01958H)
053bbH: LD HL,(01958H)
05935H: LD HL,(01958H)
0598cH: LD HL,(01958H)
05b0eH: LD (01958H),HL
Indirect address 01ac8H. 1 references:
--------------------------------------
05b14H: LD (01AC8H),HL
Indirect address 01ae2H. 1 references:
--------------------------------------
05b17H: LD (01AE2H),HL
Indirect address 01b14H. 1 references:
--------------------------------------
05b1aH: LD (01B14H),HL
Indirect address 01b1cH. 1 references:
--------------------------------------
05b1dH: LD (01B1CH),HL
Indirect address 01c16H. 1 references:
--------------------------------------
05aeaH: LD (01C16H),A
Indirect address 01c17H. 1 references:
--------------------------------------
05aefH: LD (01C17H),A
Indirect address 01c7dH. 2 references:
--------------------------------------
05b7cH: LD (01C7DH),A
05b84H: LD (01C7DH),A
Indirect address 01c7eH. 1 references:
--------------------------------------
05b20H: LD (01C7EH),HL
Indirect address 01ccdH. 1 references:
--------------------------------------
05a91H: LD (01CCDH),HL
Indirect address 01ccfH. 1 references:
--------------------------------------
05a97H: LD (01CCFH),HL
Indirect address 01cd1H. 1 references:
--------------------------------------
05a9aH: LD (01CD1H),HL
Indirect address 01ec2H. 1 references:
--------------------------------------
05b23H: LD (01EC2H),HL
Indirect address 022c9H. 1 references:
--------------------------------------
05a8bH: LD (022C9H),HL
Indirect address 028f5H. 2 references:
--------------------------------------
05b6cH: LD (028F5H),A
05b74H: LD (028F5H),A
Indirect address 02b11H. 1 references:
--------------------------------------
05aa0H: LD (02B11H),HL
Indirect address 02d44H. 1 references:
--------------------------------------
05b26H: LD (02D44H),HL
Indirect address 02f19H. 2 references:
--------------------------------------
05c9aH: LD (02F19H),A
05ca2H: LD (02F19H),A
Indirect address 02f24H. 1 references:
--------------------------------------
05b29H: LD (02F24H),HL
Indirect address 0303cH. 1 references:
--------------------------------------
05b2cH: LD (0303CH),HL
Indirect address 03042H. 1 references:
--------------------------------------
05b2fH: LD (03042H),HL
Indirect address 0307bH. 1 references:
--------------------------------------
05aa6H: LD (0307BH),HL
Indirect address 03140H. 1 references:
--------------------------------------
05ab7H: LD (03140H),A
Indirect address 03141H. 1 references:
--------------------------------------
05abdH: LD (03141H),HL
Indirect address 0315bH. 1 references:
--------------------------------------
05ab2H: LD (0315BH),HL
Indirect address 0318cH. 1 references:
--------------------------------------
05aa9H: LD (0318CH),HL
Indirect address 03199H. 1 references:
--------------------------------------
05aacH: LD (03199H),HL
Indirect address 031adH. 1 references:
--------------------------------------
05adbH: LD (031ADH),A
Indirect address 031aeH. 1 references:
--------------------------------------
05ae1H: LD (031AEH),HL
Indirect address 0322eH. 1 references:
--------------------------------------
05ad4H: LD A,(0322EH)
Indirect address 041ecH. 1 references:
--------------------------------------
05afdH: LD (041ECH),A
Indirect address 041ffH. 1 references:
--------------------------------------
05b36H: LD (041FFH),HL
Indirect address 0430dH. 1 references:
--------------------------------------
058c3H: LD A,(0430DH)
Indirect address 04a0eH. 5 references:
--------------------------------------
053ceH: LD HL,(04A0EH)
054f2H: LD HL,(04A0EH)
0557bH: LD HL,(04A0EH)
05582H: LD (04A0EH),HL
055e4H: LD HL,(04A0EH)
Indirect address 04a10H. 1 references:
--------------------------------------
05543H: LD HL,(04A10H)
Indirect address 04ab3H. 3 references:
--------------------------------------
052f3H: LD HL,(04AB3H)
0562eH: LD HL,(04AB3H)
05c1fH: LD HL,(04AB3H)
Indirect address 04ab5H. 3 references:
--------------------------------------
0530eH: LD HL,(04AB5H)
05647H: LD HL,(04AB5H)
05c14H: LD HL,(04AB5H)
Indirect address 04e4eH. 2 references:
--------------------------------------
0519fH: LD (04E4EH),HL
0532eH: LD (04E4EH),HL
Indirect address 04e94H. 2 references:
--------------------------------------
05175H: LD HL,(04E94H)
05179H: LD (04E94H),HL
Indirect address 0504eH. 1 references:
--------------------------------------
0536dH: LD A,(0504EH)
Indirect address 05051H. 2 references:
--------------------------------------
050ecH: LD (05051H),HL
05901H: LD (05051H),HL
Indirect address 05063H. 1 references:
--------------------------------------
0595bH: LD HL,(05063H)
Indirect address 05065H. 4 references:
--------------------------------------
050f3H: LD HL,(05065H)
051b8H: LD HL,(05065H)
05272H: LD HL,(05065H)
05954H: LD HL,(05065H)
Indirect address 05067H. 2 references:
--------------------------------------
0510aH: LD HL,(05067H)
0594aH: LD HL,(05067H)
Indirect address 05069H. 1 references:
--------------------------------------
051c6H: LD HL,(05069H)
Indirect address 0506bH. 2 references:
--------------------------------------
05149H: LD (0506BH),HL
05943H: LD HL,(0506BH)
Indirect address 05465H. 6 references:
--------------------------------------
05364H: LD (05465H),A
0538bH: LD A,(05465H)
05432H: LD A,(05465H)
05490H: LD (05465H),A
05553H: LD A,(05465H)
055c7H: LD (05465H),A
Indirect address 05466H. 6 references:
--------------------------------------
0548aH: LD (05466H),A
0549fH: LD A,(05466H)
055d6H: LD A,(05466H)
0590fH: LD (05466H),A
05963H: LD A,(05466H)
05978H: LD (05466H),A
Indirect address 05467H. 6 references:
--------------------------------------
05383H: LD (05467H),A
053b7H: LD A,(05467H)
054b3H: LD A,(05467H)
054f5H: LD A,(05467H)
05574H: LD A,(05467H)
055efH: LD A,(05467H)
Indirect address 05468H. 4 references:
--------------------------------------
053b2H: LD (05468H),A
054c9H: LD A,(05468H)
05535H: LD A,(05468H)
0556fH: LD A,(05468H)
Indirect address 05469H. 3 references:
--------------------------------------
05404H: LD (05469H),HL
0556cH: LD HL,(05469H)
05598H: LD A,(05469H)
Indirect address 0546bH. 4 references:
--------------------------------------
05424H: LD (0546BH),HL
054adH: LD HL,(0546BH)
054bfH: LD HL,(0546BH)
0551eH: LD HL,(0546BH)
Indirect address 05611H. 5 references:
--------------------------------------
05617H: LD (05611H),A
05628H: LD (05611H),A
057e3H: LD A,(05611H)
057f2H: LD A,(05611H)
057ffH: LD A,(05611H)
Indirect address 05612H. 2 references:
--------------------------------------
056a5H: LD (05612H),HL
05736H: LD HL,(05612H)
Indirect address 05614H. 1 references:
--------------------------------------
056faH: LD HL,(05614H)
Indirect address 058e0H. 1 references:
--------------------------------------
058fdH: LD (058E0H),A
End of reference file for "XPATCH-5510.bin"

View File

@@ -0,0 +1,330 @@
----------------------------------------
-- dZ80 configuration file
----------------------------------------
----------------------------------------
-- Disassembly control
----------------------------------------
cpu="z80"
inputfile="XPATCH-5510.bin"
outputfile="XPATCH-5510.asm"
--fileheadersize=27
filebaseaddr=20572
disstart=0
disend=23724
--disstart=0
--disend=3584
--quiet=0
labelledoutput=1
----------------------------------------
-- Layout
----------------------------------------
labelreference=1
addresscolumn=1
opcodecolumn=1
relativejumpcomment=1
uppercase=1
autoblanklines=1
db="db"
comment="; "
radix=16
numprefix="0"
numsuffix="H"
----------------------------------------
-- Scripts
----------------------------------------
--script="scripts\\spectrum.lua"
----------------------------------------
-- References
----------------------------------------
referencefile="XPATCH-5510.ref"
inportreference=1
outportreference=1
addressreference=1
indirectaddressreference=1
limitreferences=1
----------------------------------------
-- Opcode mapfile and code/data areas
----------------------------------------
--opmapfile="mayhem.map"
-- Code Region isnt required as v2.x sets the entire region to code unless a data region overrides it.
d_SetCodeRegion(20572, 3152)
-- Set the known data regions, either as a data region (byte), word or string. The type affects the assembly output definitions and word
-- regions will attempt to map to an address, ie. jump tables will be setup with labels rather than constants.
d_SetDataRegion( hex("507D"), 27)
d_SetStringRegion( hex("507D"), 11)
d_SetStringRegion( hex("5089"), 15)
d_SetDataRegion( hex("5255"), 23)
d_SetStringRegion( hex("5257"), 4)
d_SetStringRegion( hex("525C"), 15)
d_SetDataRegion( hex("5446"), 31)
d_SetStringRegion( hex("5446"), 12)
d_SetStringRegion( hex("5453"), 17)
d_SetDataRegion( hex("5465"), 8)
d_SetStringRegion( hex("55B3"), 18)
d_SetStringRegion( hex("55F8"), 25)
d_SetDataRegion( hex("5807"), 49)
d_SetStringRegion( hex("5807"), 23)
--d_SetStringRegion( hex("581F"), 5)
d_SetStringRegion( hex("5827"), 5)
d_SetStringRegion( hex("582F"), 5)
d_SetDataRegion( hex("585D"), 45)
d_SetStringRegion( hex("585D"), 4)
d_SetStringRegion( hex("5862"), 5)
d_SetStringRegion( hex("5868"), 7)
d_SetStringRegion( hex("5870"), 5)
d_SetStringRegion( hex("5876"), 3)
d_SetStringRegion( hex("587A"), 5)
d_SetStringRegion( hex("5880"), 3)
d_SetStringRegion( hex("5884"), 3)
--d_SetStringRegion( hex("585D"), 4)
--d_SetDataRegion( hex("58A5"), 59)
--d_SetStringRegion( hex("58A5"), 17)
--d_SetStringRegion( hex("58B7"), 40)
d_SetDataRegion( hex("59C7"), 25)
d_SetStringRegion( hex("59C7"), 24)
d_SetDataRegion( hex("5A04"), 56)
d_SetWordRegion( hex("5A04"), 28)
-- Reserved key words.
d_SetDataRegion( hex("5A20"), 28)
d_SetStringRegion( hex("5A20"), 3) -- LINE
d_SetStringRegion( hex("5A24"), 3) -- AUTO
d_SetStringRegion( hex("5A28"), 2) -- CLR
d_SetStringRegion( hex("5A2B"), 3) -- MOVE
d_SetStringRegion( hex("5A2F"), 5) -- COPY/P
d_SetStringRegion( hex("5A35"), 5) -- PAGE/P
d_SetDataRegion( hex("5A52"), 17)
d_SetStringRegion( hex("5A52"), 15)
-- Create a mapping table of known Sharp I/O ports and 8 bit constants.
--
-- Format Addr IsAddr Label : IsAddr = 0, value is a constant, = 1, value is an address.
d_SetByteEquate(hex("FE") , 1, "PRTC" )
d_SetByteEquate(hex("FF") , 1, "PRTD" )
-- Create a mapping table of known Sharp MZ BIOS/Memory Mapped Hardware addresses which dz80
-- can use to replace an address with the label. The EQU list will also be output at the start
-- of the disassembly file so it can compile.
-- Format Addr IsAddr Label : IsAddr = 0, value is a constant, = 1, value is an address.
d_SetWordEquate(hex("0003"), 1, "GETL" )
d_SetWordEquate(hex("0006"), 1, "LETNL" )
d_SetWordEquate(hex("0009"), 1, "NL" )
d_SetWordEquate(hex("000C"), 1, "PRNTS" )
d_SetWordEquate(hex("000F"), 1, "PRNTT" )
d_SetWordEquate(hex("0012"), 1, "PRNT" )
d_SetWordEquate(hex("0015"), 1, "MSG" )
d_SetWordEquate(hex("0018"), 1, "MSGX" )
d_SetWordEquate(hex("001B"), 1, "GETKY" )
d_SetWordEquate(hex("001E"), 1, "BRKEY" )
d_SetWordEquate(hex("0021"), 1, "?WRI" )
d_SetWordEquate(hex("0024"), 1, "?WRD" )
d_SetWordEquate(hex("0027"), 1, "?RDI" )
d_SetWordEquate(hex("002A"), 1, "?RDD" )
d_SetWordEquate(hex("002D"), 1, "?VRFY" )
d_SetWordEquate(hex("0030"), 1, "MELDY" )
d_SetWordEquate(hex("0033"), 1, "?TMST" )
d_SetWordEquate(hex("003B"), 1, "TIMRD" )
d_SetWordEquate(hex("003E"), 1, "BELL" )
d_SetWordEquate(hex("0041"), 1, "XTEMP" )
d_SetWordEquate(hex("0044"), 1, "MSTA" )
d_SetWordEquate(hex("0047"), 1, "MSTP" )
d_SetWordEquate(hex("0000"), 1, "MONIT" )
d_SetWordEquate(hex("0089"), 1, "SS" )
d_SetWordEquate(hex("0095"), 1, "ST1" )
d_SetWordEquate(hex("0410"), 1, "HLHEX" )
d_SetWordEquate(hex("041F"), 1, "_2HEX" )
d_SetWordEquate(hex("074D"), 1, "?MODE" )
d_SetWordEquate(hex("08CA"), 1, "?KEY" )
d_SetWordEquate(hex("096C"), 1, "PRNT3" )
d_SetWordEquate(hex("0BB9"), 1, "?ADCN" )
d_SetWordEquate(hex("0BCE"), 1, "?DACN" )
d_SetWordEquate(hex("0DB5"), 1, "?DSP" )
d_SetWordEquate(hex("0DA6"), 1, "?BLNK" )
d_SetWordEquate(hex("0DDC"), 1, "?DPCT" )
d_SetWordEquate(hex("03BA"), 1, "PRTHL" )
d_SetWordEquate(hex("03C3"), 1, "PRTHX" )
d_SetWordEquate(hex("03DA"), 1, "ASC" )
d_SetWordEquate(hex("03F9"), 1, "HEX" )
d_SetWordEquate(hex("0DDC"), 1, "DPCT" )
d_SetWordEquate(hex("0DA7"), 1, "DLY12" )
d_SetWordEquate(hex("0DAA"), 1, "DLY12A" )
d_SetWordEquate(hex("0EE6"), 1, "?RSTR1" )
d_SetWordEquate(hex("06A3"), 1, "MOTOR" )
d_SetWordEquate(hex("071A"), 1, "CKSUM" )
d_SetWordEquate(hex("077A"), 1, "GAP" )
d_SetWordEquate(hex("0485"), 1, "WTAPE" )
d_SetWordEquate(hex("0700"), 1, "MSTOP" )
d_SetWordEquate(hex("11FD"), 1, "TAPECOPY" )
d_SetWordEquate(hex("1200"), 1, "COLDSTRT" )
d_SetWordEquate(hex("1250"), 1, "WARMSTRTMON")
d_SetWordEquate(hex("15A8"), 1, "CMDWORDTBL" )
d_SetWordEquate(hex("1BB2"), 1, "CMDJMPTBL" )
d_SetWordEquate(hex("2E33"), 1, "CMTBUF" )
d_SetWordEquate(hex("2E34"), 1, "CMTFNAME" )
-- Known BASIC SA-5510 labels/addresses.
d_SetWordEquate(hex("1C3C"), 1, "CMDREMDATA" )
d_SetWordEquate(hex("13AB"), 1, "SYNTAXERR" )
d_SetWordEquate(hex("2D12"), 1, "CMDREAD" )
d_SetWordEquate(hex("1C4D"), 1, "CMDLIST" )
d_SetWordEquate(hex("1E91"), 1, "CMDRUN" )
d_SetWordEquate(hex("1C42"), 1, "CMDNEW" )
d_SetWordEquate(hex("2B0D"), 1, "CMDPRINT" )
d_SetWordEquate(hex("1D6A"), 1, "CMDLET" )
d_SetWordEquate(hex("1F2B"), 1, "CMDFOR" )
d_SetWordEquate(hex("21AD"), 1, "CMDIF" )
d_SetWordEquate(hex("13AB"), 1, "CMDTHEN" )
d_SetWordEquate(hex("1EA6"), 1, "CMDGOTO" )
d_SetWordEquate(hex("1EC7"), 1, "CMDGOSUB" )
d_SetWordEquate(hex("1EF8"), 1, "CMDRETURN" )
d_SetWordEquate(hex("1FC0"), 1, "CMDNEXT" )
d_SetWordEquate(hex("1D2C"), 1, "CMDSTOP" )
d_SetWordEquate(hex("1D15"), 1, "CMDEND" )
d_SetWordEquate(hex("203E"), 1, "CMDON" )
d_SetWordEquate(hex("2D75"), 1, "CMDLOAD" )
d_SetWordEquate(hex("2D82"), 1, "CMDSAVE" )
d_SetWordEquate(hex("2EB3"), 1, "CMDVERIFY" )
d_SetWordEquate(hex("2191"), 1, "CMDPOKE" )
d_SetWordEquate(hex("2080"), 1, "CMDDIM" )
d_SetWordEquate(hex("2201"), 1, "CMDDEFFN" )
d_SetWordEquate(hex("2BFF"), 1, "CMDINPUT" )
d_SetWordEquate(hex("1D4D"), 1, "CMDRESTORE" )
d_SetWordEquate(hex("21A6"), 1, "CMDCLS" )
d_SetWordEquate(hex("2269"), 1, "CMDMUSIC" )
d_SetWordEquate(hex("2282"), 1, "CMDTEMPO" )
d_SetWordEquate(hex("2942"), 1, "CMDUSRN" )
d_SetWordEquate(hex("2D9F"), 1, "CMDWOPEN" )
d_SetWordEquate(hex("2D92"), 1, "CMDROPEN" )
d_SetWordEquate(hex("2DAD"), 1, "CMDCLOSE" )
d_SetWordEquate(hex("28B6"), 1, "CMDMON" )
d_SetWordEquate(hex("2967"), 1, "CMDLIMIT" )
d_SetWordEquate(hex("29CE"), 1, "CMDCONT" )
d_SetWordEquate(hex("2902"), 1, "CMDGET" )
d_SetWordEquate(hex("29FE"), 1, "CMDINP" )
d_SetWordEquate(hex("2A1C"), 1, "CMDOUT" )
d_SetWordEquate(hex("28B9"), 1, "CMDCURSOR" )
d_SetWordEquate(hex("2AA6"), 1, "CMDSET" )
d_SetWordEquate(hex("2AAA"), 1, "CMDRESET" )
d_SetWordEquate(hex("2A2F"), 1, "CMDAUTO" )
d_SetWordEquate(hex("33AB"), 1, "CMDCOPY" )
d_SetWordEquate(hex("32D4"), 1, "CMDPAGE" )
d_SetWordEquate(hex("13AE"), 1, "OVFLERR" )
d_SetWordEquate(hex("13B1"), 1, "ILDATERR" )
d_SetWordEquate(hex("13B4"), 1, "DATMISERR" )
d_SetWordEquate(hex("13B7"), 1, "STRLENERR" )
d_SetWordEquate(hex("13BA"), 1, "MEMERR" )
d_SetWordEquate(hex("13C0"), 1, "LINELENERR" )
d_SetWordEquate(hex("13C3"), 1, "GOSUBERR" )
d_SetWordEquate(hex("13C6"), 1, "FORNEXTERR" )
d_SetWordEquate(hex("13C9"), 1, "FUNCERR" )
d_SetWordEquate(hex("13CC"), 1, "NEXTFORERR" )
d_SetWordEquate(hex("13CF"), 1, "RETGOSBERR" )
d_SetWordEquate(hex("13D2"), 1, "UNDEFFNERR" )
d_SetWordEquate(hex("13D5"), 1, "LINEERR" )
d_SetWordEquate(hex("13D8"), 1, "CONTERR" )
d_SetWordEquate(hex("13DB"), 1, "BADWRERR" )
d_SetWordEquate(hex("13DE"), 1, "CMDSTMTERR" )
d_SetWordEquate(hex("13E1"), 1, "READDATAERR")
d_SetWordEquate(hex("13E4"), 1, "OPENERR" )
d_SetWordEquate(hex("13E7"), 1, "UNKNWNERR" )
d_SetWordEquate(hex("13EA"), 1, "OUTFILEERR" )
d_SetWordEquate(hex("13ED"), 1, "PRTNRDYERR" )
d_SetWordEquate(hex("13F0"), 1, "PRTHWERR" )
d_SetWordEquate(hex("13F3"), 1, "PRTPAPERERR")
d_SetWordEquate(hex("13F6"), 1, "CHKSUMERR" )
d_SetWordEquate(hex("1347"), 1, "TITLEMSG" )
d_SetWordEquate(hex("1364"), 1, "COPYRMSG" )
d_SetWordEquate(hex("1384"), 1, "READYMSG" )
d_SetWordEquate(hex("138A"), 1, "ERRORMSG" )
d_SetWordEquate(hex("1391"), 1, "INMSG" )
d_SetWordEquate(hex("1395"), 1, "BREAKMSG" )
d_SetWordEquate(hex("139C"), 1, "BYTESMSG" )
d_SetWordEquate(hex("13A3"), 1, "ERRCODE" )
d_SetWordEquate(hex("1332"), 1, "MSGNL" )
d_SetWordEquate(hex("167B"), 1, "UNUSEDTBL1" )
d_SetWordEquate(hex("167D"), 1, "UNUSEDTBL2" )
d_SetWordEquate(hex("124E"), 1, "WARMSTRT" )
d_SetWordEquate(hex("167F"), 1, "OPERATORTBL")
d_SetWordEquate(hex("17FC"), 1, "STRTONUM" )
d_SetWordEquate(hex("1E88"), 1, "GETNUM" )
d_SetWordEquate(hex("173F"), 1, "SKIPSPACE" )
d_SetWordEquate(hex("173E"), 1, "INCSKIPSPCE")
d_SetWordEquate(hex("177B"), 1, "EXECHL" )
d_SetWordEquate(hex("1795"), 1, "EXECNOTCHR" )
d_SetWordEquate(hex("17A3"), 1, "MATCHCHR" )
d_SetWordEquate(hex("490D"), 0, "LINEBUFR" )
-- XPATCH labels/addresses.
d_SetWordEquate(hex("5A63"), 1, "XPINIT" )
d_SetWordEquate(hex("5B55"), 1, "RELOC3302" )
d_SetWordEquate(hex("5BB0"), 1, "RELOC4806" )
-- Comments to be added at fixed addresses.
d_SetComment( hex("1250"), "Sharp defined BASIC restart location from Monitor." )
d_SetComment( hex("5B55"), "Relocated to 0x3302 for 0x5B bytes." )
d_SetComment( hex("5BB0"), "Relocated to 0x4806 for 0xF8 bytes." )
d_SetComment( hex("5CA8"), "End of Relocated code." )
-- Known Sharp Constants.
d_SetWordEquate(hex("10F0"), 0, "ATRB" ) -- ATTRIBUTE
d_SetWordEquate(hex("10F1"), 0, "NAME" ) -- FILE NAME
d_SetWordEquate(hex("1102"), 0, "SIZE" ) -- BYTESIZE
d_SetWordEquate(hex("1104"), 0, "DTADR" ) -- DATA ADDRESS
d_SetWordEquate(hex("1106"), 0, "EXADR" ) -- EXECUTION ADDRESS
d_SetWordEquate(hex("1108"), 0, "COMNT" ) -- COMMENT
d_SetWordEquate(hex("1164"), 0, "SWPW" ) -- SWEEP WORK
d_SetWordEquate(hex("116E"), 0, "KDATW" ) -- KEY WORK
d_SetWordEquate(hex("1170"), 0, "KANAF" ) -- KANA FLAG (01=GRAPHIC MODE)
d_SetWordEquate(hex("1171"), 0, "DSPXY" ) -- DISPLAY COORDINATES
d_SetWordEquate(hex("1173"), 0, "MANG" ) -- COLUMN MANAGEMENT
d_SetWordEquate(hex("1179"), 0, "MANGE" ) -- COLUMN MANAGEMENT END
d_SetWordEquate(hex("117A"), 0, "PBIAS" ) -- PAGE BIAS
d_SetWordEquate(hex("117B"), 0, "ROLTOP" ) -- ROLL TOP BIAS
d_SetWordEquate(hex("117C"), 0, "MGPNT" ) -- COLUMN MANAG. POINTER
d_SetWordEquate(hex("117D"), 0, "PAGETP" ) -- PAGE TOP
d_SetWordEquate(hex("117F"), 0, "ROLEND" ) -- ROLL END
d_SetWordEquate(hex("118E"), 0, "FLASH" ) -- FLASHING DATA
d_SetWordEquate(hex("118F"), 0, "SFTLK" ) -- SHIFT LOCK
d_SetWordEquate(hex("1190"), 0, "REVFLG" ) -- REVERSE FLAG
d_SetWordEquate(hex("1191"), 0, "SPAGE" ) -- PAGE CHANGE
d_SetWordEquate(hex("1192"), 0, "FLSDT" ) -- CURSOR DATA
d_SetWordEquate(hex("1193"), 0, "STRGF" ) -- STRING FLAG
d_SetWordEquate(hex("1194"), 0, "DPRNT" ) -- TAB COUNTER
d_SetWordEquate(hex("1195"), 0, "TMCNT" ) -- TAPE MARK COUNTER
d_SetWordEquate(hex("1197"), 0, "SUMDT" ) -- CHECK SUM DATA
d_SetWordEquate(hex("1199"), 0, "CSMDT" ) -- FOR COMPARE SUM DATA
d_SetWordEquate(hex("119B"), 0, "AMPM" ) -- AMPM DATA
d_SetWordEquate(hex("119C"), 0, "TIMFG" ) -- TIME FLAG
d_SetWordEquate(hex("119D"), 0, "SWRK" ) -- KEY SOUND FLAG
d_SetWordEquate(hex("119E"), 0, "TEMPW" ) -- TEMPO WORK
d_SetWordEquate(hex("119F"), 0, "ONTYO" ) -- ONTYO WORK
d_SetWordEquate(hex("11A0"), 0, "OCTV" ) -- OCTAVE WORK
d_SetWordEquate(hex("11A1"), 0, "RATIO" ) -- ONPU RATIO
d_SetWordEquate(hex("11A3"), 0, "BUFER" ) -- GET LINE BUFFER
----------------------------------------
-- End of configuration file
----------------------------------------

Binary file not shown.

View File

@@ -0,0 +1 @@
XPATCH.ini

View File

@@ -52,7 +52,7 @@ HEADER2: IF BUILD_RFS = 1
ENDIF
HEADER3: IF BUILD_TZFS = 1
DB "TZFS BASIC V1.1", 0DH, 0DH ; Title/Name (17 bytes).
DB "RFS BASIC V1.1 ", 0DH, 0DH ; Title/Name (17 bytes).
DW (CODEEND - CODESTART) + (RELOCEND - RELOC) ; Size of program.
DW 01200H ; Load address of program.
DW RELOC ; Exec address of program.
@@ -152,8 +152,10 @@ INIT3: ; Setup keyboard buffer control.
LD (FLASHCTL),A
; Change to 80 character mode.
LD HL,DSPCTL ; Setup address of display control register latch.
LD A, 128 ; 80 char mode.
LD (DSPCTL), A
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
CALL MLDSP
CALL BEL ; Beep to indicate startup - for cases where screen is slow to startup.
LD A,0FFH
@@ -446,21 +448,21 @@ WORDTB: DW PEND
DW CONT
DW LIST
DW CLEAR
DW SETANSITERM ; Enable/disable the ANSI Terminal Emulator.
DW SETANSITERM ; Enable/disable the ANSI Terminal Emulator.
; Optional commands to be builtin when a tranZPUter board is present.
OPTIONS1: IF BUILD_TZFS = 1
DW CLOADTZ ; Load tokenised BASIC program.
DW CSAVETZ ; Save tokenised BASIC program.
DW LOAD ; Load ASCII text BASIC program.
DW SAVE ; Save BASIC as ASCII text.
DW SETFREQ ; Set the CPU Frequency.
DW DIRSDCARD ; List out the SD directory.
DW SETDIR ; Change directory for all load and save operations.
DW CLOADTZ ; Load tokenised BASIC program.
DW CSAVETZ ; Save tokenised BASIC program.
DW LOAD ; Load ASCII text BASIC program.
DW SAVE ; Save BASIC as ASCII text.
DW SETFREQ ; Set the CPU Frequency.
DW DIRSDCARD ; List out the SD directory.
DW SETDIR ; Change directory for all load and save operations.
ENDIF
OPTIONS2: IF BUILD_RFS = 1
DW CLOAD80A ; Load tokenised BASIC program from tape.
DW CSAVE80A ; Save tokenised BASIC program to tape.
DW CLOAD80A ; Load tokenised BASIC program from tape.
DW CSAVE80A ; Save tokenised BASIC program to tape.
DW REM
DW REM
DW REM
@@ -468,8 +470,8 @@ OPTIONS2: IF BUILD_RFS = 1
DW REM
ENDIF
OPTIONS3: IF BUILD_MZ80A = 1
DW CLOAD80A ; Load tokenised BASIC program from tape.
DW CSAVE80A ; Save tokenised BASIC program to tape.
DW CLOAD80A ; Load tokenised BASIC program from tape.
DW CSAVE80A ; Save tokenised BASIC program to tape.
DW REM
DW REM
DW REM
@@ -480,61 +482,61 @@ OPTIONS3: IF BUILD_MZ80A = 1
; RESERVED WORD TOKEN VALUES
ZEND EQU 080H ; END - ZEND marks the start of the table.
ZFOR EQU 081H ; FOR
ZDATA EQU 083H ; DATA
ZGOTO EQU 088H ; GOTO
ZGOSUB EQU 08CH ; GOSUB
ZREM EQU 08EH ; REM
ZPRINT EQU 09EH ; PRINT
ZNEW EQU 0AAH ; NEW - ZNEW marks the end of the table
; AA..BF are reserved for future commands.
ZEND EQU 080H ; END - ZEND marks the start of the table.
ZFOR EQU 081H ; FOR
ZDATA EQU 083H ; DATA
ZGOTO EQU 088H ; GOTO
ZGOSUB EQU 08CH ; GOSUB
ZREM EQU 08EH ; REM
ZPRINT EQU 09EH ; PRINT
ZNEW EQU 0AAH ; NEW - ZNEW marks the end of the table
; AA..BF are reserved for future commands.
; Space for expansion, a block of tokens for commands has been created from 0xA5 to 0xBF.
FUNCSTRT EQU 0C0H ; Function start.
ZTAB EQU FUNCSTRT + 00H ; 0A5H ; TAB
ZTO EQU FUNCSTRT + 01H ; 0A6H ; TO
ZFN EQU FUNCSTRT + 02H ; 0A7H ; FN
ZSPC EQU FUNCSTRT + 03H ; 0A8H ; SPC
ZTHEN EQU FUNCSTRT + 04H ; 0A9H ; THEN
ZNOT EQU FUNCSTRT + 05H ; 0AAH ; NOT
ZSTEP EQU FUNCSTRT + 06H ; 0ABH ; STEP
FUNCSTRT EQU 0C0H ; Function start.
ZTAB EQU FUNCSTRT + 00H ; 0A5H ; TAB
ZTO EQU FUNCSTRT + 01H ; 0A6H ; TO
ZFN EQU FUNCSTRT + 02H ; 0A7H ; FN
ZSPC EQU FUNCSTRT + 03H ; 0A8H ; SPC
ZTHEN EQU FUNCSTRT + 04H ; 0A9H ; THEN
ZNOT EQU FUNCSTRT + 05H ; 0AAH ; NOT
ZSTEP EQU FUNCSTRT + 06H ; 0ABH ; STEP
ZPLUS EQU FUNCSTRT + 07H ; 0ACH ; +
ZMINUS EQU FUNCSTRT + 08H ; 0ADH ; -
ZTIMES EQU FUNCSTRT + 09H ; 0AEH ; *
ZDIV EQU FUNCSTRT + 0AH ; 0AFH ; /
; 0B0H
; 0B1H
ZOR EQU FUNCSTRT + 0dH ; 0B2H ; OR
ZGTR EQU FUNCSTRT + 0eH ; 0B3H ; >
ZEQUAL EQU FUNCSTRT + 0fH ; 0B4H ; M
ZLTH EQU FUNCSTRT + 10H ; 0B5H ; <
ZSGN EQU FUNCSTRT + 11H ; 0B6H ; SGN
; 0B7H
; 0B8H
; 0B9H
; 0BAH
; 0BBH
; 0BCH
; 0BDH
; 0BEH
; 0BFH
; 0C0H
; 0C1H
; 0C2H
; 0C3H
; 0C4H
; 0C5H
; 0C6H
ZPOINT EQU FUNCSTRT + 22H ; 0C7H ; POINT
; 0C8H
; 0C9H
; 0CAH
; 0CBH
; 0CCH
ZLEFT EQU FUNCSTRT + 2aH ; 0CFH ; LEFT$
ZPLUS EQU FUNCSTRT + 07H ; 0ACH ; +
ZMINUS EQU FUNCSTRT + 08H ; 0ADH ; -
ZTIMES EQU FUNCSTRT + 09H ; 0AEH ; *
ZDIV EQU FUNCSTRT + 0AH ; 0AFH ; /
; 0B0H
; 0B1H
ZOR EQU FUNCSTRT + 0dH ; 0B2H ; OR
ZGTR EQU FUNCSTRT + 0eH ; 0B3H ; >
ZEQUAL EQU FUNCSTRT + 0fH ; 0B4H ; M
ZLTH EQU FUNCSTRT + 10H ; 0B5H ; <
ZSGN EQU FUNCSTRT + 11H ; 0B6H ; SGN
; 0B7H
; 0B8H
; 0B9H
; 0BAH
; 0BBH
; 0BCH
; 0BDH
; 0BEH
; 0BFH
; 0C0H
; 0C1H
; 0C2H
; 0C3H
; 0C4H
; 0C5H
; 0C6H
ZPOINT EQU FUNCSTRT + 22H ; 0C7H ; POINT
; 0C8H
; 0C9H
; 0CAH
; 0CBH
; 0CCH
ZLEFT EQU FUNCSTRT + 2aH ; 0CFH ; LEFT$
; Space for expansion, reserve a block of tokens for functions.
@@ -623,7 +625,7 @@ INITAB: JP WARMST ; Warm start jump
RET
DB 1 ; POS (x) number (1)
DB COLW ; Terminal width
INITABW: DB COLW ; Terminal width
DB 28 ; Width for commas (3 columns)
DB 0 ; No nulls after input bytes
DB 0 ; Output enabled (^O off)
@@ -5556,7 +5558,6 @@ SWEP1: LD D,088H ; Break
JR SWEP9
SWEP1A: JP REBOOT ; Shift + Graph + Break ON = RESET.
;
JR SWEP9
SWEP6: LD HL,SWPW
PUSH HL
JR NC,SWEP11
@@ -8611,7 +8612,7 @@ NUMBERBUF DS 20, 0 ; Buffe
NUMBERPOS DW 1, NUMBERBUF ; Address within buffer
CHARACTERNO DS 1, 0 ; Byte within Ansi sequence. 0=first,255=other
CURSORCOUNT DS 1, 0 ; 1/50ths of a second since last change
FONTSET DS 1, 017H ; Ansi font setup - Blue background White Foreground as default.
FONTSET DS 1, 071H ; Ansi font setup - Blue background White Foreground as default.
JSW_FF DS 1, 0 ; Byte value to turn on/off FF routine
JSW_LF DS 1, 0 ; Byte value to turn on/off LF routine
CHARACTER DS 1, 0 ; To buffer character to be printed.

7508
software/asm/SA-5510_RFS.asm Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -10,12 +10,13 @@
;-
;- Credits: Some of the comments and parts of the standard CPM deblocking/blocking algorithm
;- come from the Z80-MBC2 project, (C) SuperFabius.
;- Copyright: (c) 2018-20 Philip Smart <philip.smart@net2net.org>
;- Copyright: (c) 2018-21 Philip Smart <philip.smart@net2net.org>
;-
;- History: Jan 2020 - Seperated Bank from RFS for dedicated use with CPM CBIOS.
; May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
; additional and different hardware. The SPI is now onboard the PCB and
; not using the printer interface card.
;- May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
;- additional and different hardware. The SPI is now onboard the PCB and
;- not using the printer interface card.
;- Mar 2021 - Updates for the RFS v2.1 board.
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
;- it under the terms of the GNU General Public License as published
@@ -33,6 +34,19 @@
ORG CBIOSSTART
;----------------------------------------------------------------------------------------------------------------------------------------------
; CBIOS organisation.
;
; Source File Size ROM Type Address Location Description
; cbios.asm 4K MROM (relocated CBIOS providing the CP/M API, initialisation routines, ROM Disk
; Monitor ROM from controller routines, Interrupt routines.
; 0x0000 - 0x0FFF) 0xC000 - 0xCFFF MRON Bank 2
; cbios_bank1.asm 2K Paged ROM 0xE800 - 0xEFFF, UROM Bank 8 Basic Sound and Melody, RTC, Keyboard and helper functionality.
; cbios_bank2.asm 2k Paged ROM 0xE800 - 0xEFFF, UROM Bank 9 Screen I/O and ANSI Terminal Parser.
; cbios_bank2.asm 2k Paged ROM 0xE800 - 0xEFFF, UROM Bank 10 SD Card Controller functionality.
; cbios_bank2.asm 2k Paged ROM 0xE800 - 0xEFFF, UROM Bank 11 Floppy Disk Controller functionality.
;----------------------------------------------------------------------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
;
; BIOS jump table
@@ -312,8 +326,10 @@ INIT3: LD A,(BNKCTRLRST)
LD (FLASHCTL),A
; Change to 80 character mode.
LD HL,DSPCTL ; Setup address of display control register latch.
LD A, 128 ; 80 char mode.
LD (DSPCTL), A
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
CALL ?MLDSP
CALL ?NL
LD DE,CBIOSSIGNON ; Start of sign on message, as devices are detected they are added to the sign on.
@@ -2640,7 +2656,7 @@ KTBLC: ; CTRL ON
CBIOSSIGNON:DB "** CBIOS v1.22, (C) P.D. Smart, 2020. Drives:", NUL
CBIOSSIGNON:DB "** CBIOS v1.23, (C) P.D. Smart, 19-21. Drives:", NUL
CBIOSIGNEND:DB " **", CR, NUL
CPMSIGNON: DB "CP/M v2.23 (48K) COPYRIGHT(C) 1979, DIGITAL RESEARCH", CR, LF, NUL
NOBDOS: DB "Failed to load BDOS, aborting!", CR, LF, NUL

View File

@@ -9,12 +9,13 @@
;- CPM TPA programs.
;-
;- Credits:
;- Copyright: (c) 2018-20 Philip Smart <philip.smart@net2net.org>
;- Copyright: (c) 2018-21 Philip Smart <philip.smart@net2net.org>
;-
;- History: Jan 2020 - Seperated Bank from RFS for dedicated use with CPM CBIOS.
; May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
; additional and different hardware. The SPI is now onboard the PCB and
; not using the printer interface card.
;- May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
;- additional and different hardware. The SPI is now onboard the PCB and
;- not using the printer interface card.
;- Mar 2021 - Updates for the RFS v2.1 board.
;-
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
@@ -50,7 +51,7 @@ CBIOS1_0: LD A,(BNKCTRLRST)
NOP
NOP
NOP
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
XOR A ; We shouldnt arrive here after a reset, if we do, select MROM bank 0
LD (BNKSELMROM),A
NOP
NOP

View File

@@ -12,12 +12,13 @@
; Ansi Parser.
;
; (C) Oct 2000 - only the ansiterm.22b module was used with a lot stripped out.
;- Copyright: (c) 2018-20 Philip Smart <philip.smart@net2net.org>
;- Copyright: (c) 2018-21 Philip Smart <philip.smart@net2net.org>
;-
;- History: Jan 2020 - Seperated Bank from RFS for dedicated use with CPM CBIOS.
; May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
; additional and different hardware. The SPI is now onboard the PCB and
; not using the printer interface card.
;- May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
;- additional and different hardware. The SPI is now onboard the PCB and
;- not using the printer interface card.
;- Mar 2021 - Updates for the RFS v2.1 board.
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
;- it under the terms of the GNU General Public License as published
@@ -52,7 +53,7 @@ CBIOS2_0: LD A,(BNKCTRLRST)
NOP
NOP
NOP
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
XOR A ; We shouldnt arrive here after a reset, if we do, select MROM bank 0
LD (BNKSELMROM),A
NOP
NOP

View File

@@ -9,12 +9,13 @@
;- CPM TPA programs.
;-
;- Credits:
;- Copyright: (c) 2018-20 Philip Smart <philip.smart@net2net.org>
;- Copyright: (c) 2018-21 Philip Smart <philip.smart@net2net.org>
;-
;- History: Jan 2020 - Seperated Bank from RFS for dedicated use with CPM CBIOS.
; May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
; additional and different hardware. The SPI is now onboard the PCB and
; not using the printer interface card.
;- May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
;- additional and different hardware. The SPI is now onboard the PCB and
;- not using the printer interface card.
;- Mar 2021 - Updates for the RFS v2.1 board.
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
;- it under the terms of the GNU General Public License as published
@@ -49,7 +50,7 @@ CBIOS3_0: LD A,(BNKCTRLRST)
NOP
NOP
NOP
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
XOR A ; We shouldnt arrive here after a reset, if we do, select MROM bank 0
LD (BNKSELMROM),A
NOP
NOP
@@ -799,8 +800,17 @@ ADD32: LD BC,(SDSTARTSEC+2)
CALL ADD3216
; Now add the offset to account for the RFS image.
LD BC, RFS_IMGSZ/SD_SECSIZE ; Sector offset for the RFS Image.
CALL ADD3216
IF RFS_IMGSZ/SD_SECSIZE < 010000H
LD BC, RFS_IMGSZ/SD_SECSIZE ; Sector offset for the RFS Image.
CALL ADD3216
ELSE
LD BC,0 ; Padding is to an even address so lower word will always be zero.
ADD HL,BC
EX DE,HL
LD BC,(RFS_END_ADDR/SD_SECSIZE) / 010000H ; Upper word addition.
ADC HL,BC
EX DE,HL
ENDIF
; Store the final sum as the start sector.
PUSH HL

View File

@@ -9,12 +9,13 @@
;- CPM TPA programs.
;-
;- Credits:
;- Copyright: (c) 2018-20 Philip Smart <philip.smart@net2net.org>
;- Copyright: (c) 2018-21 Philip Smart <philip.smart@net2net.org>
;-
;- History: Jan 2020 - Seperated Bank from RFS for dedicated use with CPM CBIOS.
; May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
; additional and different hardware. The SPI is now onboard the PCB and
; not using the printer interface card.
;- May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
;- additional and different hardware. The SPI is now onboard the PCB and
;- not using the printer interface card.
;- Mar 2021 - Updates for the RFS v2.1 board.
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
;- it under the terms of the GNU General Public License as published
@@ -49,7 +50,7 @@ CBIOS1_0: LD A,(BNKCTRLRST)
NOP
NOP
NOP
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
XOR A ; We shouldnt arrive here after a reset, if we do, select MROM bank 0
LD (BNKSELMROM),A
NOP
NOP

View File

@@ -40,7 +40,7 @@ BOOTLDR2: LD A, (BNKCTRLRST)
DJNZ BOOTLDR2
LD A, 0x07
LD (BNKCTRL), A ; Setup the User ROM Bank default.
LD A, (MEMSW)
LD A, (MEMSW) ; Swap 0000:0FFF to C000:CFFF so lower location uses DRAM.
LD A, 0x02
LD (BNKSELMROM), A ; Setup the Monitor ROM bank default.
JP CBIOSSTART ; Cold start the CBIOS.

View File

@@ -7,12 +7,13 @@
;- Definitions for the Sharp MZ80A CPM v2.23 OS used in the RFS
;-
;- Credits:
;- Copyright: (c) 2019-20 Philip Smart <philip.smart@net2net.org>
;- Copyright: (c) 2019-21 Philip Smart <philip.smart@net2net.org>
;-
;- History: Jan 2020 - Initial version.
; May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
; additional and different hardware. The SPI is now onboard the PCB and
; not using the printer interface card.
; Mar 2021 - Changes to work with the RFS v2.1 board.
;-
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
@@ -32,224 +33,224 @@
;-----------------------------------------------
; Features.
;-----------------------------------------------
HW_SPI_ENA EQU 1 ; Set to 1 if hardware SPI is present on the RFS PCB v2 board.
SW_SPI_ENA EQU 0 ; Set to 1 if software SPI is present on the RFS PCB v2 board.
PP_SPI_ENA EQU 0 ; Set to 1 if using the SPI interface via the Parallel Port, ie. for RFS PCB v1 which doesnt have SPI onboard.
HW_SPI_ENA EQU 1 ; Set to 1 if hardware SPI is present on the RFS PCB v2 board.
SW_SPI_ENA EQU 0 ; Set to 1 if software SPI is present on the RFS PCB v2 board.
PP_SPI_ENA EQU 0 ; Set to 1 if using the SPI interface via the Parallel Port, ie. for RFS PCB v1 which doesnt have SPI onboard.
;-----------------------------------------------
; Entry/compilation start points.
;-----------------------------------------------
CBIOSSTART EQU 0C000h
CBIOSDATA EQU CBIOSSTART - 0400H
UROMADDR EQU 0E800H ; Start of User ROM Address space.
FDCROMADDR EQU 0F000H
CBASE EQU 0A000H
CPMCCP EQU CBASE ; CP/M System entry
CPMBDOS EQU CPMCCP + 0806H ; BDOS entry
CPMBIOS EQU CPMCCP + 01600H ; Original CPM22 BIOS entry
BOOT EQU CBIOSSTART + 0
WBOOT EQU CBIOSSTART + 3
WBOOTE EQU CBIOSSTART + 3
CONST EQU CBIOSSTART + 6
CONIN EQU CBIOSSTART + 9
CONOUT EQU CBIOSSTART + 12
LIST EQU CBIOSSTART + 15
PUNCH EQU CBIOSSTART + 18
READER EQU CBIOSSTART + 21
HOME EQU CBIOSSTART + 24
SELDSK EQU CBIOSSTART + 27
SETTRK EQU CBIOSSTART + 30
SETSEC EQU CBIOSSTART + 33
SETDMA EQU CBIOSSTART + 36
READ EQU CBIOSSTART + 39
WRITE EQU CBIOSSTART + 42
FRSTAT EQU CBIOSSTART + 45
SECTRN EQU CBIOSSTART + 48
UNUSED EQU CBIOSSTART + 51
BANKTOBANK EQU CBIOSSTART + 54
CCP EQU CBASE
CCPCLRBUF EQU CBASE + 3
DPBASE EQU CPMBIOS
CDIRBUF EQU CPMBIOS + (MAXDISKS * 16)
CSVALVMEM EQU CDIRBUF + 128
CSVALVEND EQU CSVALVMEM + 1253
IOBYT EQU 00003H ; IOBYTE address
CDISK EQU 00004H ; Address of Current drive name and user number
CPMUSERDMA EQU 00080h ; Default CPM User DMA address.
DPSIZE EQU 16 ; Size of a Disk Parameter Block
DPBLOCK0 EQU SCRN - (8 * DPSIZE) ; Location of the 1st DPB in the CBIOS Rom.
DPBLOCK1 EQU DPBLOCK0 + DPSIZE
DPBLOCK2 EQU DPBLOCK1 + DPSIZE
DPBLOCK3 EQU DPBLOCK2 + DPSIZE
DPBLOCK4 EQU DPBLOCK3 + DPSIZE
DPBLOCK5 EQU DPBLOCK4 + DPSIZE
DPBLOCK6 EQU DPBLOCK5 + DPSIZE
DPBLOCK7 EQU DPBLOCK6 + DPSIZE
CBIOSSTART EQU 0C000h
CBIOSDATA EQU CBIOSSTART - 0400H
UROMADDR EQU 0E800H ; Start of User ROM Address space.
FDCROMADDR EQU 0F000H
CBASE EQU 0A000H
CPMCCP EQU CBASE ; CP/M System entry
CPMBDOS EQU CPMCCP + 0806H ; BDOS entry
CPMBIOS EQU CPMCCP + 01600H ; Original CPM22 BIOS entry
BOOT EQU CBIOSSTART + 0
WBOOT EQU CBIOSSTART + 3
WBOOTE EQU CBIOSSTART + 3
CONST EQU CBIOSSTART + 6
CONIN EQU CBIOSSTART + 9
CONOUT EQU CBIOSSTART + 12
LIST EQU CBIOSSTART + 15
PUNCH EQU CBIOSSTART + 18
READER EQU CBIOSSTART + 21
HOME EQU CBIOSSTART + 24
SELDSK EQU CBIOSSTART + 27
SETTRK EQU CBIOSSTART + 30
SETSEC EQU CBIOSSTART + 33
SETDMA EQU CBIOSSTART + 36
READ EQU CBIOSSTART + 39
WRITE EQU CBIOSSTART + 42
FRSTAT EQU CBIOSSTART + 45
SECTRN EQU CBIOSSTART + 48
UNUSED EQU CBIOSSTART + 51
BANKTOBANK EQU CBIOSSTART + 54
CCP EQU CBASE
CCPCLRBUF EQU CBASE + 3
DPBASE EQU CPMBIOS
CDIRBUF EQU CPMBIOS + (MAXDISKS * 16)
CSVALVMEM EQU CDIRBUF + 128
CSVALVEND EQU CSVALVMEM + 1253
IOBYT EQU 00003H ; IOBYTE address
CDISK EQU 00004H ; Address of Current drive name and user number
CPMUSERDMA EQU 00080h ; Default CPM User DMA address.
DPSIZE EQU 16 ; Size of a Disk Parameter Block
DPBLOCK0 EQU SCRN - (8 * DPSIZE) ; Location of the 1st DPB in the CBIOS Rom.
DPBLOCK1 EQU DPBLOCK0 + DPSIZE
DPBLOCK2 EQU DPBLOCK1 + DPSIZE
DPBLOCK3 EQU DPBLOCK2 + DPSIZE
DPBLOCK4 EQU DPBLOCK3 + DPSIZE
DPBLOCK5 EQU DPBLOCK4 + DPSIZE
DPBLOCK6 EQU DPBLOCK5 + DPSIZE
DPBLOCK7 EQU DPBLOCK6 + DPSIZE
;-----------------------------------------------
; Configurable settings.
;-----------------------------------------------
MAXRDRETRY EQU 002h
MAXWRRETRY EQU 002h
BLKSIZ EQU 4096 ; CP/M allocation size
HSTSIZ EQU 512 ; host disk sector size
HSTSPT EQU 32 ; host disk sectors/trk
HSTBLK EQU HSTSIZ/128 ; CP/M sects/host buff
CPMSPT EQU HSTBLK * HSTSPT ; CP/M sectors/track
SECMSK EQU HSTBLK-1 ; sector mask
WRALL EQU 0 ; write to allocated
WRDIR EQU 1 ; write to directory
WRUAL EQU 2 ; write to unallocated
TMRTICKINTV EQU 5 ; Number of 0.010mSec ticks per interrupt, ie. resolution of RTC.
MTROFFMSECS EQU 100 ; Time from last access to motor being switched off in seconds in TMRTICKINTV ticks.
COLW: EQU 80 ; Width of the display screen (ie. columns).
ROW: EQU 25 ; Number of rows on display screen.
SCRNSZ: EQU COLW * ROW ; Total size, in bytes, of the screen display area.
SCRLW: EQU COLW / 8 ; Number of 8 byte regions in a line for hardware scroll.
MODE80C: EQU 1
ROMDRVSIZE: EQU 320 ; Size in K of the Rom RFS Drive, currently 240 or 320 are coded. Please set value in make_cpmdisks.sh when changing this parameter.
MAXRDRETRY EQU 002h
MAXWRRETRY EQU 002h
BLKSIZ EQU 4096 ; CP/M allocation size
HSTSIZ EQU 512 ; host disk sector size
HSTSPT EQU 32 ; host disk sectors/trk
HSTBLK EQU HSTSIZ/128 ; CP/M sects/host buff
CPMSPT EQU HSTBLK * HSTSPT ; CP/M sectors/track
SECMSK EQU HSTBLK-1 ; sector mask
WRALL EQU 0 ; write to allocated
WRDIR EQU 1 ; write to directory
WRUAL EQU 2 ; write to unallocated
TMRTICKINTV EQU 5 ; Number of 0.010mSec ticks per interrupt, ie. resolution of RTC.
MTROFFMSECS EQU 100 ; Time from last access to motor being switched off in seconds in TMRTICKINTV ticks.
COLW: EQU 80 ; Width of the display screen (ie. columns).
ROW: EQU 25 ; Number of rows on display screen.
SCRNSZ: EQU COLW * ROW ; Total size, in bytes, of the screen display area.
SCRLW: EQU COLW / 8 ; Number of 8 byte regions in a line for hardware scroll.
MODE80C: EQU 1
ROMDRVSIZE: EQU 320 ; Size in K of the Rom RFS Drive, currently 240 or 320 are coded. Please set value in make_cpmdisks.sh when changing this parameter.
; BIOS equates
MAXDISKS EQU 7 ; Max number of Drives supported
KEYBUFSIZE EQU 16 ; Ensure this is a power of 2, max size 256.
MAXDISKS EQU 7 ; Max number of Drives supported
KEYBUFSIZE EQU 16 ; Ensure this is a power of 2, max size 256.
; Debugging
ENADEBUG EQU 0 ; Enable debugging logic, 1 = enable, 0 = disable
ENADEBUG EQU 0 ; Enable debugging logic, 1 = enable, 0 = disable
;-------------------------------------------------------
; Function entry points in the CBIOS ROMS
;-------------------------------------------------------
UROMJMPTBL EQU UROMADDR + 00020H ; Position at beginning of each bank of an API jump table of public methods in the bank
UROMJMPTBL EQU UROMADDR + 00020H ; Position at beginning of each bank of an API jump table of public methods in the bank
; Public functions in CBIOS User ROM Bank 1 - utility functions, ie. Audio.
QREBOOT EQU 0 + UROMJMPTBL
QMELDY EQU 3 + UROMJMPTBL
QTEMP EQU 6 + UROMJMPTBL
QMSTA EQU 9 + UROMJMPTBL
QMSTP EQU 12 + UROMJMPTBL
QBEL EQU 15 + UROMJMPTBL
QMODE EQU 18 + UROMJMPTBL
QTIMESET EQU 21 + UROMJMPTBL
QTIMEREAD EQU 24 + UROMJMPTBL
QCHKKY EQU 27 + UROMJMPTBL
QGETKY EQU 30 + UROMJMPTBL
QREBOOT EQU 0 + UROMJMPTBL
QMELDY EQU 3 + UROMJMPTBL
QTEMP EQU 6 + UROMJMPTBL
QMSTA EQU 9 + UROMJMPTBL
QMSTP EQU 12 + UROMJMPTBL
QBEL EQU 15 + UROMJMPTBL
QMODE EQU 18 + UROMJMPTBL
QTIMESET EQU 21 + UROMJMPTBL
QTIMEREAD EQU 24 + UROMJMPTBL
QCHKKY EQU 27 + UROMJMPTBL
QGETKY EQU 30 + UROMJMPTBL
; Public functions in CBIOS User ROM Bank 2 - Screen / ANSI terminal functions.
QPRNT EQU 0 + UROMJMPTBL
QPRTHX EQU 3 + UROMJMPTBL
QPRTHL EQU 6 + UROMJMPTBL
QANSITERM EQU 9 + UROMJMPTBL
QPRNT EQU 0 + UROMJMPTBL
QPRTHX EQU 3 + UROMJMPTBL
QPRTHL EQU 6 + UROMJMPTBL
QANSITERM EQU 9 + UROMJMPTBL
; Public functions in CBIOS User ROM Bank 3 - SD Card functions.
SD_INIT EQU 0 + UROMJMPTBL
SD_READ EQU 3 + UROMJMPTBL
SD_WRITE EQU 6 + UROMJMPTBL
SD_GETLBA EQU 9 + UROMJMPTBL
SDC_READ EQU 12 + UROMJMPTBL
SDC_WRITE EQU 15 + UROMJMPTBL
SD_INIT EQU 0 + UROMJMPTBL
SD_READ EQU 3 + UROMJMPTBL
SD_WRITE EQU 6 + UROMJMPTBL
SD_GETLBA EQU 9 + UROMJMPTBL
SDC_READ EQU 12 + UROMJMPTBL
SDC_WRITE EQU 15 + UROMJMPTBL
; Public functions in CBIOS User ROM Bank 4 - Floppy Disk Controller functions.
QDSKINIT EQU 0 + UROMJMPTBL
QSETDRVCFG EQU 3 + UROMJMPTBL
QSETDRVMAP EQU 6 + UROMJMPTBL
QSELDRIVE EQU 9 + UROMJMPTBL
QGETMAPDSK EQU 12 + UROMJMPTBL
QDSKREAD EQU 15 + UROMJMPTBL
QDSKWRITE EQU 18 + UROMJMPTBL
QDSKINIT EQU 0 + UROMJMPTBL
QSETDRVCFG EQU 3 + UROMJMPTBL
QSETDRVMAP EQU 6 + UROMJMPTBL
QSELDRIVE EQU 9 + UROMJMPTBL
QGETMAPDSK EQU 12 + UROMJMPTBL
QDSKREAD EQU 15 + UROMJMPTBL
QDSKWRITE EQU 18 + UROMJMPTBL
;-----------------------------------------------
; Memory mapped ports in hardware.
;-----------------------------------------------
SCRN: EQU 0D000H
ARAM: EQU 0D800H
DSPCTL: EQU 0DFFFH ; Screen 40/80 select register (bit 7)
KEYPA: EQU 0E000h
KEYPB: EQU 0E001h
KEYPC: EQU 0E002h
KEYPF: EQU 0E003h
CSTR: EQU 0E002h
CSTPT: EQU 0E003h
CONT0: EQU 0E004h
CONT1: EQU 0E005h
CONT2: EQU 0E006h
CONTF: EQU 0E007h
SUNDG: EQU 0E008h
TEMP: EQU 0E008h
MEMSW: EQU 0E00CH
MEMSWR: EQU 0E010H
INVDSP: EQU 0E014H
NRMDSP: EQU 0E015H
SCLDSP: EQU 0E200H
SCLBASE: EQU 0E2H
BNKCTRLRST: EQU 0EFF8H ; Bank control reset, returns all registers to power up default.
BNKCTRLDIS: EQU 0EFF9H ; Disable bank control registers by resetting the coded latch.
HWSPIDATA: EQU 0EFFBH ; Hardware SPI Data register (read/write).
HWSPISTART: EQU 0EFFCH ; Start an SPI transfer.
BNKSELMROM: EQU 0EFFDh ; Select RFS Bank1 (MROM)
BNKSELUSER: EQU 0EFFEh ; Select RFS Bank2 (User ROM)
BNKCTRL: EQU 0EFFFH ; Bank Control register (read/write).
SCRN: EQU 0D000H
ARAM: EQU 0D800H
DSPCTL: EQU 0DFFFH ; Screen 40/80 select register (bit 7)
KEYPA: EQU 0E000h
KEYPB: EQU 0E001h
KEYPC: EQU 0E002h
KEYPF: EQU 0E003h
CSTR: EQU 0E002h
CSTPT: EQU 0E003h
CONT0: EQU 0E004h
CONT1: EQU 0E005h
CONT2: EQU 0E006h
CONTF: EQU 0E007h
SUNDG: EQU 0E008h
TEMP: EQU 0E008h
MEMSW: EQU 0E00CH
MEMSWR: EQU 0E010H
INVDSP: EQU 0E014H
NRMDSP: EQU 0E015H
SCLDSP: EQU 0E200H
SCLBASE: EQU 0E2H
BNKCTRLRST: EQU 0EFF8H ; Bank control reset, returns all registers to power up default.
BNKCTRLDIS: EQU 0EFF9H ; Disable bank control registers by resetting the coded latch.
HWSPIDATA: EQU 0EFFBH ; Hardware SPI Data register (read/write).
HWSPISTART: EQU 0EFFCH ; Start an SPI transfer.
BNKSELMROM: EQU 0EFFDh ; Select RFS Bank1 (MROM)
BNKSELUSER: EQU 0EFFEh ; Select RFS Bank2 (User ROM)
BNKCTRL: EQU 0EFFFH ; Bank Control register (read/write).
;
; RFS v2 Control Register constants.
;
BBCLK EQU 1 ; BitBang SPI Clock.
SDCS EQU 2 ; SD Card Chip Select, active low.
BBMOSI EQU 4 ; BitBang MOSI (Master Out Serial In).
CDLTCH1 EQU 8 ; Coded latch up count bit 1
CDLTCH2 EQU 16 ; Coded latch up count bit 2
CDLTCH3 EQU 32 ; Coded latch up count bit 3
BK2A19 EQU 64 ; User ROM Device Select Bit 0 (or Address bit 19).
BK2A20 EQU 128 ; User ROM Device Select Bit 1 (or Address bit 20).
BBCLK EQU 1 ; BitBang SPI Clock.
SDCS EQU 2 ; SD Card Chip Select, active low.
BBMOSI EQU 4 ; BitBang MOSI (Master Out Serial In).
CDLTCH1 EQU 8 ; Coded latch up count bit 1
CDLTCH2 EQU 16 ; Coded latch up count bit 2
CDLTCH3 EQU 32 ; Coded latch up count bit 3
BK2A19 EQU 64 ; User ROM Device Select Bit 0 (or Address bit 19).
BK2A20 EQU 128 ; User ROM Device Select Bit 1 (or Address bit 20).
; BK2A20 : BK2A19
; 0 0 = Flash RAM 0 (default).
; 0 1 = Flash RAM 1.
; 1 0 = Flasm RAM 2 or Static RAM 0.
; 1 1 = Reserved.
BNKCTRLDEF EQU BBMOSI+SDCS+BBCLK ; Default on startup for the Bank Control register.
BNKCTRLDEF EQU BBMOSI+SDCS+BBCLK ; Default on startup for the Bank Control register.
;-----------------------------------------------
; IO ports in hardware and values.
;-----------------------------------------------
SPI_OUT EQU 0FFH
SPI_IN EQU 0FEH
SPI_OUT EQU 0FFH
SPI_IN EQU 0FEH
;
DOUT_LOW EQU 000H
DOUT_HIGH EQU 004H
DOUT_MASK EQU 004H
DIN_LOW EQU 000H
DIN_HIGH EQU 001H
CLOCK_LOW EQU 000H
CLOCK_HIGH EQU 002H
CLOCK_MASK EQU 0FDH
CS_LOW EQU 000H
CS_HIGH EQU 001H
DOUT_LOW EQU 000H
DOUT_HIGH EQU 004H
DOUT_MASK EQU 004H
DIN_LOW EQU 000H
DIN_HIGH EQU 001H
CLOCK_LOW EQU 000H
CLOCK_HIGH EQU 002H
CLOCK_MASK EQU 0FDH
CS_LOW EQU 000H
CS_HIGH EQU 001H
;-----------------------------------------------
; Rom File System Header (MZF)
;-----------------------------------------------
RFS_ATRB: EQU 00000h ; Code Type, 01 = Machine Code.
RFS_NAME: EQU 00001h ; Title/Name (17 bytes).
RFS_SIZE: EQU 00012h ; Size of program.
RFS_DTADR: EQU 00014h ; Load address of program.
RFS_EXADR: EQU 00016h ; Exec address of program.
RFS_COMNT: EQU 00018h ; COMMENT
MZFHDRSZ EQU 128 ; Full MZF Header size
MZFHDRNCSZ EQU 24 ; Only the primary MZF data, no comment field.
RFSSECTSZ EQU 256
MROMSIZE EQU 4096
UROMSIZE EQU 2048
BANKSPERTRACK EQU (ROMSECTORSIZE * ROMSECTORS) / UROMSIZE ; (8) We currently only use the UROM for disk images.
SECTORSPERBANK EQU UROMSIZE / ROMSECTORSIZE ; (16)
SECTORSPERBLOCK EQU RFSSECTSZ/ROMSECTORSIZE ; (2)
ROMSECTORSIZE EQU 128
ROMSECTORS EQU 128
;ROMBK1: EQU 01016H ; CURRENT MROM BANK
;ROMBK2: EQU 01017H ; CURRENT USERROM BANK
;WRKROMBK1: EQU 01018H ; WORKING MROM BANK
;WRKROMBK2: EQU 01019H ; WORKING USERROM BANK
RFS_ATRB: EQU 00000h ; Code Type, 01 = Machine Code.
RFS_NAME: EQU 00001h ; Title/Name (17 bytes).
RFS_SIZE: EQU 00012h ; Size of program.
RFS_DTADR: EQU 00014h ; Load address of program.
RFS_EXADR: EQU 00016h ; Exec address of program.
RFS_COMNT: EQU 00018h ; COMMENT
MZFHDRSZ EQU 128 ; Full MZF Header size
MZFHDRNCSZ EQU 24 ; Only the primary MZF data, no comment field.
RFSSECTSZ EQU 256
MROMSIZE EQU 4096
UROMSIZE EQU 2048
BANKSPERTRACK EQU (ROMSECTORSIZE * ROMSECTORS) / UROMSIZE ; (8) We currently only use the UROM for disk images.
SECTORSPERBANK EQU UROMSIZE / ROMSECTORSIZE ; (16)
SECTORSPERBLOCK EQU RFSSECTSZ/ROMSECTORSIZE ; (2)
ROMSECTORSIZE EQU 128
ROMSECTORS EQU 128
;ROMBK1: EQU 01016H ; CURRENT MROM BANK
;ROMBK2: EQU 01017H ; CURRENT USERROM BANK
;WRKROMBK1: EQU 01018H ; WORKING MROM BANK
;WRKROMBK2: EQU 01019H ; WORKING USERROM BANK
;-----------------------------------------------
; ROM Banks, 0-7 are reserved for alternative
@@ -260,303 +261,309 @@ ROMSECTORS EQU 128
; 8-15 are reserved for CPM code in
; the User ROM bank.
;-----------------------------------------------
MROMPAGES EQU 8
USRROMPAGES EQU 12 ; Monitor ROM : User ROM
ROMBANK0 EQU 0 ; MROM SA1510 40 Char : RFS Bank 0 - Main RFS Entry point and functions.
ROMBANK1 EQU 1 ; MROM SA1510 80 Char : RFS Bank 1 - Floppy disk controller and utilities.
ROMBANK2 EQU 2 ; CPM 2.2 CBIOS : RFS Bank 2 - SD Card controller and utilities.
ROMBANK3 EQU 3 ; RFS Utilities : RFS Bank 3 - Cmdline tools (Memory, Printer, Help)
ROMBANK4 EQU 4 ; Free : RFS Bank 4 - CMT Utilities.
ROMBANK5 EQU 5 ; Free : RFS Bank 5
ROMBANK6 EQU 6 ; Free : RFS Bank 6
ROMBANK7 EQU 7 ; Free : RFS Bank 7 - Memory and timer test utilities.
ROMBANK8 EQU 8 ; : CBIOS Bank 1 - Utilities
ROMBANK9 EQU 9 ; : CBIOS Bank 2 - Screen / ANSI Terminal
ROMBANK10 EQU 10 ; : CBIOS Bank 3 - SD Card
ROMBANK11 EQU 11 ; : CBIOS Bank 4 - Floppy disk controller.
MROMPAGES EQU 8
USRROMPAGES EQU 12 ; Monitor ROM : User ROM
ROMBANK0 EQU 0 ; MROM SA1510 40 Char : RFS Bank 0 - Main RFS Entry point and functions.
ROMBANK1 EQU 1 ; MROM SA1510 80 Char : RFS Bank 1 - Floppy disk controller and utilities.
ROMBANK2 EQU 2 ; CPM 2.2 CBIOS : RFS Bank 2 - SD Card controller and utilities.
ROMBANK3 EQU 3 ; RFS Utilities : RFS Bank 3 - Cmdline tools (Memory, Printer, Help)
ROMBANK4 EQU 4 ; Free : RFS Bank 4 - CMT Utilities.
ROMBANK5 EQU 5 ; Free : RFS Bank 5
ROMBANK6 EQU 6 ; Free : RFS Bank 6
ROMBANK7 EQU 7 ; Free : RFS Bank 7 - Memory and timer test utilities.
ROMBANK8 EQU 8 ; : CBIOS Bank 1 - Utilities
ROMBANK9 EQU 9 ; : CBIOS Bank 2 - Screen / ANSI Terminal
ROMBANK10 EQU 10 ; : CBIOS Bank 3 - SD Card
ROMBANK11 EQU 11 ; : CBIOS Bank 4 - Floppy disk controller.
OBJCD EQU 001h
OBJCD EQU 001h
;-----------------------------------------------
; IO Registers
;-----------------------------------------------
FDC EQU 0D8h ; MB8866 IO Region 0D8h - 0DBh
FDC_CR EQU 000h + FDC ; Command Register
FDC_STR EQU 000h + FDC ; Status Register
FDC_TR EQU 001h + FDC ; Track Register
FDC_SCR EQU 002h + FDC ; Sector Register
FDC_DR EQU 003h + FDC ; Data Register
FDC_MOTOR EQU 004h + FDC ; DS[0-3] and Motor control. 4 drives DS= BIT 0 -> Bit 2 = Drive number, 2=1,1=0,0=0 DS0, 2=1,1=0,0=1 DS1 etc
FDC EQU 0D8h ; MB8866 IO Region 0D8h - 0DBh
FDC_CR EQU FDC + 000h ; Command Register
FDC_STR EQU FDC + 000h ; Status Register
FDC_TR EQU FDC + 001h ; Track Register
FDC_SCR EQU FDC + 002h ; Sector Register
FDC_DR EQU FDC + 003h ; Data Register
FDC_MOTOR EQU FDC + 004h ; DS[0-3] and Motor control. 4 drives DS= BIT 0 -> Bit 2 = Drive number, 2=1,1=0,0=0 DS0, 2=1,1=0,0=1 DS1 etc
; bit 7 = 1 MOTOR ON LOW (Active)
FDC_SIDE EQU 005h + FDC ; Side select, Bit 0 when set = SIDE SELECT LOW
FDC_SIDE EQU FDC + 005h ; Side select, Bit 0 when set = SIDE SELECT LOW
;-----------------------------------------------
; Common character definitions.
;-----------------------------------------------
SCROLL EQU 001H ;Set scroll direction UP.
BELL EQU 007H
SPACE EQU 020H
TAB EQU 009H ;TAB ACROSS (8 SPACES FOR SD-BOARD)
CR EQU 00DH
LF EQU 00AH
FF EQU 00CH
DELETE EQU 07FH
BACKS EQU 008H
SOH EQU 1 ; For XModem etc.
EOT EQU 4
ACK EQU 6
NAK EQU 015H
NUL EQU 000H
NULL EQU 000H
CTRL_A EQU 001H
CTRL_B EQU 002H
CTRL_C EQU 003H
CTRL_D EQU 004H
CTRL_E EQU 005H
CTRL_F EQU 006H
CTRL_G EQU 007H
CTRL_H EQU 008H
CTRL_I EQU 009H
CTRL_J EQU 00AH
CTRL_K EQU 00BH
CTRL_L EQU 00CH
CTRL_M EQU 00DH
CTRL_N EQU 00EH
CTRL_O EQU 00FH
CTRL_P EQU 010H
CTRL_Q EQU 011H
CTRL_R EQU 012H
CTRL_S EQU 013H
CTRL_T EQU 014H
CTRL_U EQU 015H
CTRL_V EQU 016H
CTRL_W EQU 017H
CTRL_X EQU 018H
CTRL_Y EQU 019H
CTRL_Z EQU 01AH
ESC EQU 01BH
CTRL_SLASH EQU 01CH
CTRL_RB EQU 01DH
CTRL_CAPPA EQU 01EH
CTRL_UNDSCR EQU 01FH
CTRL_AT EQU 000H
NOKEY EQU 0F0H
CURSRIGHT EQU 0F1H
CURSLEFT EQU 0F2H
CURSUP EQU 0F3H
CURSDOWN EQU 0F4H
DBLZERO EQU 0F5H
INSERT EQU 0F6H
CLRKEY EQU 0F7H
HOMEKEY EQU 0F8H
BREAKKEY EQU 0FBH
SCROLL EQU 001H ;Set scroll direction UP.
BELL EQU 007H
SPACE EQU 020H
TAB EQU 009H ;TAB ACROSS (8 SPACES FOR SD-BOARD)
CR EQU 00DH
LF EQU 00AH
FF EQU 00CH
CS EQU 0CH ; Clear screen
DELETE EQU 07FH
BACKS EQU 008H
SOH EQU 1 ; For XModem etc.
EOT EQU 4
ACK EQU 6
NAK EQU 015H
NUL EQU 000H
NULL EQU 000H
CTRL_A EQU 001H
CTRL_B EQU 002H
CTRL_C EQU 003H
CTRL_D EQU 004H
CTRL_E EQU 005H
CTRL_F EQU 006H
CTRL_G EQU 007H
CTRL_H EQU 008H
CTRL_I EQU 009H
CTRL_J EQU 00AH
CTRL_K EQU 00BH
CTRL_L EQU 00CH
CTRL_M EQU 00DH
CTRL_N EQU 00EH
CTRL_O EQU 00FH
CTRL_P EQU 010H
CTRL_Q EQU 011H
CTRL_R EQU 012H
CTRL_S EQU 013H
CTRL_T EQU 014H
CTRL_U EQU 015H
CTRL_V EQU 016H
CTRL_W EQU 017H
CTRL_X EQU 018H
CTRL_Y EQU 019H
CTRL_Z EQU 01AH
ESC EQU 01BH
CTRL_SLASH EQU 01CH
CTRL_LB EQU 01BH
CTRL_RB EQU 01DH
CTRL_CAPPA EQU 01EH
CTRL_UNDSCR EQU 01FH
CTRL_AT EQU 000H
NOKEY EQU 0F0H
CURSRIGHT EQU 0F1H
CURSLEFT EQU 0F2H
CURSUP EQU 0F3H
CURSDOWN EQU 0F4H
DBLZERO EQU 0F5H
INSERT EQU 0F6H
CLRKEY EQU 0F7H
HOMEKEY EQU 0F8H
BREAKKEY EQU 0FBH
GRAPHKEY EQU 0FCH
ALPHAKEY EQU 0FDH
; MMC/SD command (SPI mode)
CMD0 EQU 64 + 0 ; GO_IDLE_STATE
CMD1 EQU 64 + 1 ; SEND_OP_COND
ACMD41 EQU 0x40+41 ; SEND_OP_COND (SDC)
CMD8 EQU 64 + 8 ; SEND_IF_COND
CMD9 EQU 64 + 9 ; SEND_CSD
CMD10 EQU 64 + 10 ; SEND_CID
CMD12 EQU 64 + 12 ; STOP_TRANSMISSION
CMD13 EQU 64 + 13 ; SEND_STATUS
ACMD13 EQU 0x40+13 ; SD_STATUS (SDC)
CMD16 EQU 64 + 16 ; SET_BLOCKLEN
CMD17 EQU 64 + 17 ; READ_SINGLE_BLOCK
CMD18 EQU 64 + 18 ; READ_MULTIPLE_BLOCK
CMD23 EQU 64 + 23 ; SET_BLOCK_COUNT
ACMD23 EQU 0x40+23 ; SET_WR_BLK_ERASE_COUNT (SDC)
CMD24 EQU 64 + 24 ; WRITE_BLOCK
CMD25 EQU 64 + 25 ; WRITE_MULTIPLE_BLOCK
CMD32 EQU 64 + 32 ; ERASE_ER_BLK_START
CMD33 EQU 64 + 33 ; ERASE_ER_BLK_END
CMD38 EQU 64 + 38 ; ERASE
CMD55 EQU 64 + 55 ; APP_CMD
CMD58 EQU 64 + 58 ; READ_OCR
CMD0 EQU 64 + 0 ; GO_IDLE_STATE
CMD1 EQU 64 + 1 ; SEND_OP_COND
ACMD41 EQU 0x40+41 ; SEND_OP_COND (SDC)
CMD8 EQU 64 + 8 ; SEND_IF_COND
CMD9 EQU 64 + 9 ; SEND_CSD
CMD10 EQU 64 + 10 ; SEND_CID
CMD12 EQU 64 + 12 ; STOP_TRANSMISSION
CMD13 EQU 64 + 13 ; SEND_STATUS
ACMD13 EQU 0x40+13 ; SD_STATUS (SDC)
CMD16 EQU 64 + 16 ; SET_BLOCKLEN
CMD17 EQU 64 + 17 ; READ_SINGLE_BLOCK
CMD18 EQU 64 + 18 ; READ_MULTIPLE_BLOCK
CMD23 EQU 64 + 23 ; SET_BLOCK_COUNT
ACMD23 EQU 0x40+23 ; SET_WR_BLK_ERASE_COUNT (SDC)
CMD24 EQU 64 + 24 ; WRITE_BLOCK
CMD25 EQU 64 + 25 ; WRITE_MULTIPLE_BLOCK
CMD32 EQU 64 + 32 ; ERASE_ER_BLK_START
CMD33 EQU 64 + 33 ; ERASE_ER_BLK_END
CMD38 EQU 64 + 38 ; ERASE
CMD55 EQU 64 + 55 ; APP_CMD
CMD58 EQU 64 + 58 ; READ_OCR
; Card type flags (CardType)
CT_MMC EQU 001H ; MMC ver 3
CT_SD1 EQU 002H ; SD ver 1
CT_SD2 EQU 004H ; SD ver 2
CT_SDC EQU CT_SD1|CT_SD2 ; SD
CT_BLOCK EQU 008H ; Block addressing
CT_MMC EQU 001H ; MMC ver 3
CT_SD1 EQU 002H ; SD ver 1
CT_SD2 EQU 004H ; SD ver 2
CT_SDC EQU CT_SD1|CT_SD2 ; SD
CT_BLOCK EQU 008H ; Block addressing
; Disk types.
DSKTYP_FDC EQU 0 ; Type of disk is a Floppy disk and handled by the FDC controller.
DSKTYP_ROM EQU 1 ; Type of disk is a ROM and handled by the ROM methods.
DSKTYP_SDC EQU 2 ; Type of disk is an SD Card and handled by the SD Card methods.
DSKTYP_FDC EQU 0 ; Type of disk is a Floppy disk and handled by the FDC controller.
DSKTYP_ROM EQU 1 ; Type of disk is a ROM and handled by the ROM methods.
DSKTYP_SDC EQU 2 ; Type of disk is an SD Card and handled by the SD Card methods.
;
; Rom Filing System constants.
;
RFS_DIRENT EQU 256 ; Directory entries in the RFS directory.
RFS_DIRENTSZ EQU 32 ; Size of a directory entry.
RFS_DIRSIZE EQU RFS_DIRENT * RFS_DIRENTSZ ; Total size of the directory.
RFS_BLOCKSZ EQU 65536 ; Size of a file block per directory entry.
RFS_IMGSZ EQU RFS_DIRSIZE + (RFS_DIRENT * RFS_BLOCKSZ) ; Total size of the RFS image.
RFS_DIRENT EQU 256 ; Directory entries in the RFS directory.
RFS_DIRENTSZ EQU 32 ; Size of a directory entry.
RFS_DIRSIZE EQU RFS_DIRENT * RFS_DIRENTSZ ; Total size of the directory.
RFS_BLOCKSZ EQU 65536 ; Size of a file block per directory entry.
RFS_DRIVES EQU 10 ; Number of RFS Drives (Images).
RFS_IMGSZ EQU RFS_DIRSIZE + (RFS_DIRENT * RFS_BLOCKSZ) ; Total size of the RFS image.
RFS_END_ADDR EQU 010000000H ; End of RFS/Start of CP/M.
;
; CPM constants
;
CPM_SD_SEC EQU 32
CPM_SD_TRK EQU 1024
CPM_SD_IMGSZ EQU CPM_SD_TRK * CPM_SD_SEC * SD_SECSIZE
CPM_SD_SEC EQU 32
CPM_SD_TRK EQU 1024
CPM_SD_IMGSZ EQU CPM_SD_TRK * CPM_SD_SEC * SD_SECSIZE
;
; SD Card constants.
;
SD_SECSIZE EQU 512 ; Default size of an SD Sector
SD_SECPTRK EQU CPM_SD_SEC ; Sectors of SD_SECSIZE per virtual track.
SD_TRACKS EQU CPM_SD_TRK ; Number of virtual tracks per disk image.
SD_SECSIZE EQU 512 ; Default size of an SD Sector
SD_SECPTRK EQU CPM_SD_SEC ; Sectors of SD_SECSIZE per virtual track.
SD_TRACKS EQU CPM_SD_TRK ; Number of virtual tracks per disk image.
;-----------------------------------------------
; BIOS WORK AREA (MZ80A)
;-----------------------------------------------
ORG CBIOSDATA
ORG CBIOSDATA
; Keyboard processing, ensure starts where LSB = 0.
VARSTART EQU $ ; Start of variables.
KEYBUF: DS virtual KEYBUFSIZE ; Interrupt driven keyboard buffer.
KEYCOUNT: DS virtual 1
KEYWRITE: DS virtual 2 ; Pointer into the buffer where the next character should be placed.
KEYREAD: DS virtual 2 ; Pointer into the buffer where the next character can be read.
KEYLAST: DS virtual 1 ; KEY LAST VALUE
KEYRPT: DS virtual 1 ; KEY REPEAT COUNTER
USRBANKSAV: DS virtual 1 ; Save user bank number when calling another user bank.
HLSAVE: DS virtual 2 ; Space to save HL register when manipulating stack.
ROMCTL DS virtual 1 ; Rom Paging control register contents.
; Keyboard processing, ensure starts where LSB = 0.
VARSTART EQU $ ; Start of variables.
KEYBUF: DS virtual KEYBUFSIZE ; Interrupt driven keyboard buffer.
KEYCOUNT: DS virtual 1
KEYWRITE: DS virtual 2 ; Pointer into the buffer where the next character should be placed.
KEYREAD: DS virtual 2 ; Pointer into the buffer where the next character can be read.
KEYLAST: DS virtual 1 ; KEY LAST VALUE
KEYRPT: DS virtual 1 ; KEY REPEAT COUNTER
USRBANKSAV: DS virtual 1 ; Save user bank number when calling another user bank.
HLSAVE: DS virtual 2 ; Space to save HL register when manipulating stack.
ROMCTL DS virtual 1 ; Rom Paging control register contents.
;
SPV:
IBUFE: ; TAPE BUFFER (128 BYTES)
ATRB: DS virtual 1 ; ATTRIBUTE
NAME: DS virtual 17 ; FILE NAME
SIZE: DS virtual 2 ; BYTESIZE
DTADR: DS virtual 2 ; DATA ADDRESS
EXADR: DS virtual 2 ; EXECUTION ADDRESS
COMNT: DS virtual 92 ; Comment / code area of CMT header.
SWPW: DS virtual 10 ; SWEEP WORK
KDATW: DS virtual 2 ; KEY WORK
KANAF: DS virtual 1 ; KANA FLAG (01=GRAPHIC MODE)
DSPXY: DS virtual 2 ; DISPLAY COORDINATES
;DSPXYLST: DS virtual 2 ; Last known cursor position, to compare with DSPXY to detect changes.
MANG: DS virtual 6 ; COLUMN MANAGEMENT
MANGE: DS virtual 1 ; COLUMN MANAGEMENT END
PBIAS: DS virtual 1 ; PAGE BIAS
ROLTOP: DS virtual 1 ; ROLL TOP BIAS
MGPNT: DS virtual 1 ; COLUMN MANAG. POINTER
PAGETP: DS virtual 2 ; PAGE TOP
ROLEND: DS virtual 1 ; ROLL END
DS virtual 14 ; BIAS
FLASH: DS virtual 1 ; FLASHING DATA
SFTLK: DS virtual 1 ; SHIFT LOCK
REVFLG: DS virtual 1 ; REVERSE FLAG
FLSDT: DS virtual 1 ; CURSOR DATA
STRGF: DS virtual 1 ; STRING FLAG
DPRNT: DS virtual 1 ; TAB COUNTER
FLASHCTL: DS virtual 1 ; CURSOR FLASH CONTROL. BIT 0 = Cursor On/Off, BIT 1 = Cursor displayed.
DSPXYADDR: DS virtual 2 ; Address of last known position.
;AMPM: DS virtual 1 ; AMPM DATA
;TIMFG: DS virtual 1 ; TIME FLAG
SWRK: DS virtual 1 ; KEY SOUND FLAG
TEMPW: DS virtual 1 ; TEMPO WORK
ONTYO: DS virtual 1 ; ONTYO WORK
OCTV: DS virtual 1 ; OCTAVE WORK
RATIO: DS virtual 2 ; ONPU RATIO
;BUFER: DS virtual 81 ; GET LINE BUFFER
;KEYBUF: DS virtual 1 ; KEY BUFFER
DRVAVAIL DS virtual 1 ; Flag to indicate which drive controllers are available. Bit 2 = SD, Bit 1 = ROM, Bit 0 = FDC
TIMESEC DS virtual 6 ; RTC 48bit TIME IN MILLISECONDS
FDCCMD DS virtual 1 ; LAST FDC COMMAND SENT TO CONTROLLER.
MOTON DS virtual 1 ; MOTOR ON = 1, OFF = 0
INVFDCDATA: DS virtual 1 ; INVERT DATA COMING FROM FDC, 1 = INVERT, 0 = AS IS
TRK0FD1 DS virtual 1 ; FD 1 IS AT TRACK 0 = BIT 0 set
TRK0FD2 DS virtual 1 ; FD 2 IS AT TRACK 0 = BIT 0 set
TRK0FD3 DS virtual 1 ; FD 3 IS AT TRACK 0 = BIT 0 set
TRK0FD4 DS virtual 1 ; FD 4 IS AT TRACK 0 = BIT 0 set
RETRIES DS virtual 2 ; DATA READ RETRIES
TMPADR DS virtual 2 ; TEMPORARY ADDRESS STORAGE
TMPSIZE DS virtual 2 ; TEMPORARY SIZE
TMPCNT DS virtual 2 ; TEMPORARY COUNTER
ATRB: DS virtual 1 ; ATTRIBUTE
NAME: DS virtual 17 ; FILE NAME
SIZE: DS virtual 2 ; BYTESIZE
DTADR: DS virtual 2 ; DATA ADDRESS
EXADR: DS virtual 2 ; EXECUTION ADDRESS
COMNT: DS virtual 92 ; Comment / code area of CMT header.
SWPW: DS virtual 10 ; SWEEP WORK
KDATW: DS virtual 2 ; KEY WORK
KANAF: DS virtual 1 ; KANA FLAG (01=GRAPHIC MODE)
DSPXY: DS virtual 2 ; DISPLAY COORDINATES
;DSPXYLST: DS virtual 2 ; Last known cursor position, to compare with DSPXY to detect changes.
MANG: DS virtual 6 ; COLUMN MANAGEMENT
MANGE: DS virtual 1 ; COLUMN MANAGEMENT END
PBIAS: DS virtual 1 ; PAGE BIAS
ROLTOP: DS virtual 1 ; ROLL TOP BIAS
MGPNT: DS virtual 1 ; COLUMN MANAG. POINTER
PAGETP: DS virtual 2 ; PAGE TOP
ROLEND: DS virtual 1 ; ROLL END
DS virtual 14 ; BIAS
FLASH: DS virtual 1 ; FLASHING DATA
SFTLK: DS virtual 1 ; SHIFT LOCK
REVFLG: DS virtual 1 ; REVERSE FLAG
FLSDT: DS virtual 1 ; CURSOR DATA
STRGF: DS virtual 1 ; STRING FLAG
DPRNT: DS virtual 1 ; TAB COUNTER
FLASHCTL: DS virtual 1 ; CURSOR FLASH CONTROL. BIT 0 = Cursor On/Off, BIT 1 = Cursor displayed.
DSPXYADDR: DS virtual 2 ; Address of last known position.
;AMPM: DS virtual 1 ; AMPM DATA
;TIMFG: DS virtual 1 ; TIME FLAG
SWRK: DS virtual 1 ; KEY SOUND FLAG
TEMPW: DS virtual 1 ; TEMPO WORK
ONTYO: DS virtual 1 ; ONTYO WORK
OCTV: DS virtual 1 ; OCTAVE WORK
RATIO: DS virtual 2 ; ONPU RATIO
;BUFER: DS virtual 81 ; GET LINE BUFFER
;KEYBUF: DS virtual 1 ; KEY BUFFER
DRVAVAIL DS virtual 1 ; Flag to indicate which drive controllers are available. Bit 2 = SD, Bit 1 = ROM, Bit 0 = FDC
TIMESEC DS virtual 6 ; RTC 48bit TIME IN MILLISECONDS
FDCCMD DS virtual 1 ; LAST FDC COMMAND SENT TO CONTROLLER.
MOTON DS virtual 1 ; MOTOR ON = 1, OFF = 0
INVFDCDATA: DS virtual 1 ; INVERT DATA COMING FROM FDC, 1 = INVERT, 0 = AS IS
TRK0FD1 DS virtual 1 ; FD 1 IS AT TRACK 0 = BIT 0 set
TRK0FD2 DS virtual 1 ; FD 2 IS AT TRACK 0 = BIT 0 set
TRK0FD3 DS virtual 1 ; FD 3 IS AT TRACK 0 = BIT 0 set
TRK0FD4 DS virtual 1 ; FD 4 IS AT TRACK 0 = BIT 0 set
RETRIES DS virtual 2 ; DATA READ RETRIES
TMPADR DS virtual 2 ; TEMPORARY ADDRESS STORAGE
TMPSIZE DS virtual 2 ; TEMPORARY SIZE
TMPCNT DS virtual 2 ; TEMPORARY COUNTER
;
CPMROMLOC: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Image.
CPMROMDRV0: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Rom Drive Image Disk 0.
CPMROMDRV1: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Rom Drive Image Disk 1.
NDISKS: DS virtual 1 ; Dynamically calculated number of disks on boot.
DISKMAP: DS virtual MAXDISKS ; Disk map of CPM logical to physical controller disk.
FDCDISK: DS virtual 1 ; Physical disk number.
SECPERTRK: DS virtual 1 ; Sectors per track for 1 head.
SECPERHEAD: DS virtual 1 ; Sectors per head.
SECTORCNT: DS virtual 1 ; Sector size as a count of how many sectors make 512 bytes.
DISKTYPE: DS virtual 1 ; Disk type of current selection.
MTROFFTIMER:DS virtual 1 ; Second down counter for FDC motor off.
CPMROMLOC: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Image.
CPMROMDRV0: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Rom Drive Image Disk 0.
CPMROMDRV1: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Rom Drive Image Disk 1.
NDISKS: DS virtual 1 ; Dynamically calculated number of disks on boot.
DISKMAP: DS virtual MAXDISKS ; Disk map of CPM logical to physical controller disk.
FDCDISK: DS virtual 1 ; Physical disk number.
SECPERTRK: DS virtual 1 ; Sectors per track for 1 head.
SECPERHEAD: DS virtual 1 ; Sectors per head.
SECTORCNT: DS virtual 1 ; Sector size as a count of how many sectors make 512 bytes.
DISKTYPE: DS virtual 1 ; Disk type of current selection.
MTROFFTIMER: DS virtual 1 ; Second down counter for FDC motor off.
;
SEKDSK: DS virtual 1 ; Seek disk number
SEKTRK: DS virtual 2 ; Seek disk track
SEKSEC: DS virtual 1 ; Seek sector number
SEKHST: DS virtual 1 ; Seek sector host
SEKDSK: DS virtual 1 ; Seek disk number
SEKTRK: DS virtual 2 ; Seek disk track
SEKSEC: DS virtual 1 ; Seek sector number
SEKHST: DS virtual 1 ; Seek sector host
;
HSTDSK: DS virtual 1 ; Host disk number
HSTTRK: DS virtual 2 ; Host track number
HSTSEC: DS virtual 1 ; Host sector number
HSTWRT: DS virtual 1 ; Host write flag
HSTACT: DS virtual 1 ;
HSTDSK: DS virtual 1 ; Host disk number
HSTTRK: DS virtual 2 ; Host track number
HSTSEC: DS virtual 1 ; Host sector number
HSTWRT: DS virtual 1 ; Host write flag
HSTACT: DS virtual 1 ;
;
UNACNT: DS virtual 1 ; Unalloc rec cnt
UNADSK: DS virtual 1 ; Last unalloc disk
UNATRK: DS virtual 2 ; Last unalloc track
UNASEC: DS virtual 1 ; Last unalloc sector
UNACNT: DS virtual 1 ; Unalloc rec cnt
UNADSK: DS virtual 1 ; Last unalloc disk
UNATRK: DS virtual 2 ; Last unalloc track
UNASEC: DS virtual 1 ; Last unalloc sector
;
ERFLAG: DS virtual 1 ; Error number, 0 = no error.
READOP: DS virtual 1 ; If read operation then 1, else 0 for write.
RSFLAG: DS virtual 1 ; Read sector flag.
WRTYPE: DS virtual 1 ; Write operation type.
TRACKNO: DS virtual 2 ; Host controller track number
SECTORNO: DS virtual 1 ; Host controller sector number
DMAADDR: DS virtual 2 ; Last DMA address
HSTBUF: DS virtual 512 ; Host buffer for disk sector storage
ERFLAG: DS virtual 1 ; Error number, 0 = no error.
READOP: DS virtual 1 ; If read operation then 1, else 0 for write.
RSFLAG: DS virtual 1 ; Read sector flag.
WRTYPE: DS virtual 1 ; Write operation type.
TRACKNO: DS virtual 2 ; Host controller track number
SECTORNO: DS virtual 1 ; Host controller sector number
DMAADDR: DS virtual 2 ; Last DMA address
HSTBUF: DS virtual 512 ; Host buffer for disk sector storage
HSTBUFE:
SDVER: DS virtual 1 ; SD Card version.
SDCAP: DS virtual 1 ; SD Card capabilities..
SDSTARTSEC DS virtual 4 ; Starting sector of data to read/write from/to SD card.
SDBUF: DS virtual 11 ; SD Card command fram buffer for the command and response storage.
SDVER: DS virtual 1 ; SD Card version.
SDCAP: DS virtual 1 ; SD Card capabilities..
SDSTARTSEC DS virtual 4 ; Starting sector of data to read/write from/to SD card.
SDBUF: DS virtual 11 ; SD Card command fram buffer for the command and response storage.
CURSORPSAV DS virtual 2 ; Cursor save position;default 0,0
HAVELOADED DS virtual 1 ; To show that a value has been put in for Ansi emualtor.
ANSIFIRST DS virtual 1 ; Holds first character of Ansi sequence
NUMBERBUF DS virtual 20 ; Buffer for numbers in Ansi
NUMBERPOS DS virtual 2 ; Address within buffer
CHARACTERNO DS virtual 1 ; Byte within Ansi sequence. 0=first,255=other
CURSORCOUNT DS virtual 1 ; 1/50ths of a second since last change
FONTSET DS virtual 1 ; Ansi font setup.
JSW_FF DS virtual 1 ; Byte value to turn on/off FF routine
JSW_LF DS virtual 1 ; Byte value to turn on/off LF routine
CHARACTER DS virtual 1 ; To buffer character to be printed.
CURSORPOS DS virtual 2 ; Cursor position, default 0,0.
BOLDMODE DS virtual 1
HIBRITEMODE DS virtual 1 ; 0 means on, &C9 means off
UNDERSCMODE DS virtual 1
ITALICMODE DS virtual 1
INVMODE DS virtual 1
CHGCURSMODE DS virtual 1
ANSIMODE DS virtual 1 ; 1 = on, 0 = off
COLOUR EQU 0
CURSORPSAV DS virtual 2 ; Cursor save position;default 0,0
HAVELOADED DS virtual 1 ; To show that a value has been put in for Ansi emualtor.
ANSIFIRST DS virtual 1 ; Holds first character of Ansi sequence
NUMBERBUF DS virtual 20 ; Buffer for numbers in Ansi
NUMBERPOS DS virtual 2 ; Address within buffer
CHARACTERNO DS virtual 1 ; Byte within Ansi sequence. 0=first,255=other
CURSORCOUNT DS virtual 1 ; 1/50ths of a second since last change
FONTSET DS virtual 1 ; Ansi font setup.
JSW_FF DS virtual 1 ; Byte value to turn on/off FF routine
JSW_LF DS virtual 1 ; Byte value to turn on/off LF routine
CHARACTER DS virtual 1 ; To buffer character to be printed.
CURSORPOS DS virtual 2 ; Cursor position, default 0,0.
BOLDMODE DS virtual 1
HIBRITEMODE DS virtual 1 ; 0 means on, &C9 means off
UNDERSCMODE DS virtual 1
ITALICMODE DS virtual 1
INVMODE DS virtual 1
CHGCURSMODE DS virtual 1
ANSIMODE DS virtual 1 ; 1 = on, 0 = off
COLOUR EQU 0
SPSAVE: DS virtual 2 ; CPM Stack save.
SPISRSAVE: DS virtual 2
; Stack space for the CBIOS.
MSGSTRBUF: DS virtual 128 ; Lower end of the stack space is for interbank message printing, ie.space for a string to print.
BIOSSTACK EQU $
; Stack space for the Interrupt Service Routine.
DS virtual 16 ; Max 8 stack pushes.
ISRSTACK EQU $
SPSAVE: DS virtual 2 ; CPM Stack save.
SPISRSAVE: DS virtual 2
; Stack space for the CBIOS.
MSGSTRBUF: DS virtual 128 ; Lower end of the stack space is for interbank message printing, ie.space for a string to print.
BIOSSTACK EQU $
; Stack space for the Interrupt Service Routine.
DS virtual 16 ; Max 8 stack pushes.
ISRSTACK EQU $
DBGSTACKP: DS virtual 2
DS virtual 64
DBGSTACK: EQU $
DBGSTACKP: DS virtual 2
DS virtual 64
DBGSTACK: EQU $
VAREND EQU $ ; End of variables
VAREND EQU $ ; End of variables

View File

@@ -7,15 +7,17 @@
;- Definitions for the RFS including SA1510 locations.
;-
;- Credits:
;- Copyright: (c) 2019-20 Philip Smart <philip.smart@net2net.org>
;- Copyright: (c) 2019-21 Philip Smart <philip.smart@net2net.org>
;-
;- History: Sep 2019 - Initial version.
; May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
; additional and different hardware. The SPI is now onboard the PCB and
; not using the printer interface card.
; July 2020 - Updated for the v2.1 hardware. RFS can run with a tranZPUter board with
; or without the K64 I/O processor. RFS wont use the K64 processor all
; operations are done by the Z80 under RFS.
;- May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the
;- additional and different hardware. The SPI is now onboard the PCB and
;- not using the printer interface card.
;- July 2020 - Updated for the tranZPUter v2.1 hardware. RFS can run with a tranZPUter
;- board with or without the K64 I/O processor. RFS wont use the K64
;- processor all operations are done by the Z80 under RFS.
;- March 2021- Updates to accommodate the RFS v2.1 board along with back porting TZFS
;- developments.
;-
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
@@ -47,6 +49,73 @@ UROMBSTBL EQU UROMADDR + 020H ; Entry
RFSJMPTABLE EQU UROMADDR + 00080H ; Start of jump table.
FDCROMADDR EQU 0F000H
;-----------------------------------------------
; Common character definitions.
;-----------------------------------------------
SCROLL EQU 001H ;Set scroll direction UP.
BELL EQU 007H
SPACE EQU 020H
TAB EQU 009H ;TAB ACROSS (8 SPACES FOR SD-BOARD)
CR EQU 00DH
LF EQU 00AH
FF EQU 00CH
CS EQU 0CH ; Clear screen
DELETE EQU 07FH
BACKS EQU 008H
SOH EQU 1 ; For XModem etc.
EOT EQU 4
ACK EQU 6
NAK EQU 015H
NUL EQU 000H
NULL EQU 000H
CTRL_A EQU 001H
CTRL_B EQU 002H
CTRL_C EQU 003H
CTRL_D EQU 004H
CTRL_E EQU 005H
CTRL_F EQU 006H
CTRL_G EQU 007H
CTRL_H EQU 008H
CTRL_I EQU 009H
CTRL_J EQU 00AH
CTRL_K EQU 00BH
CTRL_L EQU 00CH
CTRL_M EQU 00DH
CTRL_N EQU 00EH
CTRL_O EQU 00FH
CTRL_P EQU 010H
CTRL_Q EQU 011H
CTRL_R EQU 012H
CTRL_S EQU 013H
CTRL_T EQU 014H
CTRL_U EQU 015H
CTRL_V EQU 016H
CTRL_W EQU 017H
CTRL_X EQU 018H
CTRL_Y EQU 019H
CTRL_Z EQU 01AH
ESC EQU 01BH
CTRL_SLASH EQU 01CH
CTRL_LB EQU 01BH
CTRL_RB EQU 01DH
CTRL_CAPPA EQU 01EH
CTRL_UNDSCR EQU 01FH
CTRL_AT EQU 000H
NOKEY EQU 0F0H
CURSRIGHT EQU 0F1H
CURSLEFT EQU 0F2H
CURSUP EQU 0F3H
CURSDOWN EQU 0F4H
DBLZERO EQU 0F5H
INSERT EQU 0F6H
CLRKEY EQU 0F7H
HOMEKEY EQU 0F8H
BREAKKEY EQU 0FBH
GRAPHKEY EQU 0FCH
ALPHAKEY EQU 0FDH
;-------------------------------------------------------
; Function entry points in the standard SA-1510 Monitor.
;-------------------------------------------------------
@@ -93,7 +162,7 @@ WTAPE: EQU 00485H
MSTOP: EQU 00700H
; Debugging
ENADEBUG EQU 0 ; Enable debugging logic, 1 = enable, 0 = disable
ENADEBUG EQU 1 ; Enable debugging logic, 1 = enable, 0 = disable
;-----------------------------------------------
; Memory mapped ports in hardware.
@@ -168,15 +237,33 @@ SETXMHZ EQU 062H ; Selec
SET2MHZ EQU 064H ; Select the system 2MHz clock frequency.
CLKSELRD EQU 066H ; Read clock selected setting, 0 = 2MHz, 1 = XMHz
SVCREQ EQU 068H ; I/O Processor service request.
CPUCFG EQU 06CH ; Version 2.2 CPU configuration register.
CPUSTATUS EQU 06CH ; Version 2.2 CPU runtime status register.
CPUINFO EQU 06DH ; Version 2.2 CPU information register.
CPLDCFG EQU 06EH ; Version 2.1 CPLD configuration register.
CPLDSTATUS EQU 06EH ; Version 2.1 CPLD status register.
CPLDINFO EQU 06FH ; Version 2.1 CPLD version information register.
MMIO0 EQU 0E0H ; MZ-700/MZ-800 Memory Management Set 0
MMIO1 EQU 0E1H ; MZ-700/MZ-800 Memory Management Set 1
MMIO2 EQU 0E2H ; MZ-700/MZ-800 Memory Management Set 2
MMIO3 EQU 0E3H ; MZ-700/MZ-800 Memory Management Set 3
MMIO4 EQU 0E4H ; MZ-700/MZ-800 Memory Management Set 4
MMIO5 EQU 0E5H ; MZ-700/MZ-800 Memory Management Set 5
MMIO6 EQU 0E6H ; MZ-700/MZ-800 Memory Management Set 6
MMIO7 EQU 0E7H ; MZ-700/MZ-800 Memory Management Set 7
;-----------------------------------------------
; CPLD Configuration constants.
;-----------------------------------------------
SET_MODE_MZ80A EQU 1 ; Set to original unmodified hardware.
SET_MODE_MZ700 EQU 2 ; Map keyboard and memory mode settings to MZ700 mode.
MODE_MZ80K EQU 0 ; Set to MZ-80K mode.
MODE_MZ80C EQU 1 ; Set to MZ-80C mode.
MODE_MZ1200 EQU 2 ; Set to MZ-1200 mode.
MODE_MZ80A EQU 3 ; Set to MZ-80A mode (base mode on MZ-80A hardware).
MODE_MZ700 EQU 4 ; Set to MZ-700 mode (base mode on MZ-700 hardware).
MODE_MZ800 EQU 5 ; Set to MZ-800 mode.
MODE_MZ80B EQU 6 ; Set to MZ-80B mode.
MODE_MZ2000 EQU 7 ; Set to MZ-2000 mode.
MODE_VIDEO_FPGA EQU 8 ; Bit flag (bit 3) to switch CPLD into using the new FPGA video hardware.
;-----------------------------------------------
; tranZPUter SW Memory Management modes
@@ -192,11 +279,16 @@ TZMM_CPM EQU 006H + TZMM_ENIOWAIT ; CPM m
TZMM_CPM2 EQU 007H + TZMM_ENIOWAIT ; CPM main memory configuration, F000-FFFF are on the tranZPUter board in block 4, 0040-CFFF and E800-EFFF are in block 5, mainboard for D000-DFFF (video), E000-E800 (Memory control) selected.
; Special case for 0000:003F (interrupt vectors) which resides in block 4, F3C0:F3FF & F7C0:F7FF (floppy disk paging vectors) which resides on the mainboard.
TZMM_COMPAT EQU 008H + TZMM_ENIOWAIT ; Original mode but with main DRAM in Bank 0 to allow bootstrapping of programs from other machines such as the MZ700.
TZMM_HOSTACCESS EQU 009H + TZMM_ENIOWAIT ; Mode to allow code running in Bank 0, address E800:FFFF to access host memory. Monitor ROM 0000-0FFF and Main DRAM 0x1000-0xD000, video and memory mapped I/O are on the host machine, User/Floppy ROM E800-FFFF are in tranZPUter memory.
TZMM_MZ700_0 EQU 00AH + TZMM_ENIOWAIT ; MZ700 Mode - 0000:0FFF is on the tranZPUter board in block 6, 1000:CFFF is on the tranZPUter board in block 0, D000:FFFF is on the mainboard.
TZMM_MZ700_1 EQU 00BH + TZMM_ENIOWAIT ; MZ700 Mode - 0000:0FFF is on the tranZPUter board in block 0, 1000:CFFF is on the tranZPUter board in block 0, D000:FFFF is on the tranZPUter in block 6.
TZMM_MZ700_2 EQU 00CH + TZMM_ENIOWAIT ; MZ700 Mode - 0000:0FFF is on the tranZPUter board in block 6, 1000:CFFF is on the tranZPUter board in block 0, D000:FFFF is on the tranZPUter in block 6.
TZMM_MZ700_3 EQU 00DH + TZMM_ENIOWAIT ; MZ700 Mode - 0000:0FFF is on the tranZPUter board in block 0, 1000:CFFF is on the tranZPUter board in block 0, D000:FFFF is inaccessible.
TZMM_MZ700_4 EQU 00EH + TZMM_ENIOWAIT ; MZ700 Mode - 0000:0FFF is on the tranZPUter board in block 6, 1000:CFFF is on the tranZPUter board in block 0, D000:FFFF is inaccessible.
TZMM_MZ800 EQU 00FH + TZMM_ENIOWAIT ; MZ800 Mode - Tracks original hardware mode offering MZ700/MZ800 configurations.
TZMM_FPGA EQU 015H + TZMM_ENIOWAIT ; Open up access for the K64F to the FPGA resources such as memory. All other access to RAM or mainboard is blocked.
TZMM_TZPUM EQU 016H + TZMM_ENIOWAIT ; Everything in on mainboard, no access to tranZPUter memory.
TZMM_TZPU EQU 017H + TZMM_ENIOWAIT ; Everything is in tranZPUter domain, no access to underlying Sharp mainboard unless memory management mode is switched. tranZPUter RAM 64K block 0 is selected.
TZMM_TZPU0 EQU 018H + TZMM_ENIOWAIT ; Everything is in tranZPUter domain, no access to underlying Sharp mainboard unless memory management mode is switched. tranZPUter RAM 64K block 0 is selected.
TZMM_TZPU1 EQU 019H + TZMM_ENIOWAIT ; Everything is in tranZPUter domain, no access to underlying Sharp mainboard unless memory management mode is switched. tranZPUter RAM 64K block 1 is selected.
TZMM_TZPU2 EQU 01AH + TZMM_ENIOWAIT ; Everything is in tranZPUter domain, no access to underlying Sharp mainboard unless memory management mode is switched. tranZPUter RAM 64K block 2 is selected.
@@ -259,69 +351,6 @@ ROMBANK9 EQU 9 ;
ROMBANK10 EQU 10 ; : CBIOS Bank 3 - SD Card
ROMBANK11 EQU 11 ; : CBIOS Bank 4 - Floppy disk controller.
OBJCD EQU 001h
;-----------------------------------------------
; Common character definitions.
;-----------------------------------------------
SCROLL EQU 001H ; Set scrool direction UP.
BELL EQU 007H
SPACE EQU 020H
TAB EQU 009H ; TAB ACROSS (8 SPACES FOR SD-BOARD)
CR EQU 00DH
LF EQU 00AH
FF EQU 00CH
ESC EQU 01BH
DELETE EQU 07FH
BACKS EQU 008H
SOH EQU 1 ; For XModem etc.
EOT EQU 4
ACK EQU 6
NAK EQU 15H
NUL EQU 00H
NULL EQU 000H
CTRL_A EQU 001H
CTRL_B EQU 002H
CTRL_C EQU 003H
CTRL_D EQU 004H
CTRL_E EQU 005H
CTRL_F EQU 006H
CTRL_G EQU 007H
CTRL_H EQU 008H
CTRL_I EQU 009H
CTRL_J EQU 00AH
CTRL_K EQU 00BH
CTRL_L EQU 00CH
CTRL_M EQU 00DH
CTRL_N EQU 00EH
CTRL_O EQU 00FH
CTRL_P EQU 010H
CTRL_Q EQU 011H
CTRL_R EQU 012H
CTRL_S EQU 013H
CTRL_T EQU 014H
CTRL_U EQU 015H
CTRL_V EQU 016H
CTRL_W EQU 017H
CTRL_X EQU 018H
CTRL_Y EQU 019H
CTRL_Z EQU 01AH
CTRL_SLASH EQU 01CH
CTRL_RB EQU 01DH
CTRL_CAPPA EQU 01EH
CTRL_UNDSCR EQU 01FH
CTRL_AT EQU 000H
NOKEY EQU 0F0H
CURSRIGHT EQU 0F1H
CURSLEFT EQU 0F2H
CURSUP EQU 0F3H
CURSDOWN EQU 0F4H
DBLZERO EQU 0F5H
INSERT EQU 0F6H
CLRKEY EQU 0F7H
HOMEKEY EQU 0F8H
BREAKKEY EQU 0FBH
; MMC/SD command (SPI mode)
CMD0 EQU 64 + 0 ; GO_IDLE_STATE
@@ -387,6 +416,18 @@ SDDIR_DIRSIZE EQU SDDIR_DIRENT * SDDIR_DIRENTSZ ; Total
SDDIR_BLOCKSZ EQU 65536 ; Size of a file block per directory entry.
SDDIR_IMGSZ EQU SDDIR_DIRSIZE + (SDDIR_DIRENT * SDDIR_BLOCKSZ) ; Total size of the RFS image.
OBJCD EQU 001H ; MZF contains a binary object.
BTX1CD EQU 002H ; MZF contains a BASIC program.
BTX2CD EQU 005H ; MZF contains a BASIC program.
TZOBJCD0 EQU 0F8H ; MZF contains a TZFS binary object for page 0.
TZOBJCD1 EQU 0F8H
TZOBJCD2 EQU 0F8H
TZOBJCD3 EQU 0F8H
TZOBJCD4 EQU 0F8H
TZOBJCD5 EQU 0F8H
TZOBJCD6 EQU 0F8H
TZOBJCD7 EQU 0F8H ; MZF contains a TZFS binary object for page 7.
;-----------------------------------------------
; SA-1510 MONITOR WORK AREA (MZ80A)
;-----------------------------------------------
@@ -447,7 +488,9 @@ TMPLINECNT: EQU 01022H ; Tempo
TMPSTACKP: EQU 01024H ; Temporary stack pointer save.
SDVER: EQU 01026H
SDCAP: EQU 01027H
TZPU: EQU 01028H ; Tranzputer present flag (0 = not present, > 0 = present and version number).
SDDRIVENO EQU 01028H ; RFS SDCFS Active Drive Number
CMTFILENO EQU 01029H ; Next Sequential file number to read when file request given without name.
TZPU: EQU 0102AH ; Tranzputer present flag (0 = not present, > 0 = present and version number).
; Variables sharing the BUFER buffer, normally the BUFER is only used to get keyboard input and so long as data in BUFER is processed
; before calling the CMT/SD commands and not inbetween there shouldnt be any issue. Also the space used is at the top end of the buffer which is not used so often.
; This frees up memory needed by the CMT and SD card.

View File

@@ -129,7 +129,14 @@ BKSWRET0: POP AF ; Get b
; Enhanced function Jump table.
; This table is generally used by the monitor ROM to call functions within the User ROM.
;------------------------------------------------------------------------------------------
PRTMZF: JP _PRTMZF
PRTMZF: JP _PRTMZF ; UROMADDR+80H - Print out an MZF header stored in the IBUFE location.
PRTDBG: JP _PRTDBG ; UROMADDR+83H - Print out debug information, if enabled.
CMT_RDINF: JP _CMT_RDINF ; UROMADDR+86H - Tape/SD intercept handler - Read Header
CMT_RDDATA: JP _CMT_RDDATA ; UROMADDR+89H - Tape/SD intercept handler - Read Data
CMT_WRINF: JP _CMT_WRINF ; UROMADDR+80H - Tape/SD intercept handler - Write Header
CMT_WRDATA: JP _CMT_WRDATA ; UROMADDR+8FH - Tape/SD intercept handler - Write Data
CMT_VERIFY: JP _CMT_VERIFY ; UROMADDR+92H - Tape/SD intercept handler - Verify Data
CMT_DIR: JP _CMT_DIR ; UROMADDR+95H - SD card directory listing command.
;-----------------------------------------
@@ -171,6 +178,10 @@ MONITOR: IN A,(CPLDINFO) ; See i
XOR A
CHKTZ1: AND 00FH
LD (TZPU), A ; Flag = 0 if no tranZPUter present otherwise contains version (1 - 15).
LD HL,DSPCTL ; Setup address of display control register latch.
;
XOR A ; Set the initial SDCFS active drive number.
LD (SDDRIVENO),A
;
LD A, (ROMBK1)
CP 1
@@ -179,13 +190,14 @@ CHKTZ1: AND 00FH
JR NZ, SIGNON
;
SET40CHAR: LD A, 0 ; Using MROM in Bank 0 = 40 char mode.
LD (DSPCTL), A
LD A, 0
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
LD (SCRNMODE), A
LD (SPAGE), A ; Allow MZ80A scrolling
JR SIGNON
SET80CHAR: LD A, 128 ; Using MROM in Bank 1 = 80 char mode.
LD (DSPCTL), A
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
LD A, 1
LD (SCRNMODE), A
LD A, 0FFH
@@ -221,6 +233,21 @@ ST1X: CALL NL ; Comma
LD DE,BUFER
CALL GETL
;
LD A,(BUFER+1) ; Drive change number 0..9. Each number represents an RFS SDCFS Drive number.
CP '0'
JR C,CMDCMP
CP ':'
JR NC,CMDCMP
SUB '0'
LD D,A
LD A,(BUFER+2)
CP CR ; If a CR is present then we match, a drive selection number was entered.
LD A,D
JR NZ,CMDCMP
; Simple command, just update the active drive number.
LD (SDDRIVENO),A
JR ST1X
;
CMDCMP: LD HL,CMDTABLE
CMDCMP0: LD DE,BUFER+1 ; First command byte after the * prompt.
LD A,(HL)
@@ -228,12 +255,14 @@ CMDCMP0: LD DE,BUFER+1 ; First
JR Z,ST1X ; Skip processing on lines where just CR pressed.
BIT 7,A ; Bit 7 set on command properties indicates table end, exit if needed.
JR NZ,CMDNOCMP
LD C,A ; Command properties into C
SET 6,C ; Assume command match.
AND 007H ; Mask out bytes in command mask.
LD B,A ; Number of bytes in command.
INC HL
CMDCMP1: LD A,(DE) ; Compare all bytes and reset match bit if we find a difference.
CP (HL)
JR Z, CMDCMP2
RES 6,C ; No command match.
@@ -287,11 +316,11 @@ CMDCMPEND: JP ST1X
;
; 7 6 5:3 2:0
; END MATCH BANK SIZE
CMDTABLE: DB 000H | 000H | 000H | 001H ; Bit 2:0 = Command Size, 5:3 = Bank, 6 = Command match, 7 = Command table end.
DB '4' ; 40 Char screen mode.
CMDTABLE: DB 000H | 000H | 000H | 002H ; Bit 2:0 = Command Size, 5:3 = Bank, 6 = Command match, 7 = Command table end.
DB "40" ; 40 Char screen mode.
DW SETMODE40
DB 000H | 000H | 000H | 001H
DB '8' ; 80 Char screen mode.
DB 000H | 000H | 000H | 002H
DB "80" ; 80 Char screen mode.
DW SETMODE80
DB 000H | 000H | 000H | 004H
DB "7008" ; Switch to 80 column MZ700 mode.
@@ -438,15 +467,19 @@ HIROM: LD A, (MEMSW) ; Swap
SETMODE40: LD A, ROMBANK0 ; Switch to 40Char monitor.
LD (ROMBK1),A
LD (BNKSELMROM),A
LD HL,DSPCTL ; Setup address of display control register latch.
LD A, 0
LD (DSPCTL), A
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
JP MONIT
SETMODE80: LD A, ROMBANK1 ; Switch to 80char monitor.
LD (ROMBK1),A
LD (BNKSELMROM),A
LD HL,DSPCTL ; Setup address of display control register latch.
LD A, 128
LD (DSPCTL), A
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
JP MONIT
NOTZPU: LD DE,MSGNOTZINST ; No tranZPUter installed.
@@ -475,13 +508,15 @@ SETCLR_1: LD (DE),A
SETMODE7008:LD A,(TZPU) ; Check there is a tranZPUter card installed.
OR A
JR Z,NOTZPU
LD HL,DSPCTL ; Setup address of display control register latch.
LD A, 128 ; Setup for 80char display.
LD (DSPCTL), A
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
CALL SETMODECLR ; Set memory mode and clear variable area.
LD A,ROMBANK5 ; Select the 80 column version of the 1Z-013A ROM.
SETMODE_2: LD (ROMBK1),A
LD (BNKSELMROM),A
LD A,SET_MODE_MZ700 ; Set the CPLD compatibility mode.
LD A,MODE_MZ700 ; Set the CPLD compatibility mode.
SETMODE_3: OUT (CPLDCFG),A
JP MONIT ; Cold start the monitor.
@@ -490,8 +525,10 @@ SETMODE_3: OUT (CPLDCFG),A
SETMODE700: LD A,(TZPU) ; Check there is a tranZPUter card installed.
OR A
JR Z,NOTZPU
LD HL,DSPCTL ; Setup address of display control register latch.
LD A, 0 ; Setup for 40char display.
LD (DSPCTL), A
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
CALL SETMODECLR ; Set memory mode and clear variable area.
LD A,ROMBANK4 ; Select the 40 column version of the 1Z-013A ROM.
JR SETMODE_2
@@ -509,7 +546,7 @@ ISMZF: PUSH BC
PUSH HL
;
LD A,(HL)
CP 001h ; Only interested in machine code images.
CP OBJCD ; Only interested in machine code images.
JR NZ, ISMZFNOT
;
INC HL
@@ -517,21 +554,19 @@ ISMZF: PUSH BC
LD B,FNSIZE ; Maximum of 17 characters, including terminator in filename.
ISMZFNXT: LD A,(HL)
LD (DE),A
CP 00Dh ; If we find a terminator then this indicates potentially a valid name.
JR Z, ISMZFVFY
CP 020h ; >= Space
CP 00DH ; If we find a terminator then this indicates potentially a valid name.
JR Z, ISMZFNXT3
CP 000H ; Same applies for NULL terminator.
JR Z, ISMZFNXT3
CP 020H ; >= Space
JR C, ISMZFNOT
CP 05Dh ; =< ]
CP 05DH ; =< ]
JR C, ISMZFNXT3
ISMZFNXT2: CP 091h
ISMZFNXT2: CP 091H
JR C, ISMZFNOT ; DEL or > 0x7F, cant be a valid filename so this is not an MZF header.
ISMZFNXT3: INC DE
INC HL
DJNZ ISMZFNXT
JR ISMZFNOT ; No end of string terminator, this cant be a valid filename.
ISMZFVFY: LD A,B
CP FNSIZE
JR Z,ISMZFNOT ; If the filename has no length it cant be valid, so loop.
ISMZFYES: CP A ; Set zero flag to indicate match.
ISMZFNOT: POP HL
@@ -540,7 +575,7 @@ ISMZFNOT: POP HL
RET
PRTDBG: IF ENADEBUG = 1
_PRTDBG: IF ENADEBUG = 1
PUSH HL
PUSH DE
PUSH BC
@@ -608,7 +643,7 @@ PRTNOPAUSE: LD A,E
;
LD A, D ; Print out file number and increment.
CALL PRTHX
LD A, '.'
LD A, '.' ; File type is MACHINE CODE program.
CALL PRNT
LD DE,NAME ; Print out filename.
LD B,FNSIZE ; Maximum size of filename.
@@ -668,15 +703,25 @@ DIRROM: DI ; Disab
LD DE,MSGRDIRLST ; Print out header.
LD HL,PRINTMSG
CALL BKSW0to6
; D = File sequence number.
LD D,0 ; File numbering start.
;
; Get directory of User ROM.
;
LD A,ROMBANK3
LD (WRKROMBK1),A
LD (BNKSELMROM),A
CALL DIRMROM
;
; Scan MROM Bank
; B = Bank Page
; C = Block in page
; D = File sequence number.
;
LD B,MROMPAGES ; First 8 pages are reserved in MROM bank.
LD C,0 ; Block in page.
LD D,0 ; File numbering start.
;
DIRNXTPG: LD A,B
LD (WRKROMBK1), A
@@ -712,29 +757,24 @@ DIRNOTMZF: INC C ; Next
DIRNXTPG2: LD A,B
CP 080h ; MROM has 128 banks of 4K, so stop when we reach 128.
JR NZ, DIRNXTPG
;
; Get directory of User ROM.
;
LD A,ROMBANK3
LD (WRKROMBK1),A
LD (BNKSELMROM),A
CALL DIRMROM
DIRNXTPGX: LD A,(ROMBK1)
LD (BNKSELMROM),A ; Set the MROM bank back to original.
EI ; No need to block interrupts now as MROM bank restored.
RET ; End of scan, return to monitor
; JP ST1X ; End of scan, return to monitor
; In:
; DE = filename
; HL = filename
; D = File sequence number.
; Out:
; B = Bank Page file found
; C = Block where found.
; D = File sequence number.
; Z set if found.
FINDMZF: PUSH DE
LD (TMPADR), DE ; Save name of program to load.
LD (TMPADR), HL ; Save name of program to load.
EX DE, HL ; String needed in DE for conversion.
LD HL,0FFFFh ; Tag the filenumber as invalid.
LD (TMPCNT), HL
CALL ConvertStringToNumber ; See if a file number was given instead of a filename.
@@ -744,11 +784,10 @@ FINDMZF: PUSH DE
; Scan MROM Bank
; B = Bank Page
; C = Block in page
; D = File sequence number.
;
FINDMZF0: LD B,MROMPAGES ; First 4 pages are reserved in User ROM bank.
FINDMZF0: POP DE ; Get file sequence number in D.
LD B,MROMPAGES ; First 4 pages are reserved in User ROM bank.
LD C,0 ; Block in page.
LD D,0 ; File numbering start.
FINDMZF1: LD A,B
LD (WRKROMBK1), A
LD (BNKSELMROM),A ; Select bank.
@@ -814,7 +853,6 @@ FINDMZFNO: PUSH AF
LD A,(ROMBK1)
LD (BNKSELMROM),A ; Set the MROM bank back to original.
POP AF
POP HL
RET
@@ -827,16 +865,26 @@ LOADROMNX: LD L,0FFH
LOADROM: LD L,000H
LOADROM1: DI
PUSH HL ; Preserve execute flag.
CALL FINDMZF ; Find the bank and block where the file resides. HL = filename.
JR Z, LROMLOAD
EX DE,HL ; User ROM expects HL to have the filename pointer.
PUSH HL ; Save pointer to filename for FINDMZF in Monitor ROM.
; D = File sequence number.
LD D,0 ; File numbering start.
;
LD A,ROMBANK3 ; Activate the RFS Utilities MROM bank.
LD (WRKROMBK1), A
LD (BNKSELMROM),A
CALL MFINDMZF ; Try and find the file in User ROM via MROM utility.
JR NZ, LROMNTFND
POP HL
JR Z,MROMLOAD0
;
PUSH BC ; Preserve bank and block where MZF file found.
CALL FINDMZF ; Find the bank and block where the file resides. HL = filename.
JR Z, LROMLOAD
;
JR LROMNTFND ; Requested file not found.
;
MROMLOAD0: PUSH BC ; Preserve bank and block where MZF file found.
PUSH AF
LD A,(ROMBK1) ; Page in monitor so we can print a message.
LD (BNKSELMROM),A
@@ -967,10 +1015,222 @@ LROMLOAD5: POP HL ; Retri
JP (HL) ; Execution address.
LROMLOAD9: RET
; Quick method to load CPM. So long as the filename doesnt change this method will load and boot CPM.
LOADCPM: LD DE,CPMFN48 ; Load up the 48K version of CPM
LOADPROG: LD HL,LOADSDCARD
CALL BKSW0to2
RET
; Quick method to load the basic interpreter. So long as the filename doesnt change this method will load and boot Basic.
LOADBASIC: LD DE,BASICFILENM
JR LOADPROG
;-------------------------------------------------------------------------------
; END OF RFS COMMAND FUNCTIONS.
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
; DEVICE DRIVERS - Intercept handlers to provide enhanced services to
; existing MA-80A BIOS API functions.
;-------------------------------------------------------------------------------
; Method to set the RFS Drive number from the Load/Save string provided.
SETDRIVE: PUSH AF
PUSH BC
SETDRV0: LD A,(DE) ; If a drive is given it will be in format <driveno>:<filename>
OR A ; Exit if null or CR found, no drive specifier present.
JR Z,SETDRV2
CP 00DH
JR Z,SETDRV2
CP '"' ; String quotes, skip over.
JR NZ,SETDRV1
INC DE
JR SETDRV0
;
SETDRV1: SUB '0' ; Check the drive number, should be in range 0..9
CP 10
JR NC,SETDRV2
LD C,A
INC DE
LD A,(DE)
DEC DE
CP ':' ; Is the drive being specified?
JR NZ,SETDRV2
LD A,C
LD (SDDRIVENO),A ; Store drive number for later use.
XOR A
LD (CMTFILENO),A ; Setup the starting file number for sequential file reads (ie. when no filename given).
;
PUSH DE ; Need to remove the drive qualifier once processed.
PUSH DE
INC DE
INC DE ; Move onto filename.
EX DE,HL
POP DE
LD BC,SDDIR_FNSZ
LDIR
POP DE
;
SETDRV2: POP BC
POP AF
RET
; Method to check if the active drive is the CMT.
CHECKCMT: LD A,(SDDRIVENO)
CP 'C'
RET
; Convert the lower 4 bits of A into a Hex character.
TOHEXDIGIT: AND 00FH ; Simple logic, add 30H to get 0..9, add additional 7 if value >= 10 to get digits A..F.
CP 00AH
JR C,NOADD
ADD A,007H
NOADD: ADD A,030H
RET
; Convert a number into Hex string and store in buffer pointed to by DE.
;
TOHEX: PUSH DE
PUSH AF ; Save AF to retrieve lower 4 bits.
RRCA ; Shift upper 4 bits to lower to convert to hex.
RRCA
RRCA
RRCA
CALL TOHEXDIGIT
LD (DE),A ; Store and convert lower 4 bits.
INC DE
POP AF
CALL TOHEXDIGIT
LD (DE),A
INC DE
LD A,CR ; Terminate with a CR.
LD (DE),A
POP DE ; DE back to start of string.
RET
; Handler to intercept the CMT Read Header Information call and insert selectable
; SD Card RFS Drive functionality.
; DE contains a pointer to memory containing the file to load. If (DE) = NULL then
; load the next sequential file from the SD card directory.
; DE = Filename. Can contain a drive specifier in format <driveno>:<filename>
;
; No registers or flags should be affected as we dont know the caller state.
_CMT_RDINF: CALL SETDRIVE ; Set drive if specified.
CALL CHECKCMT ; If drive is set to the CMT Unit exit with Z set so that the original CMT handlers are called.
JP Z,?RDI
LD A,(DE) ; Check to see if empty string given, if so expand the default Next file number into the buffer.
CP CR
JR NZ,_CMT_RDINF1
LD A,(CMTFILENO) ; Get next sequential number and convert to hex.
PUSH AF
CALL TOHEX
POP AF
INC A ; Increment number so next call retrieves the next sequential file.
LD (CMTFILENO),A
;
_CMT_RDINF1:PUSH DE
LD HL,LOADSDINF ; DE already points to the filename, call LOADSDINF to locate it on the SD card and setup the header.
CALL BKSW0to2
; Copy the filename into the Buffer provided allowing for file number to name expansion.
POP DE
LD HL,NAME
LD BC,SDDIR_FNSZ
LDIR
;
LD A,(RESULT)
OR A
RET Z ; 0 = success, return with carry clear.
SCF ; > 0 = fail, return with carry set.
RET
; Handler to intercept the CMT Read Data call and insert selectable SD Card RFS
; Drive functionality.
;
; No registers or flags should be affected as we dont know the caller state.
_CMT_RDDATA:LD HL,LOADSDDATA
CALL BKSW0to2
LD A,(RESULT)
OR A
JR NZ,_CMT_RDERR
RET
_CMT_RDERR: SCF
RET
; Handler to intercept the CMT Write Header Information call and insert selectable
; SD Card RFS Drive functionality.
;
; No registers or flags should be affected as we dont know the caller state.
;
; At the moment, the WRINF call only creates a filename if non specified. The actual write to file occurs in WRDATA. Once I have more understanding of
; how the sequential data mode works I can adapt it to be compatible.
_CMT_WRINF: LD DE,NAME ; Caller has already setup the CMT header so we use this for processing.
;
CALL SETDRIVE ; Set drive if specified.
CALL CHECKCMT
JP Z,?WRI
;
LD A,(DE) ; Check to see if empty string given, if so create a default name.
CP CR
JR NZ,_CMT_WRINF1
;
LD HL,DEFAULTFN
LD BC,DEFAULTFNE - DEFAULTFN
LDIR
LD A,(CMTFILENO) ; Get next sequential number and convert to hex.
PUSH AF
CALL TOHEX
POP AF
INC A ; Increment number so next call retrieves the next sequential file.
LD (CMTFILENO),A
;
_CMT_WRINF1:LD A,0 ; Always success as nothing is written.
OR A
RET
; Handler to intercept the CMT Write Data call and insert selectable SD Card RFS
; Drive functionality.
;
; No registers or flags should be affected as we dont know the caller state.
_CMT_WRDATA: LD HL,SAVESDDATA
CALL BKSW0to2
LD A,(RESULT)
OR A
JR NZ,_CMT_RDERR
RET
; Handler to intercept the CMT Verify Data call and insert selectable SD Card
; RFS Drive functionality.
;
; No registers or flags should be affected as we dont know the caller state.
_CMT_VERIFY:CALL SETDRIVE ; Set drive if specified.
CALL CHECKCMT
JR Z,_VERIFY
;
RET
_VERIFY: JP ?VRFY
SD_NOTFND: LD DE,MSGNOTFND
SD_ERRMSG: LD HL,PRINTMSG
CALL BKSW0to6 ; Print message that file wasnt found.
LD A,1
OR A
RET
; Method to list the contents of the active RFS drive number.
_CMT_DIR: CALL SETDRIVE ; Change to the given drive.
CALL CHECKCMT ; Cannot DIR tape drive so give error.
JP Z,_CMT_NODIR
LD HL,DIRSDCARD
CALL BKSW0to2 ; Call the standard RFS directory command.
RET
_CMT_NODIR: LD DE,MSGNOCMTDIR
JR SD_ERRMSG
;-------------------------------------------------------------------------------
; END OF DEVICE DRIVERS
;-------------------------------------------------------------------------------
;--------------------------------------
;
@@ -978,6 +1238,12 @@ LROMLOAD9: RET
; all messages.
;
;--------------------------------------
; Quick load program names.
CPMFN48: DB "CPM223RFS", 00DH
BASICFILENM:DB "BASIC SA-5510", 00DH
DEFAULTFN: DB "DEFAULT"
DEFAULTFNE: EQU $
; Bring in additional resources.
USE_CMPSTRING: EQU 1

View File

@@ -840,10 +840,12 @@ SD_WRITE11: POP HL ; ..loa
;
; Input: HL = Address of filename.
; D = File number.
; A = File type.
;
PRTDIR: PUSH BC
PUSH DE
PUSH HL
LD C,A ; Preseve file type.
;
LD A,(SCRNMODE)
CP 0
@@ -868,8 +870,20 @@ PRTNOWAIT: LD A,E
;
LD A, D ; Print out file number and increment.
CALL PRTHX
LD A, '.'
CALL PRNT
LD A,C
CP OBJCD
LD A, '.' ; File type is MACHINE CODE program.
JR Z,PRTDIR0A
LD A,C
CP BTX1CD
LD A,'-' ; File type is BASIC.
JR Z,PRTDIR0A
LD A,C
CP BTX2CD
LD A,'_' ; File type is BASIC.
JR Z,PRTDIR0A
LD A,'+'
PRTDIR0A: CALL PRNT
POP DE
PUSH DE ; Get pointer to the file name and print.
@@ -909,6 +923,43 @@ PRTDIR4: OR A
RET
; Method to get the LBA sector for an RFS SDCFS image location according to drive.
; Inputs:
; A = Starting sector in a single image.
; or
; DEHL = starting sector.
; Outputs:
; DEHL = Sector number.
RFSGETSECT: LD DE,0 ; Load DEHL with a 32bit start sector. DE=0 as SDCFS starts from sector 0.
LD H,0 ; Set HL to sector number.
LD L,A
RFSGETSECTR:LD A,(SDDRIVENO) ; Entry point when DEHL is defined.
GETDIRDRV: OR A ; Multiply up according to drive number.
RET Z
CP 'C' ; If SDDRIVENO is set to 'C" - CMT, then default to SD Drive 0. CMT is valid in certain applications but not for SD access.
JR NZ,GETDIRDRV1
LD A,1
GETDIRDRV1: DEC A
LD BC,08010H ; Number of sectors in an SDCFS image, 2000H directory + (64 * 65536) file blocks.
CALL ADD3216 ; Add drive sector multiple to move to next drive.
JR GETDIRDRV
; Method to set the SD Card 32bit LBA sector address.
; Inputs:
; DEHL = 32bit sector number.
SETLBAADDR: PUSH HL
POP BC
LD HL,SDSTARTSEC ; Store the starting sector in the SD card buffer ready for retrieval.
LD (HL), D
INC HL
LD (HL), E
INC HL
LD (HL), B
INC HL
LD (HL), C
INC HL
RET
; Method to get an SD Directory entry.
; The SD Card works in 512byte sectors so a sector is cached and each call evaluates if the required request is in cache, if it is not, a new sector
; is read.
@@ -933,15 +984,13 @@ GETSDDIRENT:PUSH BC
;
LD HL,SECTORBUF
LD (SDLOADADDR),HL
LD HL,0
LD (SDSTARTSEC),HL
LD B,C
LD C,0
LD (SDSTARTSEC+2),BC
LD HL,SD_SECSIZE
LD (SDLOADSIZE),HL
;
CALL RFSGETSECT ; Get the directory sector, offset by drive number. DEHL is returned as the full 32bit LBA sector address.
CALL SETLBAADDR ; Store the sector address into the SD command buffer.
;
LD BC,SD_SECSIZE ; Set retrieval size to 1 sector.
LD (SDLOADSIZE),BC
LD HL,(SDLOADADDR)
LD BC,SD_SECSIZE
;
DI
CALL SD_READ ; Read the sector.
@@ -1006,9 +1055,10 @@ GETDIRFREE2:INC E ; Onto
; Normal use would be to call GERSDDIRENT to locate a required entry or slot, update it then call
; this method to flush it back to SD disk.
WRSDDIRENT: LD A,(DIRSECBUF) ; Get the directory sector number of the cached directory sector.
LD B,A
LD C,0
LD (SDSTARTSEC+2),BC ; Set the sector ready to perform the write.
;
CALL RFSGETSECT ; Get the directory sector, offset by drive number. DEHL is returned as the full 32bit LBA sector address.
CALL SETLBAADDR ; Store the sector address into the SD command buffer.
;
LD HL,SECTORBUF ; Address of the sector.
LD BC,SD_SECSIZE ; Set the size as one full sector.
;
@@ -1054,10 +1104,11 @@ DIRSD0: LD E,0 ; Direc
DIRSD1: CALL GETSDDIRENT ; Get SD Directory entry details for directory entry number stored in D.
RET NZ
DIRSD2: LD A,(HL)
INC HL
INC HL ; Hop over flags.
BIT 7,A ; Is this entry active, ie. Bit 7 of lower flag = 1?
JR Z,DIRSD3
INC HL
LD A,(HL) ; Get file attribute for print identification.
INC HL ; Hop over flags.
CALL PRTDIR ; Valid entry so print directory number and name pointed to by HL.
JR NZ,DIRSD4
INC D
@@ -1150,7 +1201,7 @@ FINDSD10: OR A
RET
; Method to erase a file in the SD RFS. This is a simple matter of resetting the valid entry flag (bit 7 of FLAG1) in the directory entry for
; Method to erase a filCOSMIC_CRUISER1MC.256.bine in the SD RFS. This is a simple matter of resetting the valid entry flag (bit 7 of FLAG1) in the directory entry for
; the required file.
; Input: DE = String containing filenumber or filename to erase.
; Output: A = 0 Success, 1 = Fail.
@@ -1167,24 +1218,15 @@ ERASESD: CALL FINDSDX
POP BC ; Get the directory entry number.
LD B,0
LD DE,MSGERASEDIR
LD HL,PRINTMSG
CALL BKSW2to6 ; Print out the filename.
LD A,0 ; Success.
RET
ERASESD1: LD DE,MSGERAFAIL ; Fail, print out message.
LD HL,PRINTMSG
JR SDPRINTRES
ERASESD1: LD A,1
LD DE,MSGERAFAIL ; Fail, print out message.
SDPRINTRES: LD (RESULT),A
SDPRINT: LD HL,PRINTMSG
CALL BKSW2to6 ; Print out the filename.
LD A,1
RET
; Quick method to load the basic interpreter. So long as the filename doesnt change this method will load and boot Basic.
LOADBASIC: LD DE,BASICFILENM
JR LOADSDCARD
; Quick method to load CPM. So long as the filename doesnt change this method will load and boot CPM.
LOADCPM: LD DE,CPMFN48 ; Load up the 48K version of CPM
JR LOADSDCARD
; Entry point when copying the SD file. Setup flags to indicate copying to effect any special processing.
; The idea is to load the file into memory, dont execute and pass back the parameters within the CMT header.
;
@@ -1197,6 +1239,7 @@ LOADSDCP: LD A,0FFH
; DE points to a number or filename to load.
LOADSDCARDX:LD A,0FFH
JR LOADSD1
LOADSDCARD: LD A,000H
LOADSD1: LD (SDAUTOEXEC),A
XOR A ; Clear copying flag.
@@ -1204,10 +1247,25 @@ LOADSD2: LD (SDCOPY),A
LD A,0FFH ; For interbank calls, save result in a memory variable.
LD (RESULT),A
CALL FINDSDX
JR Z,LOADSD9
JP Z,LOADSD10
LOADSD3: LD DE,MSGNOTFND
LD HL,PRINTMSG
CALL BKSW2to6 ; Print message that file wasnt found.
JR SDPRINT
; Helper method for the CMT replacement functions3. This method is inter bank called to locate a file pointed to by DE and set the header information.
LOADSDINF: CALL FINDSDX
JR Z,LOADSD9 ; Same as section above difference is we want to return after the header information has been extracted.
LD A,2 ; Return code for failure.
JR LOADSD9B
; Helper method for CMT replacement functions. This method is called to load data with details already set in the CMT header and SD command buffer.
LOADSDDATA: LD DE,(DTADR) ; Update the load address in case caller changed it after reading the header.
LD (SDLOADADDR),DE
CALL LOADSD11
LD A,0
JR C,LOADSDDAT1
JR Z,LOADSDDAT1
INC A
LOADSDDAT1: LD (RESULT),A
RET
; We have found the directory entry, so use it to load the program into memory.
@@ -1222,18 +1280,33 @@ LOADSD9: LD A,L
LD (ATRB),A ; Type of file, store in the tape header memory.
INC HL
LD DE,NAME
LD BC,SDDIR_FNSZ
LDIR ; Copy the filename into the CMT area.
LD E,(HL)
LD B,SDDIR_FNSZ
LOADSD90: LD A,(HL)
OR A
JR NZ,LOADSD91
LD A,CR ; Map NULL's to CR - applications use CR.
LOADSD91: LD (DE),A ; Copy the filename into the CMT area.
INC HL
LD D,(HL) ; Start sector upper 16 bits, big endian.
INC DE
DJNZ LOADSD90
;
LD D,(HL)
INC HL
LD (SDSTARTSEC),DE
LD E,(HL)
LD E,(HL) ; Start sector upper 16 bits, big endian. SDCFS under RFS this should always be zero.
INC HL
LD D,(HL) ; Start sector lower 16 bits, big endian.
PUSH DE
LD D,(HL)
INC HL
LD (SDSTARTSEC+2),DE
LD E,(HL) ; Start sector lower 16 bits, big endian.
INC HL
;
EX (SP),HL
EX DE,HL
CALL RFSGETSECTR ; Get the directory sector, offset by drive number. DEHL is returned as the full 32bit LBA sector address.
CALL SETLBAADDR ; Store the sector address into the SD command buffer.
POP HL
;
LD E,(HL)
INC HL
LD D,(HL) ; Size of file.
@@ -1247,19 +1320,27 @@ LOADSD9: LD A,L
LD A,D
LD (DTADRSTORE),DE ; Save the original load address, use this to fill DTADR when complete if it has changed..
CP 001H
JR NC,LOADSD10
JR NC,LOADSD9A
LD DE,01200H ; If the file specifies a load address below 1000H then shift to 1200H as it is not valid.
LOADSD10: LD (DTADR),DE
LOADSD9A: LD (DTADR),DE
LD (SDLOADADDR),DE
LD E,(HL)
INC HL
LD D,(HL) ; Execution address, store in tape header memory.
LD (EXADR),DE
XOR A ; Return code for success.
LOADSD9B: LD (RESULT),A ; Store result in memory as interbank calls dont preserve AF.
RET
;
LOADSD10 CALL LOADSD9 ; Modularised file find as the CMT replacement functions need it.
LD DE,MSGLOAD+1 ; Skip initial CR.
LD BC,NAME
LD HL,PRINTMSG
CALL BKSW2to6 ; Print out the filename.
CALL LOADSD11
JR C,LOADSD14
JR NZ,LOADSDERR
JR LOADSD14
;
LOADSD11: LD A,(SDLOADSIZE+1)
CP 002H
@@ -1271,7 +1352,7 @@ LOADSD12: LD HL,(SDLOADADDR)
CALL SD_READ ; Read the sector.
EI
OR A
JP NZ,LOADSDERR ; Failure to read a sector, abandon with error message.
RET NZ ; Failure to read a sector, abandon with error message.
LD (SDLOADADDR),HL ; Save the updated address.
;
LD HL,SDSTARTSEC+3
@@ -1283,8 +1364,8 @@ LOADSD12A: LD HL,(SDLOADSIZE)
LD DE,SD_SECSIZE
OR A
SBC HL,DE
JR C,LOADSD14
JR Z,LOADSD14
RET C
RET Z
LD (SDLOADSIZE),HL
JR LOADSD11
@@ -1310,8 +1391,6 @@ LOADSDX: LD A,0 ; Non e
LOADSDX1: LD (RESULT),A
RET
LOADSD17: LD DE,MSGNOTBIN
LD HL,PRINTMSG
CALL BKSW2to6 ; Print out the filename.
JR LOADSD16
LOADSDERR: LD DE,MSGSDRERR
@@ -1338,23 +1417,21 @@ SAVESDCARD: LD HL,GETCMTPARM ; Get t
LD A,C
OR A
RET NZ ; Exit if an error occurred.
XOR A ; Disable the copy flag.
;
LD A,OBJCD ; Set attribute: OBJ
LD (ATRB),A
;
SAVESDDATA: XOR A ; Disable the copy flag.
SAVESD1: LD (SDCOPY),A
LD A,0FFH ; Interbank calls, pass result via a memory variable. Assume failure unless updated.
LD (RESULT),A
LD A,OBJCD ; Set attribute: OBJ
LD (ATRB),A
; Find free slot.
CALL GETDIRFREE
JR NC,SAVESD4
LD DE,MSGDIRFULL ; Directory is full so abort command.
LD HL,PRINTMSG
CALL BKSW2to6 ; Print out the filename.
LD A,1 ; Directory full code.
LD (RESULT),A
RET
JP SDPRINTRES
;
SAVESD4: PUSH DE ; Save the directory entry number.
PUSH HL
@@ -1363,7 +1440,7 @@ SAVESD4: PUSH DE ; Save
LD DE,MSGSVDIRENT
LD HL,PRINTMSG
CALL BKSW2to6 ; Print out the filename.
POP HL
POP HL ; HL points to the directory entry buffer.
LD A,080H
LD (HL),A ; Set directory entry flag indicating that the entry is in use.
INC HL
@@ -1386,20 +1463,24 @@ SAVESD4: PUSH DE ; Save
PUSH HL
POP BC ; 32bit LBA now in DEBC
POP HL
; Store the Big Endian LBA Sector into the directory entry.
LD (HL),D ; Now save the 32bit LBA sector number into the directory entry.
LD (SDSTARTSEC),DE ; DE will always be 0 for RFS so we dont worry about endian, ie. (256 * 64K + 256 * 32)/512 = 0x00008010
INC HL
LD (HL),E
INC HL
LD A,B
LD (HL),A
LD (SDSTARTSEC+2),A
INC HL
LD A,C
LD (HL),A
LD (SDSTARTSEC+3),A
INC HL
;
PUSH BC ; Save BC and swap for HL so sector now in DEHL.
EX (SP),HL
CALL RFSGETSECTR ; Get the directory sector, offset by drive number. DEHL is returned as the full 32bit LBA sector address.
CALL SETLBAADDR ; Store the sector address into the SD command buffer.
POP HL
;
LD DE,(SIZE) ; Add in the size of the program.
LD (SDLOADSIZE),DE
LD (HL),E
@@ -1473,11 +1554,8 @@ SAVESD8: ; Data written, now write out the directory entry.
LD (RESULT),A
RET
SAVESD9: LD DE,MSGSVFAIL ; Fail, print out message.
LD HL,PRINTMSG
CALL BKSW2to6 ; Print out the filename.
LD A,1 ; Write failed code.
LD (RESULT),A
RET
JP SDPRINTRES ; Print out the filename.
;-------------------------------------------------------------------------------
; END OF SD CONTROLLER FUNCTIONALITY
@@ -1491,9 +1569,5 @@ SAVESD9: LD DE,MSGSVFAIL ; Fail,
;
;--------------------------------------
; Quick load program names.
CPMFN48: DB "CPM223RFS", 00DH
BASICFILENM:DB "BASIC SA-5510", 00DH
ALIGN 0EFFFh
DB 0FFh

View File

@@ -515,7 +515,6 @@ SLPT: DB 01H ; TEXT
; END OF PRINTER CMDLINE TOOLS FUNCTIONALITY
;-------------------------------------------------------------------------------
;--------------------------------------
;
; Message table - Refer to bank 6 for

View File

@@ -276,8 +276,9 @@ PRTSTRE: POP DE
; Help text. Use of lower case, due to Sharp's non standard character set, is not easy, you have to manually code each byte
; hence using upper case.
HELPSCR: DB "4 - 40 col mode.", 00DH
DB "8 - 80 col mode.", 00DH
HELPSCR: DB "0..9 - select RFS Drive.", 00DH
DB "40 - 40 col mode.", 00DH
DB "80 - 80 col mode.", 00DH
DB "700 - Select MZ-700 Mode.", 00DH
DB "7008 - Select MZ-700 80 col Mode.", 00DH
DB "B - toggle keyboard bell.", 00DH
@@ -480,6 +481,7 @@ MSGSD2TERR: DB "Copy from SD to Tape Failed", 00DH, 000H
MSGT2SDOK: DB "Success, Tape to SD done.", 00DH, 000H
MSGSD2TOK: DB "Success, SD to Tape done.", 00DH, 000H
MSGNOTZINST:DB "No tranZPUter >=v2 card installed.", 00DH, 000H
MSGNOCMTDIR:DB "Cannot list CMT directory.", 00DH, 000H
ALIGN 0EFFFh
DB 0FFh

View File

@@ -178,6 +178,18 @@ ROMBANK9 EQU 9 ;
ROMBANK10 EQU 10 ; : CBIOS Bank 3 - SD Card
ROMBANK11 EQU 11 ; : CBIOS Bank 4 - Floppy disk controller.
; File types.
OBJCD EQU 001H ; MZF contains a binary object.
BTX1CD EQU 002H ; MZF contains a BASIC program.
BTX2CD EQU 005H ; MZF contains a BASIC program.
TZOBJCD0 EQU 0F8H ; MZF contains a TZFS binary object for page 0.
TZOBJCD1 EQU 0F8H
TZOBJCD2 EQU 0F8H
TZOBJCD3 EQU 0F8H
TZOBJCD4 EQU 0F8H
TZOBJCD5 EQU 0F8H
TZOBJCD6 EQU 0F8H
TZOBJCD7 EQU 0F8H ; MZF contains a TZFS binary object for page 7.
; Address definitions.
;
@@ -188,6 +200,7 @@ MROMJMPTBL EQU 00070H ; Fixed
;
RFSJMPTABLE EQU UROMADDR + 00080H ; Entry point to the bank switching table.
PRTMZF EQU RFSJMPTABLE + 00000H ; Entry point into User ROM for the PRTMZF function.
PRTDBG EQU RFSJMPTABLE + 00003H ; Entry point into User ROM for the PRTDBG function.
;
MZFHDRSZ EQU 128
RFSSECTSZ EQU 256
@@ -313,8 +326,10 @@ ISMZF: PUSH BC
LD B,FNSIZE ; Maximum of 17 characters, including terminator in filename.
ISMZFNXT: LD A,(HL)
LD (DE),A
CP 00Dh ; If we find a terminator then this indicates potentially a valid name.
JR Z, ISMZFVFY
CP 00DH ; If we find a terminator then this indicates potentially a valid name.
JR Z, ISMZFNXT3
CP 000H ; Same applies for NULL terminator.
JR Z, ISMZFNXT3
CP 020h ; >= Space
JR C, ISMZFNOT
CP 05Dh ; =< ]
@@ -324,10 +339,6 @@ ISMZFNXT2: CP 091h
ISMZFNXT3: INC DE
INC HL
DJNZ ISMZFNXT
JR ISMZFNOT ; No end of string terminator, this cant be a valid filename.
ISMZFVFY: LD A,B
CP FNSIZE
JR Z,ISMZFNOT ; If the filename has no length it cant be valid, so loop.
ISMZFYES: CP A ; Set zero flag to indicate match.
ISMZFNOT: POP HL
POP DE
@@ -335,14 +346,13 @@ ISMZFNOT: POP HL
RET
; B contains Bank to select.
; D = File sequence number.
; HL contains the Block page address.
_DIRMROM: PUSH BC
PUSH DE
;
; Scan MROM Bank
; B = Bank Page
; C = Block in page
; D = File sequence number.
;
LD B,USRROMPAGES ; First 16x2K pages are reserved in User bank.
LD A,(ROMCTL)
@@ -392,7 +402,6 @@ DIRNXTPG2: LD A,B
LD A,(ROMBK2)
SCF ; Select the required user bank and Set carry so that the control registers remain enabled.
CALL SELUSRBNK
POP DE
POP BC
RET
@@ -403,6 +412,7 @@ _PRTMZF: LD A,(ROMBK2)
SCF ; Select the required user bank and Set carry so that the control registers remain enabled.
CALL SELUSRBNK
CALL PRTMZF
;CALL PRTDBG
LD A,(WRKROMBK2)
OR A ; Select the required user bank and Clear carry so that the control registers are disabled.
CALL SELUSRBNK
@@ -410,7 +420,8 @@ _PRTMZF: LD A,(ROMBK2)
; In:
; HL = filename
; HL = filename
; D = File sequence number.
; Out:
; B = Bank Page file found
; C = Block where found.

View File

@@ -61,14 +61,16 @@ STRT1: CALL CLR8
; Setup display to 40/80 characters depending upon config.
IF MODE80C = 0
LD HL,DSPCTL ; Setup address of display control register latch.
LD A, 0 ; Using MROM in Bank 0 = 40 char mode.
LD (DSPCTL), A
LD A, 0
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
LD (SPAGE), A ; Allow MZ80A scrolling
ELSE
LD HL,DSPCTL ; Setup address of display control register latch.
LD A, 128 ; Using MROM in Bank 1 = 80 char mode.
LD (DSPCTL), A
LD A, 0FFH
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
LD (HL), A
LD (SPAGE), A ; MZ80K Scrolling in 80 column mode for time being.
ENDIF
CALL MLDSP

View File

@@ -1,7 +1,7 @@
#!/bin/bash
ROOT_DIR=/dvlp/Projects/dev/github/MZ80A_RFS/
SW_DIR=${ROO_DIR}/software
SW_DIR=${ROOT_DIR}/software
PROCESS_MZF_FILES=0
if [ "x$1" = '-m' ]; then
PROCESS_MZF_FILES=1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -8,7 +8,7 @@
## This script builds a CPM version compatible with the MZ-80A RFS system.
##
## Credits:
## Copyright: (c) 2020 Philip Smart <philip.smart@net2net.org>
## Copyright: (c) 2020-21 Philip Smart <philip.smart@net2net.org>
##
## History: January 2020 - Initial script written.
##
@@ -37,7 +37,9 @@ ASMDIR=${ROOTDIR}/software/asm
ASMTMPDIR=${ROOTDIR}/software/tmp
INCDIR=${ROOTDIR}/software/asm/include
ROMDIR=${ROOTDIR}/software/roms # Compiled or source ROM files.
MZFDIR=${ROOTDIR}/software/MZF # MZF Format source files.
MZFDIR=${ROOTDIR}/software/MZF/Common # MZF Format source files.
MZBDIR=${ROOTDIR}/software/MZB/Common
BLOCKSIZELIST="128 256"
# Go through list and build images.
#
@@ -58,8 +60,21 @@ do
echo "Copy ${ASMDIR}/${f}.obj to ${ROMDIR}/${f}.rom"
cp ${ASMTMPDIR}/${f}.obj ${ROMDIR}/${f}.rom
else
# Build standard MZF files for inclusion in the SD Drive.
echo "Copy ${ASMDIR}/${f}.obj to ${MZFDIR}/${f}.mzf"
cp ${ASMTMPDIR}/${f}.obj ${MZFDIR}/${f}.mzf
# Create sectored versions of file for inclusion into the ROM Drives.
for BLOCKSIZE in ${BLOCKSIZELIST}
do
FILESIZE=$(stat -c%s "${ASMTMPDIR}/${f}.obj")
if [ $((${FILESIZE} % ${BLOCKSIZE})) -ne 0 ]; then
FILESIZE=$(( ((${FILESIZE} / ${BLOCKSIZE})+1 ) * ${BLOCKSIZE} ))
fi
dd if=/dev/zero ibs=1 count=${FILESIZE} 2>/dev/null | tr "\000" "\377" > "${MZBDIR}/${f}.${BLOCKSIZE}.bin"
dd if="${ASMTMPDIR}/${f}.obj" of="${MZBDIR}/${f}.${BLOCKSIZE}.bin" conv=notrunc 2>/dev/null
done
fi
fi
done

View File

@@ -9,7 +9,7 @@
## into a ROM file using the GLASS Z80 assembler.
##
## Credits:
## Copyright: (c) 2018 Philip Smart <philip.smart@net2net.org>
## Copyright: (c) 2018-21 Philip Smart <philip.smart@net2net.org>
##
## History: August 2018 - Initial script written.
##
@@ -38,7 +38,7 @@ ASMDIR=${ROOTDIR}/software/asm
ASMTMPDIR=${ROOTDIR}/software/tmp
INCDIR=${ROOTDIR}/software/asm/include
ROMDIR=${ROOTDIR}/software/roms
MZFDIR=${ROOTDIR}/software/MZB
MZFDIR=${ROOTDIR}/software/MZB/Common
# Go through list and build image.
#
@@ -56,10 +56,10 @@ do
then
# The object file is binary, no need to link, copy according to build group.
if [[ ${BUILDROMLIST} = *"${f}"* ]]; then
echo "Copy ${ASMDIR}/${f}.obj to ${ROMDIR}/${f}.rom"
echo "Copy ${ASMTMPDIR}/${f}.obj to ${ROMDIR}/${f}.rom"
cp ${ASMTMPDIR}/${f}.obj ${ROMDIR}/${f}.rom
else
echo "Copy ${ASMDIR}/${f}.obj to ${MZFDIR}/${f}.mzf"
echo "Copy ${ASMTMPDIR}/${f}.obj to ${MZFDIR}/${f}.mzf"
cp ${ASMTMPDIR}/${f}.obj ${MZFDIR}/${f}.mzf
fi
fi

View File

@@ -9,7 +9,7 @@
## into a ROM file using the GLASS Z80 assembler.
##
## Credits:
## Copyright: (c) 2018 Philip Smart <philip.smart@net2net.org>
## Copyright: (c) 2018-21 Philip Smart <philip.smart@net2net.org>
##
## History: August 2018 - Initial script written.
##
@@ -35,12 +35,14 @@ ASM=glass.jar
#BUILDROMLIST="MZ80AFI rfs rfs_mrom IPL monitor_SA1510 monitor_80c_SA1510 monitor_mz-1r12 quickdisk_mz-1e05 quickdisk_mz-1e14 monitor_1Z-013A monitor_80c_1Z-013A"
BUILDROMLIST="monitor_SA1510_hiload monitor_80c_SA1510_hiload monitor_80c_SA1510 MZ80AFI monitor_SA1510 monitor_80c_SA1510 monitor_1Z-013A monitor_80c_1Z-013A IPL"
#BUILDMZFLIST="hi-ramcheck sharpmz-test"
BUILDMZFLIST="BASIC sharpmz-test"
BUILDMZFLIST="SA-5510_RFS sharpmz-test"
ASMDIR=${ROOTDIR}/software/asm
ASMTMPDIR=${ROOTDIR}/software/tmp
INCDIR=${ROOTDIR}/software/asm/include
ROMDIR=${ROOTDIR}/software/roms
MZFDIR=${ROOTDIR}/software/MZF
MZFDIR=${ROOTDIR}/software/MZF/Common
MZBDIR=${ROOTDIR}/software/MZB/Common
BLOCKSIZELIST="128 256"
# Go through list and build image.
#
@@ -58,11 +60,26 @@ do
then
# The object file is binary, no need to link, copy according to build group.
if [[ ${BUILDROMLIST} = *"${f}"* ]]; then
echo "Copy ${ASMDIR}/${f}.obj to ${ROMDIR}/${f}.rom"
echo "Copy ${ASMTMPDIR}/${f}.obj to ${ROMDIR}/${f}.rom"
cp ${ASMTMPDIR}/${f}.obj ${ROMDIR}/${f}.rom
else
echo "Copy ${ASMDIR}/${f}.obj to ${MZFDIR}/${f}.MZF"
# Build standard MZF files for inclusion in the SD Drive.
echo "Copy ${ASMTMPDIR}/${f}.obj to ${MZFDIR}/${f}.MZF"
cp ${ASMTMPDIR}/${f}.obj ${MZFDIR}/${f}.MZF
# Create sectored versions of file for inclusion into the ROM Drives.
for BLOCKSIZE in ${BLOCKSIZELIST}
do
FILESIZE=$(stat -c%s "${ASMTMPDIR}/${f}.obj")
if [ $((${FILESIZE} % ${BLOCKSIZE})) -ne 0 ]; then
FILESIZE=$(( ((${FILESIZE} / ${BLOCKSIZE})+1 ) * ${BLOCKSIZE} ))
fi
dd if=/dev/zero ibs=1 count=${FILESIZE} 2>/dev/null | tr "\000" "\377" > "${MZBDIR}/${f}.${BLOCKSIZE}.bin"
dd if="${ASMTMPDIR}/${f}.obj" of="${MZBDIR}/${f}.${BLOCKSIZE}.bin" conv=notrunc 2>/dev/null
done
fi
fi
done

BIN
software/tools/dz80 Executable file

Binary file not shown.

BIN
software/tools/glass-0.5.1.jar Executable file

Binary file not shown.

BIN
software/tools/glass-0.5.jar Executable file

Binary file not shown.

Binary file not shown.

View File

@@ -42,9 +42,9 @@ SOURCEDIRS="CPM_RFS_[1-2] CPM[0-9][0-9]_* CPM_MC_5 CPM_MC_C? CPM_MC_D? CPM_MC_E?
ROOTDIR=`realpath ../../MZ80A_RFS`
CPM_PATH=${ROOTDIR}/software/CPM
ROMDIR=${ROOTDIR}/software/roms # Compiled or source ROM files.
MZFDIR=${ROOTDIR}/software/MZF # MZF Format source files.
MZFDIR=${ROOTDIR}/software/MZF/Common # MZF Format source files.
HDRDIR=${ROOTDIR}/software/hdr # MZF Header directory for building images.
MZBDIR=${ROOTDIR}/software/MZB # MZF Binary sectored output files to go into ROMS.
MZBDIR=${ROOTDIR}/software/MZB/Common # MZF Binary sectored output files to go into ROMS.
DISKSDIR=${ROOTDIR}/software/disks # MZF Binary sectored output files to go into ROMS.
ROMRFSDIR=${ROOTDIR}/software/CPM/ROMRFS/RAW # ROM RFS Drive raw image.
FD1M44_PATH=${CPM_PATH}/1M44

View File

@@ -11,9 +11,10 @@
## and flash the images created into the Flast ROMS.
##
## Credits:
## Copyright: (c) 2020 Philip Smart <philip.smart@net2net.org>
## Copyright: (c) 2020-21 Philip Smart <philip.smart@net2net.org>
##
## History: January 2020 - Initial script written.
## March 2021 - Updates for the RFS v2.1 board.
##
#########################################################################################################
## This source file is free software: you can redistribute it and#or modify
@@ -33,41 +34,24 @@
ROOTDIR=../../MZ80A_RFS
MZB_PATH=${ROOTDIR}/software/MZB
ROM_PATH=${ROOTDIR}/software/roms/
ROM_LIST_FILE=/tmp/ROMLIST
SECTORSIZE=256
CPMDISKMODE=SPLIT
MZFTOOL=${ROOTDIR}/software/tools/mzftool.pl
MONITOR_ROM=/tmp/mrom.rom
USER_ROM_I=/tmp/user.rom
USER_ROM_II=/tmp/user2.rom
USER_ROM_III=/tmp/user3.rom
# Place the RFS rom into the User ROM at the beginning as it contains all the banked pages.
echo "cat ${ROM_PATH}/rfs.rom ${ROM_PATH}/cbios_bank1.rom ${ROM_PATH}/cbios_bank2.rom ${ROM_PATH}/cbios_bank3.rom ${ROM_PATH}/cbios_bank4.rom > /tmp/user.rom"
cat ${ROM_PATH}/rfs.rom ${ROM_PATH}/cbios_bank1.rom ${ROM_PATH}/cbios_bank2.rom \
${ROM_PATH}/cbios_bank3.rom ${ROM_PATH}/cbios_bank4.rom \
> /tmp/user.rom
# Monitor/User ROM 1/2/3 = empty.
> ${MONITOR_ROM}
> ${USER_ROM_I}
> ${USER_ROM_II}
> ${USER_ROM_III}
# User ROM 2/3 = empty.
> /tmp/user2.rom
> /tmp/user3.rom
# According to flag set above, either put the CPM Disks in the first ROM, or place one in each ROM allowing for better write spread and larger disks.
#
if [ "${CPMDISKMODE}" != "SPLIT" ]; then
# CPM RFS Disks currently only in User ROM.
for f in 1 2
do
if [ -f ${MZB_PATH}/CPM_RFS_${f}.${SECTORSIZE}.bin ]; then
echo "cat ${MZB_PATH}/CPM_RFS_${f}.${SECTORSIZE}.bin >> /tmp/user.rom"
cat ${MZB_PATH}/CPM_RFS_${f}.${SECTORSIZE}.bin >> /tmp/user.rom
fi
done
else
if [ -f ${MZB_PATH}/CPM_RFS_1.${SECTORSIZE}.bin ]; then
echo "cat ${MZB_PATH}/CPM_RFS_1.${SECTORSIZE}.bin >> /tmp/user.rom"
cat ${MZB_PATH}/CPM_RFS_1.${SECTORSIZE}.bin >> /tmp/user.rom
fi
if [ -f ${MZB_PATH}/CPM_RFS_2.${SECTORSIZE}.bin ]; then
echo "cat ${MZB_PATH}/CPM_RFS_2.${SECTORSIZE}.bin >> /tmp/user2.rom"
cat ${MZB_PATH}/CPM_RFS_2.${SECTORSIZE}.bin >> /tmp/user2.rom
fi
fi
# Create a file with a list of programs placed into the ROM. This list can then be used by the SD
# card script to ensure no duplication occurs when building the SD RFS program directory.
rm -f ${ROM_LIST_FILE}
# Place the monitor roms into the MROM at the beginning for banked page usage.
echo "cat ${ROM_PATH}/monitor_SA1510.rom ${ROM_PATH}/monitor_80c_SA1510.rom ${ROM_PATH}/cbios.rom ${ROM_PATH}/rfs_mrom.rom ${ROM_PATH}/monitor_1Z-013A.rom ${ROM_PATH}/monitor_80c_1Z-013A.rom ${ROM_PATH}/IPL.rom ${ROM_PATH}/blank_mrom.rom > /tmp/mrom.rom"
@@ -75,8 +59,42 @@ cat ${ROM_PATH}/monitor_SA1510.rom ${ROM_PATH}/monitor_80c_SA1510.rom \
${ROM_PATH}/cbios.rom ${ROM_PATH}/rfs_mrom.rom \
${ROM_PATH}/monitor_1Z-013A.rom ${ROM_PATH}/monitor_80c_1Z-013A.rom \
${ROM_PATH}/IPL.rom ${ROM_PATH}/blank_mrom.rom \
> /tmp/mrom.rom
GENROM=0
>> ${MONITOR_ROM}
# Place the RFS rom into the User ROM at the beginning as it contains all the banked pages.
echo "cat ${ROM_PATH}/rfs.rom ${ROM_PATH}/cbios_bank1.rom ${ROM_PATH}/cbios_bank2.rom ${ROM_PATH}/cbios_bank3.rom ${ROM_PATH}/cbios_bank4.rom > ${USER_ROM_I}"
cat ${ROM_PATH}/rfs.rom ${ROM_PATH}/cbios_bank1.rom ${ROM_PATH}/cbios_bank2.rom \
${ROM_PATH}/cbios_bank3.rom ${ROM_PATH}/cbios_bank4.rom \
>> ${USER_ROM_I}
# For CPM, to be safe, we manually copy the required files rather than use the list below. The CP/M boot image must be in User ROM 1.
cat ${MZB_PATH}/Common/cpm22.${SECTORSIZE}.bin >> ${USER_ROM_I}
# According to flag set above, either put the CPM Disks in the first ROM, or place one in each ROM allowing for better write spread and larger disks.
#
if [ "${CPMDISKMODE}" != "SPLIT" ]; then
# CPM RFS Disks currently only in User ROM.
for f in 1 2
do
if [ -f ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin ]; then
echo "cat ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin >> ${USER_ROM_I}"
cat ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin >> ${USER_ROM_I}
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
fi
done
else
if [ -f ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin ]; then
echo "cat ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin >> ${USER_ROM_I}"
cat ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin >> ${USER_ROM_I}
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
fi
if [ -f ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin ]; then
echo "cat ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin >> ${USER_ROM_II}"
cat ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin >> ${USER_ROM_II}
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
fi
fi
# Manually choose the programs you want installed into the ROMS. The files will be first placed into the USER ROM and when full into the
# Monitor ROM. Thus order is important if you want a particular program in a particular ROM.
@@ -87,35 +105,45 @@ ROM_INCLUDE=""
#
# Common
#
ROM_INCLUDE+="${MZB_PATH}/Common/BASIC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/cpm22.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/CPM223.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/A-BASIC_SA-5510.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/BASIC_SP-5035MC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/FORTRANSOSZ80.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/MZ700_FORTH1.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/SA-5510_COMPILER.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/XPATCH_5510_V2.2.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/RFSBASIC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/SEND-1.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/sharpmz-test.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/testtz.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/APOLLO_CHESS_V2A.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/Common/5Z009-1B.MZF:"
#ROM_INCLUDE+="${MZB_PATH}/Common/BASIC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/Common/cpm22.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/Common/CPM223.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/Common/sharpmz-test.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/Common/testtz.${SECTORSIZE}.bin:"
#
# MZ-80A
#
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SA-6510.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/3-D_MAZE.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/80A_PENCIL.A2_C2.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/80A_PENCIL.A2_S.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/A-BASIC_SA-5510.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/A-BASIC_SA-5510.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/ADVENTUREGAME.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/AIR_LANDER.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/ALIEN_ATTACK.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/ALIEN_ATTACK_MACHINECODE.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/ALIEN_EAGLE.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/ALLIGATOR.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/APOLLO_CHESS_V2A.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/APOLLO_CHESS_V2A.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BASIC80A.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BASIC_SA-5510.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BASIC.SA-5510.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BASIC_SA-5510.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BASIC.SA-5510.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BLOCKING.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BOUNCING_BALL.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BREAKOUT.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BREAKOUT_MC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BRICKSTOP.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BYTESAVER_SA5510.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BYTESAVER_SA5510.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/CELLS_AND_SERPS.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/COLONY.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/COSMIAD-A.${SECTORSIZE}.bin:"
@@ -168,9 +196,8 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80A/QBERT.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/QUEST.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/RACE_CHASE.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/RIBBIT_V2.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SA-5510_COMPILER.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SA-5510_KN.COMM.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SA-6510.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SA-5510_COMPILER.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SA-5510_KN.COMM.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SARGON_2.71.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SCRAMBLE_A.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SEND-1.${SECTORSIZE}.bin:"
@@ -189,7 +216,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80A/TUNNEL_RUN.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/UFO.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/WIGGLY_WORM.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/WITCHES.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/XPATCH_5510_V2.2.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/XPATCH_5510_V2.2.${SECTORSIZE}.bin:"
#
# MZ-80K
#
@@ -198,7 +225,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80A/XPATCH_5510_V2.2.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/6502BETRMC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/6502DEMO2MC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/6502DEMOMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/8048_CPU_DISAS.MC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/8048_CPU_DISAS.MC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/A-BASIC_SA-5510.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ABENTEUEBASIC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ADVANCE-GUARDMC.${SECTORSIZE}.bin:"
@@ -635,87 +662,95 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-700/KUMA_INTERPR..${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-700/Z80_DESASSEMBLEUR.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-700/ZEN.${SECTORSIZE}.bin:"
# Create a file with a list of programs placed into the ROM. This list can then be used by the SD
# card script to ensure no duplication occurs when building the SD RFS program directory.
ROM_LIST_FILE=/tmp/ROMLIST
rm -f ${ROM_LIST_FILE}
# Set the pointer which indicates the next ROM to be filled with applications.
GENROM=0
IFS=":"; for f in ${ROM_INCLUDE}
do
if [ -f ${f} ]; then
if (( ${GENROM} == 0 )); then
cat /tmp/user.rom "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")
if (( ${FILESIZE} < 524288 )); then
echo "Adding $f to User I Rom"
cat "${f}" >> /tmp/user.rom
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
else
GENROM=1
fi
fi
if (( ${GENROM} == 1 )); then
cat /tmp/mrom.rom "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")
if (( ${FILESIZE} < 524288 )); then
echo "Adding $f to Monitor Rom"
cat "${f}" >> /tmp/mrom.rom
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
else
GENROM=2
fi
fi
# Identify type of file.
${MZFTOOL} --command=IDENT --mzffile=${f} >/dev/null
FILETYPE=$?
if (( ${GENROM} == 2 )); then
cat /tmp/user2.rom "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")
if (( ${FILESIZE} < 524288 )); then
echo "Adding $f to User II Rom"
cat "${f}" >> /tmp/user2.rom
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
else
GENROM=3
fi
fi
if [ ${FILETYPE} == 1 ]; then
if (( ${GENROM} == 3 )); then
cat /tmp/user3.rom "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")
if (( ${FILESIZE} < 524288 )); then
echo "Adding $f to User III Rom"
cat "${f}" >> /tmp/user3.rom
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
else
GENROM=4
if (( ${GENROM} == 0 )); then
cat ${MONITOR_ROM} "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")
if (( ${FILESIZE} < 524288 )); then
echo "Adding $f to Monitor Rom"
cat "${f}" >> ${MONITOR_ROM}
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
else
GENROM=1
fi
fi
fi
if (( ${GENROM} == 4 )); then
echo "Limit reached ROMS full, skipping from ${f}..."
break
if (( ${GENROM} == 1 )); then
cat ${USER_ROM_I} "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")
if (( ${FILESIZE} < 524288 )); then
echo "Adding $f to User I Rom"
cat "${f}" >> ${USER_ROM_I}
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
else
GENROM=2
fi
fi
if (( ${GENROM} == 2 )); then
cat ${USER_ROM_II} "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")
if (( ${FILESIZE} < 524288 )); then
echo "Adding $f to User II Rom"
cat "${f}" >> ${USER_ROM_II}
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
else
GENROM=3
fi
fi
if (( ${GENROM} == 3 )); then
cat ${USER_ROM_III} "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")
if (( ${FILESIZE} < 524288 )); then
echo "Adding $f to User III Rom"
cat "${f}" >> ${USER_ROM_III}
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
else
GENROM=4
fi
fi
if (( ${GENROM} == 4 )); then
echo "Limit reached ROMS full, skipping from ${f}..."
break
fi
else
echo "File:${f},Type:${FILETYPE} is not machine code, skipping.."
fi
else
echo "ALERT! File:${f} not found."
fi
done
if [ -f /tmp/user.rom ]; then
mv /tmp/user.rom ${ROM_PATH}/USER_ROM_${SECTORSIZE}.bin
if [ -f ${USER_ROM_I} ]; then
mv ${USER_ROM_I} ${ROM_PATH}/USER_ROM_${SECTORSIZE}.bin
FILESIZE=$(stat -c%s "${ROM_PATH}USER_ROM_${SECTORSIZE}.bin")
echo "USER ROM I SIZE (${ROM_PATH}USER_ROM_${SECTORSIZE}.bin) = ${FILESIZE} Bytes"
fi
if [ -f /tmp/user2.rom ]; then
mv /tmp/user2.rom ${ROM_PATH}/USER_ROM_II_${SECTORSIZE}.bin
if [ -f ${USER_ROM_II} ]; then
mv ${USER_ROM_II} ${ROM_PATH}/USER_ROM_II_${SECTORSIZE}.bin
FILESIZE=$(stat -c%s "${ROM_PATH}USER_ROM_II_${SECTORSIZE}.bin")
echo "USER ROM II SIZE (${ROM_PATH}USER_ROM_II_${SECTORSIZE}.bin) = ${FILESIZE} Bytes"
fi
if [ -f /tmp/user3.rom ]; then
mv /tmp/user3.rom ${ROM_PATH}/USER_ROM_III_${SECTORSIZE}.bin
if [ -f ${USER_ROM_III} ]; then
mv ${USER_ROM_III} ${ROM_PATH}/USER_ROM_III_${SECTORSIZE}.bin
FILESIZE=$(stat -c%s "${ROM_PATH}USER_ROM_III_${SECTORSIZE}.bin")
echo "USER ROM III SIZE (${ROM_PATH}USER_ROM_III_${SECTORSIZE}.bin) = ${FILESIZE} Bytes"
fi
if [ -f /tmp/mrom.rom ]; then
mv /tmp/mrom.rom ${ROM_PATH}/MROM_${SECTORSIZE}.bin
if [ -f ${MONITOR_ROM} ]; then
mv ${MONITOR_ROM} ${ROM_PATH}/MROM_${SECTORSIZE}.bin
FILESIZE=$(stat -c%s "${ROM_PATH}/MROM_${SECTORSIZE}.bin")
echo "MROM SIZE (${ROM_PATH}/MROM_${SECTORSIZE}.bin) = ${FILESIZE} Bytes"
fi

View File

@@ -10,7 +10,7 @@
## ie. <RFS IMAGE> + <CPM DISK IMAGE 0> .. <CPM DIK IMAGE n>.
##
## Credits:
## Copyright: (c) 2020 Philip Smart <philip.smart@net2net.org>
## Copyright: (c) 2020-21 Philip Smart <philip.smart@net2net.org>
##
## History: March 2020 - Initial script written.
## March 2021 - Updated the file list and filter out files stored in the ROM Drives.
@@ -36,419 +36,190 @@ TOOL_DIR=${ROOTDIR}/software/tools
IMAGE_DIR=${ROOTDIR}/software/roms
CPM_DIR=${ROOTDIR}/software/CPM/SDC16M/RAW
SDTOOL=${TOOL_DIR}/sdtool
RFS_IMAGE_FILE=${IMAGE_DIR}/SHARP_MZ80A_RFS_IMAGE_1.img
RFS_IMAGE_FILE=${IMAGE_DIR}/SHARP_MZ80A_RFS_IMAGE_
RFS_IMAGE_EXT=img
RFS_IMAGE_DRIVES=10
RFS_IMAGE_DRIVE_LIST=`seq -s ' ' 0 $((${RFS_IMAGE_DRIVES}-1))`
CPM_IMAGE_FILES="SDCDISK0.RAW SDCDISK1.RAW SDCDISK2.RAW SDCDISK3.RAW SDCDISK4.RAW SDCDISK5.RAW SDCDISK6.RAW"
SD_IMAGE_FILE=${IMAGE_DIR}/SHARP_MZ80A_RFS_CPM_IMAGE_1.img
ROM_LIST_FILE=/tmp/ROMLIST
MZFTOOL=${ROOTDIR}/software/tools/mzftool.pl
# Create the initial RFS image.
${SDTOOL} --image ${RFS_IMAGE_FILE} --create
if [ $? != 0 ]; then
echo "Failed to create initial RFS Image, aborting."
# Function to add a given file/type into an RFS Drive.
function addFileToImage
{
# Parameters.
local DRIVENO=$1
local FILETYPE=$2
local FILTER=$3
local FILENAME=$4
local result=0
# Identify type of file.
${MZFTOOL} --command=IDENT --mzffile=${FILENAME} >/dev/null
ft=$?
# Use the File Type and ROM File List to filter out duplicates.
#
if [ ${FILETYPE} == $ft ]; then
grep `basename "${FILENAME}" .MZF` ${ROM_LIST_FILE} > /dev/null
if [ $? -eq 1 -o ${FILTER} -eq 0 ]; then
# Filter out CPM ROM Drive images.
if [[ "${FILENAME}" != *CPM22-DRV* ]] && [[ "${FILENAME}" != *CPM_RFS_* ]]; then
echo "Adding ${FILENAME} to RFS Drive:${DRIVENO}..."
${SDTOOL} --image ${RFS_IMAGE_FILE}${DRIVENO}.${RFS_IMAGE_EXT} --add ${FILENAME}
result=$?
if [ $result -ne 0 ]; then
if [ $result = 60 ]; then
result=10
else
echo "Failed to add:${FILENAME} into the RFS Drive Image:${RFS_IMAGE_FILE}${DRIVENO}.${RFS_IMAGE_EXT}, aborting."
result=11
fi
fi
fi
fi
else
result=1
fi
return $result
}
# Function to add a directory of files belonging to a machine type to a given RFS image. Machine code files are added to the requested
# image, BASIC are added onto drives 7..9 according to type.
#
function addMachineFiles
{
# Parameters.
local DRIVENO=$1
local SRCDIR=$2
local FILTER=$3
local result=0
for f in `(cd ${MZF_PATH}/${SRCDIR}; ls *.MZF)`
do
addFileToImage ${DRIVENO} 1 ${FILTER} ${MZF_PATH}/${SRCDIR}/${f}
result=$?
if [[ ${result} -eq 1 ]] && [[ "${SRCDIR}" = "MZ-80A" ]]; then
addFileToImage 5 2 ${FILTER} ${MZF_PATH}/${SRCDIR}/${f}
result=$?
fi
if [[ ${result} -eq 1 ]] && [[ "${SRCDIR}" = "MZ-80K" ]]; then
addFileToImage 6 2 ${FILTER} ${MZF_PATH}/${SRCDIR}/${f}
result=$?
fi
if [[ ${result} -eq 1 ]] && [[ "${SRCDIR}" = "MZ-700" ]]; then
addFileToImage 7 5 ${FILTER} ${MZF_PATH}/${SRCDIR}/${f}
result=$?
fi
if [[ ${result} -eq 1 ]] && [[ "${SRCDIR}" = "MZ-800" ]]; then
addFileToImage 7 5 ${FILTER} ${MZF_PATH}/${SRCDIR}/${f}
result=$?
fi
if [ ${result} -ne 0 -a ${result} -ne 1 ]; then
echo "Failed to add file:${MZF_PATH}/${SRCDIR}/${f} to Drive:0, aborting for manual check."
result=1
fi
done
return $result
}
# Initialise the target SD image.
> ${SD_IMAGE_FILE}
# Create the initial RFS drive images.
for d in ${RFS_IMAGE_DRIVE_LIST}
do
${SDTOOL} --image ${RFS_IMAGE_FILE}${d}.${RFS_IMAGE_EXT} --create
if [ $? != 0 ]; then
echo "Failed to create RFS Drive Image:${RFS_IMAGE_FILE}${d}.${RFS_IMAGE_EXT}, aborting."
exit 1
fi
done
# There are upto 10 RFS Drives so the software is apportioned as follows:
# Drive Description
# ----- -----------
# 0 Common and MZ-80A Machine Code programs.
# 1 MZ-80K Machine Code programs.
# 2 MZ-700 Machine Code programs.
# 3 MZ-800 Machine Code programs.
# 3 MZ-1500 Machine Code programs.
# 4 MZ-2000 Machine Code programs.
# 4 MZ-80B Machine Code programs.
# 5 BASIC programs, type 2 (MZ80A)
# 6 BASIC programs, type 2 (MZ80K)
# 7 BASIC programs, type 5 (MZ700/800)
# 8 Other programs.
# 9 Other programs.
#
# Files are filtered out if they already exist in the Flash RAMS. The script make_roms.sh creates
# a list of files it adds into the Flash RAMS which is used by this script.
# NB: A maximum of 256 files can be added due to the limit of the RFS directory.
#
addMachineFiles 0 Common 0
RESULT=$?
if [ ${RESULT} -eq 0 ]; then
addMachineFiles 0 MZ-80A 1
RESULT=$?
fi
if [ ${RESULT} -eq 0 ]; then
addMachineFiles 1 MZ-80K 1
RESULT=$?
fi
if [ ${RESULT} -eq 0 ]; then
addMachineFiles 2 MZ-700 1
RESULT=$?
fi
if [ ${RESULT} -eq 0 ]; then
addMachineFiles 3 MZ-800 1
RESULT=$?
fi
if [ ${RESULT} -eq 0 ]; then
addMachineFiles 3 MZ-1500 1
RESULT=$?
fi
if [ ${RESULT} -eq 0 ]; then
addMachineFiles 4 MZ-2000 1
RESULT=$?
fi
if [ ${RESULT} -eq 0 ]; then
addMachineFiles 4 MZ-80B 1
RESULT=$?
fi
if [ ${RESULT} -ne 0 ]; then
echo "Aborting due to ealier errors..."
exit 1
fi
# Manually choose the programs you want installed into the RFS image. The files will be first placed into
# the directory in the order they appear here, which initially is alphabetic order.
#
# NB: A maximum of 256 files can be added due to the limit of the RFS directory.
#
RFS_INCLUDE=
#
# Current Common files.
#
RFS_INCLUDE+="${MZF_PATH}/Common/BASIC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/Common/CPM223.MZF:"
RFS_INCLUDE+="${MZF_PATH}/Common/cpm22.MZF:"
RFS_INCLUDE+="${MZF_PATH}/Common/SEND-1.MZF:"
RFS_INCLUDE+="${MZF_PATH}/Common/sharpmz-test.MZF:"
RFS_INCLUDE+="${MZF_PATH}/Common/testtz.MZF:"
#
# MZ-80A files.
#
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/3-D_MAZE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/80A_PENCIL.A2_C2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/80A_PENCIL.A2_S.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/A-BASIC_SA-5510.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/ADVENTUREGAME.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/AIR_LANDER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/ALIEN_ATTACK_MACHINECODE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/ALIEN_ATTACK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/ALIEN_EAGLE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/ALLIGATOR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/APOLLO_CHESS_V2A.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/BASIC80A.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/BASIC_SA-5510.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/BASIC.SA-5510.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/BLOCKING.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/BOUNCING_BALL.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/BREAKOUT_MC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/BREAKOUT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/BRICKSTOP.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/BYTESAVER_SA5510.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/CELLS_AND_SERPS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/COLONY.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/COSMIAD-A.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/COSMIAD-K.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/CURSEDCHAMBER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DCS_MZ80A_APPEND.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DCS_MZ80A_RENUM.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DEFENDER(2).MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DEFENDER_BIZZARRI.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DEFENDER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DIAMOND.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DIGGER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DOG_AND_FLEA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DOG_STAR_2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/DUCK_SHOOT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/EPIDEMIC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/ESCAPE_FORCE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/ESCAPE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/FLYING_MISSION.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/FOREST_OF_DOOM.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/FRUIT_MACHINE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/GALAXY_INVADERS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/GREEDY_GREMLINS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/HANGMAN2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/HORSE_RACE2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/HUCALC_80A_C2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/HUCALC_80A_M.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/HUCALC_80A_S.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/LAND_ESCAPE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/LASER_DEFENCE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/LE_MANS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/LUDO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/LUNARLANDER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/MAD_MAX_2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/MAN-HUNT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/M_C_BREAKOUT_2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/M_C_RACE_CHASE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/MINOTAUR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/MISSILE_ATTACK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/MUNCHERS_2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/MZ80A_BASIC.DSK:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/MZ-80A_GALACTIC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/NAVVY.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/NEW_INVADERS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/NOUGHTS_CROSSES.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/NUMBERCRUNCH.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/OBSTACLES.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/PINBALL.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/PUCKMAN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/QBERT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/QUEST.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/RACE_CHASE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/RIBBIT_V2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SA-5510_COMPILER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SA-5510_KN.COMM.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SA-6510.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SARGON_2.71.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SCRAMBLE_A.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SERENDIPITY.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SKI_RUN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SPACE_COMBAT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SPACE_FIGHTER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SPACE_INVADERS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SPOOKS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/STARSHIP_MK2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/STAR_WARS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/SUPER_TILT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/THE_LILY_POND.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/THE_MEANIES.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/TUNNEL_RUN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/UFO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/WIGGLY_WORM.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/WITCHES.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-80A/XPATCH_5510_V2.2.MZF:"
#
# MZ-700 files.
#
RFS_INCLUDE+="${MZF_PATH}/MZ-700/1Z-013B.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/2Z009E.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/3-D_CAR_RACE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/3-D_GRAPHIKPAKET.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/3DMUEHLE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/3D-WAY_OUT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/6502_BETRIEBSSYS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/700_POKER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ACE_RACER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ADVANCEDCHESS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/AIRBUS_A_310.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ALIENS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/AMITYVILLE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ANTARES.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ANTHILL_RAIDER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/APOLLO2_8-200785.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/APOLLO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/APPRENTISSAGE_NOMBRES.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ASTEROID_BELT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ASTRO-BLASTER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ATTACK-A-TANK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/AUTO_RUN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BACKGAMMON.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BAS700TUTORIAL.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BASEZERO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BASIC_1Z-013B.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BASIC_700-VERS.4.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BASIC_MZ-5Z008_2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BASIC_MZ-5Z008.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BATTLE_GAME.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BIO-700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BLASTOFF.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BLOKTEKENINGEN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BOMBERMAN_MZ700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BOULDER_DASH.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/BREUKEN_1.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CADRE_DIABOLIQUE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CALENDRIER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CANNON_BALL.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CATACOMBES.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CATERPILLAR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CENTRO-ANL.DISK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CENTRO-ANLEITUNG.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CIRCUS_STAR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CLUB_GOLF.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/C-MASTER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CODEWOORD.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/COMMANDO_PLAIN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/COMPETITIE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/COMPUT-A-SLOT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/COMPUTERTEKENEN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CONNECT_FOUR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CONVERTER_A_700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CONVEYOR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/COPY-CF.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/COSMO_BLASTER_MZ700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CRIBBAGE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CROAKER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/CYFAX.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DATABASE_FILER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DATEI_UNIVERSAL.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DBP-701.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DELETE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DEMASASO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DEMO-LISSAJOU.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DEMO_SIN-BERG.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DESCENTE_AUX_ENFERS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DESTRUCTEURS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DOMINATION.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/DONKEY_GORILLA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/EXPLODING_ATOMS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/EXPRESS_BAS_700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/F1200.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FANTASTIC_GROVE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FDCOPY.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FD_EDITOR_MZ700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FIGHTER_COMMAND.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FIRE!!!.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FISHERMAN_FRED.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FLUGSIM_MZ700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FLUGSIMULATOR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FORTRANSOSZ80.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/FULL_SPEED.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/GATE-CRASHER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/GDP9-BA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/GEBOORTEDATUM.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/GLOBAL_WAR_3.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/GLOBULE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/GOBBLER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/GREEDY_GREMLINS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/GRID.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/GUERRE_SPATIALE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/HDC_ORGEL.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/HP4TMZ7L.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/HP4TMZ7.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/HUNCHY.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/IMPOSSIBLE_MISSION.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ISOLA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/JEUX_INTERGALACTIQUES.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/JUMPING_RUNNER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/JUNGLE-JINKS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KALENDER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KAMERTJE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KASBOEK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/K-BASIC_V.5.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KENTUCKY_DERBY.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KNIFORTH.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KNIGHT'S_CASTLE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KNIGHTS_UFO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KP_DBASIC.800B.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/K.S.M._PT._1.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/K.S.M._PT._2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/K.S.M._PT._3.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KUMA_INTERPR..MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KUP80Z354.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/KUP80Z355.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/LADY-BUG.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/LAND_ESCAPE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/LE_MANS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/LIGHTNING_PATROL.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/LIJNENSPEL.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/LOGO_V30.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MAC_PAC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MAD_MAZE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MAN-HUNT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MANZA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MASTERMIND.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MATH_PENDU.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MAZE_ESCAPE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MESSING.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MISSION_ALPHA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MISSION_A.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MISSION_DELTA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ML-SP_8002_BBG.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MOLEATTA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MONITOR3.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MONITOR6.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MONITOR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MORPION.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MORPIUS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MOTY.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MOVING_SEARCHER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MUCMAC700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MUNROE_MANOR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MUSIC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MUSIQUE_SUISSE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MZ-1P01.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MZ-2Z009.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MZ700BAS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MZ-700_DEMO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MZ700_FORTH1.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MZ-700_FORTH.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MZ-700_KLAVIER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/MZ-700_PLOT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/NAKAMOTO_MZ700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/NAKAMOTO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/NIBBLER_PART1.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/NIBBLER_PART2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/NIGHTMARE_PARK2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/NIGHTMARE_PARK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/NIGHTM_PRK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/NITE_FLITE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/OCTOPUSSY.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PAC-MAN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PAINFUL_MAN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PANIQUE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PARA_SHOOT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PASCAL_SP-4015_C.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PASCAL_SP-4015.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PATROL_ALPHA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PCGAID_EUROPE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PCGAID.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PCG_BASIC_MZ700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PCG_BASIC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PENDU.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PRINTERFIGUREN1.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PUISSANCE_4.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/PUZZLE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/QD_BAS_5Z008_MZ700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/QDCOPY.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/QD-PASCAL_C.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/QUIXI.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/REALFORT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/REBOND.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/RESCUE_PLANE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/REVERSE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ROLLSROYCE1906.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ROUND_SHOOT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SAFE-CRACKER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/S-BASIC-CENT-2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/S-BASIC-COMP-CNT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/S-BASIC-COMPILER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/S-BASIC-COMPILER-ORIGINAL.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/S-BASICODE_2.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SCHACH2_MZ700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SCHACH700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SH7CED1.3G.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SHOGUN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SKY_CHAOS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/S-MASTER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SNAKE-AND-SNAKE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SOUDARD.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SOUTH_PACIFIC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SPACE_FIGHTER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SPACE_GUERILLA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SPACE_INVADERS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SPA_DATA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SQUASH_700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/STAR_FIGHTER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/STARTREK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/STKEEPER2BAS700A.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/STRIP_POKER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUBMARINE_SHOOTER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUB-MONITOR-700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUICIDE_RUN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUPER-BANDIT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUPER_BIORHYTHM.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUPER_HELICOPTER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUPER_PUCK-MAN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUPER_SPY_OBJ.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUPERTYPEN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUPER_VRAC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUTAM1F.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUTAMC9.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUTAPEBA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SUTAPEMO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/SYSTEME_EXPERT.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/TAPEWORM.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/TBASIC_BM_PK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/T-BASIC_(UITLEG).MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/TELEFONTARIEVEN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/THREE_CARD_BRAG.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/TOMAHAWK.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/TRACKER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/TRANS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/TRUCKER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/TYPEN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/UFO.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/UNI700BASIC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/URANIA_II.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/URAS-700.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/VICIOUS_VIPER.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/VOL_676.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/VRAGENDMAKEN.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/WIZARD_CASTLE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/WONDERHOUSE.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/WOOKYA.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/WOOKYB.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/XANAGRAMS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/XBC_F_1_02.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/XBC.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/YAMS.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/Z80_DESASSEMBLEUR.MZF:"
RFS_INCLUDE+="${MZF_PATH}/MZ-700/ZEN.MZF:"
#
#
#
IFS=":"; for f in ${RFS_INCLUDE}
# Confirmation listing of the drives and contents.
IFS=" "; for d in ${RFS_IMAGE_DRIVE_LIST}
do
# Use the ROM File List to filter out duplicates.
#
grep `basename "${f}" .MZF` ${ROM_LIST_FILE} > /dev/null
if [ $? = 1 ]; then
echo "Adding ${f}..."
${SDTOOL} --image ${RFS_IMAGE_FILE} --add ${f}
RESULT=$?
if [ $RESULT != 0 ]; then
if [ $RESULT = 60 ]; then
break;
fi
echo "Failed to add:${f} into the RFS Image, aborting."
exit 2
fi
fi
echo "RFS Drive: ${RFS_IMAGE_FILE}${d}.${RFS_IMAGE_EXT}"
${SDTOOL} --image ${RFS_IMAGE_FILE}${d}.${RFS_IMAGE_EXT} --list-dir
done
${SDTOOL} --image ${RFS_IMAGE_FILE} --list-dir
# Concatenate the RFS and CPM images to make a final SD card image.
#
echo "Adding RFS Image:$RFS_IMAGE_FILE} to start of SD Card image."
cat ${RFS_IMAGE_FILE} > ${SD_IMAGE_FILE}
IFS=" "; for d in ${RFS_IMAGE_DRIVE_LIST}
do
echo "Adding RFS Drive Image:${RFS_IMAGE_FILE}${d}.${RFS_IMAGE_EXT} to start of SD Card image."
cat ${RFS_IMAGE_FILE}${d}.${RFS_IMAGE_EXT} >> ${SD_IMAGE_FILE}
done
# Pad the file to 0x10000000 before adding CPM images. This takes into account the RFS Drives plus padding to a round address.
truncate -s 268435456 ${SD_IMAGE_FILE}
IFS=" "; for f in ${CPM_IMAGE_FILES}
do
echo "Adding CPM Drive Image:${f} to SD Card image."
cat ${CPM_DIR}/${f} >> ${SD_IMAGE_FILE}
done
echo "SD Card image generated, file:${SD_IMAGE_FILE}"
echo ""
echo ""
echo "Using a suitable tool, such as dd under Linux, copy the SD Card image onto an SD Card."
echo "ie. dd if=${SD_IMAGE_FILE} of=/dev/sdd bs=512"
echo "No disk partitioning is needed as the SDFS image starts at sector 0 on the SD Card."
echo "Once the image has been copied, place into the SD Card Reader on the RFS Board."
exit 0

View File

@@ -10,9 +10,12 @@
## Also useful to add headers to homegrow machine code programs.
##
## Credits:
## Copyright: (c) 2018 Philip Smart <philip.smart@net2net.org>
## Copyright: (c) 2018-2021 Philip Smart <philip.smart@net2net.org>
##
## History: August 2018 - Initial script written.
## March 2021 - Updated to fix MZF header files. Some programs have encoded ASCII
## into the header along with other strange characters, these need to
## be in Sharp ASCII format.
##
#########################################################################################################
## This source file is free software: you can redistribute it and#or modify
@@ -32,8 +35,8 @@
# Title and Versioning.
#
$TITLE = "MZF Tool";
$VERSION = "0.1";
$VERSIONDATE = "25.09.2018";
$VERSION = "0.2";
$VERSIONDATE = "23.03.2021";
# Global Modules.
#
@@ -82,6 +85,407 @@ $errorMailSubject = "MZF Tool Errors...";
$PERL = "perl";
$PERLFLAGS = "";
# ASCII to Sharp Display Code mapping table.
@ASCIIToSharpCode = (
0xCC, # NUL '\0' (null character)
0xE0, # SOH (start of heading)
0xF2, # STX (start of text)
0xF3, # ETX (end of text)
0xCE, # EOT (end of transmission)
0xCF, # ENQ (enquiry)
0xF6, # ACK (acknowledge)
0xF7, # BEL '\a' (bell)
0xF8, # BS '\b' (backspace)
0xF9, # HT '\t' (horizontal tab)
0xFA, # LF '\n' (new line)
0xFB, # VT '\v' (vertical tab)
0xFC, # FF '\f' (form feed)
0xFD, # CR '\r' (carriage ret)
0xFE, # SO (shift out)
0xFF, # SI (shift in)
0xE1, # DLE (data link escape)
0xC1, # DC1 (device control 1)
0xC2, # DC2 (device control 2)
0xC3, # DC3 (device control 3)
0xC4, # DC4 (device control 4)
0xC5, # NAK (negative ack.)
0xC6, # SYN (synchronous idle)
0xE2, # ETB (end of trans. blk)
0xE3, # CAN (cancel)
0xE4, # EM (end of medium)
0xE5, # SUB (substitute)
0xE6, # ESC (escape)
0xEB, # FS (file separator)
0xEE, # GS (group separator)
0xEF, # RS (record separator)
0xF4, # US (unit separator)
0x00, # SPACE
0x61, # !
0x62, # "
0x63, # #
0x64, # $
0x65, # %
0x66, # &
0x67, # '
0x68, # (
0x69, # )
0x6B, # *
0x6A, # +
0x2F, # ,
0x2A, # -
0x2E, # .
0x2D, # /
0x20, # 0
0x21, # 1
0x22, # 2
0x23, # 3
0x24, # 4
0x25, # 5
0x26, # 6
0x27, # 7
0x28, # 8
0x29, # 9
0x4F, # :
0x2C, # ;
0x51, # <
0x2B, # =
0x57, # >
0x49, # ?
0x55, # @
0x01, # A
0x02, # B
0x03, # C
0x04, # D
0x05, # E
0x06, # F
0x07, # G
0x08, # H
0x09, # I
0x0A, # J
0x0B, # K
0x0C, # L
0x0D, # M
0x0E, # N
0x0F, # O
0x10, # P
0x11, # Q
0x12, # R
0x13, # S
0x14, # T
0x15, # U
0x16, # V
0x17, # W
0x18, # X
0x19, # Y
0x1A, # Z
0x52, # [
0x59, # \ '\\'
0x54, # ]
0xBE, # ^
0x3C, # _
0xC7, # `
0x81, # a
0x82, # b
0x83, # c
0x84, # d
0x85, # e
0x86, # f
0x87, # g
0x88, # h
0x89, # i
0x8A, # j
0x8B, # k
0x8C, # l
0x8D, # m
0x8E, # n
0x8F, # o
0x90, # p
0x91, # q
0x92, # r
0x93, # s
0x94, # t
0x95, # u
0x96, # v
0x97, # w
0x98, # x
0x99, # y
0x9A, # z
0xBC, # {
0x80, # |
0x40, # }
0xA5, # ~
0xC0 # DEL
);
# Sharp Display Code to ASCII mapping tables.
#
@SharpCodeToASCII = (
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20, # 0x0F
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20, # 0x1F
0x20,
0x21,
0x22,
0x23,
0x24,
0x25,
0x26,
0x27,
0x28,
0x29,
0x2A,
0x2B,
0x2C,
0x2D,
0x2E,
0x2F, # 0x2F
0x30,
0x31,
0x32,
0x33,
0x34,
0x35,
0x36,
0x37,
0x38,
0x39,
0x3A,
0x3B,
0x3C,
0x3D,
0x3E,
0x3F, # 0x3F
0x40,
0x41,
0x42,
0x43,
0x44,
0x45,
0x46,
0x47,
0x48,
0x49,
0x4A,
0x4B,
0x4C,
0x4D,
0x4E,
0x4F, # 0x4F
0x50,
0x51,
0x52,
0x53,
0x54,
0x55,
0x56,
0x57,
0x58,
0x59,
0x5A,
0x5B,
0x5C,
0x5D,
0x5E,
0x5F, # 0x5F
0x20, # 0x60
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20, # 0x6F
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20, # 0x7F
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20, # 0x8F
0x20,
0x20,
0x65,
0x20,
0x20,
0x20,
0x74,
0x67,
0x68,
0x20,
0x62,
0x78,
0x64,
0x72,
0x70,
0x63, # 0x9F
0x71,
0x61,
0x7A,
0x77,
0x73,
0x75,
0x69,
0x20,
0x4F, # O with umlaut
0x6B,
0x66,
0x76,
0x20,
0x75, # u with umlaut
0x42, # Strasse S
0x6A, # 0XAF
0x6E,
0x20,
0x55, # U with umlaut
0x6D,
0x20,
0x20,
0x20,
0x6F,
0x6C,
0x41, # A with umlaut
0x6F, # o with umlaut
0x61, # a with umlaut
0x20,
0x79,
0x20,
0x20, # 0xBF
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20, # 0XCF
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20, # 0XDF
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20, # 0XEF
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20,
0x20 # 0XFF
);
##################################################################################
# GENERIC SUB-ROUTINES
@@ -428,10 +832,10 @@ sub argOptions
print STDOUT "Usage: $PROGNAME <commands> [<options>] \n";
print STDOUT " commands= --help |\n";
print STDOUT " --verbose |\n";
print STDOUT " --command=<IDENT|ADDHEADER|DELHEADER> |\n";
print STDOUT " --mzffile=<file> {IDENT|ADDHEADER|DELHEADER} |\n";
print STDOUT " --command=<IDENT|ADDHEADER|DELHEADER|FIXHEADER> |\n";
print STDOUT " --mzffile=<file> {IDENT|ADDHEADER|DELHEADER|FIXHEADER}|\n";
print STDOUT " --srcfile=<file> {ADDHEADER} |\n";
print STDOUT " --dstfile=<file> {DELHEADER} |\n";
print STDOUT " --dstfile=<file> {DELHEADER|FIXHEADER} |\n";
print STDOUT " --filename=<name of tape file> (ADDHEADER} |\n";
print STDOUT " --loadaddr=<addr tape should load @> (ADDHEADER} |\n";
print STDOUT " --execaddr=<auto exec addr> (ADDHEADER} |\n";
@@ -447,6 +851,22 @@ sub argOptions
exit( $exitCode );
}
# Method to map an ASCII standard character, as a value, into a Sharp ASCII value.
#
sub getSharpASCIICode
{
local($matchChar) = @_;
$matchcnt = 0;
foreach (@SharpCodeToASCII)
{
if($matchChar eq $_)
{
return($matchcnt);
}
$matchcnt = $matchcnt + 1;
}
return(0xF0);
}
##################################################################################
# END OF GENERIC SUB-ROUTINES
@@ -487,7 +907,7 @@ $comment = "";
GetOptions( "debug=n" => \$debugMode, # Debug Mode?
"verbose" => \$verbose, # Show details?
"mzffile=s" => \$mzfFile, # MZF file.
"dstfile=s" => \$dstFile, # Destination file (for header removal).
"dstfile=s" => \$dstFile, # Destination file (for header removal or MZF file with updated header).
"srcfile=s" => \$srcFile, # Source file (for header adding).
"filename=s" => \$fileName, # Filename to insert into header.
"loadaddr=s" => \$s_loadAddr, # Tape load address.
@@ -522,7 +942,7 @@ if($s_tapeType ne "")
# Verify command.
#
if($command eq "IDENT" || $command eq "ADDHEADER" || $command eq "DELHEADER")
if($command eq "IDENT" || $command eq "ADDHEADER" || $command eq "DELHEADER" || $command eq "FIXHEADER")
{
1;
}
@@ -536,10 +956,14 @@ if($command eq "ADDHEADER" && ($fileName eq "" || !defined($loadAddr) || !define
{
argOptions(3, "ADDHEADER command requires the following parameters to be provided: --filename, --loadaddr, --execaddr, --tapetype\n",$ERR_BADARGUMENTS);
}
if($command eq "FIXHEADER" && $dstFile eq "")
{
argOptions(3, "FIXHEADER command requires the following parameter to be provided: --dstfile\n",$ERR_BADARGUMENTS);
}
# For ident or delete header commands, we need to open and read the mzf file.
#
if(($command eq "IDENT" || $command eq "DELHEADER") && defined($mzfFile) && $mzfFile ne "")
if(($command eq "IDENT" || $command eq "DELHEADER" || $command eq "FIXHEADER") && defined($mzfFile) && $mzfFile ne "")
{
# If defined, can we open it?
#
@@ -562,8 +986,10 @@ if(($command eq "IDENT" || $command eq "DELHEADER") && defined($mzfFile) && $mzf
# Once the MZF is in memory, analyse the details and output.
#
$mzf_header = pack('a'x128, @MZF);
($mzf_type, $mzf_filename, $mzf_size, $mzf_loadaddr, $mzf_execaddr, $mzf_comment) = unpack 'c1 a17 v4 v4 v4 a104', $mzf_header;
$mzf_header = pack('a'x24, @MZF);
($mzf_type, $mzf_filename, $mzf_size, $mzf_loadaddr, $mzf_execaddr) = unpack 'c1 a17 v4 v4 v4 a104', $mzf_header;
# Comment is unpacked seperately as there appears to be a perl bug where the first char becomes 0 when unpacking in the above list.
$mzf_comment = pack('a'x104, @MZF[24..128]);
$mzf_filename =~ s/\r|\n//g;
# Output detail if requested.
@@ -578,14 +1004,50 @@ if(($command eq "IDENT" || $command eq "DELHEADER") && defined($mzfFile) && $mzf
printf STDOUT "Comment : %s\n", $mzf_comment;
}
# For the DELHEADER command, a destination needs to be provided and opened.
if($command eq "DELHEADER" && defined($dstFile) && $dstFile ne "")
# For the DELHEADER/FIXHEADER command, a destination needs to be provided and opened.
if(($command eq "DELHEADER" || $command eq "FIXHEADER") && defined($dstFile) && $dstFile ne "")
{
if( ! open(DSTFILE, ">".$dstFile) )
{
argOptions(1, "Cannot open the destination file: $dstFile.\n",$ERR_BADFILENAME);
}
}
# For the FIXHEADER, look at the filename and correct if it doesnt use Sharp ASCII.
#
if($command eq "FIXHEADER")
{
# Remove start and trailing space.
$mzf_filename = trim($mzf_filename);
# Go through the string and convert the stored filename to Sharp format.
$new_mzf_filename = "";
for $idx (0..length($mzf_filename)-1)
{
$hdrChar = substr($mzf_filename, $idx, 1);
$mapIdx = ord($hdrChar);
if($hdrChar =~ m/[^a-z]/)
{
$new_mzf_filename = $new_mzf_filename . pack("C1", $mapIdx);
} else
{
$new_mzf_filename = $new_mzf_filename . pack("C1", getSharpASCIICode($mapIdx));
}
}
# Remove start and trailing space.
$new_mzf_filename = trim($new_mzf_filename);
# Pad to length of filename field with NULL bytes.
for $idx (length($new_mzf_filename)..17-1)
{
$new_mzf_filename = $new_mzf_filename . pack("C1", 0x00);
}
# Repack the header with the updated filename.
$new_mzf_header = pack('c1 a17 v v v', $mzf_type, $new_mzf_filename, $mzf_size, $mzf_loadaddr, $mzf_execaddr);
$new_mzf_header .= pack('a104', $mzf_comment) ;
}
}
elsif($command eq "ADDHEADER" && defined($mzfFile) && $mzfFile ne "")
{
@@ -660,6 +1122,25 @@ elsif($command eq "DELHEADER")
foreach my $byte (@MZF) { if($cnt++ >= 128) { print DSTFILE $byte; } }
close DSTFILE;
}
elsif($command eq "FIXHEADER")
{
# Can we create the destination file, ie. the file containing the MZF program with a corrected header?
#
if( ! open(DSTFILE, ">".$dstFile) )
{
argOptions(1, "Cannot open the destination file: $dstFile.\n",$ERR_BADFILENAME);
}
# Strip off the old header.
splice(@MZF, 0, 128);
# Now add the new header and source data into the destination file.
print DSTFILE $new_mzf_header;
foreach my $byte (@MZF) { print DSTFILE $byte; }
# All done.
close DSTFILE;
}
# Exit code is the type of MZF file.
exit $mzf_type;

View File

@@ -59,9 +59,11 @@ do
IFS=' '; while read -r FSIZE FNAME;
do
TNAME=`echo $FNAME | sed 's/mzf/MZF/g'`
if [ "$FNAME" != "$TNAME" ]; then
mv "$FNAME" "$TNAME"
FDIRNAME=`dirname ${FNAME}`
FILENAME=`basename ${FNAME}`
TNAME=`echo $FILENAME | sed 's/mzf/MZF/g'`
if [ "${FILENAME}" != "${TNAME}" ]; then
mv "${FILENAME}" "${TNAME}"
fi
set +x
for BLOCKSIZE in ${BLOCKSIZELIST}
@@ -72,8 +74,8 @@ do
if [ `echo ${FSIZE} - ${SECTORSIZE} | bc` -le 0 ];
then
echo $BASE $TNAME $SECTORSIZE
dd if=/dev/zero ibs=1 count=$SECTORSIZE 2>/dev/null | tr "\000" "\377" > "${MZBDIR}/${SUBDIR}/$BASE.${BLOCKSIZE}.bin"
dd if="${MZFDIR}/${SUBDIR}/$TNAME" of="${MZBDIR}/${SUBDIR}/$BASE.${BLOCKSIZE}.bin" conv=notrunc 2>/dev/null
dd if=/dev/zero ibs=1 count=$SECTORSIZE 2>/dev/null | tr "\000" "\377" > "${MZBDIR}/${FDIRNAME}/${BASE}.${BLOCKSIZE}.bin"
dd if="${MZFDIR}/${FDIRNAME}/$TNAME" of="${MZBDIR}/${FDIRNAME}/${BASE}.${BLOCKSIZE}.bin" conv=notrunc 2>/dev/null
break;
fi
done