From 7c6f1f50b86ec8c538f96c9874d06a684cca3b8b Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Wed, 21 Jan 2026 13:21:16 -0800 Subject: [PATCH] Misc. Cleanup - Add debugging to XModem, but bracketed with conditional compilation and turned off. - Update S100 T35 config name from t35 to t35_std to conform with naming of the standard config files. - Refresh Ch375 Native USB generated files to match current versions generated. - Move SCON driver include in HBIOS from Multi-function section to Character device section. - Added ToDo comments to SCSI driver. - Added VT-100 TERM.DEF file to the Games disk image. - Commented out debug output in SIMH config file. --- Source/Apps/XM/xmdm125.asm | 106 +++++++++++++++++- Source/Doc/Hardware.md | 6 +- Source/HBIOS/Build.cmd | 2 +- Source/HBIOS/Build.sh | 2 +- Source/HBIOS/Config/SZ180_std.asm | 3 + .../Config/{SZ80_t35.asm => SZ80_t35_std.asm} | 0 Source/HBIOS/ch376-native/keyboard.s | 2 +- Source/HBIOS/ch376-native/scsi-drv.s | 2 +- Source/HBIOS/ch376-native/ufi-drv.s | 2 +- Source/HBIOS/hbios.asm | 19 ++-- Source/HBIOS/scsi.asm | 2 + Source/Images/d_games/u0/TERM.DEF | Bin 0 -> 128 bytes Tools/simh/Sim.cfg | 2 +- 13 files changed, 125 insertions(+), 23 deletions(-) rename Source/HBIOS/Config/{SZ80_t35.asm => SZ80_t35_std.asm} (100%) create mode 100644 Source/Images/d_games/u0/TERM.DEF diff --git a/Source/Apps/XM/xmdm125.asm b/Source/Apps/XM/xmdm125.asm index 8b02e742..0b245f1e 100644 --- a/Source/Apps/XM/xmdm125.asm +++ b/Source/Apps/XM/xmdm125.asm @@ -50,6 +50,10 @@ VYEAR EQU 86 NO EQU 0 YES EQU NOT NO ; +; Add debugging code? +; +DEBUG EQU NO +; ; Define ASCII characters used ; BS EQU 08H ; Backspace character @@ -2258,7 +2262,14 @@ RCVRPT: IF CONFUN ; Check for function key? CALL RECV ; Get any character received JC RCVSTOT ; Timeout ; -RCVRPTB:CPI SOH ; 'SOH' for a 128-byte block? +RCVRPTB: + IF DEBUG + CALL ILPRT + DB CR,LF,0 + CALL PRTHEXBYTE + ENDIF + + CPI SOH ; 'SOH' for a 128-byte block? JZ RCVSOH ; Yes CPI STX ; A 1024-byte block? JZ RCVSTX ; @@ -2343,7 +2354,13 @@ DELFILE:LXI D,FCB ; Point to file ; ;RCVSTOT:JMP RCVSERR ; Bump error count, etc. ; [WBW] Bypass line flush if error is timeout -RCVSTOT:JMP RCVSER1 ; Bump error count, etc. +RCVSTOT: + IF DEBUG + CALL ILPRT + DB 'Timeout',CR,LF,0 + ENDIF + + JMP RCVSER1 ; Bump error count, etc. ; ; Got SOH or STX - get block number, block number complemented ; @@ -2360,10 +2377,16 @@ RCVHDR: SHLD BLKSIZ ; Store block size for later MVI A,1 ; Need something to store at FRSTIM STA FRSTIM ; Indicate first 'SOH' received CALL RECV ; Get record + IF DEBUG + CALL PRTHEXBYTE + ENDIF JC RCVSTOT ; Got timeout MOV D,A ; D=block number MVI B,1 ; Timeout = 1 sec CALL RECV ; Get complimented record number + IF DEBUG + CALL PRTHEXBYTE + ENDIF JC RCVSTOT ; Timeout CMA ; Calculate the complement CMP D ; Good record number? @@ -2383,6 +2406,9 @@ RCVDATA:MOV A,D ; Get record number ; RCVCHR: MVI B,1 ; 1 sec timeout CALL RECV ; Get the character + IF DEBUG + CALL PRTHEXBYTE + ENDIF JC RCVSTOT ; Timeout MOV M,A ; Store the character INX H ; Point to next character @@ -2421,15 +2447,30 @@ CHKSNUM:LDA RCVRNO ; Get received ; record, else send a NAK requesting the record be sent again. ; RCVCRC: MVI E,2 ; Number of bytes to receive + IF DEBUG + CALL ILPRT + DB CR,LF,0 + ENDIF ; RCVCRC2:MVI B,1 ; 1 sececond timeout CALL RECV ; Get crc byte + IF DEBUG + CALL PRTHEXBYTE + ENDIF JC RCVSTOT ; Timeout DCR E ; Decrement the number of bytes JNZ RCVCRC2 ; Get both bytes + IF DEBUG + CALL ILPRT + DB CR,LF,0 + ENDIF CALL CHKCRC ; Check received CRC against calc'd CRC ORA A ; Is CRC okay? JZ CHKSNUM ; Yes, go check record numbers + IF DEBUG + CALL ILPRT + DB 'CRC Err',CR,LF,0 + ENDIF JMP RCVSERR ; Go check error limit and send NAK ; ; Previous record repeated, due to the last ACK being garbaged. ACK it @@ -4267,6 +4308,51 @@ DKIND: LDAX D ; Get the character from the string DKIND1: LDA KIND ; Get the kind of file back RET ; Finished ENDIF +; + IF DEBUG +; +; PRINT THE HEX BYTE VALUE IN A +; +PRTHEXBYTE: + PUSH PSW + PUSH D + CALL HEXASCII + MOV A,D + CALL CTYPE + MOV A,E + CALL CTYPE + POP D + POP PSW + RET + +; +; CONVERT BINARY VALUE IN A TO ASCII HEX CHARACTERS IN DE +; +HEXASCII: + MOV D,A + CALL HEXCONV + MOV E,A + MOV A,D + RLC + RLC + RLC + RLC + CALL HEXCONV + MOV D,A + RET +; +; CONVERT LOW NIBBLE OF A TO ASCII HEX +; +HEXCONV: + ANI 0FH ;LOW NIBBLE ONLY + ADI 90H + DAA + ACI 40H + DAA + RET +; + ENDIF +; ;..... ; ;----------------------------------------------------------------------- @@ -4499,15 +4585,19 @@ NIBBL: ANI 0FH ; Isolate digit ; Inline print of message, terminates with a 0 ; ILPRT: XTHL ; Save HL, get HL=message + PUSH PSW ; Save accum/flags ; -ILPLP: MOV A,M ; Get the character +ILPLP: + MOV A,M ; Get the character INX H ; To next character ORA A ; End of message? JZ ILPRET ; Yes, return CALL CTYPE ; Type the message JMP ILPLP ; Loop ; -ILPRET: XTHL ; Restore HL +ILPRET: + POP PSW ; Restore accum/flags + XTHL ; Restore HL RET ; Past message ; ; Exit printing message following call @@ -4582,6 +4672,14 @@ MOVE: MOV A,M ; Get a character ; CHKCRC: PUSH H ; Check 'CRC' bytes of received message LHLD CRCVAL + + IF DEBUG + MOV A,H + CALL PRTHEXBYTE + MOV A,L + CALL PRTHEXBYTE + ENDIF + MOV A,H ORA L POP H diff --git a/Source/Doc/Hardware.md b/Source/Doc/Hardware.md index 9447da28..cbe0f9f9 100644 --- a/Source/Doc/Hardware.md +++ b/Source/Doc/Hardware.md @@ -122,7 +122,7 @@ Others | [NABU w/ RomWBW Option Board]^5^ | NABU | NABU_std.rom | 115200 | | [S100 Computers Z180 SBC]^4^ | S100 | SZ180_std.rom | 57600 | | [S100 Computers Z80 CPU]^4^ | S100 | SZ80_std.rom | 19200 | -| [S100 Computers T35 FPGA Z80 SBC]^4^ | S100 | SZ80_t35.rom | 9600 | +| [S100 Computers T35 FPGA Z80 SBC]^4^ | S100 | SZ80_t35_std.rom | 9600 | | [UNA Hardware BIOS]^1^ | - | UNA_std.rom | - | | [Z80-Retro SBC]^3^ | - | Z80RETRO_std.rom | 38400 | | [Z180 Mark IV SBC]^1^ | ECB | MK4_std.rom | 38400 | @@ -478,7 +478,7 @@ A T35 FPGA Z80 based S100 SBC * Creator: John Monahan * Website: [S100 Computers FPGA Z80 SBC](http://www.s100computers.com/My%20System%20Pages/FPGA%20Z80%20SBC/FPGA%20Z80%20SBC.htm) -#### ROM Image File: SZ80_t35.rom +#### ROM Image File: SZ80_t35_std.rom | | | |-------------------|---------------| @@ -528,7 +528,7 @@ A T35 FPGA Z80 based S100 SBC See website for dip switch settings. - RomWBW is loaded by the S100 monitor from either CF Card or SD Card. - The CF/SD Card should be imaged using SZ80_t35_hd1k_combo.img which + The CF/SD Card should be imaged using SZ80_t35_std_hd1k_combo.img which includes RomWBW. `\clearpage`{=latex} diff --git a/Source/HBIOS/Build.cmd b/Source/HBIOS/Build.cmd index 3b67e140..a185af13 100644 --- a/Source/HBIOS/Build.cmd +++ b/Source/HBIOS/Build.cmd @@ -272,7 +272,7 @@ call Build EPITX std || exit /b :: call Build MON std || exit /b call Build NABU std || exit /b call Build SZ80 std || exit /b -call Build SZ80 t35 || exit /b +call Build SZ80 t35_std || exit /b call Build UNA std || exit /b call Build MSX std || exit /b diff --git a/Source/HBIOS/Build.sh b/Source/HBIOS/Build.sh index 974d5e96..0734b6d6 100755 --- a/Source/HBIOS/Build.sh +++ b/Source/HBIOS/Build.sh @@ -56,7 +56,7 @@ if [ "${ROM_PLATFORM}" == "dist" ] ; then # ROM_PLATFORM="MON"; ROM_CONFIG="std"; bash Build.sh ROM_PLATFORM="NABU"; ROM_CONFIG="std"; bash Build.sh ROM_PLATFORM="SZ80"; ROM_CONFIG="std"; bash Build.sh - ROM_PLATFORM="SZ80"; ROM_CONFIG="t35"; bash Build.sh + ROM_PLATFORM="SZ80"; ROM_CONFIG="t35_std"; bash Build.sh ROM_PLATFORM="MSX"; ROM_CONFIG="std"; bash Build.sh ROM_PLATFORM="UNA"; ROM_CONFIG="std"; bash Build.sh exit diff --git a/Source/HBIOS/Config/SZ180_std.asm b/Source/HBIOS/Config/SZ180_std.asm index 228f6665..865c2949 100644 --- a/Source/HBIOS/Config/SZ180_std.asm +++ b/Source/HBIOS/Config/SZ180_std.asm @@ -57,6 +57,9 @@ Z180_CLKDIV .SET 1 ; Z180: CHK DIV: 0=OSC/2, 1=OSC, 2=OSC*2 Z180_MEMWAIT .SET 1 ; Z180: MEMORY WAIT STATES (0-3) Z180_IOWAIT .SET 3 ; Z180: I/O WAIT STATES TO ADD ABOVE 1 W/S BUILT-IN (0-3) ; +FPLED_ENABLE .SET TRUE ; FP: ENABLES FRONT PANEL LEDS +FPLED_IO .SET $05 ; FP: PORT ADDRESS FOR FP LEDS +; INTRTCENABLE .SET TRUE ; ENABLE PERIODIC INTERRUPT CLOCK DRIVER (INTRTC.ASM) MMRTCENABLE .SET TRUE ; MMRTC: ENABLE NS MM58167B RTC DRIVER (MMRTC.ASM) DS12RTCENABLE .SET TRUE ; DS12RTC: ENABLE DS1288X RTC DRIVER (DS12RTC.ASM) diff --git a/Source/HBIOS/Config/SZ80_t35.asm b/Source/HBIOS/Config/SZ80_t35_std.asm similarity index 100% rename from Source/HBIOS/Config/SZ80_t35.asm rename to Source/HBIOS/Config/SZ80_t35_std.asm diff --git a/Source/HBIOS/ch376-native/keyboard.s b/Source/HBIOS/ch376-native/keyboard.s index abc73e8a..221b24c7 100644 --- a/Source/HBIOS/ch376-native/keyboard.s +++ b/Source/HBIOS/ch376-native/keyboard.s @@ -5,7 +5,7 @@ #IF (!CHNATIVEEZ80) #include "ch376-native/keyboard/class_hid_keyboard.c.s" #ENDIF +#include "ch376-native/keyboard/kyb-init.c.s" #IF (!CHNATIVEEZ80) #include "ch376-native/keyboard/kyb_driver.c.s" #ENDIF -#include "ch376-native/keyboard/kyb-init.c.s" diff --git a/Source/HBIOS/ch376-native/scsi-drv.s b/Source/HBIOS/ch376-native/scsi-drv.s index ea6f8a70..3723445a 100644 --- a/Source/HBIOS/ch376-native/scsi-drv.s +++ b/Source/HBIOS/ch376-native/scsi-drv.s @@ -2,7 +2,7 @@ #IF (!CHNATIVEEZ80) #include "ch376-native/scsi-drv/class_scsi.c.s" #ENDIF +#include "ch376-native/scsi-drv/scsi-init.c.s" #IF (!CHNATIVEEZ80) #include "ch376-native/scsi-drv/scsi_driver.c.s" #ENDIF -#include "ch376-native/scsi-drv/scsi-init.c.s" diff --git a/Source/HBIOS/ch376-native/ufi-drv.s b/Source/HBIOS/ch376-native/ufi-drv.s index bcc735b4..d37ebb30 100644 --- a/Source/HBIOS/ch376-native/ufi-drv.s +++ b/Source/HBIOS/ch376-native/ufi-drv.s @@ -2,10 +2,10 @@ #IF (!CHNATIVEEZ80) #include "ch376-native/ufi-drv/class_ufi.c.s" #ENDIF +#include "ch376-native/ufi-drv/ufi-init.c.s" #IF (!CHNATIVEEZ80) #include "ch376-native/ufi-drv/ufi_driver.c.s" #ENDIF -#include "ch376-native/ufi-drv/ufi-init.c.s" #IF (!CHNATIVEEZ80) #include "ch376-native/ufi-drv/usb_cbi.c.s" #ENDIF diff --git a/Source/HBIOS/hbios.asm b/Source/HBIOS/hbios.asm index 08286985..21b251d2 100644 --- a/Source/HBIOS/hbios.asm +++ b/Source/HBIOS/hbios.asm @@ -8915,7 +8915,7 @@ HB_MODSTART .EQU $ ; - PCF ; - DMA ; - NABU -; - EZ80SYSTMP +; - EZ80TMR ; #IF (CPUFAM == CPU_EZ80) #INCLUDE "ez80cpu.asm" @@ -9019,6 +9019,7 @@ HB_MODSTART .EQU $ ; - ACIA ; - SSER ; - DLPSER +; - SCON ; - UF ; #IF (ASCIENABLE) @@ -9065,6 +9066,10 @@ HB_MODSTART .EQU $ #INCLUDE "dlpser.asm" #ENDIF ; +#IF (SCONENABLE) + #INCLUDE "scon.asm" +#ENDIF +; #IF (UFENABLE) #INCLUDE "uf.asm" #ENDIF @@ -9330,15 +9335,9 @@ HB_MODSTART .EQU $ ; MULTI-FUNCTION MODULES ;-------------------------------------------------------------------------------------------------- ; -; - SCON -; - PRP -; - PPP -; - ESP -; -; -#IF (SCONENABLE) - #INCLUDE "scon.asm" -#ENDIF +; - PRP (PRPCON, PRPSD) +; - PPP (PPPCON, PPPSD) +; - ESP (ESPCON, ESPSER) ; #IF (PRPENABLE) #INCLUDE "prp.asm" diff --git a/Source/HBIOS/scsi.asm b/Source/HBIOS/scsi.asm index 4d58aa4d..f422ab80 100644 --- a/Source/HBIOS/scsi.asm +++ b/Source/HBIOS/scsi.asm @@ -7,6 +7,8 @@ ; DERIVED FROM CODE PROVIDED BY JAY COTTON. ; ; TODO: +; - IMPLEMENT BUS SCANNING FOR DEVICES AT STARTUP +; - USE TEST UNIT READY TO WAIT FOR SPINUP? ; ; NOTES: ; diff --git a/Source/Images/d_games/u0/TERM.DEF b/Source/Images/d_games/u0/TERM.DEF new file mode 100644 index 0000000000000000000000000000000000000000..e80009f24d8ac261deb912acd20f0a9b9ffe664d GIT binary patch literal 128 zcmb1=2w-IV&j14~EX?f8TueNSyo`K|{0#gI($Pj<($U`1(LmDLgB_-hbQ)p@gyeGM NU|`W