Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map/switches2 #455

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Source/Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ setlocal
call BuildProp || exit /b
call BuildShared || exit /b
call BuildBP || exit /b
call BuildROM %* || exit /b
call BuildImages || exit /b
call BuildROM %* || exit /b
call BuildZRC || exit /b
call BuildZ1RCC || exit /b
call BuildZZRCC || exit /b
Expand All @@ -15,4 +15,4 @@ call BuildFZ80 || exit /b

if "%1" == "dist" (
call Clean || exit /b
)
)
11 changes: 6 additions & 5 deletions Source/HBIOS/Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ call :asm usrrom || exit /b
call :asm updater || exit /b
call :asm imgpad2 || exit /b

::
:: Build components in Sub folders
::
pushd SysConfig && call Build || exit /b & popd
:: Sysconf builds as both BIN and COM files
tasm -t%CPUType% -g3 -fFF -dROMWBW sysconf.asm sysconf.bin sysconf_bin.lst || exit /b
tasm -t%CPUType% -g3 -fFF -dCPM sysconf.asm sysconf.com sysconf_com.lst || exit /b

::
:: Create additional ROM bank images by assembling components into
Expand All @@ -102,7 +101,7 @@ pushd SysConfig && call Build || exit /b & popd
::

copy /b romldr.bin + dbgmon.bin + ..\zsdos\zsys_wbw.bin + ..\cpm22\cpm_wbw.bin osimg.bin || exit /b
copy /b ..\Forth\camel80.bin + nascom.bin + ..\tastybasic\src\tastybasic.bin + game.bin + eastaegg.bin + netboot.mod + updater.bin + SysConfig\sysconfig.bin + usrrom.bin osimg1.bin || exit /b
copy /b ..\Forth\camel80.bin + nascom.bin + ..\tastybasic\src\tastybasic.bin + game.bin + eastaegg.bin + netboot.mod + updater.bin + sysconf.bin + usrrom.bin osimg1.bin || exit /b

