Interim updates for use with SFD700
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -201,3 +201,7 @@ dz80.ini
|
|||||||
full.asm
|
full.asm
|
||||||
full.bin
|
full.bin
|
||||||
MZ800_IOCS.ref
|
MZ800_IOCS.ref
|
||||||
|
asm/c2
|
||||||
|
asm/sa1510.asm.prekuma
|
||||||
|
roms/test.rom
|
||||||
|
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ PP_SPI_ENA EQU 0 ; Set t
|
|||||||
|
|
||||||
; Build time options, only set to '1' to build, '0' to disable, only set one 40C/80C at a time. Set KUMA 80C option if Kuma upgrade being targetted otherwise will default to 40/80 column card.
|
; Build time options, only set to '1' to build, '0' to disable, only set one 40C/80C at a time. Set KUMA 80C option if Kuma upgrade being targetted otherwise will default to 40/80 column card.
|
||||||
; IF BUILD_VERSION = 0
|
; IF BUILD_VERSION = 0
|
||||||
BUILD_80C EQU 0 ; Build for an MZ-80A with a 40/80 column card.
|
BUILD_80C EQU 1 ; Build for an MZ-80A with a 40/80 column card.
|
||||||
BUILD_40C EQU 1 ; Build for a standard 40 column MZ-80A.
|
BUILD_40C EQU 0 ; Build for a standard 40 column MZ-80A.
|
||||||
BUILD_KUMA EQU 0 ; Enable support for the Kuma 40/80 column upgrade.
|
BUILD_KUMA EQU 0 ; Enable support for the Kuma 40/80 column upgrade.
|
||||||
BUILD_MZ80A EQU 0 ; Build for the Sharp MZ-80A base hardware.
|
BUILD_MZ80A EQU 1 ; Build for the Sharp MZ-80A base hardware.
|
||||||
BUILD_MZ700 EQU 1 ; Build for the Sharp MZ-700 base hardware.
|
BUILD_MZ700 EQU 0 ; Build for the Sharp MZ-700 base hardware.
|
||||||
BUILD_MZ1500 EQU 0 ; Build for the Sharp MZ-1500 base hardware.
|
BUILD_MZ1500 EQU 0 ; Build for the Sharp MZ-1500 base hardware.
|
||||||
|
|
||||||
; ENDIF
|
; ENDIF
|
||||||
|
|||||||
@@ -31,4 +31,136 @@ PAD: MACRO ?address
|
|||||||
;
|
;
|
||||||
ALIGN_FIT8: MACRO ?size
|
ALIGN_FIT8: MACRO ?size
|
||||||
ds (($ + ?size - 1) >> 8) != ($ >> 8) && (100H - ($ & 0FFH)) || 0
|
ds (($ + ?size - 1) >> 8) != ($ >> 8) && (100H - ($ & 0FFH)) || 0
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
HWSELROM: MACRO
|
||||||
|
IF BUILD_ROMDISK = 1
|
||||||
|
LD B,16 ; If we read the bank control reset register 15 times then this will enable bank control and then the 16th read will reset all bank control registers to default.
|
||||||
|
HWSEL1: LD A,(BNKCTRLRST)
|
||||||
|
DJNZ HWSEL1 ; Apply the default number of coded latch reads to enable the bank control registers.
|
||||||
|
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
||||||
|
LD (BNKCTRL),A
|
||||||
|
LD (ROMCTL),A ; Save to memory the value in the bank control register - this register is used for SPI etc so need to remember its setting.
|
||||||
|
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
|
||||||
|
LD (BNKSELMROM),A
|
||||||
|
LD (BNKSELUSER),A ; and start up - ie. SA1510 Monitor - this occurs as User Bank 0 is enabled and the jmp to 0 is coded in it.
|
||||||
|
ENDIF ; 22 bytes.
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
IN A,(SFD700_MODE)
|
||||||
|
OR A
|
||||||
|
LD A,BNKDEFMROM_MZ80A ; Setup default MROM for an MZ80A, this is a 4K Window into the UROM at F000.
|
||||||
|
JR HWSEL11
|
||||||
|
HWSEL11: LD A,BNKDEFMROM_MZ700 ; Setup default MROM for an MZ700, this is a 4K Window into the UROM at F000.
|
||||||
|
OUT (REG_FXXX),A
|
||||||
|
LD (ROMBK1),A
|
||||||
|
LD A,BNKDEFUROM ; Setup default UROM, this is a 2K Window into the UROM at E800 and contains the RFS.
|
||||||
|
OUT (REG_EXXX),A
|
||||||
|
LD (ROMBK2),A
|
||||||
|
NOP
|
||||||
|
ENDIF
|
||||||
|
ENDM
|
||||||
|
HWSELROM2: MACRO
|
||||||
|
IF BUILD_ROMDISK = 1
|
||||||
|
LD B,16 ; If we read the bank control reset register 15 times then this will enable bank control and then the 16th read will reset all bank control registers to default.
|
||||||
|
HWSEL2: LD A,(BNKCTRLRST)
|
||||||
|
DJNZ HWSEL2 ; Apply the default number of coded latch reads to enable the bank control registers.
|
||||||
|
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
||||||
|
LD (BNKCTRL),A
|
||||||
|
NOP ; Nops to allocate space for missing LD (ROMCTL),A present in first bank.
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
|
||||||
|
LD (BNKSELMROM),A
|
||||||
|
LD (BNKSELUSER),A ; and start up - ie. SA1510 Monitor - this occurs as User Bank 0 is enabled and the jmp to 0 is coded in it.
|
||||||
|
NOP ; Nops to allocate space for Bank 0 JP to startup code.
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
ENDIF ; 25 bytes.
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
IN A,(SFD700_MODE)
|
||||||
|
OR A
|
||||||
|
LD A,BNKDEFMROM_MZ80A ; Setup default MROM for an MZ80A, this is a 4K Window into the UROM at F000.
|
||||||
|
JR HWSEL21
|
||||||
|
LD A,BNKDEFMROM_MZ700 ; Setup default MROM for an MZ700, this is a 4K Window into the UROM at F000.
|
||||||
|
HWSEL21: OUT (REG_FXXX),A
|
||||||
|
LD A,BNKDEFUROM ; Setup default UROM, this is a 2K Window into the UROM at E800 and contains the RFS.
|
||||||
|
OUT (REG_EXXX),A
|
||||||
|
NOP ; Nops to allocate space to match RomDisk block.
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
ENDIF
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
; Macro to select which part of the FlashROM appears in the Monitor ROM 0000:0FFF Window.
|
||||||
|
; On the SFD700 board, for ease of coding as the Monitor ROM doesnt exist but the Floppy ROM F000:FFFF window does,
|
||||||
|
; then on this board, MROM refers to the F000:FFFF window when working with code which is compatible across the RomDisk, SFD700 etc..
|
||||||
|
HWSELMROM: MACRO
|
||||||
|
IF BUILD_ROMDISK = 1
|
||||||
|
LD (BNKSELMROM),A
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
OUT (REG_FXXX),A
|
||||||
|
ENDIF
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
; Macro to perform the in-situ bank switch. RomDisk it is a simple register load, for the SFD700
|
||||||
|
; depending on the target bank, we need to bring in the complimentary FXXX bank as needed.
|
||||||
|
BNKSWSEL: MACRO
|
||||||
|
IF BUILD_ROMDISK = 1
|
||||||
|
LD (BNKSELUSER),A
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
OUT (REG_EXXX),A ; Execute active bank switch.
|
||||||
|
CP ROMBANK6 ; ROMBANK6/7 page in ROM from E300:FFFF
|
||||||
|
JR C,BNKSWJMP
|
||||||
|
INC A
|
||||||
|
JR BNKSWJMP2
|
||||||
|
BNKSWJMP: LD A,(ROMBK1) ; All other banks place the current active ROM into F000:FXXX space.
|
||||||
|
BNKSWJMP2: OUT (REG_FXXX),A
|
||||||
|
ENDIF
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
; Macro to return from a bank switch.
|
||||||
|
BNKSWSELRET:MACRO
|
||||||
|
IF BUILD_ROMDISK = 1
|
||||||
|
LD (BNKSELUSER),A
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
OUT (REG_EXXX),A ; Execute active bank switch.
|
||||||
|
LD A,(ROMBK1) ; Ensure the current active ROM is switched to the F000:FXXX space.
|
||||||
|
OUT (REG_FXXX),A
|
||||||
|
ENDIF
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
; Macro to select which part of the FlashROM appears in the User ROM E800:EFFF window.
|
||||||
|
HWSELUROM: MACRO
|
||||||
|
IF BUILD_ROMDISK = 1
|
||||||
|
LD (BNKSELUSER),A
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
OUT (REG_EXXX),A
|
||||||
|
ENDIF
|
||||||
|
ENDM
|
||||||
|
|
||||||
|
; Macro which is generally specific to the RomDisk, the code enables the Bank paging registers.
|
||||||
|
SETCODELTCH:MACRO
|
||||||
|
IF BUILD_ROMDISK = 1
|
||||||
|
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
||||||
|
LD (ROMCTL),A ; Save to memory the value in the bank control register - this register is used for SPI etc so need to remember its setting.
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
ENDIF
|
||||||
|
ENDM
|
||||||
|
|||||||
@@ -41,9 +41,13 @@
|
|||||||
HW_SPI_ENA EQU 1 ; Set to 1 if hardware SPI is present on the RFS PCB v2 board.
|
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.
|
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.
|
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.
|
||||||
FUSIONX_ENA EQU 1 ; Set to 1 if using RFS on the tranZPUter FusionX board.
|
FUSIONX_ENA EQU 0 ; Set to 1 if using RFS on the tranZPUter FusionX board.
|
||||||
KUMA80_ENA EQU 0 ; Target has Kuma 40/80 upgrade installed.
|
KUMA80_ENA EQU 0 ; Target has Kuma 40/80 upgrade installed.
|
||||||
VIDEOMODULE_ENA EQU 0 ; Target has 40/80 column colour video module installed.
|
VIDEOMODULE_ENA EQU 0 ; Target has 40/80 column colour video module installed.
|
||||||
|
BUILD_ROMDISK EQU 0 ; RFS is built for the MZ-80A RomDisk card.
|
||||||
|
BUILD_SFD700 EQU 1 ; RFS is built for the SFD700 Floppy Disk Controller.
|
||||||
|
;BUILD_MZ80A EQU 0 ; RFS is customised to operate on an MZ-80A.
|
||||||
|
;BUILD_MZ700 EQU 1 ; RFS is customised to operate on an MZ-700.
|
||||||
|
|
||||||
; Debugging
|
; Debugging
|
||||||
ENADEBUG EQU 0 ; Enable debugging logic, 1 = enable, 0 = disable
|
ENADEBUG EQU 0 ; Enable debugging logic, 1 = enable, 0 = disable
|
||||||
@@ -53,9 +57,14 @@ ENADEBUG EQU 0 ; Enabl
|
|||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
UROMADDR EQU 0E800H ; Start of User ROM Address space.
|
UROMADDR EQU 0E800H ; Start of User ROM Address space.
|
||||||
UROMBSTBL EQU UROMADDR + 020H ; Entry point to the bank switching table.
|
UROMBSTBL EQU UROMADDR + 020H ; Entry point to the bank switching table.
|
||||||
RFSJMPTABLE EQU UROMADDR + 00080H ; Start of jump table.
|
RFSJMPTABLE EQU UROMADDR + 000B0H ; Start of jump table.
|
||||||
FDCROMADDR EQU 0F000H
|
FDCROMADDR EQU 0F000H
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
BNKDEFMROM_MZ80A EQU 0 ; Default MROM (FDC) selected, 1st 4k slot..
|
||||||
|
BNKDEFMROM_MZ700 EQU 1 ; Default MROM (FDC) selected, 1st 4k slot..
|
||||||
|
BNKDEFUROM EQU 2 ; Default UROM (RFS) selected, starts at 8K.
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
; Common character definitions.
|
; Common character definitions.
|
||||||
@@ -143,30 +152,24 @@ BRKEY EQU 0001Eh
|
|||||||
MELDY EQU 00030h
|
MELDY EQU 00030h
|
||||||
?TMST EQU 00033h
|
?TMST EQU 00033h
|
||||||
MONIT: EQU 00000h
|
MONIT: EQU 00000h
|
||||||
SS: EQU 00089h
|
|
||||||
ST1: EQU 00095h
|
|
||||||
HLHEX EQU 00410h
|
HLHEX EQU 00410h
|
||||||
_2HEX EQU 0041Fh
|
_2HEX EQU 0041Fh
|
||||||
?MODE: EQU 0074DH
|
|
||||||
?KEY EQU 008CAh
|
|
||||||
PRNT3 EQU 0096Ch
|
|
||||||
?ADCN EQU 00BB9h
|
|
||||||
?DACN EQU 00BCEh
|
|
||||||
?DSP: EQU 00DB5H
|
|
||||||
?BLNK EQU 00DA6h
|
|
||||||
?DPCT EQU 00DDCh
|
|
||||||
PRTHL: EQU 003BAh
|
PRTHL: EQU 003BAh
|
||||||
PRTHX: EQU 003C3h
|
PRTHX: EQU 003C3h
|
||||||
HEX: EQU 003F9h
|
PRNT3 EQU 0096Ch
|
||||||
|
?ADCN EQU 00BB9h
|
||||||
|
?DSP: EQU 00DB5H
|
||||||
DPCT: EQU 00DDCh
|
DPCT: EQU 00DDCh
|
||||||
DLY12: EQU 00DA7h
|
HEX: EQU 003F9h
|
||||||
DLY12A: EQU 00DAAh
|
|
||||||
?RSTR1: EQU 00EE6h
|
|
||||||
MOTOR: EQU 006A3H
|
|
||||||
CKSUM: EQU 0071AH
|
CKSUM: EQU 0071AH
|
||||||
GAP: EQU 0077AH
|
GAP: EQU 0077AH
|
||||||
WTAPE: EQU 00485H
|
|
||||||
MSTOP: EQU 00700H
|
MSTOP: EQU 00700H
|
||||||
|
MOTOR80A: EQU 006A3H
|
||||||
|
MOTOR700: EQU 0069FH
|
||||||
|
WTAPE80A: EQU 00485H
|
||||||
|
WTAPE700: EQU 0048AH
|
||||||
|
|
||||||
|
DLY12: EQU 00DA7h
|
||||||
|
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
; Memory mapped ports in hardware.
|
; Memory mapped ports in hardware.
|
||||||
@@ -192,6 +195,9 @@ INVDSP: EQU 0E014H
|
|||||||
NRMDSP: EQU 0E015H
|
NRMDSP: EQU 0E015H
|
||||||
SCLDSP: EQU 0E200H
|
SCLDSP: EQU 0E200H
|
||||||
SCLBASE: EQU 0E2H
|
SCLBASE: EQU 0E2H
|
||||||
|
;
|
||||||
|
; RomDisk memory mapped ports
|
||||||
|
;
|
||||||
BNKCTRLRST: EQU 0EFF8H ; Bank control reset, returns all registers to power up default.
|
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.
|
BNKCTRLDIS: EQU 0EFF9H ; Disable bank control registers by resetting the coded latch.
|
||||||
HWSPIDATA: EQU 0EFFBH ; Hardware SPI Data register (read/write).
|
HWSPIDATA: EQU 0EFFBH ; Hardware SPI Data register (read/write).
|
||||||
@@ -225,6 +231,8 @@ BNKCTRLDEF EQU BBMOSI+SDCS+BBCLK ; Defau
|
|||||||
SPI_OUT EQU 0FFH
|
SPI_OUT EQU 0FFH
|
||||||
SPI_IN EQU 0FEH
|
SPI_IN EQU 0FEH
|
||||||
;
|
;
|
||||||
|
; RomDisk
|
||||||
|
;
|
||||||
DOUT_LOW EQU 000H
|
DOUT_LOW EQU 000H
|
||||||
DOUT_HIGH EQU 004H
|
DOUT_HIGH EQU 004H
|
||||||
DOUT_MASK EQU 004H
|
DOUT_MASK EQU 004H
|
||||||
@@ -236,6 +244,8 @@ CLOCK_MASK EQU 0FDH
|
|||||||
CS_LOW EQU 000H
|
CS_LOW EQU 000H
|
||||||
CS_HIGH EQU 001H
|
CS_HIGH EQU 001H
|
||||||
;
|
;
|
||||||
|
; tranZPUter SW
|
||||||
|
;
|
||||||
MMCFG EQU 060H ; Memory management configuration latch.
|
MMCFG EQU 060H ; Memory management configuration latch.
|
||||||
SETXMHZ EQU 062H ; Select the alternate clock frequency.
|
SETXMHZ EQU 062H ; Select the alternate clock frequency.
|
||||||
SET2MHZ EQU 064H ; Select the system 2MHz clock frequency.
|
SET2MHZ EQU 064H ; Select the system 2MHz clock frequency.
|
||||||
@@ -255,6 +265,22 @@ MMIO4 EQU 0E4H ; MZ-70
|
|||||||
MMIO5 EQU 0E5H ; MZ-700/MZ-800 Memory Management Set 5
|
MMIO5 EQU 0E5H ; MZ-700/MZ-800 Memory Management Set 5
|
||||||
MMIO6 EQU 0E6H ; MZ-700/MZ-800 Memory Management Set 6
|
MMIO6 EQU 0E6H ; MZ-700/MZ-800 Memory Management Set 6
|
||||||
MMIO7 EQU 0E7H ; MZ-700/MZ-800 Memory Management Set 7
|
MMIO7 EQU 0E7H ; MZ-700/MZ-800 Memory Management Set 7
|
||||||
|
;
|
||||||
|
; SFD700
|
||||||
|
;
|
||||||
|
REG_EXXX EQU 060H ; A write copies D6:0 into the EXXX page address register to set a uniform 4K block in the region E300:EFFF window.
|
||||||
|
REG_FXXX EQU 061H ; A write copies D6:0 into the FXXX page address register to set a uniform 4k block in the region F000:FFFF.
|
||||||
|
REG_MEMMODE EQU 062H ; A write with D0 = low enables FlashROM, D0 = high enables RAM.
|
||||||
|
SFD700_MODE EQU 063H ; FDC Interface card configured target mode.
|
||||||
|
FDC_CMD EQU 0D8H ; WD1773 Command Register.
|
||||||
|
FDC_STATUS EQU 0D8H ; WD1773 Status Register.
|
||||||
|
FDC_TRACK EQU 0D9H ; WD1773 Track Register.
|
||||||
|
FDC_SECTOR EQU 0DAH ; WD1773 Sector Register.
|
||||||
|
FDC_DATA EQU 0DBH ; WD1773 Data Register.
|
||||||
|
FDC_DRIVE EQU 0DCH ; FDC Drive Select. D2 = 1 to enable, D1:0 = FDC number. D7 = Motor Enable.
|
||||||
|
FDC_SIDE EQU 0DDH ; FDC Side Select. D0 = Side.
|
||||||
|
FDC_DDEN EQU 0DEH ; FDC Double Density Enable.
|
||||||
|
FDC_IRQ EQU 0DFH ; A write enables WD1773 interrupts, a read disables WD1773 interrupts.
|
||||||
|
|
||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
; CPLD Configuration constants.
|
; CPLD Configuration constants.
|
||||||
@@ -323,6 +349,13 @@ RFSSECTSZ EQU 256
|
|||||||
MROMSIZE EQU 4096
|
MROMSIZE EQU 4096
|
||||||
UROMSIZE EQU 2048
|
UROMSIZE EQU 2048
|
||||||
FNSIZE EQU 17
|
FNSIZE EQU 17
|
||||||
|
IF BUILD_ROMDISK = 1
|
||||||
|
MROMSTART: EQU 00000H
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
MROMSTART: EQU 0F000H
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;
|
;
|
||||||
; Monitor ROM Jump Table definitions.
|
; Monitor ROM Jump Table definitions.
|
||||||
;
|
;
|
||||||
@@ -342,19 +375,34 @@ MROMLOAD: EQU MROMJMPTBL + 00006H
|
|||||||
;-----------------------------------------------
|
;-----------------------------------------------
|
||||||
MROMPAGES EQU 8
|
MROMPAGES EQU 8
|
||||||
USRROMPAGES EQU 12 ; Monitor ROM : User ROM
|
USRROMPAGES EQU 12 ; Monitor ROM : User ROM
|
||||||
ROMBANK0 EQU 0 ; MROM SA1510 40 Char : RFS Bank 0 - Main RFS Entry point and functions.
|
IF BUILD_ROMDISK = 1
|
||||||
ROMBANK1 EQU 1 ; MROM SA1510 80 Char : RFS Bank 1 - Floppy disk controller and utilities.
|
ROMBANK0 EQU 0 ; MROM SA1510 40 Char : RFS Bank 0 - Main RFS Entry point and functions.
|
||||||
ROMBANK2 EQU 2 ; CPM 2.2 CBIOS : RFS Bank 2 - SD Card controller and utilities.
|
ROMBANK1 EQU 1 ; MROM SA1510 80 Char : RFS Bank 1 - Floppy disk controller and utilities.
|
||||||
ROMBANK3 EQU 3 ; RFS Utilities : RFS Bank 3 - Cmdline tools (Memory, Printer, Help)
|
ROMBANK2 EQU 2 ; CPM 2.2 CBIOS : RFS Bank 2 - SD Card controller and utilities.
|
||||||
ROMBANK4 EQU 4 ; MZ700 1Z-013A 40C : RFS Bank 4 - CMT Utilities.
|
ROMBANK3 EQU 3 ; RFS Utilities : RFS Bank 3 - Cmdline tools (Memory, Printer, Help)
|
||||||
ROMBANK5 EQU 5 ; MZ700-1Z-013A 80C : RFS Bank 5
|
ROMBANK4 EQU 4 ; MZ700 1Z-013A 40C : RFS Bank 4 - CMT Utilities.
|
||||||
ROMBANK6 EQU 6 ; MZ-80B IPL : RFS Bank 6
|
ROMBANK5 EQU 5 ; MZ700-1Z-013A 80C : RFS Bank 5
|
||||||
ROMBANK7 EQU 7 ; Free : RFS Bank 7 - Memory and timer test utilities.
|
ROMBANK6 EQU 6 ; MZ-80B IPL : RFS Bank 6
|
||||||
ROMBANK8 EQU 8 ; : CBIOS Bank 1 - Utilities
|
ROMBANK7 EQU 7 ; Free : RFS Bank 7 - Memory and timer test utilities.
|
||||||
ROMBANK9 EQU 9 ; : CBIOS Bank 2 - Screen / ANSI Terminal
|
ROMBANK8 EQU 8 ; : CBIOS Bank 1 - Utilities
|
||||||
ROMBANK10 EQU 10 ; : CBIOS Bank 3 - SD Card
|
ROMBANK9 EQU 9 ; : CBIOS Bank 2 - Screen / ANSI Terminal
|
||||||
ROMBANK11 EQU 11 ; : CBIOS Bank 4 - Floppy disk controller.
|
ROMBANK10 EQU 10 ; : CBIOS Bank 3 - SD Card
|
||||||
|
ROMBANK11 EQU 11 ; : CBIOS Bank 4 - Floppy disk controller.
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ROMBANK0 EQU 0 + BNKDEFUROM ; : RFS Bank 0 - Main RFS Entry point and functions.
|
||||||
|
ROMBANK1 EQU 1 + BNKDEFUROM ; : RFS Bank 1 - Floppy disk controller and utilities.
|
||||||
|
ROMBANK2 EQU 2 + BNKDEFUROM ; : RFS Bank 2 - SD Card controller and utilities.
|
||||||
|
ROMBANK3 EQU 3 + BNKDEFUROM ; : RFS Bank 3 - Cmdline tools (Memory, Printer, Help)
|
||||||
|
ROMBANK4 EQU 4 + BNKDEFUROM ; : RFS Bank 4 - CMT Utilities.
|
||||||
|
ROMBANK5 EQU 5 + BNKDEFUROM ; : RFS Bank 5
|
||||||
|
ROMBANK6 EQU 6 + BNKDEFUROM ; : RFS Bank 6
|
||||||
|
ROMBANK7 EQU 8 + BNKDEFUROM ; : RFS Bank 7 - Memory and timer test utilities.
|
||||||
|
ROMBANK8 EQU 10 + BNKDEFUROM ; : CBIOS Bank 1 - Utilities
|
||||||
|
ROMBANK9 EQU 11 + BNKDEFUROM ; : CBIOS Bank 2 - Screen / ANSI Terminal
|
||||||
|
ROMBANK10 EQU 12 + BNKDEFUROM ; : CBIOS Bank 3 - SD Card
|
||||||
|
ROMBANK11 EQU 13 + BNKDEFUROM ; : CBIOS Bank 4 - Floppy disk controller.
|
||||||
|
ENDIF
|
||||||
|
|
||||||
; MMC/SD command (SPI mode)
|
; MMC/SD command (SPI mode)
|
||||||
CMD0 EQU 64 + 0 ; GO_IDLE_STATE
|
CMD0 EQU 64 + 0 ; GO_IDLE_STATE
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
i ; Bring in additional resources.
|
i ; Bring in additional resources.
|
||||||
INCLUDE "rfs_definitions.asm"
|
INCLUDE "rfs_definitions.asm"
|
||||||
INCLUDE "macros.asm"
|
INCLUDE "macros.asm"
|
||||||
|
SS: EQU 00089h
|
||||||
|
|
||||||
|
|
||||||
;======================================
|
;======================================
|
||||||
|
|||||||
546
asm/rfs.asm
546
asm/rfs.asm
@@ -10,18 +10,21 @@
|
|||||||
;- Credits:
|
;- Credits:
|
||||||
;- Copyright: (c) 2018-2023 Philip Smart <philip.smart@net2net.org>
|
;- Copyright: (c) 2018-2023 Philip Smart <philip.smart@net2net.org>
|
||||||
;-
|
;-
|
||||||
;- History: July 2019 - Merged 2 utilities to create this compilation.
|
;- History: v1.0 July 2019 - Merged 2 utilities to create this compilation.
|
||||||
; May 2020 - Bank switch changes with release of v2 pcb with coded latch. The coded
|
; v2.0 May 2020 - Bank switch changes with release of v2 pcb with coded latch. The coded
|
||||||
; latch adds additional instruction overhead as the control latches share
|
; latch adds additional instruction overhead as the control latches share
|
||||||
; the same address space as the Flash RAMS thus the extra hardware to
|
; the same address space as the Flash RAMS thus the extra hardware to
|
||||||
; only enable the control registers if a fixed number of reads is made
|
; only enable the control registers if a fixed number of reads is made
|
||||||
; into the upper 8 bytes which normally wouldnt occur. Caveat - ensure
|
; into the upper 8 bytes which normally wouldnt occur. Caveat - ensure
|
||||||
; that no loop instruction is ever placed into EFF8H - EFFFH.
|
; that no loop instruction is ever placed into EFF8H - EFFFH.
|
||||||
; July 2020 - Updated for the v2.1 hardware. RFS can run with a tranZPUter board with
|
; v2.0 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
|
; or without the K64 I/O processor. RFS wont use the K64 processor all
|
||||||
; operations are done by the Z80 under RFS.
|
; operations are done by the Z80 under RFS.
|
||||||
;- April 2021- Updates for the v2.1 RFS board.
|
;- v2.1 April 2021- Updates for the v2.1 RFS board.
|
||||||
;- June 2023 - Updates for the Kuma 40/80 upgrade.
|
;- v2.2 June 2023 - Updates for the Kuma 40/80 upgrade and FusionX.
|
||||||
|
;- v2.3 Aug 2023 - Updates to make RFS run under the SFD700 Floppy Disk Interface board.
|
||||||
|
;- UROM remains the same, a 2K paged ROM, MROM is located at F000 when
|
||||||
|
;- RFS is built for the SFD700.
|
||||||
;-
|
;-
|
||||||
;--------------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------------
|
||||||
;- This source file is free software: you can redistribute it and-or modify
|
;- This source file is free software: you can redistribute it and-or modify
|
||||||
@@ -41,6 +44,101 @@
|
|||||||
; Bring in additional resources.
|
; Bring in additional resources.
|
||||||
INCLUDE "rfs_definitions.asm"
|
INCLUDE "rfs_definitions.asm"
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ORG 0E000H
|
||||||
|
ALIGN 0E300H
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
; Monitor command table. This table contains the list of recognised commands along with the
|
||||||
|
; handler function and bank in which it is located.
|
||||||
|
;
|
||||||
|
; 7 6 5:3 2:0
|
||||||
|
; END MATCH BANK SIZE
|
||||||
|
CMDTABLE2: IF BUILD_SFD700 = 1
|
||||||
|
DB 000H | 000H | 038H | 003H
|
||||||
|
DB "ASM" ; Assembler.
|
||||||
|
DW ASM_MAIN
|
||||||
|
DB 000H | 000H | 000H | 005H
|
||||||
|
DB "BASIC" ; Load and run BASIC SA-5510.
|
||||||
|
DW LOADBASIC
|
||||||
|
DB 000H | 000H | 020H | 001H
|
||||||
|
DB 'B' ; Bell.
|
||||||
|
DW SGX
|
||||||
|
DB 000H | 000H | 000H | 003H
|
||||||
|
DB "CPM" ; Load and run CPM.
|
||||||
|
DW LOADCPM
|
||||||
|
DB 000H | 000H | 018H | 002H
|
||||||
|
DB "CP" ; Copy Memory.
|
||||||
|
DW MCOPY
|
||||||
|
DB 000H | 000H | 018H | 001H
|
||||||
|
DB 'C' ; Clear Memory.
|
||||||
|
DW INITMEMX
|
||||||
|
DB 000H | 000H | 038H | 004H
|
||||||
|
DB "DASM" ; Disassembler.
|
||||||
|
DW DASM_MAIN
|
||||||
|
DB 000H | 000H | 018H | 001H
|
||||||
|
DB 'D' ; Dump Memory.
|
||||||
|
DW DUMPX
|
||||||
|
DB 000H | 000H | 008H | 001H
|
||||||
|
DB 'F' ; RFS Floppy boot code.
|
||||||
|
DW FLOPPY
|
||||||
|
DB 000H | 000H | 008H | 001H
|
||||||
|
DB 0AAH ; Original Floppy boot code.
|
||||||
|
DW FDCK
|
||||||
|
DB 000H | 000H | 030H | 001H
|
||||||
|
DB 'H' ; Help screen.
|
||||||
|
DW HELP
|
||||||
|
DB 000H | 000H | 000H | 002H
|
||||||
|
DB "IR" ; List ROM directory.
|
||||||
|
DW DIRROM
|
||||||
|
DB 000H | 000H | 000H | 001H
|
||||||
|
DB 'J' ; Jump to address.
|
||||||
|
DW GOTOX
|
||||||
|
DB 000H | 000H | 020H | 004H
|
||||||
|
DB "LTNX" ; Load from CMT without auto execution.
|
||||||
|
DW LOADTAPENX
|
||||||
|
DB 000H | 000H | 020H | 002H
|
||||||
|
DB "LT" ; Load from CMT
|
||||||
|
DW LOADTAPE
|
||||||
|
DB 000H | 000H | 000H | 004H
|
||||||
|
DB "LRNX" ; Load from ROM without auto execution.
|
||||||
|
DW LOADROMNX
|
||||||
|
DB 000H | 000H | 000H | 002H
|
||||||
|
DB "LR" ; Load from ROM
|
||||||
|
DW LOADROM
|
||||||
|
DB 000H | 000H | 020H | 001H
|
||||||
|
DB "L" ; Original Load from CMT
|
||||||
|
DW LOADTAPE
|
||||||
|
DB 000H | 000H | 018H | 001H
|
||||||
|
DB 'M' ; Edit Memory.
|
||||||
|
DW MCORX
|
||||||
|
DB 000H | 000H | 018H | 001H
|
||||||
|
DB 'P' ; Printer test.
|
||||||
|
DW PTESTX
|
||||||
|
DB 000H | 000H | 020H | 001H
|
||||||
|
DB 'R' ; Memory test.
|
||||||
|
DW MEMTEST
|
||||||
|
DB 000H | 000H | 020H | 002H
|
||||||
|
DB "ST" ; Save to CMT
|
||||||
|
DW SAVEX
|
||||||
|
DB 000H | 000H | 020H | 001H
|
||||||
|
DB 'S' ; Save to CMT
|
||||||
|
DW SAVEX
|
||||||
|
DB 000H | 000H | 000H | 004H
|
||||||
|
DB "TEST" ; A test function used in debugging.
|
||||||
|
DW LOCALTEST
|
||||||
|
DB 000H | 000H | 020H | 001H
|
||||||
|
DB 'T' ; Timer test.
|
||||||
|
DW TIMERTST
|
||||||
|
DB 000H | 000H | 000H | 001H
|
||||||
|
DB 'V' ; Verify CMT Save.
|
||||||
|
DW VRFYX
|
||||||
|
DB 080H | 000H | 000H | 001H
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ALIGN UROMADDR
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;============================================================
|
;============================================================
|
||||||
;
|
;
|
||||||
@@ -49,20 +147,11 @@
|
|||||||
;============================================================
|
;============================================================
|
||||||
ORG UROMADDR
|
ORG UROMADDR
|
||||||
|
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
; Common code spanning all banks.
|
; Common code spanning all banks.
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
ROMFS: NOP
|
ROMFS: NOP
|
||||||
LD B,16 ; If we read the bank control reset register 15 times then this will enable bank control and then the 16th read will reset all bank control registers to default.
|
HWSELROM ; Select the first ROM.
|
||||||
ROMFS_0: LD A,(BNKCTRLRST)
|
|
||||||
DJNZ ROMFS_0 ; Apply the default number of coded latch reads to enable the bank control registers.
|
|
||||||
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
|
||||||
LD (BNKCTRL),A
|
|
||||||
LD (ROMCTL),A ; Save to memory the value in the bank control register - this register is used for SPI etc so need to remember its setting.
|
|
||||||
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
|
|
||||||
LD (BNKSELMROM),A
|
|
||||||
LD (BNKSELUSER),A ; and start up - ie. SA1510 Monitor - this occurs as User Bank 0 is enabled and the jmp to 0 is coded in it.
|
|
||||||
JP ROMFS_1 ; Skip the reset vector.
|
JP ROMFS_1 ; Skip the reset vector.
|
||||||
JP 00000H ; Other banks will switch at this point thus forcing a full reset.
|
JP 00000H ; Other banks will switch at this point thus forcing a full reset.
|
||||||
|
|
||||||
@@ -117,10 +206,10 @@ BKSW0_0: PUSH HL ; Place
|
|||||||
LD HL, BKSWRET0 ; Place bank switchers return address on stack.
|
LD HL, BKSWRET0 ; Place bank switchers return address on stack.
|
||||||
EX (SP),HL
|
EX (SP),HL
|
||||||
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
||||||
LD (BNKSELUSER), A ; Repeat the bank switch B times to enable the bank control register and set its value.
|
BNKSWSEL
|
||||||
JP (HL) ; Jump to required function.
|
JP (HL) ; Jump to required function.
|
||||||
BKSWRET0: POP AF ; Get bank which called us.
|
BKSWRET0: POP AF ; Get bank which called us.
|
||||||
LD (BNKSELUSER), A ; Return to that bank.
|
BNKSWSELRET
|
||||||
POP AF
|
POP AF
|
||||||
RET ; Return to caller.
|
RET ; Return to caller.
|
||||||
|
|
||||||
@@ -162,12 +251,11 @@ ROMFS_1:
|
|||||||
ROMFS_2: LD (HL),A
|
ROMFS_2: LD (HL),A
|
||||||
INC HL
|
INC HL
|
||||||
DJNZ ROMFS_2
|
DJNZ ROMFS_2
|
||||||
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
SETCODELTCH ; On RomDisk setup coded latch to default.
|
||||||
LD (ROMCTL),A ; Save to memory the value in the bank control register - this register is used for SPI etc so need to remember its setting.
|
LD A, (ROMBK1)
|
||||||
LD A,(ROMBK1)
|
ROMFS_3: HWSELMROM ; start up.
|
||||||
ROMFS_3: LD (BNKSELMROM),A ; start up.
|
|
||||||
LD A, (ROMBK2)
|
LD A, (ROMBK2)
|
||||||
LD (BNKSELUSER),A
|
HWSELUROM
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
; START OF RFS INITIALISATION AND COMMAND ENTRY PROCESSOR FUNCTIONALITY.
|
; START OF RFS INITIALISATION AND COMMAND ENTRY PROCESSOR FUNCTIONALITY.
|
||||||
@@ -175,7 +263,7 @@ ROMFS_3: LD (BNKSELMROM),A ; start
|
|||||||
;
|
;
|
||||||
; Replacement command processor in place of the SA1510 command processor.
|
; Replacement command processor in place of the SA1510 command processor.
|
||||||
;
|
;
|
||||||
MONITOR: IF FUSIONX_ENA = 0
|
MONITOR: IF FUSIONX_ENA+BUILD_SFD700 = 0
|
||||||
IN A,(CPLDINFO) ; See if a tranZPUter board is present.
|
IN A,(CPLDINFO) ; See if a tranZPUter board is present.
|
||||||
AND 0E7H ; Mask out the CPLD Version and host HW.
|
AND 0E7H ; Mask out the CPLD Version and host HW.
|
||||||
LD C,A
|
LD C,A
|
||||||
@@ -198,11 +286,15 @@ CHKTZ1: AND 0E0H
|
|||||||
XOR A ; Set the initial SDCFS active drive number.
|
XOR A ; Set the initial SDCFS active drive number.
|
||||||
LD (SDDRIVENO),A
|
LD (SDDRIVENO),A
|
||||||
;
|
;
|
||||||
LD A, (ROMBK1)
|
IF BUILD_ROMDISK = 1
|
||||||
CP 1
|
LD A, (ROMBK1) ; Is the 80column MZ-80A monitor active? Yes, set display as 80col.
|
||||||
JR Z, SET80CHAR
|
CP 1
|
||||||
CP 0
|
JR Z, SET80CHAR
|
||||||
JR NZ, SIGNON
|
CP 0
|
||||||
|
JR NZ, SIGNON
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1 ; Ensure in 40 column mode.
|
||||||
|
ENDIF
|
||||||
;
|
;
|
||||||
SET40CHAR: IF VIDEOMODULE_ENA = 1
|
SET40CHAR: IF VIDEOMODULE_ENA = 1
|
||||||
XOR A ; Using MROM in Bank 0 = 40 char mode.
|
XOR A ; Using MROM in Bank 0 = 40 char mode.
|
||||||
@@ -249,21 +341,23 @@ SIGNON3: LD HL,PRINTMSG
|
|||||||
; JR ST1X
|
; JR ST1X
|
||||||
|
|
||||||
; Initialise SD card, report any errors.
|
; Initialise SD card, report any errors.
|
||||||
LD HL, SDINIT ; SD Card Initialisation
|
IF BUILD_ROMDISK = 1
|
||||||
CALL BKSW0to2 ; Call the initialisation routine.
|
LD HL, SDINIT ; SD Card Initialisation
|
||||||
LD A,L
|
CALL BKSW0to2 ; Call the initialisation routine.
|
||||||
OR A ; 0 = No error.
|
LD A,L
|
||||||
JR Z,ST1X
|
OR A ; 0 = No error.
|
||||||
|
JR Z,ST1X
|
||||||
|
|
||||||
; Place error code in C to print as a number and report with the error message.
|
; Place error code in C to print as a number and report with the error message.
|
||||||
ADD A,'0'
|
ADD A,'0'
|
||||||
LD C,A
|
LD C,A
|
||||||
LD DE,MSGSDINITER
|
LD DE,MSGSDINITER
|
||||||
LD HL,PRINTMSG
|
LD HL,PRINTMSG
|
||||||
CALL BKSW0to6
|
CALL BKSW0to6
|
||||||
|
ENDIF
|
||||||
|
|
||||||
; Command processor, table based.
|
; Command processor, table based.
|
||||||
; A line is inpt then a comparison made with entries in the table. If a match is found then the bank and function
|
; A line is input then a comparison made with entries in the table. If a match is found then the bank and function
|
||||||
; address are extracted and a call to the function @ given bank made. The commands can be of variable length
|
; address are extracted and a call to the function @ given bank made. The commands can be of variable length
|
||||||
; but important to not that longer commands using the same letters as shorter commands must appear first in the table.
|
; but important to not that longer commands using the same letters as shorter commands must appear first in the table.
|
||||||
;
|
;
|
||||||
@@ -290,7 +384,12 @@ ST1X: CALL NL ; Comma
|
|||||||
;
|
;
|
||||||
CMDCMP: XOR A ; Clear the result variable used by interbank calls. Some functions set this variable and we act on it.
|
CMDCMP: XOR A ; Clear the result variable used by interbank calls. Some functions set this variable and we act on it.
|
||||||
LD (RESULT),A
|
LD (RESULT),A
|
||||||
LD HL,CMDTABLE
|
IF BUILD_ROMDISK = 1
|
||||||
|
LD HL,CMDTABLE
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
LD HL,CMDTABLE2
|
||||||
|
ENDIF
|
||||||
CMDCMP0: LD DE,BUFER+1 ; First command byte after the * prompt.
|
CMDCMP0: LD DE,BUFER+1 ; First command byte after the * prompt.
|
||||||
LD A,(HL)
|
LD A,(HL)
|
||||||
CP 000H
|
CP 000H
|
||||||
@@ -348,7 +447,12 @@ CMDCMP6: LD DE,CMDCMPEND ; Put r
|
|||||||
LD DE,(TMPADR) ; For the current bank, just jump to the function.
|
LD DE,(TMPADR) ; For the current bank, just jump to the function.
|
||||||
JP (HL)
|
JP (HL)
|
||||||
|
|
||||||
CMDNOCMP: LD DE,MSGBADCMD
|
CMDNOCMP: LD A,(BUFER+1) ; If nothing was entered, ignore line otherwise print questions to show command wasnt recognised.
|
||||||
|
OR A
|
||||||
|
JR Z,CMDCMPEND
|
||||||
|
CP 00DH
|
||||||
|
JR Z,CMDCMPEND
|
||||||
|
LD DE,MSGBADCMD
|
||||||
LD HL,PRINTMSG
|
LD HL,PRINTMSG
|
||||||
CALL BKSW0to6
|
CALL BKSW0to6
|
||||||
CMDCMPEND: LD A,(RESULT)
|
CMDCMPEND: LD A,(RESULT)
|
||||||
@@ -362,115 +466,117 @@ CMDCMPEND: LD A,(RESULT)
|
|||||||
;
|
;
|
||||||
; 7 6 5:3 2:0
|
; 7 6 5:3 2:0
|
||||||
; END MATCH BANK SIZE
|
; END MATCH BANK SIZE
|
||||||
CMDTABLE: DB 000H | 000H | 000H | 002H ; Bit 2:0 = Command Size, 5:3 = Bank, 6 = Command match, 7 = Command table end.
|
CMDTABLE: IF BUILD_ROMDISK = 1
|
||||||
DB "40" ; 40 Char screen mode.
|
DB 000H | 000H | 000H | 002H ; Bit 2:0 = Command Size, 5:3 = Bank, 6 = Command match, 7 = Command table end.
|
||||||
DW SETMODE40
|
DB "40" ; 40 Char screen mode.
|
||||||
DB 000H | 000H | 000H | 002H
|
DW SETMODE40
|
||||||
DB "80" ; 80 Char screen mode.
|
DB 000H | 000H | 000H | 002H
|
||||||
DW SETMODE80
|
DB "80" ; 80 Char screen mode.
|
||||||
;DB 000H | 000H | 000H | 004H
|
DW SETMODE80
|
||||||
;DB "7008" ; Switch to 80 column MZ700 mode.
|
;DB 000H | 000H | 000H | 004H
|
||||||
;DW SETMODE7008
|
;DB "7008" ; Switch to 80 column MZ700 mode.
|
||||||
;DB 000H | 000H | 000H | 003H
|
;DW SETMODE7008
|
||||||
;DB "700" ; Switch to 40 column MZ700 mode.
|
;DB 000H | 000H | 000H | 003H
|
||||||
;DW SETMODE700
|
;DB "700" ; Switch to 40 column MZ700 mode.
|
||||||
DB 000H | 000H | 000H | 005H
|
;DW SETMODE700
|
||||||
DB "BASIC" ; Load and run BASIC SA-5510.
|
DB 000H | 000H | 000H | 005H
|
||||||
DW LOADBASIC
|
DB "BASIC" ; Load and run BASIC SA-5510.
|
||||||
DB 000H | 000H | 020H | 001H
|
DW LOADBASIC
|
||||||
DB 'B' ; Bell.
|
DB 000H | 000H | 020H | 001H
|
||||||
DW SGX
|
DB 'B' ; Bell.
|
||||||
DB 000H | 000H | 000H | 003H
|
DW SGX
|
||||||
DB "CPM" ; Load and run CPM.
|
DB 000H | 000H | 000H | 003H
|
||||||
DW LOADCPM
|
DB "CPM" ; Load and run CPM.
|
||||||
DB 000H | 000H | 018H | 002H
|
DW LOADCPM
|
||||||
DB "CP" ; Copy Memory.
|
DB 000H | 000H | 018H | 002H
|
||||||
DW MCOPY
|
DB "CP" ; Copy Memory.
|
||||||
DB 000H | 000H | 018H | 001H
|
DW MCOPY
|
||||||
DB 'C' ; Clear Memory.
|
DB 000H | 000H | 018H | 001H
|
||||||
DW INITMEMX
|
DB 'C' ; Clear Memory.
|
||||||
DB 000H | 000H | 018H | 001H
|
DW INITMEMX
|
||||||
DB 'D' ; Dump Memory.
|
DB 000H | 000H | 018H | 001H
|
||||||
DW DUMPX
|
DB 'D' ; Dump Memory.
|
||||||
DB 000H | 000H | 010H | 002H
|
DW DUMPX
|
||||||
DB "EC" ; Erase file.
|
DB 000H | 000H | 010H | 002H
|
||||||
DW ERASESD
|
DB "EC" ; Erase file.
|
||||||
DB 000H | 000H | 008H | 001H
|
DW ERASESD
|
||||||
DB 'F' ; RFS Floppy boot code.
|
DB 000H | 000H | 008H | 001H
|
||||||
DW FLOPPY
|
DB 'F' ; RFS Floppy boot code.
|
||||||
DB 000H | 000H | 008H | 001H
|
DW FLOPPY
|
||||||
DB 0AAH ; Original Floppy boot code.
|
DB 000H | 000H | 008H | 001H
|
||||||
DW FDCK
|
DB 0AAH ; Original Floppy boot code.
|
||||||
DB 000H | 000H | 030H | 001H
|
DW FDCK
|
||||||
DB 'H' ; Help screen.
|
DB 000H | 000H | 030H | 001H
|
||||||
DW HELP
|
DB 'H' ; Help screen.
|
||||||
DB 000H | 000H | 000H | 002H
|
DW HELP
|
||||||
DB "IR" ; List ROM directory.
|
DB 000H | 000H | 000H | 002H
|
||||||
DW DIRROM
|
DB "IR" ; List ROM directory.
|
||||||
DB 000H | 000H | 010H | 002H
|
DW DIRROM
|
||||||
DB "IC" ; List SD Card directory.
|
DB 000H | 000H | 010H | 002H
|
||||||
DW DIRSDCARD
|
DB "IC" ; List SD Card directory.
|
||||||
DB 000H | 000H | 000H | 001H
|
DW DIRSDCARD
|
||||||
DB 'J' ; Jump to address.
|
DB 000H | 000H | 000H | 001H
|
||||||
DW GOTOX
|
DB 'J' ; Jump to address.
|
||||||
DB 000H | 000H | 020H | 004H
|
DW GOTOX
|
||||||
DB "LTNX" ; Load from CMT without auto execution.
|
DB 000H | 000H | 020H | 004H
|
||||||
DW LOADTAPENX
|
DB "LTNX" ; Load from CMT without auto execution.
|
||||||
DB 000H | 000H | 020H | 002H
|
DW LOADTAPENX
|
||||||
DB "LT" ; Load from CMT
|
DB 000H | 000H | 020H | 002H
|
||||||
DW LOADTAPE
|
DB "LT" ; Load from CMT
|
||||||
DB 000H | 000H | 000H | 004H
|
DW LOADTAPE
|
||||||
DB "LRNX" ; Load from ROM without auto execution.
|
DB 000H | 000H | 000H | 004H
|
||||||
DW LOADROMNX
|
DB "LRNX" ; Load from ROM without auto execution.
|
||||||
DB 000H | 000H | 000H | 002H
|
DW LOADROMNX
|
||||||
DB "LR" ; Load from ROM
|
DB 000H | 000H | 000H | 002H
|
||||||
DW LOADROM
|
DB "LR" ; Load from ROM
|
||||||
DB 000H | 000H | 010H | 004H
|
DW LOADROM
|
||||||
DB "LCNX" ; Load from SDCARD without auto execution.
|
DB 000H | 000H | 010H | 004H
|
||||||
DW LOADSDCARDX
|
DB "LCNX" ; Load from SDCARD without auto execution.
|
||||||
DB 000H | 000H | 010H | 002H
|
DW LOADSDCARDX
|
||||||
DB "LC" ; Load from SD CARD
|
DB 000H | 000H | 010H | 002H
|
||||||
DW LOADSDCARD
|
DB "LC" ; Load from SD CARD
|
||||||
DB 000H | 000H | 020H | 001H
|
DW LOADSDCARD
|
||||||
DB "L" ; Original Load from CMT
|
DB 000H | 000H | 020H | 001H
|
||||||
DW LOADTAPE
|
DB "L" ; Original Load from CMT
|
||||||
DB 000H | 000H | 018H | 001H
|
DW LOADTAPE
|
||||||
DB 'M' ; Edit Memory.
|
DB 000H | 000H | 018H | 001H
|
||||||
DW MCORX
|
DB 'M' ; Edit Memory.
|
||||||
DB 000H | 000H | 018H | 001H
|
DW MCORX
|
||||||
DB 'P' ; Printer test.
|
DB 000H | 000H | 018H | 001H
|
||||||
DW PTESTX
|
DB 'P' ; Printer test.
|
||||||
DB 000H | 000H | 038H | 001H
|
DW PTESTX
|
||||||
DB 'R' ; Memory test.
|
DB 000H | 000H | 020H | 001H
|
||||||
DW MEMTEST
|
DB 'R' ; Memory test.
|
||||||
DB 000H | 000H | 018H | 004H
|
DW MEMTEST
|
||||||
DB "SD2T" ; Copy SD Card to Tape.
|
DB 000H | 000H | 018H | 004H
|
||||||
DW SD2TAPE
|
DB "SD2T" ; Copy SD Card to Tape.
|
||||||
DB 000H | 000H | 010H | 002H
|
DW SD2TAPE
|
||||||
DB "SC" ; Save to SD CARD
|
DB 000H | 000H | 010H | 002H
|
||||||
DW SAVESDCARD
|
DB "SC" ; Save to SD CARD
|
||||||
DB 000H | 000H | 020H | 002H
|
DW SAVESDCARD
|
||||||
DB "ST" ; Save to CMT
|
DB 000H | 000H | 020H | 002H
|
||||||
DW SAVEX
|
DB "ST" ; Save to CMT
|
||||||
DB 000H | 000H | 020H | 001H
|
DW SAVEX
|
||||||
DB 'S' ; Save to CMT
|
DB 000H | 000H | 020H | 001H
|
||||||
DW SAVEX
|
DB 'S' ; Save to CMT
|
||||||
DB 000H | 000H | 000H | 004H
|
DW SAVEX
|
||||||
DB "TEST" ; A test function used in debugging.
|
DB 000H | 000H | 000H | 004H
|
||||||
DW LOCALTEST
|
DB "TEST" ; A test function used in debugging.
|
||||||
DB 000H | 000H | 018H | 004H
|
DW LOCALTEST
|
||||||
DB "T2SD" ; Copy Tape to SD Card.
|
DB 000H | 000H | 018H | 004H
|
||||||
DW TAPE2SD
|
DB "T2SD" ; Copy Tape to SD Card.
|
||||||
DB 000H | 000H | 038H | 001H
|
DW TAPE2SD
|
||||||
DB 'T' ; Timer test.
|
DB 000H | 000H | 020H | 001H
|
||||||
DW TIMERTST
|
DB 'T' ; Timer test.
|
||||||
DB 000H | 000H | 000H | 001H
|
DW TIMERTST
|
||||||
DB 'V' ; Verify CMT Save.
|
DB 000H | 000H | 000H | 001H
|
||||||
DW VRFYX
|
DB 'V' ; Verify CMT Save.
|
||||||
DB 000H | 000H | 000H | 001H
|
DW VRFYX
|
||||||
DB 'X' ; Exchange to hi load rom so DRAM = 0000:0CFFF
|
DB 000H | 000H | 000H | 001H
|
||||||
DW HIROM
|
DB 'X' ; Exchange to hi load rom so DRAM = 0000:0CFFF
|
||||||
DB 080H | 000H | 000H | 001H
|
DW HIROM
|
||||||
|
DB 080H | 000H | 000H | 001H
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
; END OF RFS INITIALISATION AND COMMAND ENTRY PROCESSOR FUNCTIONALITY.
|
; END OF RFS INITIALISATION AND COMMAND ENTRY PROCESSOR FUNCTIONALITY.
|
||||||
@@ -507,41 +613,47 @@ HEXIYX2: POP AF ; Waste
|
|||||||
;
|
;
|
||||||
;====================================
|
;====================================
|
||||||
|
|
||||||
HIROM: LD A, (MEMSW) ; Swap ROM into high range slot.
|
HIROM: IF BUILD_ROMDISK = 1
|
||||||
LD A, ROMBANK2
|
LD A, (MEMSW) ; Swap ROM into high range slot.
|
||||||
LD (ROMBK1),A ; Save bank being enabled.
|
LD A, ROMBANK2
|
||||||
LD (BNKSELMROM),A ; Switch to the hiload rom in bank 2.
|
LD (ROMBK1),A ; Save bank being enabled.
|
||||||
JP 0C000H
|
HWSELMROM ; Switch to the hiload rom in bank 2.
|
||||||
|
JP 0C000H
|
||||||
|
ENDIF
|
||||||
|
|
||||||
SETMODE40: LD A, ROMBANK0 ; Switch to 40Char monitor.
|
SETMODE40: IF BUILD_ROMDISK = 1
|
||||||
LD (ROMBK1),A
|
LD A, ROMBANK0 ; Switch to 40Char monitor.
|
||||||
LD (BNKSELMROM),A
|
LD (ROMBK1),A
|
||||||
IF VIDEOMODULE_ENA = 1
|
HWSELMROM
|
||||||
LD HL,DSPCTL ; Setup address of display control register latch.
|
IF VIDEOMODULE_ENA = 1
|
||||||
LD A, 0
|
LD HL,DSPCTL ; Setup address of display control register latch.
|
||||||
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
|
LD A, 0
|
||||||
LD (HL), A
|
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
|
||||||
|
LD (HL), A
|
||||||
|
ENDIF
|
||||||
|
IF KUMA80_ENA = 1 ; Kuma80 modification uses INTEN on PC@ of 8255, 0 = 40 column.
|
||||||
|
LD A,04H
|
||||||
|
LD (KEYPF),A
|
||||||
|
ENDIF
|
||||||
|
JP MONIT
|
||||||
ENDIF
|
ENDIF
|
||||||
IF KUMA80_ENA = 1 ; Kuma80 modification uses INTEN on PC@ of 8255, 0 = 40 column.
|
|
||||||
LD A,04H
|
|
||||||
LD (KEYPF),A
|
|
||||||
ENDIF
|
|
||||||
JP MONIT
|
|
||||||
|
|
||||||
SETMODE80: LD A, ROMBANK1 ; Switch to 80char monitor.
|
SETMODE80: IF BUILD_ROMDISK = 1
|
||||||
LD (ROMBK1),A
|
LD A, ROMBANK1 ; Switch to 80char monitor.
|
||||||
LD (BNKSELMROM),A
|
LD (ROMBK1),A
|
||||||
IF VIDEOMODULE_ENA = 1
|
HWSELMROM
|
||||||
LD HL,DSPCTL ; Setup address of display control register latch.
|
IF VIDEOMODULE_ENA = 1
|
||||||
LD A, 128
|
LD HL,DSPCTL ; Setup address of display control register latch.
|
||||||
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
|
LD A, 128
|
||||||
LD (HL), A
|
LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
|
||||||
|
LD (HL), A
|
||||||
|
ENDIF
|
||||||
|
IF KUMA80_ENA = 1 ; Kuma80 modification uses INTEN on PC@ of 8255, 0 = 40 column.
|
||||||
|
LD A,05H
|
||||||
|
LD (KEYPF),A
|
||||||
|
ENDIF
|
||||||
|
JP MONIT
|
||||||
ENDIF
|
ENDIF
|
||||||
IF KUMA80_ENA = 1 ; Kuma80 modification uses INTEN on PC@ of 8255, 0 = 40 column.
|
|
||||||
LD A,05H
|
|
||||||
LD (KEYPF),A
|
|
||||||
ENDIF
|
|
||||||
JP MONIT
|
|
||||||
|
|
||||||
NOTZPU: LD DE,MSGNOTZINST ; No tranZPUter installed.
|
NOTZPU: LD DE,MSGNOTZINST ; No tranZPUter installed.
|
||||||
LD HL,PRINTMSG
|
LD HL,PRINTMSG
|
||||||
@@ -640,8 +752,10 @@ _PRTDBG: IF ENADEBUG = 1
|
|||||||
PUSH DE
|
PUSH DE
|
||||||
PUSH BC
|
PUSH BC
|
||||||
PUSH AF
|
PUSH AF
|
||||||
LD A,(ROMBK1)
|
IF BUILD_ROMDISK = 1
|
||||||
LD (BNKSELMROM),A ; Set the MROM bank back to original.
|
LD A,(ROMBK1)
|
||||||
|
HWSELMROM ; Set the MROM bank back to original.
|
||||||
|
ENDIF
|
||||||
CALL PRTHL ; HL
|
CALL PRTHL ; HL
|
||||||
LD A, ' '
|
LD A, ' '
|
||||||
CALL PRNT
|
CALL PRNT
|
||||||
@@ -666,8 +780,10 @@ _PRTDBG: IF ENADEBUG = 1
|
|||||||
CALL PRNT
|
CALL PRNT
|
||||||
; CALL NL
|
; CALL NL
|
||||||
; CALL GETKY
|
; CALL GETKY
|
||||||
LD A,(WRKROMBK1)
|
IF BUILD_ROMDISK = 1
|
||||||
LD (BNKSELMROM),A ; Set the MROM bank back to scanned bank.
|
LD A,(WRKROMBK1)
|
||||||
|
HWSELMROM ; Set the MROM bank back to scanned bank.
|
||||||
|
ENDIF
|
||||||
POP AF
|
POP AF
|
||||||
POP BC
|
POP BC
|
||||||
POP DE
|
POP DE
|
||||||
@@ -679,8 +795,10 @@ _PRTMZF: PUSH BC
|
|||||||
PUSH DE
|
PUSH DE
|
||||||
PUSH HL
|
PUSH HL
|
||||||
;
|
;
|
||||||
LD A,(ROMBK1) ; Ensure main MROM is switched in.
|
IF BUILD_ROMDISK = 1
|
||||||
LD (BNKSELMROM),A
|
LD A,(ROMBK1) ; Ensure main MROM is switched in.
|
||||||
|
HWSELMROM
|
||||||
|
ENDIF
|
||||||
;
|
;
|
||||||
LD A,(SCRNMODE)
|
LD A,(SCRNMODE)
|
||||||
CP 0
|
CP 0
|
||||||
@@ -746,8 +864,10 @@ PRTMZF2: LD L,A
|
|||||||
PRTMZF3: XOR A
|
PRTMZF3: XOR A
|
||||||
PRTMZF4: OR A
|
PRTMZF4: OR A
|
||||||
PUSH AF
|
PUSH AF
|
||||||
LD A, (WRKROMBK1)
|
IF BUILD_ROMDISK = 1
|
||||||
LD (BNKSELMROM),A
|
LD A, (WRKROMBK1)
|
||||||
|
HWSELMROM
|
||||||
|
ENDIF
|
||||||
POP AF
|
POP AF
|
||||||
POP HL
|
POP HL
|
||||||
POP DE
|
POP DE
|
||||||
@@ -770,12 +890,14 @@ DIRROM: ;DI ; Disab
|
|||||||
LD D,0 ; File numbering start.
|
LD D,0 ; File numbering start.
|
||||||
|
|
||||||
;
|
;
|
||||||
; Get directory of User ROM.
|
; Get directory of User ROM (RomDisk).
|
||||||
;
|
;
|
||||||
LD A,ROMBANK3
|
IF BUILD_ROMDISK = 1
|
||||||
LD (WRKROMBK1),A
|
LD A,ROMBANK3
|
||||||
LD (BNKSELMROM),A
|
LD (WRKROMBK1),A
|
||||||
CALL DIRMROM
|
HWSELMROM
|
||||||
|
CALL DIRMROM
|
||||||
|
ENDIF
|
||||||
;
|
;
|
||||||
; Scan MROM Bank
|
; Scan MROM Bank
|
||||||
; B = Bank Page
|
; B = Bank Page
|
||||||
@@ -786,7 +908,7 @@ DIRROM: ;DI ; Disab
|
|||||||
;
|
;
|
||||||
DIRNXTPG: LD A,B
|
DIRNXTPG: LD A,B
|
||||||
LD (WRKROMBK1), A
|
LD (WRKROMBK1), A
|
||||||
LD (BNKSELMROM),A ; Select bank.
|
HWSELMROM ; Select bank.
|
||||||
|
|
||||||
PUSH BC ; Preserve bank count/block number.
|
PUSH BC ; Preserve bank count/block number.
|
||||||
PUSH DE ; Preserve file numbering.
|
PUSH DE ; Preserve file numbering.
|
||||||
@@ -799,7 +921,7 @@ DIRNXTPG: LD A,B
|
|||||||
ENDIF
|
ENDIF
|
||||||
LD B,A
|
LD B,A
|
||||||
LD C,0
|
LD C,0
|
||||||
LD HL,RFS_ATRB ; Add block offset to get the valid block address.
|
LD HL,MROMSTART ; Add block offset to get the valid block address.
|
||||||
ADD HL,BC
|
ADD HL,BC
|
||||||
CALL ISMZF
|
CALL ISMZF
|
||||||
POP DE
|
POP DE
|
||||||
@@ -821,7 +943,7 @@ DIRNXTPG2: LD A,B
|
|||||||
JR NZ, DIRNXTPG
|
JR NZ, DIRNXTPG
|
||||||
|
|
||||||
DIRNXTPGX: LD A,(ROMBK1)
|
DIRNXTPGX: LD A,(ROMBK1)
|
||||||
LD (BNKSELMROM),A ; Set the MROM bank back to original.
|
HWSELMROM ; Set the MROM bank back to original.
|
||||||
;EI ; No need to block interrupts now as MROM bank restored.
|
;EI ; No need to block interrupts now as MROM bank restored.
|
||||||
RET ; End of scan, return to monitor
|
RET ; End of scan, return to monitor
|
||||||
|
|
||||||
@@ -852,10 +974,10 @@ FINDMZF0: POP DE ; Get f
|
|||||||
LD C,0 ; Block in page.
|
LD C,0 ; Block in page.
|
||||||
FINDMZF1: LD A,B
|
FINDMZF1: LD A,B
|
||||||
LD (WRKROMBK1), A
|
LD (WRKROMBK1), A
|
||||||
LD (BNKSELMROM),A ; Select bank.
|
HWSELMROM ; Select bank.
|
||||||
FINDMZF2: PUSH BC ; Preserve bank count/block number.
|
FINDMZF2: PUSH BC ; Preserve bank count/block number.
|
||||||
PUSH DE ; Preserve file numbering.
|
PUSH DE ; Preserve file numbering.
|
||||||
LD HL,RFS_ATRB ; Add block offset to get the valid block.
|
LD HL,MROMSTART ; Add block offset to get the valid block.
|
||||||
LD A,C
|
LD A,C
|
||||||
IF RFSSECTSZ >= 512
|
IF RFSSECTSZ >= 512
|
||||||
RLCA
|
RLCA
|
||||||
@@ -871,7 +993,7 @@ FINDMZF2: PUSH BC ; Prese
|
|||||||
POP DE
|
POP DE
|
||||||
POP BC
|
POP BC
|
||||||
LD A,(ROMBK1)
|
LD A,(ROMBK1)
|
||||||
LD (BNKSELMROM),A ; Set the MROM bank back to original.
|
HWSELMROM ; Set the MROM bank back to original.
|
||||||
JR NZ, FINDMZF4 ; Z set if we found an MZF record.
|
JR NZ, FINDMZF4 ; Z set if we found an MZF record.
|
||||||
INC HL ; Save address of filename.
|
INC HL ; Save address of filename.
|
||||||
PUSH HL
|
PUSH HL
|
||||||
@@ -892,7 +1014,7 @@ FINDMZF3: POP HL
|
|||||||
LD DE,(TMPADR) ; Original DE put onto stack, original filename into HL
|
LD DE,(TMPADR) ; Original DE put onto stack, original filename into HL
|
||||||
LD BC,FNSIZE
|
LD BC,FNSIZE
|
||||||
LD A,(WRKROMBK1)
|
LD A,(WRKROMBK1)
|
||||||
LD (BNKSELMROM),A ; Select correct bank for comparison.
|
HWSELMROM ; Select correct bank for comparison.
|
||||||
CALL CMPSTRING
|
CALL CMPSTRING
|
||||||
POP BC
|
POP BC
|
||||||
POP DE
|
POP DE
|
||||||
@@ -913,7 +1035,7 @@ FINDMZF5: LD A,B
|
|||||||
FINDMZFYES: ; Flag set by previous test.
|
FINDMZFYES: ; Flag set by previous test.
|
||||||
FINDMZFNO: PUSH AF
|
FINDMZFNO: PUSH AF
|
||||||
LD A,(ROMBK1)
|
LD A,(ROMBK1)
|
||||||
LD (BNKSELMROM),A ; Set the MROM bank back to original.
|
HWSELMROM ; Set the MROM bank back to original.
|
||||||
POP AF
|
POP AF
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@@ -936,7 +1058,7 @@ LOADROM1: ;DI
|
|||||||
;
|
;
|
||||||
LD A,ROMBANK3 ; Activate the RFS Utilities MROM bank.
|
LD A,ROMBANK3 ; Activate the RFS Utilities MROM bank.
|
||||||
LD (WRKROMBK1), A
|
LD (WRKROMBK1), A
|
||||||
LD (BNKSELMROM),A
|
HWSELMROM
|
||||||
CALL MFINDMZF ; Try and find the file in User ROM via MROM utility.
|
CALL MFINDMZF ; Try and find the file in User ROM via MROM utility.
|
||||||
POP HL
|
POP HL
|
||||||
JR Z,MROMLOAD0
|
JR Z,MROMLOAD0
|
||||||
@@ -949,13 +1071,13 @@ LOADROM1: ;DI
|
|||||||
MROMLOAD0: PUSH BC ; Preserve bank and block where MZF file found.
|
MROMLOAD0: PUSH BC ; Preserve bank and block where MZF file found.
|
||||||
PUSH AF
|
PUSH AF
|
||||||
LD A,(ROMBK1) ; Page in monitor so we can print a message.
|
LD A,(ROMBK1) ; Page in monitor so we can print a message.
|
||||||
LD (BNKSELMROM),A
|
HWSELMROM
|
||||||
LD DE,MSGLOAD+1 ; Skip initial CR.
|
LD DE,MSGLOAD+1 ; Skip initial CR.
|
||||||
LD BC,NAME
|
LD BC,NAME
|
||||||
LD HL,PRINTMSG
|
LD HL,PRINTMSG
|
||||||
CALL BKSW0to6
|
CALL BKSW0to6
|
||||||
LD A,(WRKROMBK1) ; Revert to MROM bank to load the application.
|
LD A,(WRKROMBK1) ; Revert to MROM bank to load the application.
|
||||||
LD (BNKSELMROM),A
|
HWSELMROM
|
||||||
POP AF
|
POP AF
|
||||||
POP BC
|
POP BC
|
||||||
;
|
;
|
||||||
@@ -964,7 +1086,7 @@ MROMLOAD0: PUSH BC ; Prese
|
|||||||
|
|
||||||
LROMNTFND: POP HL ; Dont need execute flag anymore so waste it.
|
LROMNTFND: POP HL ; Dont need execute flag anymore so waste it.
|
||||||
LD A,(ROMBK1)
|
LD A,(ROMBK1)
|
||||||
LD (BNKSELMROM),A
|
HWSELMROM
|
||||||
LD HL,PRINTMSG
|
LD HL,PRINTMSG
|
||||||
LD DE,MSGNOTFND ; Not found
|
LD DE,MSGNOTFND ; Not found
|
||||||
CALL BKSW0to6
|
CALL BKSW0to6
|
||||||
@@ -985,7 +1107,7 @@ LROMLOAD: PUSH BC
|
|||||||
;
|
;
|
||||||
LD A,B
|
LD A,B
|
||||||
LD (WRKROMBK1),A
|
LD (WRKROMBK1),A
|
||||||
LD (BNKSELMROM),A
|
HWSELMROM
|
||||||
;
|
;
|
||||||
LD DE, IBUFE ; Copy the header into the work area.
|
LD DE, IBUFE ; Copy the header into the work area.
|
||||||
LD HL, 00000h ; Add block offset to get the valid block.
|
LD HL, 00000h ; Add block offset to get the valid block.
|
||||||
@@ -1016,7 +1138,7 @@ LROMLOAD: PUSH BC
|
|||||||
; C = Block
|
; C = Block
|
||||||
LROMLOAD2: LD A, B
|
LROMLOAD2: LD A, B
|
||||||
LD (WRKROMBK1), A
|
LD (WRKROMBK1), A
|
||||||
LD (BNKSELMROM),A
|
HWSELMROM
|
||||||
|
|
||||||
LROMLOAD3: PUSH BC
|
LROMLOAD3: PUSH BC
|
||||||
LD HL, 00000h
|
LD HL, 00000h
|
||||||
@@ -1068,7 +1190,7 @@ LROMLOAD7: LD A, B
|
|||||||
LROMLOAD8: POP BC
|
LROMLOAD8: POP BC
|
||||||
LROMLOAD5: POP HL ; Retrieve execute flag.
|
LROMLOAD5: POP HL ; Retrieve execute flag.
|
||||||
LD A,(ROMBK1)
|
LD A,(ROMBK1)
|
||||||
LD (BNKSELMROM),A ; Set the MROM bank back to original.
|
HWSELMROM ; Set the MROM bank back to original.
|
||||||
LD A,L ; Autoexecute turned off?
|
LD A,L ; Autoexecute turned off?
|
||||||
CP 0FFh
|
CP 0FFh
|
||||||
JP Z,LROMLOAD9 ; Go back to monitor if it has been, else execute.
|
JP Z,LROMLOAD9 ; Go back to monitor if it has been, else execute.
|
||||||
@@ -1359,12 +1481,12 @@ DEFAULTFNE: EQU $
|
|||||||
;
|
;
|
||||||
ALIGN 0EFF8h
|
ALIGN 0EFF8h
|
||||||
ORG 0EFF8h
|
ORG 0EFF8h
|
||||||
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0AAh
|
||||||
|
|
||||||
MEND:
|
MEND:
|
||||||
|
|
||||||
;
|
;
|
||||||
; Include all other banks which make up the RFS User cited ROM.
|
; Include all other banks which make up the RFS User sited ROM.
|
||||||
;
|
;
|
||||||
INCLUDE "rfs_bank1.asm"
|
INCLUDE "rfs_bank1.asm"
|
||||||
INCLUDE "rfs_bank2.asm"
|
INCLUDE "rfs_bank2.asm"
|
||||||
|
|||||||
@@ -34,6 +34,13 @@
|
|||||||
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
;--------------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ORG 0E000H
|
||||||
|
ALIGN UROMADDR
|
||||||
|
|
||||||
|
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;============================================================
|
;============================================================
|
||||||
;
|
;
|
||||||
; USER ROM BANK 1 - Floppy Disk Controller functions.
|
; USER ROM BANK 1 - Floppy Disk Controller functions.
|
||||||
@@ -45,20 +52,7 @@
|
|||||||
; Common code spanning all banks.
|
; Common code spanning all banks.
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
NOP
|
NOP
|
||||||
LD B,16 ; If we read the bank control reset register 15 times then this will enable bank control and then the 16th read will reset all bank control registers to default.
|
HWSELROM2 ; Select the first ROM page.
|
||||||
ROMFS1_0: LD A,(BNKCTRLRST)
|
|
||||||
DJNZ ROMFS1_0 ; Apply the default number of coded latch reads to enable the bank control registers.
|
|
||||||
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
|
||||||
LD (BNKCTRL),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
|
|
||||||
LD (BNKSELMROM),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
LD (BNKSELUSER),A ; and start up - ie. SA1510 Monitor - this occurs as User Bank 0 is enabled and the jmp to 0 is coded in it.
|
|
||||||
;
|
;
|
||||||
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
||||||
JP 00000H ; This is for safety!!
|
JP 00000H ; This is for safety!!
|
||||||
@@ -113,10 +107,10 @@ BKSW1_0: PUSH HL ; P
|
|||||||
LD HL, BKSWRET1 ; Place bank switchers return address on stack.
|
LD HL, BKSWRET1 ; Place bank switchers return address on stack.
|
||||||
EX (SP),HL
|
EX (SP),HL
|
||||||
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
||||||
LD (BNKSELUSER), A ; Repeat the bank switch B times to enable the bank control register and set its value.
|
BNKSWSEL
|
||||||
JP (HL) ; Jump to required function.
|
JP (HL) ; Jump to required function.
|
||||||
BKSWRET1: POP AF ; Get bank which called us.
|
BKSWRET1: POP AF ; Get bank which called us.
|
||||||
LD (BNKSELUSER), A ; Return to that bank.
|
BNKSWSELRET
|
||||||
POP AF
|
POP AF
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@@ -159,7 +153,7 @@ L000F: LD DE,MSGBOOTDRV ;
|
|||||||
CALL GETL ;
|
CALL GETL ;
|
||||||
LD A,(DE) ;
|
LD A,(DE) ;
|
||||||
CP 01BH ; BREAK pressed?
|
CP 01BH ; BREAK pressed?
|
||||||
JP Z,SS ;
|
JP Z,ST1X ;
|
||||||
LD HL,19 ; Check input value is in range 1-4.
|
LD HL,19 ; Check input value is in range 1-4.
|
||||||
ADD HL,DE ;
|
ADD HL,DE ;
|
||||||
LD A,(HL) ;
|
LD A,(HL) ;
|
||||||
@@ -532,6 +526,13 @@ PRMBLK: DB 000H, 000H, 000H, 000H, 001H, 000H, 0CEH, 000H, 000H, 000H,
|
|||||||
|
|
||||||
L03FE: JP (IY)
|
L03FE: JP (IY)
|
||||||
|
|
||||||
ALIGN 0EFF8h
|
; RomDisk, top 8 bytes are used by the control registers when enabled so dont use the space.
|
||||||
ORG 0EFF8h
|
IF BUILD_ROMDISK = 1
|
||||||
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
ALIGN 0EFF8h
|
||||||
|
ORG 0EFF8h
|
||||||
|
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ALIGN 0F000H
|
||||||
|
ENDIF
|
||||||
|
|||||||
@@ -37,6 +37,11 @@
|
|||||||
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
;--------------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ORG 0E000H
|
||||||
|
ALIGN UROMADDR
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;===========================================================
|
;===========================================================
|
||||||
;
|
;
|
||||||
; USER ROM BANK 2 - SD Card Controller functions.
|
; USER ROM BANK 2 - SD Card Controller functions.
|
||||||
@@ -48,25 +53,11 @@
|
|||||||
; Common code spanning all banks.
|
; Common code spanning all banks.
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
NOP
|
NOP
|
||||||
LD B,16 ; If we read the bank control reset register 15 times then this will enable bank control and then the 16th read will reset all bank control registers to default.
|
HWSELROM2 ; Select the first ROM page.
|
||||||
ROMFS2_0: LD A,(BNKCTRLRST)
|
|
||||||
DJNZ ROMFS2_0 ; Apply the default number of coded latch reads to enable the bank control registers.
|
|
||||||
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
|
||||||
LD (BNKCTRL),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
|
|
||||||
LD (BNKSELMROM),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
LD (BNKSELUSER),A ; and start up - ie. SA1510 Monitor - this occurs as User Bank 0 is enabled and the jmp to 0 is coded in it.
|
|
||||||
;
|
;
|
||||||
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
||||||
JP 00000H ; This is for safety!!
|
JP 00000H ; This is for safety!!
|
||||||
|
|
||||||
|
|
||||||
;------------------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------------------
|
||||||
; Bank switching code, allows a call to code in another bank.
|
; Bank switching code, allows a call to code in another bank.
|
||||||
; This code is duplicated in each bank such that a bank switch doesnt affect logic flow.
|
; This code is duplicated in each bank such that a bank switch doesnt affect logic flow.
|
||||||
@@ -117,10 +108,10 @@ BKSW2_0: PUSH HL ; P
|
|||||||
LD HL, BKSWRET2 ; Place bank switchers return address on stack.
|
LD HL, BKSWRET2 ; Place bank switchers return address on stack.
|
||||||
EX (SP),HL
|
EX (SP),HL
|
||||||
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
||||||
LD (BNKSELUSER), A ; Repeat the bank switch B times to enable the bank control register and set its value.
|
BNKSWSEL
|
||||||
JP (HL) ; Jump to required function.
|
JP (HL) ; Jump to required function.
|
||||||
BKSWRET2: POP AF ; Get bank which called us.
|
BKSWRET2: POP AF ; Get bank which called us.
|
||||||
LD (BNKSELUSER), A ; Return to that bank.
|
BNKSWSELRET
|
||||||
POP AF
|
POP AF
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@@ -197,7 +188,7 @@ TDELAYB0: RRA
|
|||||||
JR NC, TDELAYB1
|
JR NC, TDELAYB1
|
||||||
OR 0
|
OR 0
|
||||||
TDELAYB1: RRA
|
TDELAYB1: RRA
|
||||||
RET NC
|
;RET NC
|
||||||
RET
|
RET
|
||||||
|
|
||||||
|
|
||||||
@@ -1360,7 +1351,7 @@ LOADSD9A: LD (DTADR),DE
|
|||||||
LD (EXADR),DE
|
LD (EXADR),DE
|
||||||
JR LOADSDX ; Exit with ok.
|
JR LOADSDX ; Exit with ok.
|
||||||
;
|
;
|
||||||
LOADSD10 CALL LOADSD9 ; Modularised file find as the CMT replacement functions need it.
|
LOADSD10: CALL LOADSD9 ; Modularised file find as the CMT replacement functions need it.
|
||||||
LD DE,MSGLOAD+1 ; Skip initial CR.
|
LD DE,MSGLOAD+1 ; Skip initial CR.
|
||||||
LD BC,NAME
|
LD BC,NAME
|
||||||
CALL SDPRINT ; Print out the filename.
|
CALL SDPRINT ; Print out the filename.
|
||||||
@@ -1592,14 +1583,13 @@ SAVESD9: LD DE,MSGSVFAIL ; Fail,
|
|||||||
; END OF SD CONTROLLER FUNCTIONALITY
|
; END OF SD CONTROLLER FUNCTIONALITY
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
; RomDisk, top 8 bytes are used by the control registers when enabled so dont use the space.
|
||||||
;--------------------------------------
|
IF BUILD_ROMDISK = 1
|
||||||
;
|
ALIGN 0EFF8h
|
||||||
; Message table - Refer to Bank 6 for
|
ORG 0EFF8h
|
||||||
; all printable messages.
|
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
||||||
;
|
ENDIF
|
||||||
;--------------------------------------
|
|
||||||
|
|
||||||
ALIGN 0EFF8h
|
IF BUILD_SFD700 = 1
|
||||||
ORG 0EFF8h
|
ALIGN 0F000H
|
||||||
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
ENDIF
|
||||||
|
|||||||
@@ -38,6 +38,13 @@ COLW EQU 40
|
|||||||
SCRNSZ EQU COLW * ROW
|
SCRNSZ EQU COLW * ROW
|
||||||
MODE80C EQU 0
|
MODE80C EQU 0
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ORG 0E000H
|
||||||
|
ALIGN UROMADDR
|
||||||
|
|
||||||
|
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;===========================================================
|
;===========================================================
|
||||||
;
|
;
|
||||||
; USER ROM BANK 3 - Monitor memory utilities.
|
; USER ROM BANK 3 - Monitor memory utilities.
|
||||||
@@ -49,20 +56,7 @@ MODE80C EQU 0
|
|||||||
; Common code spanning all banks.
|
; Common code spanning all banks.
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
NOP
|
NOP
|
||||||
LD B,16 ; If we read the bank control reset register 15 times then this will enable bank control and then the 16th read will reset all bank control registers to default.
|
HWSELROM2 ; Select the first ROM page.
|
||||||
ROMFS3_0: LD A,(BNKCTRLRST)
|
|
||||||
DJNZ ROMFS3_0 ; Apply the default number of coded latch reads to enable the bank control registers.
|
|
||||||
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
|
||||||
LD (BNKCTRL),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
|
|
||||||
LD (BNKSELMROM),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
LD (BNKSELUSER),A ; and start up - ie. SA1510 Monitor - this occurs as User Bank 0 is enabled and the jmp to 0 is coded in it.
|
|
||||||
;
|
;
|
||||||
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
||||||
JP 00000H ; This is for safety!!
|
JP 00000H ; This is for safety!!
|
||||||
@@ -118,10 +112,10 @@ BKSW3_0: PUSH HL ; P
|
|||||||
LD HL, BKSWRET3 ; Place bank switchers return address on stack.
|
LD HL, BKSWRET3 ; Place bank switchers return address on stack.
|
||||||
EX (SP),HL
|
EX (SP),HL
|
||||||
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
||||||
LD (BNKSELUSER), A ; Repeat the bank switch B times to enable the bank control register and set its value.
|
BNKSWSEL
|
||||||
JP (HL) ; Jump to required function.
|
JP (HL) ; Jump to required function.
|
||||||
BKSWRET3: POP AF ; Get bank which called us.
|
BKSWRET3: POP AF ; Get bank which called us.
|
||||||
LD (BNKSELUSER), A ; Return to that bank.
|
BNKSWSELRET
|
||||||
POP AF
|
POP AF
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@@ -543,6 +537,13 @@ SLPT: DB 01H ; TEXT
|
|||||||
;
|
;
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
|
|
||||||
ALIGN 0EFF8h
|
; RomDisk, top 8 bytes are used by the control registers when enabled so dont use the space.
|
||||||
ORG 0EFF8h
|
IF BUILD_ROMDISK = 1
|
||||||
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
ALIGN 0EFF8h
|
||||||
|
ORG 0EFF8h
|
||||||
|
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ALIGN 0F000H
|
||||||
|
ENDIF
|
||||||
|
|||||||
@@ -33,6 +33,12 @@
|
|||||||
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
;--------------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ORG 0E000H
|
||||||
|
ALIGN UROMADDR
|
||||||
|
|
||||||
|
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;===========================================================
|
;===========================================================
|
||||||
;
|
;
|
||||||
@@ -45,20 +51,7 @@
|
|||||||
; Common code spanning all banks.
|
; Common code spanning all banks.
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
NOP
|
NOP
|
||||||
LD B,16 ; If we read the bank control reset register 15 times then this will enable bank control and then the 16th read will reset all bank control registers to default.
|
HWSELROM2 ; Select the first ROM page.
|
||||||
ROMFS4_0: LD A,(BNKCTRLRST)
|
|
||||||
DJNZ ROMFS4_0 ; Apply the default number of coded latch reads to enable the bank control registers.
|
|
||||||
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
|
||||||
LD (BNKCTRL),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
|
|
||||||
LD (BNKSELMROM),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
LD (BNKSELUSER),A ; and start up - ie. SA1510 Monitor - this occurs as User Bank 0 is enabled and the jmp to 0 is coded in it.
|
|
||||||
;
|
;
|
||||||
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
||||||
JP 00000H ; This is for safety!!
|
JP 00000H ; This is for safety!!
|
||||||
@@ -114,10 +107,10 @@ BKSW4_0: PUSH HL ; P
|
|||||||
LD HL, BKSWRET4 ; Place bank switchers return address on stack.
|
LD HL, BKSWRET4 ; Place bank switchers return address on stack.
|
||||||
EX (SP),HL
|
EX (SP),HL
|
||||||
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
||||||
LD (BNKSELUSER), A ; Repeat the bank switch B times to enable the bank control register and set its value.
|
BNKSWSEL
|
||||||
JP (HL) ; Jump to required function.
|
JP (HL) ; Jump to required function.
|
||||||
BKSWRET4: POP AF ; Get bank which called us.
|
BKSWRET4: POP AF ; Get bank which called us.
|
||||||
LD (BNKSELUSER), A ; Return to that bank.
|
BNKSWSELRET
|
||||||
POP AF
|
POP AF
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@@ -219,8 +212,18 @@ CMTWRI: ;DI
|
|||||||
LD HL,IBUFE
|
LD HL,IBUFE
|
||||||
LD BC,00080H
|
LD BC,00080H
|
||||||
CALL CKSUM
|
CALL CKSUM
|
||||||
CALL MOTOR
|
IF BUILD_ROMDISK = 1
|
||||||
JR C,CMTWRI2
|
CALL MOTOR80A
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
IN A,(SFD700_MODE)
|
||||||
|
OR A
|
||||||
|
JR Z,CMTWRI80A
|
||||||
|
CALL MOTOR700
|
||||||
|
JR CMTWRI0
|
||||||
|
CMTWRI80A: CALL MOTOR80A
|
||||||
|
ENDIF
|
||||||
|
CMTWRI0: JR C,CMTWRI2
|
||||||
LD A,E
|
LD A,E
|
||||||
CP 0CCH
|
CP 0CCH
|
||||||
JR NZ,CMTWRI1
|
JR NZ,CMTWRI1
|
||||||
@@ -235,7 +238,17 @@ CMTWRI: ;DI
|
|||||||
POP DE
|
POP DE
|
||||||
POP HL
|
POP HL
|
||||||
CMTWRI1: CALL GAP
|
CMTWRI1: CALL GAP
|
||||||
CALL WTAPE
|
IF BUILD_ROMDISK = 1
|
||||||
|
CALL WTAPE80A
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
IN A,(SFD700_MODE)
|
||||||
|
OR A
|
||||||
|
JR Z,CMTWRI80A2
|
||||||
|
CALL WTAPE700
|
||||||
|
JR CMTWRI2
|
||||||
|
CMTWRI80A2: CALL WTAPE80A
|
||||||
|
ENDIF
|
||||||
CMTWRI2: POP HL
|
CMTWRI2: POP HL
|
||||||
POP BC
|
POP BC
|
||||||
POP DE
|
POP DE
|
||||||
@@ -323,6 +336,376 @@ SGX: LD A,(SWRK)
|
|||||||
; END OF CMT CONTROLLER FUNCTIONALITY
|
; END OF CMT CONTROLLER FUNCTIONALITY
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
; START OF MEMORY TEST FUNCTIONALITY
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
MEMTEST: LD B,240 ; Number of loops
|
||||||
|
LOOP: LD HL,MEMSTART ; Start of checked memory,
|
||||||
|
LD D,0CFh ; End memory check CF00
|
||||||
|
LOOP1: LD A,000h
|
||||||
|
CP L
|
||||||
|
JR NZ,LOOP1b
|
||||||
|
CALL PRTHL ; Print HL as 4digit hex.
|
||||||
|
LD A,0C4h ; Move cursor left.
|
||||||
|
LD E,004h ; 4 times.
|
||||||
|
LOOP1a: CALL DPCT
|
||||||
|
DEC E
|
||||||
|
JR NZ,LOOP1a
|
||||||
|
LOOP1b: INC HL
|
||||||
|
LD A,H
|
||||||
|
CP D ; Have we reached end of memory.
|
||||||
|
JR Z,LOOP3 ; Yes, exit.
|
||||||
|
LD A,(HL) ; Read memory location under test, ie. 0.
|
||||||
|
CPL ; Subtract, ie. FF - A, ie FF - 0 = FF.
|
||||||
|
LD (HL),A ; Write it back, ie. FF.
|
||||||
|
SUB (HL) ; Subtract written memory value from A, ie. should be 0.
|
||||||
|
JR NZ,LOOP2 ; Not zero, we have an error.
|
||||||
|
LD A,(HL) ; Reread memory location, ie. FF
|
||||||
|
CPL ; Subtract FF - FF
|
||||||
|
LD (HL),A ; Write 0
|
||||||
|
SUB (HL) ; Subtract 0
|
||||||
|
JR Z,LOOP1 ; Loop if the same, ie. 0
|
||||||
|
LOOP2: LD A,16h
|
||||||
|
CALL PRNT ; Print A
|
||||||
|
CALL PRTHX ; Print HL as 4 digit hex.
|
||||||
|
CALL PRNTS ; Print space.
|
||||||
|
XOR A
|
||||||
|
LD (HL),A
|
||||||
|
LD A,(HL) ; Get into A the failing bits.
|
||||||
|
CALL PRTHX ; Print A as 2 digit hex.
|
||||||
|
CALL PRNTS ; Print space.
|
||||||
|
LD A,0FFh ; Repeat but first load FF into memory
|
||||||
|
LD (HL),A
|
||||||
|
LD A,(HL)
|
||||||
|
CALL PRTHX ; Print A as 2 digit hex.
|
||||||
|
NOP
|
||||||
|
JR LOOP4
|
||||||
|
|
||||||
|
LOOP3: CALL PRTHL
|
||||||
|
LD DE,OKCHECK
|
||||||
|
CALL MSG ; Print check message in DE
|
||||||
|
LD A,B ; Print loop count.
|
||||||
|
CALL PRTHX
|
||||||
|
LD DE,OKMSG
|
||||||
|
CALL MSG ; Print ok message in DE
|
||||||
|
CALL NL
|
||||||
|
DEC B
|
||||||
|
JR NZ,LOOP
|
||||||
|
LD DE,DONEMSG
|
||||||
|
CALL MSG ; Print check message in DE
|
||||||
|
JP ST1X
|
||||||
|
|
||||||
|
LOOP4: LD B,09h
|
||||||
|
CALL PRNTS ; Print space.
|
||||||
|
XOR A ; Zero A
|
||||||
|
SCF ; Set Carry
|
||||||
|
LOOP5: PUSH AF ; Store A and Flags
|
||||||
|
LD (HL),A ; Store 0 to bad location.
|
||||||
|
LD A,(HL) ; Read back
|
||||||
|
CALL PRTHX ; Print A as 2 digit hex.
|
||||||
|
CALL PRNTS ; Print space
|
||||||
|
POP AF ; Get back A (ie. 0 + C)
|
||||||
|
RLA ; Rotate left A. Bit LSB becomes Carry (ie. 1 first instance), Carry becomes MSB
|
||||||
|
DJNZ LOOP5 ; Loop if not zero, ie. print out all bit locations written and read to memory to locate bad bit.
|
||||||
|
XOR A ; Zero A, clears flags.
|
||||||
|
LD A,80h
|
||||||
|
LD B,08h
|
||||||
|
LOOP6: PUSH AF ; Repeat above but AND memory location with original A (ie. 80)
|
||||||
|
LD C,A ; Basically walk through all the bits to find which one is stuck.
|
||||||
|
LD (HL),A
|
||||||
|
LD A,(HL)
|
||||||
|
AND C
|
||||||
|
NOP
|
||||||
|
JR Z,LOOP8 ; If zero then print out the bit number
|
||||||
|
NOP
|
||||||
|
NOP
|
||||||
|
LD A,C
|
||||||
|
CPL
|
||||||
|
LD (HL),A
|
||||||
|
LD A,(HL)
|
||||||
|
AND C
|
||||||
|
JR NZ,LOOP8 ; As above, if the compliment doesnt yield zero, print out the bit number.
|
||||||
|
LOOP7: POP AF
|
||||||
|
RRCA
|
||||||
|
NOP
|
||||||
|
DJNZ LOOP6
|
||||||
|
JP ST1X
|
||||||
|
|
||||||
|
LOOP8: CALL LETNL ; New line.
|
||||||
|
LD DE,BITMSG ; BIT message
|
||||||
|
CALL MSG ; Print message in DE
|
||||||
|
LD A,B
|
||||||
|
DEC A
|
||||||
|
CALL PRTHX ; Print A as 2 digit hex, ie. BIT number.
|
||||||
|
CALL LETNL ; New line
|
||||||
|
LD DE,BANKMSG ; BANK message
|
||||||
|
CALL MSG ; Print message in DE
|
||||||
|
LD A,H
|
||||||
|
CP 50h ; 'P'
|
||||||
|
JR NC,LOOP9 ; Work out bank number, 1, 2 or 3.
|
||||||
|
LD A,01h
|
||||||
|
JR LOOP11
|
||||||
|
|
||||||
|
LOOP9: CP 90h
|
||||||
|
JR NC,LOOP10
|
||||||
|
LD A,02h
|
||||||
|
JR LOOP11
|
||||||
|
|
||||||
|
LOOP10: LD A,03h
|
||||||
|
LOOP11: CALL PRTHX ; Print A as 2 digit hex, ie. BANK number.
|
||||||
|
JR LOOP7
|
||||||
|
|
||||||
|
DLY1S: PUSH AF
|
||||||
|
PUSH BC
|
||||||
|
LD C,10
|
||||||
|
L0324: CALL DLY12
|
||||||
|
DEC C
|
||||||
|
JR NZ,L0324
|
||||||
|
POP BC
|
||||||
|
POP AF
|
||||||
|
RET
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
; END OF MEMORY TEST FUNCTIONALITY
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
; START OF TIMER TEST FUNCTIONALITY
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
; Test the 8253 Timer, configure it as per the monitor and display the read back values.
|
||||||
|
TIMERTST: CALL NL
|
||||||
|
LD DE,MSG_TIMERTST
|
||||||
|
CALL MSG
|
||||||
|
CALL NL
|
||||||
|
LD DE,MSG_TIMERVAL
|
||||||
|
CALL MSG
|
||||||
|
LD A,01h
|
||||||
|
LD DE,8000h
|
||||||
|
CALL TIMERTST1
|
||||||
|
NDE: JP NDE
|
||||||
|
JP ST1X
|
||||||
|
TIMERTST1: ;DI
|
||||||
|
PUSH BC
|
||||||
|
PUSH DE
|
||||||
|
PUSH HL
|
||||||
|
LD (AMPM),A
|
||||||
|
LD A,0F0H
|
||||||
|
LD (TIMFG),A
|
||||||
|
ABCD: LD HL,0A8C0H
|
||||||
|
XOR A
|
||||||
|
SBC HL,DE
|
||||||
|
PUSH HL
|
||||||
|
INC HL
|
||||||
|
EX DE,HL
|
||||||
|
|
||||||
|
LD HL,CONTF ; Control Register
|
||||||
|
LD (HL),0B0H ; 10110000 Control Counter 2 10, Write 2 bytes 11, 000 Interrupt on Terminal Count, 0 16 bit binary
|
||||||
|
LD (HL),074H ; 01110100 Control Counter 1 01, Write 2 bytes 11, 010 Rate Generator, 0 16 bit binary
|
||||||
|
LD (HL),030H ; 00110100 Control Counter 1 01, Write 2 bytes 11, 010 interrupt on Terminal Count, 0 16 bit binary
|
||||||
|
|
||||||
|
LD HL,CONT2 ; Counter 2
|
||||||
|
LD (HL),E
|
||||||
|
LD (HL),D
|
||||||
|
|
||||||
|
LD HL,CONT1 ; Counter 1
|
||||||
|
LD (HL),00AH
|
||||||
|
LD (HL),000H
|
||||||
|
|
||||||
|
LD HL,CONT0 ; Counter 0
|
||||||
|
LD (HL),00CH
|
||||||
|
LD (HL),0C0H
|
||||||
|
|
||||||
|
; LD HL,CONT2 ; Counter 2
|
||||||
|
; LD C,(HL)
|
||||||
|
; LD A,(HL)
|
||||||
|
; CP D
|
||||||
|
; JP NZ,L0323H
|
||||||
|
; LD A,C
|
||||||
|
; CP E
|
||||||
|
; JP Z,CDEF
|
||||||
|
;
|
||||||
|
|
||||||
|
L0323H: PUSH AF
|
||||||
|
PUSH BC
|
||||||
|
PUSH DE
|
||||||
|
PUSH HL
|
||||||
|
;
|
||||||
|
LD HL,CONTF ; Control Register
|
||||||
|
LD (HL),080H
|
||||||
|
LD HL,CONT2 ; Counter 2
|
||||||
|
LD C,(HL)
|
||||||
|
LD A,(HL)
|
||||||
|
CALL PRTHX
|
||||||
|
LD A,C
|
||||||
|
CALL PRTHX
|
||||||
|
;
|
||||||
|
CALL PRNTS
|
||||||
|
;CALL DLY1S
|
||||||
|
;
|
||||||
|
LD HL,CONTF ; Control Register
|
||||||
|
LD (HL),040H
|
||||||
|
LD HL,CONT1 ; Counter 1
|
||||||
|
LD C,(HL)
|
||||||
|
LD A,(HL)
|
||||||
|
CALL PRTHX
|
||||||
|
LD A,C
|
||||||
|
CALL PRTHX
|
||||||
|
;
|
||||||
|
CALL PRNTS
|
||||||
|
;CALL DLY1S
|
||||||
|
;
|
||||||
|
LD HL,CONTF ; Control Register
|
||||||
|
LD (HL),000H
|
||||||
|
LD HL,CONT0 ; Counter 0
|
||||||
|
LD C,(HL)
|
||||||
|
LD A,(HL)
|
||||||
|
CALL PRTHX
|
||||||
|
LD A,C
|
||||||
|
CALL PRTHX
|
||||||
|
;
|
||||||
|
;CALL DLY1S
|
||||||
|
;
|
||||||
|
LD A,0C4h ; Move cursor left.
|
||||||
|
LD E,0Eh ; 4 times.
|
||||||
|
L0330: CALL DPCT
|
||||||
|
DEC E
|
||||||
|
JR NZ,L0330
|
||||||
|
;
|
||||||
|
; LD C,20
|
||||||
|
;L0324: CALL DLY12
|
||||||
|
; DEC C
|
||||||
|
; JR NZ,L0324
|
||||||
|
;
|
||||||
|
POP HL
|
||||||
|
POP DE
|
||||||
|
POP BC
|
||||||
|
POP AF
|
||||||
|
;
|
||||||
|
LD HL,CONT2 ; Counter 2
|
||||||
|
LD C,(HL)
|
||||||
|
LD A,(HL)
|
||||||
|
CP D
|
||||||
|
JP NZ,L0323H
|
||||||
|
LD A,C
|
||||||
|
CP E
|
||||||
|
JP NZ,L0323H
|
||||||
|
;
|
||||||
|
;
|
||||||
|
PUSH AF
|
||||||
|
PUSH BC
|
||||||
|
PUSH DE
|
||||||
|
PUSH HL
|
||||||
|
CALL NL
|
||||||
|
CALL NL
|
||||||
|
CALL NL
|
||||||
|
LD DE,MSG_TIMERVAL2
|
||||||
|
CALL MSG
|
||||||
|
POP HL
|
||||||
|
POP DE
|
||||||
|
POP BC
|
||||||
|
POP AF
|
||||||
|
|
||||||
|
;
|
||||||
|
CDEF: POP DE
|
||||||
|
LD HL,CONT1
|
||||||
|
LD (HL),00CH
|
||||||
|
LD (HL),07BH
|
||||||
|
INC HL
|
||||||
|
|
||||||
|
L0336H: PUSH AF
|
||||||
|
PUSH BC
|
||||||
|
PUSH DE
|
||||||
|
PUSH HL
|
||||||
|
;
|
||||||
|
LD HL,CONTF ; Control Register
|
||||||
|
LD (HL),080H
|
||||||
|
LD HL,CONT2 ; Counter 2
|
||||||
|
LD C,(HL)
|
||||||
|
LD A,(HL)
|
||||||
|
CALL PRTHX
|
||||||
|
LD A,C
|
||||||
|
CALL PRTHX
|
||||||
|
;
|
||||||
|
CALL PRNTS
|
||||||
|
CALL DLY1S
|
||||||
|
;
|
||||||
|
LD HL,CONTF ; Control Register
|
||||||
|
LD (HL),040H
|
||||||
|
LD HL,CONT1 ; Counter 1
|
||||||
|
LD C,(HL)
|
||||||
|
LD A,(HL)
|
||||||
|
CALL PRTHX
|
||||||
|
LD A,C
|
||||||
|
CALL PRTHX
|
||||||
|
;
|
||||||
|
CALL PRNTS
|
||||||
|
CALL DLY1S
|
||||||
|
;
|
||||||
|
LD HL,CONTF ; Control Register
|
||||||
|
LD (HL),000H
|
||||||
|
LD HL,CONT0 ; Counter 0
|
||||||
|
LD C,(HL)
|
||||||
|
LD A,(HL)
|
||||||
|
CALL PRTHX
|
||||||
|
LD A,C
|
||||||
|
CALL PRTHX
|
||||||
|
;
|
||||||
|
CALL DLY1S
|
||||||
|
;
|
||||||
|
LD A,0C4h ; Move cursor left.
|
||||||
|
LD E,0Eh ; 4 times.
|
||||||
|
L0340: CALL DPCT
|
||||||
|
DEC E
|
||||||
|
JR NZ,L0340
|
||||||
|
;
|
||||||
|
POP HL
|
||||||
|
POP DE
|
||||||
|
POP BC
|
||||||
|
POP AF
|
||||||
|
|
||||||
|
LD HL,CONT2 ; Counter 2
|
||||||
|
LD C,(HL)
|
||||||
|
LD A,(HL)
|
||||||
|
CP D
|
||||||
|
JR NZ,L0336H
|
||||||
|
LD A,C
|
||||||
|
CP E
|
||||||
|
JR NZ,L0336H
|
||||||
|
CALL NL
|
||||||
|
LD DE,MSG_TIMERVAL3
|
||||||
|
CALL MSG
|
||||||
|
POP HL
|
||||||
|
POP DE
|
||||||
|
POP BC
|
||||||
|
;EI
|
||||||
|
RET
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
; END OF TIMER TEST FUNCTIONALITY
|
||||||
|
;-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
;--------------------------------------
|
||||||
|
;
|
||||||
|
; Message table
|
||||||
|
;
|
||||||
|
;--------------------------------------
|
||||||
|
OKCHECK: DB ", CHECK: ", 0Dh
|
||||||
|
OKMSG: DB " OK.", 0Dh
|
||||||
|
DONEMSG: DB 11h
|
||||||
|
DB "RAM TEST COMPLETE.", 0Dh
|
||||||
|
|
||||||
|
BITMSG: DB " BIT: ", 0Dh
|
||||||
|
BANKMSG: DB " BANK: ", 0Dh
|
||||||
|
MSG_TIMERTST:
|
||||||
|
DB "8253 TIMER TEST", 0Dh, 00h
|
||||||
|
MSG_TIMERVAL:
|
||||||
|
DB "READ VALUE 1: ", 0Dh, 00h
|
||||||
|
MSG_TIMERVAL2:
|
||||||
|
DB "READ VALUE 2: ", 0Dh, 00h
|
||||||
|
MSG_TIMERVAL3:
|
||||||
|
DB "READ DONE.", 0Dh, 00h
|
||||||
|
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
;
|
;
|
||||||
; Message table - Refer to bank 6 for
|
; Message table - Refer to bank 6 for
|
||||||
@@ -330,6 +713,13 @@ SGX: LD A,(SWRK)
|
|||||||
;
|
;
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
|
|
||||||
ALIGN 0EFF8h
|
; RomDisk, top 8 bytes are used by the control registers when enabled so dont use the space.
|
||||||
ORG 0EFF8h
|
IF BUILD_ROMDISK = 1
|
||||||
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
ALIGN 0EFF8h
|
||||||
|
ORG 0EFF8h
|
||||||
|
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ALIGN 0F000H
|
||||||
|
ENDIF
|
||||||
|
|||||||
@@ -34,6 +34,12 @@
|
|||||||
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
;--------------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ORG 0E000H
|
||||||
|
ALIGN UROMADDR
|
||||||
|
|
||||||
|
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;======================================
|
;======================================
|
||||||
;
|
;
|
||||||
@@ -46,20 +52,7 @@
|
|||||||
; Common code spanning all banks.
|
; Common code spanning all banks.
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
NOP
|
NOP
|
||||||
LD B,16 ; If we read the bank control reset register 15 times then this will enable bank control and then the 16th read will reset all bank control registers to default.
|
HWSELROM2 ; Select the first ROM page.
|
||||||
ROMFS5_0: LD A,(BNKCTRLRST)
|
|
||||||
DJNZ ROMFS5_0 ; Apply the default number of coded latch reads to enable the bank control registers.
|
|
||||||
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
|
||||||
LD (BNKCTRL),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
|
|
||||||
LD (BNKSELMROM),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
LD (BNKSELUSER),A ; and start up - ie. SA1510 Monitor - this occurs as User Bank 0 is enabled and the jmp to 0 is coded in it.
|
|
||||||
;
|
;
|
||||||
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
||||||
JP 00000H ; This is for safety!!
|
JP 00000H ; This is for safety!!
|
||||||
@@ -115,10 +108,10 @@ BKSW5_0: PUSH HL ; P
|
|||||||
LD HL, BKSWRET5 ; Place bank switchers return address on stack.
|
LD HL, BKSWRET5 ; Place bank switchers return address on stack.
|
||||||
EX (SP),HL
|
EX (SP),HL
|
||||||
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
||||||
LD (BNKSELUSER), A ; Repeat the bank switch B times to enable the bank control register and set its value.
|
BNKSWSEL
|
||||||
JP (HL) ; Jump to required function.
|
JP (HL) ; Jump to required function.
|
||||||
BKSWRET5: POP AF ; Get bank which called us.
|
BKSWRET5: POP AF ; Get bank which called us.
|
||||||
LD (BNKSELUSER), A ; Return to that bank.
|
BNKSWSELRET
|
||||||
POP AF
|
POP AF
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@@ -205,6 +198,13 @@ SHARPTOASC: DB 000H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H
|
|||||||
DB 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H ; 0xEF
|
DB 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H ; 0xEF
|
||||||
DB 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H ; 0xFF
|
DB 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H, 020H ; 0xFF
|
||||||
|
|
||||||
ALIGN 0EFF8h
|
; RomDisk, top 8 bytes are used by the control registers when enabled so dont use the space.
|
||||||
ORG 0EFF8h
|
IF BUILD_ROMDISK = 1
|
||||||
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
ALIGN 0EFF8h
|
||||||
|
ORG 0EFF8h
|
||||||
|
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
||||||
|
ENDIF
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ALIGN 0F000H
|
||||||
|
ENDIF
|
||||||
|
|||||||
@@ -36,6 +36,12 @@
|
|||||||
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
;- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
;--------------------------------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ORG 0E000H
|
||||||
|
ALIGN UROMADDR
|
||||||
|
|
||||||
|
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;======================================
|
;======================================
|
||||||
;
|
;
|
||||||
@@ -48,20 +54,7 @@
|
|||||||
; Common code spanning all banks.
|
; Common code spanning all banks.
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
NOP
|
NOP
|
||||||
LD B,16 ; If we read the bank control reset register 15 times then this will enable bank control and then the 16th read will reset all bank control registers to default.
|
HWSELROM2 ; Select the first ROM page.
|
||||||
ROMFS6_0: LD A,(BNKCTRLRST)
|
|
||||||
DJNZ ROMFS6_0 ; Apply the default number of coded latch reads to enable the bank control registers.
|
|
||||||
LD A,BNKCTRLDEF ; Set coded latch, SDCS high, BBMOSI to high and BBCLK to high which enables SDCLK.
|
|
||||||
LD (BNKCTRL),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
XOR A ; We shouldnt arrive here after a reset, if we do, select UROM bank 0
|
|
||||||
LD (BNKSELMROM),A
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
NOP
|
|
||||||
LD (BNKSELUSER),A ; and start up - ie. SA1510 Monitor - this occurs as User Bank 0 is enabled and the jmp to 0 is coded in it.
|
|
||||||
;
|
;
|
||||||
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
; No mans land... this should have switched to Bank 0 and at this point there is a jump to 00000H.
|
||||||
JP 00000H ; This is for safety!!
|
JP 00000H ; This is for safety!!
|
||||||
@@ -117,10 +110,10 @@ BKSW6_0: PUSH HL ; P
|
|||||||
LD HL, BKSWRET6 ; Place bank switchers return address on stack.
|
LD HL, BKSWRET6 ; Place bank switchers return address on stack.
|
||||||
EX (SP),HL
|
EX (SP),HL
|
||||||
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
LD (TMPSTACKP),SP ; Save the stack pointer as some old code corrupts it.
|
||||||
LD (BNKSELUSER), A ; Repeat the bank switch B times to enable the bank control register and set its value.
|
BNKSWSEL
|
||||||
JP (HL) ; Jump to required function.
|
JP (HL) ; Jump to required function.
|
||||||
BKSWRET6: POP AF ; Get bank which called us.
|
BKSWRET6: POP AF ; Get bank which called us.
|
||||||
LD (BNKSELUSER), A ; Return to that bank.
|
BNKSWSELRET
|
||||||
POP AF
|
POP AF
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@@ -280,39 +273,69 @@ 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
|
; 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.
|
; hence using upper case.
|
||||||
; 1 40
|
; 1 40
|
||||||
HELPSCR: DB "0..9 - select RFS Drive.", 00DH
|
HELPSCR: IF BUILD_ROMDISK = 1
|
||||||
DB "40 - 40 col mode.", 00DH
|
DB "0..9 - select RFS Drive.", 00DH
|
||||||
DB "80 - 80 col mode.", 00DH
|
DB "40 - 40 col mode.", 00DH
|
||||||
;DB "700 - Select MZ-700 Mode.", 00DH
|
DB "80 - 80 col mode.", 00DH
|
||||||
;DB "7008 - Select MZ-700 80 col Mode.", 00DH
|
;DB "700 - Select MZ-700 Mode.", 00DH
|
||||||
DB "B - toggle keyboard bell.", 00DH
|
;DB "7008 - Select MZ-700 80 col Mode.", 00DH
|
||||||
DB "BASIC - Load BASIC SA-5510.", 00DH
|
DB "B - toggle keyboard bell.", 00DH
|
||||||
DB "C - clear memory $1200-$D000.", 00DH
|
DB "BASIC - Load BASIC SA-5510.", 00DH
|
||||||
DB "CPXXXXYYYYZZZZ - copy memory", 00DH
|
DB "C - clear memory $1200-$D000.", 00DH
|
||||||
DB " XXXX=src,YYYY=dst,ZZZZ=size", 00DH
|
DB "CPXXXXYYYYZZZZ - copy memory", 00DH
|
||||||
DB "CPM - Load CPM.", 00DH
|
DB " XXXX=src,YYYY=dst,ZZZZ=size", 00DH
|
||||||
DB "DXXXX[YYYY] - dump mem XXXX to YYYY.", 00DH
|
DB "CPM - Load CPM.", 00DH
|
||||||
DB "EC[FN]- erase file, FN=No, or Filename", 00DH
|
DB "DXXXX[YYYY] - dump mem XXXX to YYYY.", 00DH
|
||||||
DB "F[X] - boot fd drive X.", 00DH
|
DB "EC[FN]- erase file, FN=No, or Filename", 00DH
|
||||||
DB "f - boot fd original rom.", 00DH
|
DB "F[X] - boot fd drive X.", 00DH
|
||||||
DB "H - this help screen.", 00DH
|
DB "f - boot fd original rom.", 00DH
|
||||||
DB "IR/IC - rfs dir listing rom/sd card.", 00DH
|
DB "H - this help screen.", 00DH
|
||||||
DB "JXXXX - jump to location XXXX.", 00DH
|
DB "IR/IC - rfs dir listing rom/sd card.", 00DH
|
||||||
DB "LT[FN]- load tape, FN=Filename", 00DH
|
DB "JXXXX - jump to location XXXX.", 00DH
|
||||||
DB "LR[FN]- load rom, FN=No. or Filename", 00DH
|
DB "LT[FN]- load tape, FN=Filename", 00DH
|
||||||
DB "LC[FN]- load sdcard, FN=No. or Filename", 00DH
|
DB "LR[FN]- load rom, FN=No. or Filename", 00DH
|
||||||
DB " - add NX for no exec, ie.LRNX.", 00DH
|
DB "LC[FN]- load sdcard, FN=No. or Filename", 00DH
|
||||||
DB "MXXXX - edit memory starting at XXXX.", 00DH
|
DB " - add NX for no exec, ie.LRNX.", 00DH
|
||||||
DB "P - test printer.", 00DH
|
DB "MXXXX - edit memory starting at XXXX.", 00DH
|
||||||
DB "R - test dram memory.", 00DH
|
DB "P - test printer.", 00DH
|
||||||
DB "SD2T - copy sd card to tape.", 00DH
|
DB "R - test dram memory.", 00DH
|
||||||
DB "ST[XXXXYYYYZZZZ] - save mem to tape.", 00DH
|
DB "SD2T - copy sd card to tape.", 00DH
|
||||||
DB "SC[XXXXYYYYZZZZ] - save mem to card.", 00DH
|
DB "ST[XXXXYYYYZZZZ] - save mem to tape.", 00DH
|
||||||
DB " XXXX=start,YYYY=end,ZZZZ=exec", 00DH
|
DB "SC[XXXXYYYYZZZZ] - save mem to card.", 00DH
|
||||||
DB "T - test timer.", 00DH
|
DB " XXXX=start,YYYY=end,ZZZZ=exec", 00DH
|
||||||
DB "T2SD - copy tape to sd card.", 00DH
|
DB "T - test timer.", 00DH
|
||||||
DB "V - verify tape save.", 00DH
|
DB "T2SD - copy tape to sd card.", 00DH
|
||||||
DB 000H
|
DB "V - verify tape save.", 00DH
|
||||||
|
DB 000H
|
||||||
|
ENDIF
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
DB "ASMXXXX assemble into dest XXXX", 00DH
|
||||||
|
DB "B - toggle keyboard bell.", 00DH
|
||||||
|
DB "BASIC - Load BASIC SA-5510.", 00DH
|
||||||
|
DB "C - clear memory $1200-$D000.", 00DH
|
||||||
|
DB "CPXXXXYYYYZZZZ - copy memory", 00DH
|
||||||
|
DB " XXXX=src,YYYY=dst,ZZZZ=size", 00DH
|
||||||
|
;DB "CPM - Load CPM.", 00DH
|
||||||
|
DB "DXXXX[YYYY] - dump mem XXXX to YYYY.", 00DH
|
||||||
|
DB "DASMXXXX[YYYY]", 00DH
|
||||||
|
DB " disassemble XXXX to YYYY", 00DH
|
||||||
|
DB "F[X] - boot fd drive X.", 00DH
|
||||||
|
DB "f - boot fd original rom.", 00DH
|
||||||
|
DB "H - this help screen.", 00DH
|
||||||
|
DB "IR - rfs rom dir listing.", 00DH
|
||||||
|
DB "JXXXX - jump to location XXXX.", 00DH
|
||||||
|
DB "LT[FN]- load tape, FN=Filename", 00DH
|
||||||
|
DB "LR[FN]- load rom, FN=No. or Filename", 00DH
|
||||||
|
DB " - add NX for no exec, ie.LRNX.", 00DH
|
||||||
|
DB "MXXXX - edit memory starting at XXXX.", 00DH
|
||||||
|
DB "P - test printer.", 00DH
|
||||||
|
DB "R - test dram memory.", 00DH
|
||||||
|
DB "ST[XXXXYYYYZZZZ] - save mem to tape.", 00DH
|
||||||
|
DB " XXXX=start,YYYY=end,ZZZZ=exec", 00DH
|
||||||
|
DB "T - test timer.", 00DH
|
||||||
|
DB "V - verify tape save.", 00DH
|
||||||
|
DB 000H
|
||||||
|
ENDIF
|
||||||
|
|
||||||
;-------------------------------------------------------------------------------
|
;-------------------------------------------------------------------------------
|
||||||
; END OF HELP SCREEN FUNCTIONALITY
|
; END OF HELP SCREEN FUNCTIONALITY
|
||||||
@@ -455,7 +478,7 @@ ATBL: DB 0CCH ; NUL '\0' (null character)
|
|||||||
;
|
;
|
||||||
;--------------------------------------
|
;--------------------------------------
|
||||||
MSGSONTZ: DB "+ TZ" ; Version 2.x with version 2.1+ of tranZPUter board installed.
|
MSGSONTZ: DB "+ TZ" ; Version 2.x with version 2.1+ of tranZPUter board installed.
|
||||||
MSGSON: DB "+ RFS ", 0ABh, "2.2 **", 00DH, 000H ; Version 2.x-> as we are now using the v2.x PCB with 4 devices on-board
|
MSGSON: DB "+ RFS ", 0ABh, "2.3 **", 00DH, 000H ; Version 2.x-> as we are now using the v2.x PCB with 4 devices on-board
|
||||||
MSGNOTFND: DB "Not Found", 00DH, 000H
|
MSGNOTFND: DB "Not Found", 00DH, 000H
|
||||||
MSGRDIRLST: DB "ROM Directory:", 00DH, 000H
|
MSGRDIRLST: DB "ROM Directory:", 00DH, 000H
|
||||||
MSGTRM: DB 00DH, 000H
|
MSGTRM: DB 00DH, 000H
|
||||||
@@ -491,7 +514,16 @@ MSGNOTZINST:DB "No tranZPUter >=v2 card installed.", 00DH, 000H
|
|||||||
MSGNOCMTDIR:DB "CMT has no directory.", 00DH, 000H
|
MSGNOCMTDIR:DB "CMT has no directory.", 00DH, 000H
|
||||||
MSGINVDRV: DB "Invalid drive, SD=0..9 or C=CMT", 00DH, 000H
|
MSGINVDRV: DB "Invalid drive, SD=0..9 or C=CMT", 00DH, 000H
|
||||||
MSGNOVERIFY:DB "No Verify for SD!", 00DH, 000H
|
MSGNOVERIFY:DB "No Verify for SD!", 00DH, 000H
|
||||||
|
MSGNOINSTR: DB "Bad instruction.", 00DH, 000H
|
||||||
|
MSGNOPARAM: DB "Bad parameter.", 00DH, 000H
|
||||||
|
|
||||||
ALIGN 0EFF8h
|
; RomDisk - Pad to EFFF boundary.
|
||||||
ORG 0EFF8h
|
IF BUILD_ROMDISK = 1
|
||||||
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
ALIGN 0EFF8h
|
||||||
|
ORG 0EFF8h
|
||||||
|
DB 0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh,0FFh
|
||||||
|
ENDIF
|
||||||
|
; SFD700 - Pad to 10000H
|
||||||
|
IF BUILD_SFD700 = 1
|
||||||
|
ALIGN 10000H
|
||||||
|
ENDIF
|
||||||
|
|||||||
2021
asm/rfs_bank7.asm
2021
asm/rfs_bank7.asm
File diff suppressed because it is too large
Load Diff
BIN
roms/SFD700.rom
vendored
Normal file
BIN
roms/SFD700.rom
vendored
Normal file
Binary file not shown.
BIN
roms/cbios.rom
vendored
BIN
roms/cbios.rom
vendored
Binary file not shown.
BIN
roms/cbios_bank1.rom
vendored
BIN
roms/cbios_bank1.rom
vendored
Binary file not shown.
BIN
roms/cbios_bank2.rom
vendored
BIN
roms/cbios_bank2.rom
vendored
Binary file not shown.
BIN
roms/mz-1e05.rom
vendored
Normal file
BIN
roms/mz-1e05.rom
vendored
Normal file
Binary file not shown.
BIN
roms/mz-1e14.rom
vendored
Normal file
BIN
roms/mz-1e14.rom
vendored
Normal file
Binary file not shown.
BIN
roms/rfs.rom
vendored
BIN
roms/rfs.rom
vendored
Binary file not shown.
@@ -59,9 +59,9 @@ rm -f ${ROM_LIST_FILE}
|
|||||||
|
|
||||||
# Place the monitor roms into the MROM at the beginning for banked page usage.
|
# 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"
|
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"
|
||||||
#cat ${ROM_PATH}/monitor_sa1510.rom ${ROM_PATH}/monitor_80c_sa1510.rom \
|
|
||||||
#cat ${ROM_PATH}/monitor_1Z-013A.rom ${ROM_PATH}/monitor_1Z-013A.rom \
|
#cat ${ROM_PATH}/monitor_1Z-013A.rom ${ROM_PATH}/monitor_1Z-013A.rom \
|
||||||
cat ${ROM_PATH}/monitor_1Z-009B.rom ${ROM_PATH}/monitor_1Z-009B.rom \
|
#cat ${ROM_PATH}/monitor_1Z-009B.rom ${ROM_PATH}/monitor_1Z-009B.rom \
|
||||||
|
cat ${ROM_PATH}/monitor_sa1510.rom ${ROM_PATH}/monitor_80c_sa1510.rom \
|
||||||
${ROM_PATH}/cbios.rom ${ROM_PATH}/rfs_mrom.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}/monitor_1z-013a.rom ${ROM_PATH}/monitor_80c_1z-013a.rom \
|
||||||
${ROM_PATH}/ipl.rom ${ROM_PATH}/blank_mrom.rom \
|
${ROM_PATH}/ipl.rom ${ROM_PATH}/blank_mrom.rom \
|
||||||
|
|||||||
Reference in New Issue
Block a user