mirror of
https://github.com/wwarthen/RomWBW.git
synced 2026-02-06 22:33:12 -06:00
* added hack to handle tunes * quiet clean * added chmod for execution * suppress warnings * Multi-boot fixes * the windows build somehow thinks that these filesystems are cpm3. * credit and primitive instructions * Update sd.asm Cosmetic fix. * make compile shut up about conditionals * Add bin2asm for linus and update build to process font files under linix * fixed quoted double quote bug, added tests * added tests * added bin2asm for font file source creation * Revert linux bin2asm font stuff * added rule for font source generation * build fonts * added directory mapping cache. if the same directory is being hit as last run, we don't need to rebuild the map. will likely break if you are running more than one at a time, in that the cache will be ineffective. also, if the directory contents change, this will also break. * removed strip. breaks osx * added directory tag so . isn't matched all over the place * added real cache validation * fixed build * this file is copied from optdsk.lib or optcmd.lib * install to ../HBIOS * prerequisite verbosity * diff soft failure and casefn speedup * added lzsa * added lzsa * removed strip. breaks on osx * added clobber * added code to handle multiple platform rom builds with rom size override * added align and 0x55 hex syntax * default to hd64180 * added N8 capability * added SBC_std.rom to default build * added support for binary diff * diff fixes * clean, identical build. font source generator emitted .align. this does not match the windows build * Upgrade NZCOM to latest * Misc. Cleanup * fixed expression parser bug : ~(1|2) returned 0xfe * added diff build option * Update Makefile Makefile enhancement to better handle ncurses library from Bob Dunlop. * Update sd.asm Back out hack for uz80as now that Curt fixed it. * Misc. Cleanup * UNA Catchup UNA support was lacking some of the more recent behavior changes. This corrects most of it. * Add github action for building RomWBW * Bump Pre-release Version * Update build.yml Added "make clean" which will remove temporary files without removing final binary outputs. * Update Makefile Build all ROM variants by default in Linux/Mac build. * Update Makefile * Update Makefile * Update Makefile * Update Makefile * Update Makefile * Update Makefile * Update Makefile * Update Makefile * Update Makefile * Update for GitHub Build Case issue in TASM includes showing up in GitHub build. This should correct that. * Added an gitignore files to exclude generated files * Removed Tunes/clean.cmd and Tunes/ReadMe.txt - as make clean removes them * Build.sh: marked as executable chmod +x Build.sh * Fix to HBIOS/build.sh When adding files to rom disk, if files were missing, it would error out. It appears the intent is to skip non-existing files. Updated to log out correctly for missing files - and continue operation. * Update Microsoft NASCOM BASIC.docx Nascom manual, text version by Jan S (full name unknown) * Fix issue with Apps/Tune not making If dest directory does not exist, fails to make Apps * Create ReadMe.txt * Update Makefile * Update Build.sh * Make .gitignores for Tools/unix more specific * cpmtools Update Updated cpmtools applications (Windows only). Removed hack in diskdefs that is no longer required. * HBIOS Proxy Temp Stack Enhancement Reuse the bounce buffer area as the temporary stack space required briefly in HBX_INVOKE when transitioning banks. Increases size of temporary stack space to 64 bytes. * Update ReadMe.txt * HBIOS - clean up TMPSTK * Update hbios.asm Minor cosmetic changes. * Build Process Updates Minor udpates to build process to improve consistency between Windows and Mac/Linux builds. * Update hbios.asm Add improved interrupt protection to HBIOS PEEK, POKE, and BNKCPY functions. * hbios - wrap hbx_bnkcpy * hbios - adjust hbx_peek hbx_poke guards * Update hbios.asm Adjusted used of DI/EI for PEEK and POKE to regain a bit of INTSTK space. Added code so that HB_INVBNK can be used as a flag indicating if HBIOS is active, $FF is inactive, anything else means active. * Add HBIOS MuTex * Initial Nascom basic ecb-vdu graphics set and reset for 80x25b screen with 256 character mod * Finalize Pre-release 34 Final support for FreeRTOS * Update nascom.asm Optimization, cleanup, tabs and white spaces * IDE & PPIDE Cleanup * Clean up Make version include files common. * Update Makefile * Update Makefile * Build Test * Build Test * Build Fixes * Update nascom.asm Cleanup * Update nascom.asm Optimization * hbios - temp stack tweak * Update hbios.asm Comments on HBX_BUF usage. * Update nascom.asm Optimization * Update nascom.asm Setup ECB-VDU build option, remove debug code * Update nascom.asm Set default build. update initialization * Update nascom.asm Make CLS clear vdu screen * Update nascom.asm Fixup top screen line not showing * Add SC131 Support Also cleaned up some ReadMe files. * HBIOS SCZ180 - remove mutex special files * HBIOS SCZ180 - adjust mutex comment * Misc. Cleanup Includes some minor improvements to contents in some disk images. * Delete FAT.COM Changing case of FAT.COM extension to lowercase. * Create FAT.com Completing change of case in extension of FAT.com. * Update Makefile Remove ROM variants that just have the HBIOS MUTEX enabled. Users can easily enable this in a custom build. * Cleanup Removed hack from Images Makefile. Fixed use of DEFSERCFG in various places. * GitHub CI Updates Adds automation of build and release assets upon release. * Prerelease 36 General cleanup * Build Script Cleanups * Config File Cleanups * Update RomWBW Architecture General refresh for v2.9.2 * Update vdu.asm Removed a hack in VDU driver that has existed for 8 years. :-) * Fix CONSOLE Constant Rename CIODEV_CONSOLE constant to CIO_CONSOLE because it is a unit code, not a device type code. Retabify TastyBasic. * Minor Bug Fixes - Disk assignment edge case - CP/M 3 accidental fall thru - Cosmetic updates * Update util.z80 * Documentation Cleanup * Documentation Update * Documentation Update * Documentation Updates * Documentation Updates * Create Common.inc * Documentation Updates * Documentation Updates * doc - a few random fixes * Documentation Cleanup * Fix IM 0 Build Error in ACIA * Documentation Updates * Documentation Cleanup * Remove OSLDR The OSLDR application was badly broken and almost impossible to fix with new expanded OS support. * Bug Fixes - Init RAM disk at boot under CP/M 3 - Fix ACR activation in TUNE * FD Motor Timeout - Made FDC motor timeout smaller and more consistent across different speed CPUs - Added "boot" messaging to RTC * Cleanup * Cleanup - Fix SuperZAP to work under NZCOM and ZPM3 - Finalize standard config files * Minor Changes - Slight change to ZAP configuration - Added ZSDOS.ZRL to NZCOM image * ZDE Upgrade - Upgraded ZDE 1.6 -> 1.6a * Config File Tuning * Pre-release for Testing * cfg - mutex consistent config language * Bump to Version 3.0 * Update SD Card How-To Thanks David! * update ReadMe.md Remove some odd `\`. * Update ReadMe.txt * Update ReadMe.md * Update Generated Doc Files * Improve XModem Startup - Extended startup timeout for XM.COM so that it doesn't timeout so quickly while host is selecing a file to send. - Updated SD Card How-To from David Reese. * XModem Timing Refinements * TMS Driver Z180 Improvements - TMS driver udpated to insert Z180 I/O waitstates internally so other code can run at full speed. - Updated How-To documents from David. - Fixed TUNE app to properly restore Z180 I/O waitstates after manipulating them. * CLRDIR and ZDE updates - CLRDIR has been updated by Max Scane for CP/M 3 compatibility. - A minor issue in the preconfigured ZDE VT100 terminal escape sequences was corrected. * Fix Auto CRT Console Switch on CP/M 3 * Handle lack of RTC better DSRTC driver now correctly returns an error if there is no RTC present. * Minor RTC Updates * Finalize v3.0.1 Cleanup release for v3.0 * New ROMLDR and INTRTC driver - Refactored romldr.asm - Added new periodic timer based RTC driver * CP/M 3 Date Hack - Hack to allow INTRTC to increment time without destroying the date * Update romldr.asm Work around minor Linux build inconsistency * Update Apps for New Version * Revert "Update Apps for New Version" This reverts commitad80432252. * Revert "Update romldr.asm" This reverts commit4a9825cd57. * Revert "CP/M 3 Date Hack" This reverts commit153b494e61. * Revert "New ROMLDR and INTRTC driver" This reverts commitd9bed4563e. * Start v3.1 Development * Update FDISK80.COM Updated FDISK80 to allow reserving up to 256 slices. * Update sd.asm For Z180 CSIO, ensure that xmit is finished, before asserting CS for next transaction. * Add RC2014 UART, Improve SD protocol fix - RC2014 and related platforms will autodetect a UART at 0xA0 and 0xA8 - Ensure that CS fully brackets all SD I/O * ROMLDR Improvements .com files can now be started from CP/M and size of .com files has been reduced so they always fit. * Update commit.yml Run commit build in all branches * Update commit.yml Run commit build for master and dev branches * Improved clock driver auto-detect/fallback * SIO driver now CTC aware The SIO driver can now use a CTC (if available) to provide much more flexible baud rate programming. * CTC driver fine tuning * Update xmdm125.asm Fixed a small issue in core XM125 code that caused a file write error message to not be displayed when it should be. * CF Card compatibility improvement Older CF Cards did not reset IDE registers to defaults values when reset. Implemented a work around. * Update ACIA detection ACIA should no longer be detected if there is also a UART module in the system. * Handle CTC anomaly Small update to accommodate CTC behavior that occurs when the CTC trigger is more than half the CTC clock. * Update acia.asm Updated ACIA detection to use primary ACIA port instead of phantom port. * Update acia.asm Fix bug in ACIA detection. Thanks Alan! * MacOS Build Improvement Build script updated to improve compatibility with MacOS. Credit to Fredrik Axtelius for this. * HBIOS Makefile - use env vars for target Allow build ROM targets to be restricted to just one platform thru use of ENV vars: ROM_PLATFORM - if defined to a known platform, only this platform is build - defaults to std config ROM_CONFIG - sets the desired platform config - defaults to std if the above ENVs are not defined, builds all ROMs * Added some more gitignores * Whitespace changes (crlf) * HBIOS: Force the assembly to fail for vdu drivers if function table count is not correct * Whitespace: trailing whitespaces * makefile: updated some make scripts to use when calling subdir makefiles * linux build: update to Build.sh fix for some platforms The initialization of the Rom dat file used the pipe (|) operator to build an initial empty file. But the pipe operator | may sometimes return a non-zero exit code for some linux platforms, if the the streams are closed before dd has fully processed the stream. This issue occured on a travis linux ubuntu image. Solution was to change to redirection. * Bump version * Enhance CTC periodic timer Add ability to use TIMER mode in CTC driver to generate priodic interrupts. * HBIOS: Added support for sound drivers New sound driver support with initial support for the SN76489 chip New build configuration entry: * SN76489ENABLE Ports are currently locked in with: * SN76489_PORT_LEFT .EQU $FC ; PORTS FOR ACCESSING THE SN76489 CHIP (LEFT) * SN76489_PORT_RIGHT .EQU $F8 ; PORTS FOR ACCESSING THE SN76489 CHIP (LEFT) * Miscellaneous Cleanup No functional changes. Co-authored-by: curt mayer <curt@zen-room.org> Co-authored-by: Wayne Warthen <wwarthen@gmail.com> Co-authored-by: ed <linux@maidavale.org> Co-authored-by: Dean Netherton <dnetherton@dius.com.au> Co-authored-by: ed <ed@maidavale.org> Co-authored-by: Phillip Stevens <phillip.stevens@gmail.com> Co-authored-by: Dean Netherton <dean.netherton@gmail.com>
662 lines
19 KiB
Z80 Assembly
662 lines
19 KiB
Z80 Assembly
;:::::::::::::::::::::::::::::::::::::::::::::::::::***********************
|
||
; CBOOT. B/P BIOS Cold Boot Module. ** Hardware Specific **
|
||
; This MUST be the Last Module in the BIOS because ** for prompts, Env **
|
||
; it is overwritten by RAM Data. No Dflt Termcap. ** and Termcap Dflts **
|
||
; - D-X Designs Pty Ltd P112 - ***********************
|
||
;
|
||
; 1.2 - 30 Aug 01 - Cleaned up for GPL release, Set Bank Numbers on boot
|
||
; (TPABNK only if MOVCPM) by reading Regs set by ROM. HFB
|
||
; 1.1 - 8 May 97 - Added code to activate ASCI channels. HFB
|
||
; 1.0 - 13 Aug 96 - Initial Release for P112. HFB
|
||
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||
|
||
DSEG
|
||
;.....
|
||
; Cold boot entry. This code is executed only once and so may be
|
||
; overwritten subsequently by the BIOS. In Non-banked systems, this code
|
||
; is placed in the Host Buffer, HSTBUF, allowing up to 1024 bytes in the
|
||
; section, although much less will fit on the boot tracks. In Banked
|
||
; systems, a small resident part (up to 128 bytes) occupies the Directory
|
||
; Sector Buffer, DIRBUF, while the remainder is placed in the banked
|
||
; HSTBUF, allowing both sectors to be overwritten without penalty.
|
||
; To insure minimum disruption in assembling and linking the BIOS, this
|
||
; module must be one of the first linked to place HSTBUF/DIRBUF at the
|
||
; beginning of B2RAM and DSEG.
|
||
|
||
CBOOT: DI ; Disable interrupt system
|
||
|
||
LD HL,(IOBYT) ; Get IOBYTE, Default Drive & User
|
||
LD (3),HL ; Set values in TPA bank
|
||
|
||
IF BANKED
|
||
LD SP,USP ; Set to User Stack in High memory
|
||
CALL HBX_INIT ; WW
|
||
CALL GOSYSB ; Turn on the System bank
|
||
XOR A
|
||
LD (BIOSTK),A ; Init bank switcher
|
||
LD (3),HL ; Set IOBYTE and Default DU in System bank
|
||
CALL CBOOT0 ; Execute main part of Cold Setup
|
||
LD A,(TPABNK)
|
||
CALL SELBNK ; Insure TPA is in context
|
||
ELSE
|
||
LD SP,80H ; Set stack in Low memory
|
||
CALL HBX_INIT ; WW
|
||
CALL CBOOT0 ; Execute main part of Cold Setup
|
||
ENDIF
|
||
|
||
IF NOT MOVCPM
|
||
LD HL,003CH ; Point to ZMP Flag
|
||
LD (HL),0E5H ; say this is first time run
|
||
ENDIF
|
||
|
||
IF FASTWB
|
||
; Grab a copy of command processor from TPA and
|
||
; cache it in (SYSBNK):100H. We assume that the
|
||
; original copy of command processor is in high memory.
|
||
LD A,(TPABNK) ; Source bank is TPABNK
|
||
LD C,A ; Put it in C
|
||
LD A,(SYSBNK) ; Destination bank is SYSBNK
|
||
LD B,A ; Put it in B
|
||
CALL HBX_XCOPY ; Set banks for extended copy
|
||
LD HL,(CPADR) ; Copy from start of command processor
|
||
LD DE,100H ; .. to $100 in system bank
|
||
LD BC,(CPLEN) ; Length of command processor
|
||
CALL HBX_COPY ; Do it
|
||
|
||
JP WBOOTV ; move it and commence execution
|
||
ELSE
|
||
JP GOZSYS ; Otherwise just go to Command Processor
|
||
ENDIF
|
||
|
||
IF BANKED
|
||
COMMON /B2RAM/
|
||
ENDIF
|
||
|
||
;.....
|
||
; If this system is Banked and set for Zsdos2, then ALV Buffers are in the
|
||
; system bank and will be dynamically sized during Cold Boot. This permits
|
||
; BPCNFG to configure a generic IMG file for specific Hard Drive Partitions.
|
||
|
||
CBOOT0: LD HL,BRAME ; Get end of banked RAM
|
||
LD (HISAV),HL ; and save for later use
|
||
IF HARDDSK
|
||
LD HL,DPHTBL ; Point to start of DPH Table
|
||
LD B,16 ; do all DPHs
|
||
DYNLP: LD E,(HL)
|
||
INC HL
|
||
LD D,(HL) ; Get the pointer for this one
|
||
INC HL ; advance to next
|
||
LD A,D ; Anything there?
|
||
OR E
|
||
JR Z,DYNCHK ; jump to end if Nothing
|
||
DEC DE ; Else back up Ptr to Driver
|
||
DEC DE
|
||
LD A,(DE) ; Get driver #
|
||
IF RAMDSK
|
||
DEC A
|
||
DEC A ; Hard Disk (Driver 2)?
|
||
JR Z,ADDSIZ ; ..jump if so
|
||
DEC A ; RAM Disk (Driver 3)?
|
||
ELSE
|
||
CP 2 ; Hard Disk (Driver 2)?
|
||
ENDIF ; Ramdsk
|
||
JR NZ,DYNCHK ; ..jump to end if Not
|
||
ADDSIZ: PUSH BC ; Save loop counter
|
||
PUSH HL ; and ptr to DPH
|
||
EX DE,HL
|
||
LD DE,12 ; Offset to DPB Ptr (+2 for Decs)
|
||
ADD HL,DE
|
||
LD E,(HL)
|
||
INC HL
|
||
LD D,(HL) ; Get Addr of this DPB
|
||
INC HL
|
||
INC HL
|
||
INC HL ; Advance to ALV Addr location
|
||
LD BC,(HISAV) ; get end of used RAM
|
||
LD (HL),C ; and save
|
||
INC HL
|
||
LD (HL),B ; in DPH
|
||
LD HL,5
|
||
ADD HL,DE ; Advance to Size in DPB
|
||
LD E,(HL)
|
||
INC HL
|
||
LD D,(HL) ; and fetch Size-1
|
||
INC DE ; Make = Size in Block
|
||
PUSH BC ; (save End Addr in BC)
|
||
LD B,3
|
||
DVRAME: SRL D ; Divide by 2
|
||
RR E
|
||
DJNZ DVRAME ; *3 = Div 8
|
||
INC DE ; +1
|
||
EX DE,HL
|
||
POP BC ; Restore Ram End
|
||
ADD HL,BC ; Add size to Starting Location
|
||
LD (HISAV),HL ; save for next drive/overflow check
|
||
POP HL ; Restore DPH ptr
|
||
POP BC ; and loop ctr
|
||
DYNCHK: DJNZ DYNLP ; Loop til all 16 tested
|
||
|
||
ENDIF ;harddsk
|
||
|
||
IF BANKED
|
||
LD DE,USP ; Point above critical Bios Ram storage
|
||
ELSE
|
||
LD DE,DIRBUF
|
||
ENDIF
|
||
IF Z3
|
||
LD HL,(ENVADR) ; And top of memory
|
||
ELSE
|
||
LD HL,0FFFFH
|
||
ENDIF
|
||
SBC HL,DE ; Calculate # bytes to clear (CF already clr)
|
||
EX DE,HL ; Ptr to HL, Cnt to DE
|
||
Clr0: LD (HL),0
|
||
INC HL
|
||
DEC DE
|
||
LD A,D
|
||
OR E
|
||
JR NZ,Clr0 ; ..loop til all cleared
|
||
|
||
; In systems where we have enough space, we clear unused High Memory too
|
||
|
||
IF NOT MOVCPM
|
||
LD HL,(ENVADR) ; Clear above the ENV as well
|
||
LD DE,100H ; Assuming a 2-record ENV
|
||
ADD HL,DE ; Are we already at the top of memory?
|
||
JR C,ATTOP ; ..bypass clearing if so
|
||
EX DE,HL ; Else we must calculate how much to clear
|
||
LD HL,MEMTOP ; From the TOP
|
||
SBC HL,DE ; subtract the start
|
||
LD C,L
|
||
LD B,H ; and use for count
|
||
LD L,E ; Copy Start to Source
|
||
LD H,D
|
||
INC DE ; dest is same + 1
|
||
LD (HL),0 ; we fill with Zeros
|
||
LDIR ; Do it!
|
||
ATTOP:
|
||
ENDIF ; ~Movcpm
|
||
|
||
; Initialize the ZCPR3 buffers
|
||
|
||
IF NOT MOVCPM
|
||
LD HL,(ENVADR) ; Should we move our local ENV block?
|
||
LD A,H
|
||
OR L
|
||
JR NZ,BMOVE ; ..jump if we already have one
|
||
ENDIF ; (Always move Env if using MOVCPM type load)
|
||
LD HL,Z3ENV ; Else set up pointers
|
||
LD (ENVADR),HL
|
||
LD DE,ENV
|
||
EX DE,HL
|
||
LD BC,ENVEND-ENV ; count
|
||
LDIR ; and move
|
||
IF MOVCPM ; Instead of storing Termcap bytes, Zeroize
|
||
LD H,D
|
||
LD L,E ; Dupe dest addr
|
||
LD (HL),0 ; Clear current byte
|
||
LD BC,37-1 ; Set count to remaining Termcap area
|
||
INC DE ; Dest is next byte
|
||
LDIR ; move Zero along
|
||
ENDIF ;Movcpm
|
||
BMOVE:
|
||
IF NOT MOVCPM ; No need to set values on Boot Track System
|
||
LD DE,(ENVADR) ; Get pointer to ENV
|
||
IF HAVIOP
|
||
LD HL,0FH ; Set offset to IOP Addr in ENV
|
||
CALL CALCOF ; get the addr and size
|
||
LD (IOPPTR),HL ; and set addr
|
||
ENDIF ;haviop
|
||
LD HL,18H ; Set offset to Mult Comnd Line in ENV
|
||
CALL CALCOF ; get addr and size
|
||
LD (CLPTR),HL ; set addr
|
||
INC HL
|
||
INC HL
|
||
INC HL ; Advance to CL+3
|
||
LD (CL3PTR),HL ; and set
|
||
INC HL ; Advance to CL+4
|
||
LD (CMDSET),HL ; set addr in Command Line ptr
|
||
LD (CMDSET+2),A ; and CL Size byte
|
||
LD HL,09H ; Set offset to Path addr in ENV
|
||
CALL CALCOF ; get addr
|
||
LD (PTHPTR),HL ; and set
|
||
ENDIF ;Movcpm
|
||
IF FASTWB ; Do we restore CPR from Bank?
|
||
IF MOVCPM
|
||
LD DE,BIOSJT-1600H ; Get CPR Starting Addr
|
||
LD HL,0800H ; and Default Length
|
||
ELSE
|
||
LD HL,(ENVADR) ; Get pointer to ENV start
|
||
LD DE,3FH ; offset to CPR start
|
||
ADD HL,DE
|
||
LD E,(HL) ; and get CPR starting address
|
||
INC HL
|
||
LD D,(HL)
|
||
INC HL ; (advance to length)
|
||
LD H,(HL) ; Get length in blocks (*2 at this point)
|
||
LD L,0 ; convert to Word
|
||
SRL H ; Compute Blks * 128
|
||
RR L ; to give HL = CPR length in bytes
|
||
ENDIF ;~Movcpm
|
||
|
||
;
|
||
; SETUP FOR FASTWB
|
||
;
|
||
|
||
LD (CPLEN),HL ; Save command processor length
|
||
LD (CPADR),DE ; Save command processor address (in TPA)
|
||
|
||
ENDIF ;fastwb
|
||
|
||
LD (STKSAV),SP ; Save entry stack since we alter it here
|
||
LD A,(BLOCKE-BLOCK)/6
|
||
LD SP,BLOCK
|
||
BLKMV: POP BC ; And number of bytes to move
|
||
POP HL ; Source
|
||
POP DE ; Get destination
|
||
LDIR
|
||
DEC A ; Another block moved
|
||
JR NZ,BLKMV ; Do more as required
|
||
|
||
LD SP,(STKSAV) ; Get entry Stack Pointer back so we can return
|
||
|
||
; All Buffers above BIOS have been cleared already at this point
|
||
|
||
DEC A ; 0 --> FF
|
||
LD (Z3WHL),A ; Set the Wheel Byte
|
||
|
||
; Allocate disk buffer in HBIOS bank and
|
||
; save it for use later in disk access.
|
||
LD B,0F6H ; BIOS FUNC: ALLOCATE HEAP MEMORY
|
||
LD HL,512 ; 1 SECTOR, 512 BYTES
|
||
CALL HBX_INVOKE ; DO IT
|
||
CALL NZ,PANIC ; HANDLE ERROR
|
||
LD (HB_DSKBUF),HL ; RECORD THE BUFFER ADDRESS
|
||
|
||
IF HAVIOP
|
||
LD HL,IOPRET
|
||
LD (BIOSJT+1),HL
|
||
ENDIF ;haviop
|
||
|
||
IF BANKED
|
||
CALL JDVINI ; Call directly because we are in High Stack
|
||
ELSE
|
||
CALL DEVINI ; Initialize the I/O system
|
||
ENDIF ; And any device specific ram
|
||
|
||
IF [BANKED AND ZSDOS2]
|
||
LD DE,8000H ; If ALVs in Bank, size against Bank2 Top
|
||
ELSE
|
||
LD DE,(USRSP) ; else against base of User Space
|
||
ENDIF
|
||
LD HL,(HISAV) ; Load Highest RAM Address used
|
||
OR A
|
||
SBC HL,DE ; Is Needed Space > Limit?
|
||
JR C,MEMOK ; ..jump if So
|
||
|
||
CALL PRINT ; Else Warn user
|
||
DEFB CR,LF,7,'++ Mem Ovfl +','+'+80H
|
||
|
||
; Sign on the system
|
||
|
||
MEMOK:
|
||
CALL PRINT
|
||
IF MOVCPM ; Space is critical for boot tracks
|
||
DEFB CR,LF,'P112 - ' ; Save all bytes possible
|
||
ELSE ; Otherwise sign on with complete name
|
||
DEFB CR,LF,'RomWBW - '
|
||
ENDIF
|
||
DEFB 'B/P 50.00k Bios' ;**** Do NOT alter this string ****
|
||
|
||
DEFB ' V',VERS/16+'0','.',VERS MOD 16+'0',' ' ; Vers in BCD
|
||
DATE
|
||
IF BANKED
|
||
DEFB ' (Banked) '
|
||
ELSE
|
||
IF NOT MOVCPM
|
||
DEFB ' (Non-Banked) ' ; Nothing for boot track system
|
||
ENDIF
|
||
ENDIF
|
||
IF BANKED
|
||
DEFB ' with:',CR,LF,LF
|
||
DEFB ' ZCPR3+ Env'
|
||
IF CLOCK
|
||
IF DS1202
|
||
DEFB CR,LF,' RomWBW HBIOS Clock, '
|
||
IF CLKSET
|
||
DEFB 'with '
|
||
ELSE
|
||
DEFB 'NO '
|
||
ENDIF
|
||
DEFB 'Set'
|
||
ELSE
|
||
DEFB CR,LF,' ZSDOS Interrupt Clock'
|
||
ENDIF
|
||
ENDIF
|
||
DEFB CR,LF,' High-Density Floppy'
|
||
IF FDDMA
|
||
DEFB ' (DMA-driven IO)'
|
||
ELSE
|
||
DEFB ' (Polled IO)'
|
||
ENDIF
|
||
IF HARDDSK
|
||
IF SCSI
|
||
DEFB CR,LF,' SCSI Hard Disk Driver'
|
||
ENDIF
|
||
IF IDE
|
||
DEFB CR,LF,' GIDE Hard Disk Driver'
|
||
ENDIF
|
||
IF SIMHDSK
|
||
DEFB CR,LF,' SIMH Hard Disk Driver'
|
||
ENDIF
|
||
IF HBDSK
|
||
DEFB CR,LF,' HBIOS Hard Disk Driver'
|
||
ENDIF
|
||
IF HDDMA
|
||
DEFB ' (DMA-driven IO)'
|
||
ELSE
|
||
DEFB ' (Polled IO)'
|
||
ENDIF
|
||
ENDIF
|
||
IF FASTWB
|
||
DEFB CR,LF,' Warm Boot from RAM'
|
||
ENDIF
|
||
IF RAMDSK
|
||
DEFB CR,LF,' RAM Disk (M:)'
|
||
ENDIF
|
||
IF BIOERM
|
||
DEFB CR,LF,' Full Error Messages'
|
||
ENDIF
|
||
ENDIF ;Banked
|
||
DEFB CR,LF+80H
|
||
|
||
;WW EI ; Turn Interrupts back on
|
||
RET ; ..and return
|
||
|
||
;.....
|
||
; Offset to and get ENV Address and respective element size
|
||
|
||
CALCOF: ADD HL,DE ; Add offset to Base ENV Addr
|
||
LD C,(HL) ; get low byte
|
||
INC HL
|
||
INC HL ; advance to size byte
|
||
LD A,(HL) ; get size
|
||
DEC HL ; Back down to Addr hi byte
|
||
LD H,(HL) ; and grab
|
||
LD L,C ; Ptr to Segment now in HL
|
||
RET ; return to caller
|
||
|
||
; Block Move Parameters
|
||
|
||
BLOCK: DEFW PATH-CMDSET ; # to move
|
||
DEFW CMDSET ; Source
|
||
CLPTR: DEFW Z3CL ; Destination
|
||
|
||
DEFW 10
|
||
DEFW AUTOCMD
|
||
CL3PTR: DEFW Z3CL+3
|
||
|
||
DEFW PATHE-PATH
|
||
DEFW PATH
|
||
PTHPTR: DEFW EXPATH
|
||
|
||
IF HAVIOP
|
||
DEFW IOPLEN+2
|
||
DEFW IOPENT
|
||
IOPPTR: DEFW IOP
|
||
ENDIF
|
||
|
||
; IF HARDDSK AND HDDMA AND (NOT IDE)
|
||
; DEFW DMALEN
|
||
; DEFW DMADAT
|
||
; DEFW DMATBL
|
||
; ENDIF
|
||
|
||
BLOCKE EQU $
|
||
|
||
;.....
|
||
; Initial HD DMA Control Block data
|
||
|
||
; IF HARDDSK AND HDDMA
|
||
;DMADAT: DEFW HSTBUF ; Physical sector address
|
||
; DEFB 00 ; BNK2 SHR 1 if banked, BNK0 SHR 1 If not
|
||
; DEFW DMAACK ; Dack port address
|
||
; DEFB 0
|
||
; DEFW 400H ; Number of bytes to transfer (1Sct+slop=2Scts)
|
||
;DMALEN EQU $-DMADAT
|
||
; ENDIF
|
||
|
||
CMDSET: DEFW Z3CL+4 ; Point to first character in command buffer
|
||
DEFB Z3CLS ; Command buffer size
|
||
DEFW 0 ; Clear the command line
|
||
|
||
PATH: DEFB '$','$',1,15 ; Current, A15:
|
||
DEFB 0 ; End of initial path
|
||
PATHE EQU $
|
||
|
||
; Environment Descriptor for ZCPR34
|
||
|
||
ENV: JP 0 ; Leading jump (address is CBIOS when NZCOM)
|
||
ENV1: ; ZCPR3 enviornment descriptor ...
|
||
DEFB 'Z3ENV' ; Environment id
|
||
DEFB 90H ; Env type (=>80H means extended ENV). YASBEC
|
||
; uses 90H to show User Area instead of Prt2
|
||
DEFW EXPATH ; External path (path)
|
||
DEFB EXPATHS ;
|
||
DEFW RCP ; Resident command package (rcp)
|
||
DEFB RCPS ;
|
||
DEFW IOP ; Input/output package (iop)
|
||
DEFB IOPS ;
|
||
DEFW FCP ; Flow command package (fcp)
|
||
DEFB FCPS ;
|
||
DEFW Z3NDIR ; Named directories (ndr)
|
||
DEFB Z3NDIRS ;
|
||
DEFW Z3CL ; Command line (cl)
|
||
DEFB Z3CLS ;
|
||
DEFW Z3ENV ; Environment (env)
|
||
DEFB Z3ENVS ;
|
||
DEFW SHSTK ; Shell stack (sh)
|
||
DEFB SHSTKS ;
|
||
DEFB SHSIZE ;
|
||
DEFW Z3MSG ; Message buffer (msg)
|
||
DEFW EXTFCB ; External fcb (fcb)
|
||
DEFW EXTSTK ; External stack (stk)
|
||
DEFB 0 ; Quiet flag (1=quiet, 0=not quiet)
|
||
DEFW Z3WHL ; Wheel byte (whl)
|
||
DEFB 16 ; Processor speed (mhz)
|
||
DEFB 'P'-'@' ; Max disk letter
|
||
DEFB 31 ; Max user number
|
||
DEFB 1 ; 1 = Ok to accept DU:, 0 = Not Ok
|
||
DEFB 0 ; Crt selection ()
|
||
DEFB 0 ; Printer selection ()
|
||
DEFB 80 ; Crt 0: width
|
||
DEFB 24 ; # of lines
|
||
DEFB 22 ; # of text lines
|
||
|
||
; In Extended ENV, CRT 1 is replaced by System Info
|
||
|
||
;; DEFB 132 ; . CRT 1: Width
|
||
;; DEFB 24 ; # of lines
|
||
;; DEFB 22 ; # of text lines
|
||
|
||
; The Drive Vector is a 16-bit word in which a "1" bit indicates that a drive
|
||
; is active in the system. The bits are arranged as: PONMLKJIHGFEDCBA. When
|
||
; stored in memory, it is in normal form with the Low byte stored first.
|
||
|
||
E_DRVL DEFL [DRV_A & 1] + [DRV_B & 2] + [DRV_C & 4] + [DRV_D & 8]
|
||
E_DRVL DEFL E_DRVL + [DRV_E & 16] + [DRV_F & 32] + [DRV_G & 64]
|
||
E_DRVL DEFL E_DRVL + [DRV_H & 128] ; Low Byte Formed
|
||
E_DRVH DEFL [DRV_I & 1] + [DRV_J & 2] + [DRV_K & 4] + [DRV_L & 8]
|
||
E_DRVH DEFL E_DRVH + [DRV_M & 16] + [DRV_N & 32] + [DRV_O & 64]
|
||
E_DRVH DEFL E_DRVH + [DRV_P & 128] ; High Byte Formed
|
||
|
||
DEFW E_DRVH * 256 + E_DRVL
|
||
DEFB 0 ; (Reserved)
|
||
|
||
DEFB 80 ; Prt 0: width
|
||
DEFB 66 ; # of lines
|
||
DEFB 58 ; # of text lines
|
||
DEFB 1 ; Ff flag (1=can form feed)
|
||
|
||
;========= Usurped Prt1 storage for Resident User Space Vectors =========
|
||
;; DEFB 96 ; Prt 1: width
|
||
;; DEFB 66 ; # of lines
|
||
;; DEFB 58 ; # of text lines
|
||
;; DEFB 1 ; Ff flag (1=can form feed)
|
||
|
||
DEFB USPCS ; Remaining Free User Space (recs)
|
||
USRSP: DEFW USPC ; Res. User Space base Address (xx00h/xx80h)
|
||
DEFB USPCS ; Size of Res. User Space in 128-byte recs
|
||
|
||
;========================================================================
|
||
; In Extended ENV, Printers 2 and 3 are gone, replaced by System Info
|
||
|
||
;; DEFB 132 ; . PRT 2: Width
|
||
;; DEFB 66 ; # of lines
|
||
;; DEFB 58 ; # of text lines
|
||
;; DEFB 1 ; FF flag (1=can form feed)
|
||
;; DEFB 132 ; . PRT 3: Width
|
||
;; DEFB 88 ; # of lines
|
||
;; DEFB 82 ; # of text lines
|
||
;; DEFB 1 ; FF flag (1=can form feed)
|
||
DEFW CPR ; Ccp base address
|
||
DEFB [DOS-CPR]/128 ; Size of ccp in 128 byte records
|
||
DEFW DOS ; Bdos base address (xx00h or xx80h)
|
||
DEFB [BIOSJT-DOS]/128 ; Bdos buffer size in 128 byte records
|
||
DEFW BIOSJT ; Bios base address (nzbio if nzcom running)
|
||
DEFB 'SH ' ; Shell variable filename
|
||
DEFB 'VAR' ; Shell variable filetype
|
||
DEFB ' ' ; File 1
|
||
DEFB ' ' ;
|
||
DEFB ' ' ; File 2
|
||
DEFB ' ' ;
|
||
DEFB ' ' ; File 3
|
||
DEFB ' ' ;
|
||
DEFB ' ' ; File 4
|
||
DEFB ' ' ;
|
||
DEFB 0 ; Public drive area (zrdos +)
|
||
DEFB 0 ; Public user area (zrdos +)
|
||
; Env 128 bytes long
|
||
;***************************************************************************
|
||
; This TermCap Data for the New Z-System complies with VLIB4D specs and more
|
||
; fully describes the terminal and its capabilities. Edit the fields with
|
||
; values for your terminal characteristics, or use it as a template for an
|
||
; outboard definition loaded from the Startup file.
|
||
|
||
ENV2: DEFB ' ' ; Terminal Name (13 bytes, space terminated)
|
||
|
||
IF MOVCPM ; Dummies for boot track systems
|
||
B13: DEFB 0
|
||
B14: DEFB 0 ; Bit 7 = Normal TCAP
|
||
ELSE
|
||
B13: DEFB GOELD-ENV2 ; Offset to GOELD in graphics section
|
||
B14: DEFB 10000000B ; Bit 7 = Extended TCAP, remainder undefined
|
||
ENDIF ;~Movcpm
|
||
|
||
; B15 b0 Standout 0 = Half-Intensity, 1 = Reverse Video
|
||
; B15 b1 Power Up Delay 0 = None, 1 = 10-second delay
|
||
; B15 b2 No Wrap 0 = Line Wrap, 1 = No Wrap if char written
|
||
; to last character in line
|
||
; B15 b3 No Scroll 0 = Scroll, 1 = No Scroll if char written
|
||
; to last char in last line of diplay
|
||
; B15 b4 ANSI 0 = ASCII, 1 = ANSI
|
||
|
||
B15: DEFB 00000000B ; Reverse Vid, Wrap, Scroll, ASCII
|
||
; Additional single character cursor motion bytes
|
||
DEFB 'E'-'@' ; Cursor Up
|
||
DEFB 'X'-'@' ; Cursor Down
|
||
DEFB 'D'-'@' ; Cursor Right
|
||
DEFB 'S'-'@' ; Cursor Left
|
||
|
||
IF NOT MOVCPM ; Omit in boot systems to save space
|
||
; Instead, we simply zero remainder.
|
||
DEFB 0 ; CL Delay for Screen Clear
|
||
DEFB 0 ; CM Delay for Cursor Motion
|
||
DEFB 0 ; CE Delay for Clear to End-of-Line
|
||
; Strings start here
|
||
DEFB 0 ; (CL) Home Cursor and Clear Screen
|
||
DEFB 0 ; (CM) Cursor Motion
|
||
DEFB 0 ; (CE) Clear to End-of-Line
|
||
DEFB 0 ; (SO) Reverse On
|
||
DEFB 0 ; (SE) Reverse Off
|
||
DEFB 0 ; (TO) Terminal Init
|
||
DEFB 0 ; (TE) Terminal De-init
|
||
; Extensions to Standard Z3TCAP
|
||
DEFB 0 ; (LD) Delete Line
|
||
DEFB 0 ; (LI) Insert Line
|
||
DEFB 0 ; (CD) Clear from Cursor to End-of-Scr
|
||
; Attributes setting parameters
|
||
DEFB 0 ; Set Attributes
|
||
DEFB 0 ; Attributes String
|
||
; Read items from screen
|
||
DEFB 0 ; Report Cursor Pos'n (ESC Y Pn Pn)
|
||
DEFB 0 ; Read Line Under Cursor
|
||
|
||
GOELD: DEFB 0 ; On/Off Delay
|
||
; Graphics strings offset from Delay value.
|
||
DEFB 0 ; Graphics On
|
||
DEFB 0 ; Graphics Off
|
||
DEFB 0 ; Cursor Off
|
||
DEFB 0 ; Cursor On
|
||
; Graphics Characters
|
||
DEFB '*' ; Upper-Left corner [*]
|
||
DEFB '*' ; Upper-right corner [*]
|
||
DEFB '*' ; Lower-Left corner [*]
|
||
DEFB '*' ; Lower-right corner [*]
|
||
DEFB '-' ; Horizontal Line [-]
|
||
DEFB '|' ; Vertical Line [|]
|
||
DEFB '#' ; Full Block (hashed block) [*]
|
||
DEFB 'X' ; Hashed Block (big X) [#]
|
||
DEFB '+' ; Upper Intersect (Upside down "T") [+]
|
||
DEFB '+' ; Lower Intersect ("T") [+]
|
||
DEFB '+' ; Mid Intersect (Crossing Lines) [+]
|
||
DEFB '+' ; Right Intersect ("T" rotated left) [+]
|
||
DEFB '+' ; Left Intersect ("T" rotated right) [+]
|
||
DEFB 0
|
||
DEFB 0
|
||
ENDIF ;~Movcpm
|
||
ENVEND:
|
||
|
||
; IOP initial data
|
||
|
||
IF HAVIOP
|
||
IOPENT: JP IOPEND
|
||
JP IOPEND
|
||
JP IOPEND
|
||
JP IOPEND
|
||
JP CONST
|
||
JP CONIN
|
||
JP CONOUT
|
||
JP LIST
|
||
JP AUXOUT
|
||
JP AUXIN
|
||
JP LISTST
|
||
JP IOPEND
|
||
JP IOPEND
|
||
JP IOPEND
|
||
JP IOPEND
|
||
JP IOPEND
|
||
DEFB 'Z3IOP'
|
||
DEFB 'DUMMY '
|
||
IOPLEN EQU $-IOPENT
|
||
IOPEND EQU IOP+IOPLEN
|
||
XOR A
|
||
RET
|
||
ENDIF ;haviop
|
||
|
||
BCODEE EQU $
|
||
IF BANKED
|
||
INITCS EQU BCODEE-CBOOT0 ; Size of Banked (B2RAM) part of Init Code
|
||
ELSE
|
||
INITCS EQU BCODEE-CBOOT ; Size of Complete Init Code in DSEG
|
||
ENDIF
|
||
|
||
STKSAV: DEFS 2 ; Storage for Pointer while moving
|
||
HISAV: DEFS 2 ; Storage for Hi-ALV address
|
||
|
||
IF FASTWB
|
||
DSEG
|
||
BTTBL: DEFS 8 ; Initial WB DMA Block
|
||
ENDIF
|
||
;======================== End of CBOOT =============================
|
||
|