if %Platform%==S100 (
zxcc slr180 -s100mon/fh
Expand Down Expand Up @@ -158,6 +157,8 @@ if exist %ROMName%.rom copy %ROMName%.rom ..\..\Binary || exit /b
if exist %ROMName%.upd copy %ROMName%.upd ..\..\Binary || exit /b
if exist %ROMName%.com copy %ROMName%.com ..\..\Binary || exit /b

if exist sysconf.com copy sysconf.com ..\..\Binary\Apps\ || exit /b

goto :eof

::
Expand Down
2 changes: 0 additions & 2 deletions Source/HBIOS/Clean.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ if exist build.inc del build.inc
if exist font*.asm del font*.asm
if exist build_env.cmd del build_env.cmd
if exist hbios_env.cmd del hbios_env.cmd

pushd SysConfig && call Clean & popd
17 changes: 9 additions & 8 deletions Source/HBIOS/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ MOREDIFF = game.bin hbios_rom.bin nascom.bin usrrom.bin \
dbgmon.bin hbios_app.bin imgpad2.bin osimg1.bin osimg2.bin romldr.bin \
eastaegg.bin hbios_img.bin osimg.bin game.bin updater.bin usrrom.bin

# SUBDIRS = SysConfig
DEST = ../../Binary
TOOLS =../../Tools
OTHERS = *.img *.rom *.com *.upd *.bin *.hex cpm.sys zsys.sys Build.inc font*.asm *.dat hbios_env.sh \
SysConfig/*.com SysConfig/*.bin SysConfig/*.lst
OTHERS = *.img *.rom *.com *.upd *.bin *.hex cpm.sys zsys.sys Build.inc font*.asm *.dat hbios_env.sh

# DIFFMAKE = 1

Expand All @@ -34,7 +32,7 @@ else ifeq ($(CPUFAM),3)
TASM=$(BINDIR)/uz80as -t z280
endif

DEPS=prereq dbgmon.bin romldr.bin nascom.bin tastybasic.bin game.bin eastaegg.bin updater.bin usrrom.bin imgpad2.bin
DEPS=prereq dbgmon.bin romldr.bin nascom.bin tastybasic.bin game.bin eastaegg.bin updater.bin sysconf.bin usrrom.bin imgpad2.bin

ifeq ($(ROM_PLATFORM),UNA)
ROMDEPS=romldr.bin dbgmon.bin
Expand Down Expand Up @@ -63,7 +61,7 @@ $(OBJECTS) : $(ROMDEPS)
@cat romldr.bin dbgmon.bin ../ZSDOS/zsys_$(BIOS).bin ../CPM22/cpm_$(BIOS).bin >osimg.bin
cat romldr.bin dbgmon.bin ../ZSDOS/zsys_$(BIOS).bin >osimg_small.bin
if [ $(ROM_PLATFORM) != UNA ] ; then \
cat camel80.bin nascom.bin tastybasic.bin game.bin eastaegg.bin netboot.mod updater.bin SysConfig/sysconfig.bin usrrom.bin >osimg1.bin ; \
cat camel80.bin nascom.bin tastybasic.bin game.bin eastaegg.bin netboot.mod updater.bin sysconf.bin usrrom.bin >osimg1.bin ; \
if [ $(ROM_PLATFORM) = S100 ] ; then \
cat s100mon.bin >osimg2.bin ; \
else \
Expand All @@ -89,16 +87,19 @@ $(OBJECTS) : $(ROMDEPS)
fi \
fi

prereq: $(FONTS) camel80.bin tastybasic.bin syscon
prereq: $(FONTS) camel80.bin tastybasic.bin

font%.asm:
cp ../Fonts/$@ .

camel80.bin:
cp ../Forth/$@ .

syscon:
$(MAKE) --directory SysConfig
sysconf.bin:
@$(TASM) -dROMWBW sysconf.asm sysconf.bin sysconf_bin.lst

sysconf.com:
@$(TASM) -dCPM sysconf.asm sysconf.com sysconf_com.lst

s100mon.bin:
$(ZXCC) $(CPM)/SLR180 -s100mon/FH
Expand Down
7 changes: 2 additions & 5 deletions Source/HBIOS/Makefile.new
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ camel80.bin:
tastybasic.bin:
cp ../TastyBasic/src/$@ .

sysconfig.bin:
cp SysConfig/$@ .

s100mon.bin:
$(ZXCC) $(CPM)/SLR180 -s100mon/FH
$(ZXCC) $(CPM)/MLOAD25 -s100mon.bin=s100mon
Expand Down Expand Up @@ -103,8 +100,8 @@ UNA_%.osimg.bin: UNA_%.romldr.bin UNA_%.dbgmon.bin
%.osimg_small.bin: %.romldr.bin %.dbgmon.bin
cat $(*F).romldr.bin $(*F).dbgmon.bin ../ZSDOS/zsys_wbw.bin >$@

%.osimg1.bin: camel80.bin %.nascom.bin tastybasic.bin %.game.bin %.eastaegg.bin netboot.mod %.updater.bin sysconfig.bin %.usrrom.bin
cat camel80.bin $(*F).nascom.bin tastybasic.bin $(*F).game.bin $(*F).eastaegg.bin netboot.mod $(*F).updater.bin sysconfig.bin $(*F).usrrom.bin >$@
%.osimg1.bin: camel80.bin %.nascom.bin tastybasic.bin %.game.bin %.eastaegg.bin netboot.mod %.updater.bin sysconf.bin %.usrrom.bin
cat camel80.bin $(*F).nascom.bin tastybasic.bin $(*F).game.bin $(*F).eastaegg.bin netboot.mod $(*F).updater.bin sysconf.bin $(*F).usrrom.bin >$@
srec_cat $@ -Binary -Crop 0 0x7FFF -Checksum_Negative_Big_Endian 0x7FFF 1 1 -o $@ -Binary

S100_%.imgpad2.bin: s100mon.bin
Expand Down
11 changes: 0 additions & 11 deletions Source/HBIOS/SysConfig/Build.cmd

This file was deleted.

6 changes: 0 additions & 6 deletions Source/HBIOS/SysConfig/Clean.cmd

This file was deleted.

12 changes: 0 additions & 12 deletions Source/HBIOS/SysConfig/Makefile

This file was deleted.

21 changes: 0 additions & 21 deletions Source/HBIOS/SysConfig/README.md

This file was deleted.

45 changes: 22 additions & 23 deletions Source/HBIOS/hbios.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3393,7 +3393,7 @@ NVR_INIT:
JR NZ, NVR_INIT_DEF ; failed to correclty read data
;
CALL NVSW_CHECKSUM ; checksum calc into A
LD HL,CB_SWITCHCK ; address of HCB value
LD HL,CB_SWITCHCK ; address of HCB switch checksum value
CP (HL) ; compare Caculated Check, with hcb Check Value
JR Z,NVR_INIT_END ; The same so success
NVR_INIT_DEF:
Expand Down Expand Up @@ -5697,14 +5697,9 @@ SYS_GETFN:
; HL: SWITCH VALUE 8/16 BIT
;
SYS_GETSWITCH:
; PUSH DE
; CALL NVSW_CONFIG ; make sure shadow copy is inited
; POP DE ;
; RET NZ ; Configuration Failed, thus cant continue
;
LD A,D
CP $FF ; test if want to just get NVRAM status
JP Z,NVSW_STATUS ; Check the Status - Call and Return
JR Z,SYS_GETSWITCH3 ; Check the Status - Call and Return
;
CALL SWITCH_RES ; D SWITCH NUMBER -> OUT HL address, E FLAGS
RET NZ ; IF NZ FLAG SET THEN ISSUE
Expand All @@ -5722,6 +5717,20 @@ SYS_GETSWITCH2:
LD L,C
XOR A ; signal success
RET
;
; Return Status
; A=0 if NVRAM does not exist. with NZ flag set
; A=1 if NVRAM exists, not inited. with NZ flag set
; A='W' if NVRAM is fully inited. with Z flag set
;
; Note the NZ flag can be used to detect and return an error condition
; where the NVRAM is not fully initialised
;
SYS_GETSWITCH3:
LD A,(CB_SWITCHES) ; the status byte
CP 'W' ; set NZ based on A = W
RET
;
#IF ((CPUFAM == CPU_EZ80) & (EZ80TIMER == EZ80TMR_FIRM))
; IMPLEMENTED IN EZ80DRV.ASM
;
Expand Down Expand Up @@ -5974,12 +5983,16 @@ SYS_SET:
; HL: SWITCH VALUE 8/16 BIT
;
SYS_SETSWITCH:
CALL NVSW_STATUS ; Check the status of NV RAM
RET NZ ; IF NZ then we cant continue, return NZ at this point
LD A,(CB_SWITCHES) ; Check the basic status of NV RAM
CP 0 ; no nv ram is present. ( if = 0 )
JR Z,SWITCH_RES1 ; then we cant continue, return NZ at this point
;
LD A,D ; switch # argument
CP $FF ; test if want to reset NVRAM
JP Z,NVSW_RESET ; then perform reset function. CALL AND RETURN
;
CALL SYS_GETSWITCH3 ; Check the Full status of NV RAM
RET NZ ; is not fully initialised, so return
;
LD B,H ; move value to write into BC
LD C,L
Expand Down Expand Up @@ -7571,20 +7584,6 @@ Z2DMAADR2:
; ROUTINES FOR NON VOLITILE (NVRAM) SWITCHES
;--------------------------------------------------------------------------------------------------
;
; Return Status
; A=0 if no NVRAM exists. with NZ flag set
; A=1 if NVRAM is present. with Z flag set
; A='W' if NVRAM is fullly inited. with Z flag set
; Note the NZ flag can be used to detect and return an error condition
;
NVSW_STATUS:
LD A,(CB_SWITCHES) ; the status byte
LD B,A ; save it
AND 1 ; applies to 'W' and $01 status, -> 1
CP 1 ; set NZ based on A = 1
LD A,B ; return the
RET
;
; RESET CONTENTS OF NVRAM, STORING INTO
; RETURN NONZERO IF WRITTEN - ZERO IF NOT WRITTEN
;
Expand Down
Loading