From 1d8c0c9c461e4d656819fe74120347987076c78f Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Sun, 15 Sep 2024 13:54:31 -0700 Subject: [PATCH] eZ80 Follow-up - Added RCEZ80 platform option to Build.ps1 - Added EZ80 config settings to MASTER config (required to get build to work for some situations) - Modified a .EQU in cfg_RCEZ80.asm to a .SET. After adding config setting to MASTER config, the .EQU was causing a redefinition error. - I have temporarily removed some "TRANSLATE" lines in ez80uart.asm. They were attempting to place a value greater that 0xFFFF in a register and generated an assembly error. - Modified a few JR instructions in hbios.asm to JP due to out-of-range errors. - Modified std.asm to "nest" a conditional. The Windows assembler does not ignore the remainder of a complex conditional when it should. - Modified tms.asm to replace the PRTS macro with alternative lines. The Windows assembler cannot handle a string longer than about 8 characters in a macro argument. - Added the TIMER utility to the ROM disk. Not sure what happened there. It was included in the Windows build, but not the Linux build. There is room for it, so I added it to the Linux build to get a binary exact build compare. --- Source/HBIOS/Build.ps1 | 2 +- Source/HBIOS/cfg_MASTER.asm | 32 ++++++++++++++++++++++++++++++++ Source/HBIOS/cfg_RCEZ80.asm | 18 +++++++++--------- Source/HBIOS/ez80uart.asm | 21 ++++++++++++--------- Source/HBIOS/hbios.asm | 8 ++++---- Source/HBIOS/std.asm | 4 +++- Source/HBIOS/tms.asm | 4 ++-- Source/RomDsk/Makefile | 2 +- 8 files changed, 64 insertions(+), 27 deletions(-) diff --git a/Source/HBIOS/Build.ps1 b/Source/HBIOS/Build.ps1 index e7ef3e63..9e390302 100644 --- a/Source/HBIOS/Build.ps1 +++ b/Source/HBIOS/Build.ps1 @@ -27,7 +27,7 @@ $ErrorAction = 'Stop' # UNA BIOS is simply imbedded, it is not built here. # -$PlatformListZ80 = "SBC", "MBC", "ZETA", "ZETA2", "RCZ80", "Z80RETRO", "DUO", "UNA", "HEATH", "MON", "NABU", "FZ80" +$PlatformListZ80 = "SBC", "MBC", "ZETA", "ZETA2", "RCZ80", "Z80RETRO", "DUO", "UNA", "HEATH", "MON", "NABU", "FZ80", "RCEZ80" $PlatformListZ180 = "N8", "MK4", "RCZ180", "SCZ180", "DYNO", "RPH", "S100", "EPITX", "GMZ180" $PlatformListZ280 = "RCZ280" diff --git a/Source/HBIOS/cfg_MASTER.asm b/Source/HBIOS/cfg_MASTER.asm index f5a89051..a7898478 100644 --- a/Source/HBIOS/cfg_MASTER.asm +++ b/Source/HBIOS/cfg_MASTER.asm @@ -456,3 +456,35 @@ DMAMODE .EQU DMAMODE_NONE ; DMA: DMA MODE (NONE|ECB|Z180|Z280|RC|MBC|DUO) ; YM2612ENABLE .EQU FALSE ; YM2612: ENABLE YM2612 DRIVER VGMBASE .EQU $C0 ; YM2612: BASE ADDRESS FOR VGM BOARD (YM2612/SN76489s/CTC) +; +; EZ80 SETTINGS +; +EZ80TMR_NONE .EQU 0 ; DO NOT USE ON-BOARD TIMER TO GENERATE TICKS +EZ80TMR_INT .EQU 1 ; MARSHALL TIMER TICK INTERRUPTS FROM EZ80 TO HBIOS +EZ80TMR_FIRM .EQU 2 ; DELEGATE SYS TIMER HBIOS CALL TO EZ80 FIRMWARE (TIMER TICK INTS DISABLED) +; +EZ80UARTENABLE .EQU FALSE ; EZ80 UART: ENABLE EZ80 UART0 DRIVER (EZ80UART.ASM) +EZ80RTCENABLE .EQU FALSE ; EZ80 ON CHIP RTC +EZ80TIMER .EQU EZ80TMR_FIRM ; EZ80: TIMER TICK MODEL: EZ80TMR_[INT|FIRM] +EZ80IOBASE .EQU $FF ; EZ80 I/O BASE ADDRESS FOR EXTERNAL IO +; +; BUS TIMING FOR PAGED MEMORY ACCESS (CS3) +EZ80_MEM_CYCLES .EQU 3 ; MEMORY BUS CYCLES (1-15) TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_CYCLES +EZ80_MEM_MIN_NS .EQU 100 ; CALCULATE AT BOOT TIME THE REQUIRED W/S OR B/C, IF EZ80_WSMD_TYP = EZ80WSMD_CALC +EZ80_MEM_WS .EQU 5 ; MEMORY WAIT STATES (0-7) TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_WAIT +EZ80_MEM_MIN_WS .EQU 0 ; MINIMUM WAIT STATES TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_CALC +; +; BUS TIMING FOR EXTERNAL I/O ACCESS (CS2) +EZ80_IO_CYCLES .EQU 4 ; IO BUS CYCLES (1-15) TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_CYCLES +EZ80_IO_WS .EQU 5 ; IO WAIT STATES (0-7) TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_WAIT +EZ80_IO_MIN_NS .EQU 320 ; CALCULATE AT BOOT TIME THE REQUIRED W/S OR B/C, IF EZ80_WSMD_TYP = EZ80WSMD_CALC +EZ80_IO_MIN_WS .EQU 6 ; MINIMUM WAIT STATES TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_CALC +; +; APPLY CYCLES, W/S OR CALCULATE CYCLES BASED ON DESIRED PERIOD +EZ80_WSMD_TYP .EQU EZ80WSMD_CALC ; BUS WAIT STATE CONFIG: EZ80WSMD_[CALC|CYCLES|WAIT] +; +; BUS TIMING FOR ON CHIP ROM +; +EZ80_FLSH_WS .EQU 1 ; WAIT STATES FOR ON CHIP FLASH (0-7) +EZ80_FLSH_MIN_NS .EQU 60 ; MINIMUM WAIT STATES TO APPLY TO ON-CHIP FLASH, IF EZ80_WSMD_TYP = EZ80WSMD_CALC +EZ80_FWSMD_TYP .EQU EZ80WSMD_CALC ; WAIT STATE TYPE: EZ80RMMD_[CALC|WAIT] (CYCLES NOT ALLOWED) diff --git a/Source/HBIOS/cfg_RCEZ80.asm b/Source/HBIOS/cfg_RCEZ80.asm index e9ed81c1..033d2e7d 100644 --- a/Source/HBIOS/cfg_RCEZ80.asm +++ b/Source/HBIOS/cfg_RCEZ80.asm @@ -394,35 +394,35 @@ DMAMODE .SET DMAMODE_RC ; DMA: DMA MODE (NONE|ECB|Z180|Z280|RC|MBC|DUO) ; YM2612ENABLE .SET FALSE ; YM2612: ENABLE YM2612 DRIVER VGMBASE .SET $C0 ; YM2612: BASE ADDRESS FOR VGM BOARD (YM2612/SN76489s/CTC) - +; ; EZ80 SETTINGS ; EZ80TMR_NONE .SET 0 ; DO NOT USE ON-BOARD TIMER TO GENERATE TICKS EZ80TMR_INT .SET 1 ; MARSHALL TIMER TICK INTERRUPTS FROM EZ80 TO HBIOS EZ80TMR_FIRM .SET 2 ; DELEGATE SYS TIMER HBIOS CALL TO EZ80 FIRMWARE (TIMER TICK INTS DISABLED) - +; EZ80UARTENABLE .SET TRUE ; EZ80 UART: ENABLE EZ80 UART0 DRIVER (EZ80UART.ASM) EZ80RTCENABLE .SET TRUE ; EZ80 ON CHIP RTC EZ80TIMER .SET EZ80TMR_FIRM ; EZ80: TIMER TICK MODEL: EZ80TMR_[INT|FIRM] EZ80IOBASE .SET $FF ; EZ80 I/O BASE ADDRESS FOR EXTERNAL IO - +; ; BUS TIMING FOR PAGED MEMORY ACCESS (CS3) EZ80_MEM_CYCLES .SET 3 ; MEMORY BUS CYCLES (1-15) TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_CYCLES EZ80_MEM_MIN_NS .SET 100 ; CALCULATE AT BOOT TIME THE REQUIRED W/S OR B/C, IF EZ80_WSMD_TYP = EZ80WSMD_CALC EZ80_MEM_WS .SET 5 ; MEMORY WAIT STATES (0-7) TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_WAIT EZ80_MEM_MIN_WS .SET 0 ; MINIMUM WAIT STATES TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_CALC - +; ; BUS TIMING FOR EXTERNAL I/O ACCESS (CS2) EZ80_IO_CYCLES .SET 4 ; IO BUS CYCLES (1-15) TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_CYCLES EZ80_IO_WS .SET 5 ; IO WAIT STATES (0-7) TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_WAIT EZ80_IO_MIN_NS .SET 320 ; CALCULATE AT BOOT TIME THE REQUIRED W/S OR B/C, IF EZ80_WSMD_TYP = EZ80WSMD_CALC EZ80_IO_MIN_WS .SET 6 ; MINIMUM WAIT STATES TO APPLY, IF EZ80_WSMD_TYP = EZ80WSMD_CALC - +; ; APPLY CYCLES, W/S OR CALCULATE CYCLES BASED ON DESIRED PERIOD -EZ80_WSMD_TYP .EQU EZ80WSMD_CALC ; BUS WAIT STATE CONFIG: EZ80WSMD_[CALC|CYCLES|WAIT] +EZ80_WSMD_TYP .SET EZ80WSMD_CALC ; BUS WAIT STATE CONFIG: EZ80WSMD_[CALC|CYCLES|WAIT] ; ; BUS TIMING FOR ON CHIP ROM ; -EZ80_FLSH_WS .SET 1 ; WAIT STATES FOR ON CHIP FLASH (0-7) -EZ80_FLSH_MIN_NS .SET 60 ; MINIMUM WAIT STATES TO APPLY TO ON-CHIP FLASH, IF EZ80_WSMD_TYP = EZ80WSMD_CALC -EZ80_FWSMD_TYP .SET EZ80WSMD_CALC ; WAIT STATE TYPE: EZ80RMMD_[CALC|WAIT] (CYCLES NOT ALLOWED) +EZ80_FLSH_WS .SET 1 ; WAIT STATES FOR ON CHIP FLASH (0-7) +EZ80_FLSH_MIN_NS .SET 60 ; MINIMUM WAIT STATES TO APPLY TO ON-CHIP FLASH, IF EZ80_WSMD_TYP = EZ80WSMD_CALC +EZ80_FWSMD_TYP .SET EZ80WSMD_CALC ; WAIT STATE TYPE: EZ80RMMD_[CALC|WAIT] (CYCLES NOT ALLOWED) diff --git a/Source/HBIOS/ez80uart.asm b/Source/HBIOS/ez80uart.asm index c113c577..522564db 100644 --- a/Source/HBIOS/ez80uart.asm +++ b/Source/HBIOS/ez80uart.asm @@ -224,15 +224,18 @@ EZUART_QUERY: TRANSLATE(96000-67200, 01010b) ; BAUDRATE=76800 (BETWEEN 67201 AND 96000) TRANSLATE(134400-96000, 11001b) ; BAUDRATE=115200 (BETWEEN 96001 AND 134400) TRANSLATE(192000-134400, 01011b) ; BAUDRATE=153600 (BETWEEN 134401 AND 192000) - TRANSLATE(268800-192000, 11010b) ; BAUDRATE=230400 (BETWEEN 192001 AND 268800) - TRANSLATE(384000-268800, 01100b) ; BAUDRATE=307200 (BETWEEN 268801 AND 384000) - TRANSLATE(537600-384000, 11011b) ; BAUDRATE=460800 (BETWEEN 384001 AND 537600) - TRANSLATE(768000-537600, 01101b) ; BAUDRATE=614400 (BETWEEN 537601 AND 768000) - TRANSLATE(1075200-768000, 11100b) ; BAUDRATE=921600 (BETWEEN 768001 AND 1075200) - TRANSLATE(1536000-1075200, 01110b) ; BAUDRATE=1228800 (BETWEEN 1075201 AND 1536000) - TRANSLATE(2150400-1536000, 11101b) ; BAUDRATE=1843200 (BETWEEN 1536001 AND 2150400) - TRANSLATE(3072000-2150400, 01111b) ; BAUDRATE=2457600 (BETWEEN 2150401 AND 3072000) - TRANSLATE(5529600-3072000, 11110b) ; BAUDRATE=3686400 (BETWEEN 3072001 AND 5529600) +;;; +;;; The following are causing "Unused data in MS byte of argument." errors +;;; +;;; TRANSLATE(268800-192000, 11010b) ; BAUDRATE=230400 (BETWEEN 192001 AND 268800) +;;; TRANSLATE(384000-268800, 01100b) ; BAUDRATE=307200 (BETWEEN 268801 AND 384000) +;;; TRANSLATE(537600-384000, 11011b) ; BAUDRATE=460800 (BETWEEN 384001 AND 537600) +;;; TRANSLATE(768000-537600, 01101b) ; BAUDRATE=614400 (BETWEEN 537601 AND 768000) +;;; TRANSLATE(1075200-768000, 11100b) ; BAUDRATE=921600 (BETWEEN 768001 AND 1075200) +;;; TRANSLATE(1536000-1075200, 01110b) ; BAUDRATE=1228800 (BETWEEN 1075201 AND 1536000) +;;; TRANSLATE(2150400-1536000, 11101b) ; BAUDRATE=1843200 (BETWEEN 1536001 AND 2150400) +;;; TRANSLATE(3072000-2150400, 01111b) ; BAUDRATE=2457600 (BETWEEN 2150401 AND 3072000) +;;; TRANSLATE(5529600-3072000, 11110b) ; BAUDRATE=3686400 (BETWEEN 3072001 AND 5529600) LD D, 11111b ; BAUDRATE=7372800 (>=5529601) uart_query_end: diff --git a/Source/HBIOS/hbios.asm b/Source/HBIOS/hbios.asm index fd9109a8..30702b51 100644 --- a/Source/HBIOS/hbios.asm +++ b/Source/HBIOS/hbios.asm @@ -5476,13 +5476,13 @@ SYS_GETAPPBNKS: SYS_SET: LD A,C ; GET REQUESTED SUB-FUNCTION CP BF_SYSSET_TIMER - JR Z,SYS_SETTIMER + JP Z,SYS_SETTIMER CP BF_SYSSET_SECS - JR Z,SYS_SETSECS + JP Z,SYS_SETSECS CP BF_SYSSET_BOOTINFO - JR Z,SYS_SETBOOTINFO + JP Z,SYS_SETBOOTINFO CP BF_SYSSET_CPUSPD - JR Z,SYS_SETCPUSPD + JP Z,SYS_SETCPUSPD CP BF_SYSSET_PANEL JP Z,SYS_SETPANEL SYSCHKERR(ERR_NOFUNC) ; SIGNAL ERROR diff --git a/Source/HBIOS/std.asm b/Source/HBIOS/std.asm index dc3935e0..3d9b8099 100644 --- a/Source/HBIOS/std.asm +++ b/Source/HBIOS/std.asm @@ -663,9 +663,11 @@ SYSTIM .SET TM_Z280 #ENDIF #ENDIF ; - #IF ((CPUFAM == CPU_EZ80) & (EZ80TIMER == EZ80TMR_INT)) + #IF (CPUFAM == CPU_EZ80) + #IF (EZ80TIMER == EZ80TMR_INT)) SYSTIM .SET TM_EZ80 SYSECHO " EZ80" + #ENDIF #ENDIF ; #IF SYSTIM == TM_NONE diff --git a/Source/HBIOS/tms.asm b/Source/HBIOS/tms.asm index 00998e9a..4a309e45 100644 --- a/Source/HBIOS/tms.asm +++ b/Source/HBIOS/tms.asm @@ -276,8 +276,8 @@ TMS_INIT: ; TMS_INIT1: #IF (TMSTIMENABLE) - PRTS(" INTERRUPT ENABLED$") - + CALL PRTSTRD + .TEXT " INTERRUPT ENABLED$" #ENDIF CALL PC_SPACE LD A,TMS_COLS diff --git a/Source/RomDsk/Makefile b/Source/RomDsk/Makefile index 57e5ff7c..1f067db1 100644 --- a/Source/RomDsk/Makefile +++ b/Source/RomDsk/Makefile @@ -7,7 +7,7 @@ include $(TOOLS)/Makefile.inc .SHELLFLAGS = -ce ROMAPPS1 := assign mode rtc syscopy xm -ROMAPPS2 := fdu format survey sysgen talk cpuspd +ROMAPPS2 := fdu format survey sysgen talk timer cpuspd rom128_%.dat: DISKDEF=wbw_rom128 rom256_%.dat: DISKDEF=wbw_rom256