Skip to content

Commit

Permalink
eZ80 Follow-up
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
wwarthen committed Sep 15, 2024
1 parent be225c6 commit 1d8c0c9
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Source/HBIOS/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
32 changes: 32 additions & 0 deletions Source/HBIOS/cfg_MASTER.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
18 changes: 9 additions & 9 deletions Source/HBIOS/cfg_RCEZ80.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
21 changes: 12 additions & 9 deletions Source/HBIOS/ez80uart.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions Source/HBIOS/hbios.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion Source/HBIOS/std.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Source/HBIOS/tms.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Source/RomDsk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d8c0c9

Please sign in to comment.