From 53bdee68d531755062d1ace6da8b6522adc56de5 Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Fri, 10 Feb 2023 11:31:32 -0800 Subject: [PATCH] Fixed SURVEY Crash on SBC Platform Hacked to avoid bank switch problem. See issue #316 --- Doc/ChangeLog.txt | 1 + Source/Apps/Build.cmd | 4 +- Source/Apps/Clean.cmd | 1 + Source/Apps/Makefile | 10 ++-- Source/Apps/Survey/Build.cmd | 16 ++++++ Source/Apps/Survey/Clean.cmd | 8 +++ Source/Apps/Survey/Makefile | 6 +++ Source/Apps/{survey.asm => Survey/survey.mac} | 53 +++++++++++++++++-- 8 files changed, 84 insertions(+), 15 deletions(-) create mode 100644 Source/Apps/Survey/Build.cmd create mode 100644 Source/Apps/Survey/Clean.cmd create mode 100644 Source/Apps/Survey/Makefile rename Source/Apps/{survey.asm => Survey/survey.mac} (90%) diff --git a/Doc/ChangeLog.txt b/Doc/ChangeLog.txt index 44d037c0..50cfed09 100644 --- a/Doc/ChangeLog.txt +++ b/Doc/ChangeLog.txt @@ -68,6 +68,7 @@ Version 3.1.1 - L?N: Updated ZDE to v1.8 including time stamp preservation fixes - D?M: Minor update to CP/NET client files, fix to CPNBOOT - WBW: Added p-System IV.0 Z80 implementation +- WBW: Hacked SURVEY to work around bank switching crash Version 3.1 ----------- diff --git a/Source/Apps/Build.cmd b/Source/Apps/Build.cmd index 675d1f44..1396ca29 100644 --- a/Source/Apps/Build.cmd +++ b/Source/Apps/Build.cmd @@ -21,9 +21,6 @@ call :asm rtchb || exit /b zxcc Z80ASM -SYSGEN/F || exit /b -zxcc MAC SURVEY.ASM -$PO || exit /b -zxcc MLOAD25 -SURVEY.COM=SURVEY.HEX || exit /b - pushd XM && call Build || exit /b & popd pushd FDU && call Build || exit /b & popd pushd Tune && call Build || exit /b & popd @@ -34,6 +31,7 @@ pushd ZMD && call Build || exit /b & popd pushd Dev && call Build || exit /b & popd pushd VGM && call Build || exit /b & popd pushd cpuspd && call Build || exit /b & popd +pushd Survey && call Build || exit /b & popd copy *.com %APPBIN%\ || exit /b diff --git a/Source/Apps/Clean.cmd b/Source/Apps/Clean.cmd index 198f461d..e60ceb53 100644 --- a/Source/Apps/Clean.cmd +++ b/Source/Apps/Clean.cmd @@ -17,3 +17,4 @@ pushd ZMD && call Clean || exit /b 1 & popd pushd Dev && call Clean || exit /b 1 & popd pushd VGM && call Clean || exit /b 1 & popd pushd cpuspd && call Clean || exit /b 1 & popd +pushd Survey && call Clean || exit /b 1 & popd diff --git a/Source/Apps/Makefile b/Source/Apps/Makefile index 96d2411c..03bacb2c 100644 --- a/Source/Apps/Makefile +++ b/Source/Apps/Makefile @@ -1,13 +1,9 @@ -OBJECTS = sysgen.com survey.com \ - syscopy.com assign.com format.com talk.com mode.com rtc.com \ - timer.com rtchb.com -SUBDIRS = XM FDU FAT Tune Test ZMP ZMD Dev VGM cpuspd +OBJECTS = sysgen.com syscopy.com assign.com format.com talk.com \ + mode.com rtc.com timer.com rtchb.com +SUBDIRS = XM FDU FAT Tune Test ZMP ZMD Dev VGM cpuspd Survey DEST = ../../Binary/Apps TOOLS =../../Tools include $(TOOLS)/Makefile.inc USETASM = 1 - -survey.com: USETASM = 0 - diff --git a/Source/Apps/Survey/Build.cmd b/Source/Apps/Survey/Build.cmd new file mode 100644 index 00000000..91a22e25 --- /dev/null +++ b/Source/Apps/Survey/Build.cmd @@ -0,0 +1,16 @@ +@echo off +setlocal + +set TOOLS=..\..\..\Tools + +set PATH=%TOOLS%\zxcc;%PATH% + +set CPMDIR80=%TOOLS%/cpm/ + +:: zxcc MAC survey.asm -$PO || exit /b +:: zxcc MLOAD25 survey || exit /b + +zxcc M80 -,=survey/L/R +zxcc L80 -survey,survey/N/E + +:: copy /Y survey.com ..\..\..\Binary\Apps\ || exit /b diff --git a/Source/Apps/Survey/Clean.cmd b/Source/Apps/Survey/Clean.cmd new file mode 100644 index 00000000..14eed93d --- /dev/null +++ b/Source/Apps/Survey/Clean.cmd @@ -0,0 +1,8 @@ +@echo off +setlocal + +if exist *.hex del *.hex +if exist *.rel del *.rel +if exist *.prn del *.prn +if exist *.lst del *.lst +if exist *.com del *.com diff --git a/Source/Apps/Survey/Makefile b/Source/Apps/Survey/Makefile new file mode 100644 index 00000000..5fbf081e --- /dev/null +++ b/Source/Apps/Survey/Makefile @@ -0,0 +1,6 @@ +OBJECTS = survey.com +DEST = ../../../Binary/Apps +TOOLS = ../../../Tools +OTHERS = *.hex + +include $(TOOLS)/Makefile.inc diff --git a/Source/Apps/survey.asm b/Source/Apps/Survey/survey.mac similarity index 90% rename from Source/Apps/survey.asm rename to Source/Apps/Survey/survey.mac index f049be90..b341e485 100644 --- a/Source/Apps/survey.asm +++ b/Source/Apps/Survey/survey.mac @@ -15,6 +15,10 @@ ; ;VERSION LIST - Most recent version first. ; +;10/Feb/23 - Total hack to avoid crash on ECB SBC +; RomWBW now required by this version +; Wayne Warthen +; ;16/Dec/17 - Handle 16-bit port addressing using ; Z80 IN A,(C) instruction. Wayne Warthen ; @@ -234,7 +238,21 @@ TABS EQU 9 ; Tab columns ; MAIN PROGRAM ; ;***********************; ; - ORG 100H + ;ORG 100H +; +; +; + .Z80 + LD HL,IMGORG + LD DE,START + LD BC,IMGEND-IMGORG + LDIR + JP START + .8080 +; +IMGORG: +; + .PHASE 8000H ; START: LXI H,0 ; Save stack pointer @@ -242,7 +260,8 @@ START: SHLD OLDSP LXI SP,FINIS+64 CALL TYPE ; Type initial CRLF - DB TAB,TAB,'*** System Survey (December 17) ***' + DW CRLF,CRLF + DB TAB,'*** RomWBW System Survey (Feb 2023) ***' DW CRLF,CRLFE ;DISK SURVEY @@ -586,6 +605,13 @@ PDLY: MOV A,H ; ON CONSOLE STATUS PORT ORA L JNZ PDLY +; + .Z80 + ; RECORD THE ACTIVE BANK + LD A,(0FFE0H) ; GET CURRENT HBIOS BANK ID + LD (BANK),A ; AND SAVE IT + .8080 +; LXI H,0 ; Init active port counter mvi d,0 ; Init port counter mvi e,0ffh ; init port group variable @@ -596,11 +622,23 @@ PORTLP: CPI SKIPORT JZ ISPORT ; Print mask port ENDIF - +; mov c,a ; port number to reg c mvi b,0 ; for 16 bit port addressing - db 0edh,078h ; z80: in a,(c) + .Z80 + in a,(c) + .8080 +; + .Z80 + ; MAKE SURE CORRECT BANK IS STILL SELECTED! + push af + ld a,(BANK) + call 0FFF3H + pop af + .8080 +; ; inactive port could return 0xFF or 0x78 or the port address +; cmp c jz nextpt cpi 0FFh @@ -708,7 +746,6 @@ BITSHF: JNZ BITSHF RET - ;***********************; ; DATA STORAGE ; ;***********************; @@ -722,6 +759,12 @@ RAMF: DS 1 ; RAM good flag EMPF: DS 1 ; Empty so far flag BLKSHF: DS 1 ; block shift factor MAXALL: DS 2 ; maximum block number +BANK: DS 1 ; saved HBIOS bank id FINIS EQU $ ; End of program +; + .DEPHASE +; +IMGEND: +; END  \ No newline at end of file