mirror of
https://github.com/wwarthen/RomWBW.git
synced 2026-02-06 14:11:48 -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>
1085 lines
18 KiB
Plaintext
1085 lines
18 KiB
Plaintext
; ZCPR3 TCAP Facility (Z3TCAP)
|
||
; Program Name: TCMAKE
|
||
; Author: Richard Conn
|
||
; Version: 1.0
|
||
; Date: 10 Mar 84
|
||
version equ 10
|
||
|
||
;
|
||
; TCMAKE allows the user to create a Z3T file for his particular
|
||
; terminal.
|
||
;
|
||
|
||
;
|
||
; Basic Equates
|
||
;
|
||
z3env SET 0f400h ;ZCPR3 Environment Descriptor
|
||
qch equ '\' ;quote char
|
||
fcb equ 5ch
|
||
tbuff equ 80h
|
||
ctrlc equ 'C'-'@'
|
||
cr equ 0dh
|
||
lf equ 0ah
|
||
|
||
;
|
||
; ZCPR3 and SYSLIB References
|
||
;
|
||
ext z3init,qprint,z3log
|
||
ext bbline,sksp,eval
|
||
ext codend,moveb,fillb,hmovb
|
||
ext print,pfn1,pstr,capine,cin,caps,crlf,cout,pafdc,pa2hc
|
||
ext initfcb,f$make,f$write,f$close
|
||
ext f$exist,gfa,f$delete
|
||
|
||
;
|
||
; Environment Definition
|
||
;
|
||
if z3env ne 0
|
||
;
|
||
; External ZCPR3 Environment Descriptor
|
||
;
|
||
jmp start
|
||
db 'Z3ENV' ;This is a ZCPR3 Utility
|
||
db 1 ;External Environment Descriptor
|
||
z3eadr:
|
||
dw z3env
|
||
start:
|
||
lhld z3eadr ;pt to ZCPR3 environment
|
||
;
|
||
else
|
||
;
|
||
; Internal ZCPR3 Environment Descriptor
|
||
;
|
||
MACLIB Z3BASE.LIB
|
||
MACLIB SYSENV.LIB
|
||
z3eadr:
|
||
jmp start
|
||
SYSENV
|
||
start:
|
||
lxi h,z3eadr ;pt to ZCPR3 environment
|
||
endif
|
||
|
||
;
|
||
; Start of Program -- Initialize ZCPR3 Environment
|
||
;
|
||
call z3init ;initialize the ZCPR3 Env and the VLIB Env
|
||
|
||
;
|
||
; Print Banner
|
||
;
|
||
call qprint
|
||
db 'TCMAKE, Version '
|
||
db (version/10)+'0','.',(version mod 10)+'0'
|
||
db cr,lf,0
|
||
|
||
;
|
||
; Check for Entry in FCB
|
||
;
|
||
lda fcb+1 ;get first char
|
||
cpi ' ' ;none if space
|
||
jz help
|
||
cpi '/' ;none if slash
|
||
jnz start1
|
||
;
|
||
; Print Help Info
|
||
;
|
||
help:
|
||
call print
|
||
db 'TCMAKE - Create a Z3T File'
|
||
db cr,lf,'Syntax:'
|
||
db cr,lf,' TCMAKE outfile -or- TCMAKE outfile.typ'
|
||
db cr,lf
|
||
db cr,lf,'where "outfile" is the file to be generated by'
|
||
db cr,lf,'the execution of TCMAKE. If no file type is'
|
||
db cr,lf,'given, a file type of Z3T is the default.'
|
||
db 0
|
||
ret
|
||
;
|
||
; Resume Processing
|
||
;
|
||
start1:
|
||
;
|
||
; Set Default File Type if None
|
||
;
|
||
lxi d,fcb+9 ;pt to file type
|
||
lxi h,deftyp ;pt to default file type
|
||
mvi b,3 ;3 bytes
|
||
ldax d ;get first char
|
||
cpi ' ' ;none if space
|
||
cz moveb ;set default file type
|
||
;
|
||
; Init the Buffers and Pointers
|
||
;
|
||
call codend ;pt to scratch area
|
||
shld scratch ;set ptr
|
||
lxi d,100h ;give space (overkill)
|
||
xra a ;init strings to empty
|
||
sta rcfirst ;clear flag
|
||
dad d
|
||
shld cladr ;CL
|
||
mov m,a ;clear
|
||
dad d
|
||
shld cmadr ;CM
|
||
mov m,a ;clear
|
||
dad d
|
||
shld ceadr ;CE
|
||
mov m,a ;clear
|
||
dad d
|
||
shld soadr ;SO
|
||
mov m,a ;clear
|
||
dad d
|
||
shld seadr ;SE
|
||
mov m,a ;clear
|
||
dad d
|
||
shld tiadr ;TI
|
||
mov m,a ;clear
|
||
dad d
|
||
shld teadr ;TE
|
||
mov m,a ;clear
|
||
dad d
|
||
shld cmbadr ;CM Beginning
|
||
mov m,a ;clear
|
||
dad d
|
||
shld cmmadr ;CM Middle
|
||
mov m,a ;clear
|
||
dad d
|
||
shld cmeadr ;CM Ending
|
||
mov m,a ;clear
|
||
dad d
|
||
shld reqn ;Row Equation
|
||
mov m,a
|
||
dad d
|
||
shld ceqn ;Column Equation
|
||
mov m,a
|
||
lxi h,ku ;clear 1-byte buffers
|
||
mvi b,7 ;7 of them
|
||
xra a ;0 fill
|
||
call fillb
|
||
;
|
||
; Create the Data Base
|
||
;
|
||
menu1:
|
||
call create ;create entry
|
||
call assemble ;assemble the entry
|
||
jz menu1 ;continue if buffer overflow
|
||
;
|
||
; Confirm Selection
|
||
;
|
||
call print
|
||
db cr,lf,' Selected Terminal is: ',0
|
||
lhld scratch ;pt to buffer
|
||
call prent ;print name
|
||
call print
|
||
db ' -- Confirm (Y/N)? ',0
|
||
call capine ;get input
|
||
call crlf
|
||
cpi 'Y'
|
||
jnz menu1 ;continue
|
||
call wrfile ;write file
|
||
ret
|
||
;
|
||
; Assemble Data into Z3T Format
|
||
; Return with Z if Buffer Overflow (more than 128 bytes)
|
||
; Return with NZ if OK
|
||
;
|
||
assemble:
|
||
mvi c,128-23 ;128 bytes max with 23 bytes for header
|
||
mvi b,23 ;copy 23 byte header
|
||
lhld scratch ;into scratch area
|
||
lxi d,tname ;from TNAME
|
||
xchg
|
||
call hmovb
|
||
lhld cladr ;copy CL string
|
||
call asmcopy
|
||
lxi h,crcmd ;reverse row/col to col/row?
|
||
lda rcfirst ;get flag
|
||
cpi 'C' ;reverse if C
|
||
jnz asmc0
|
||
call asmcopy
|
||
dcx d ;don't let zero in
|
||
asmc0:
|
||
lhld cmbadr ;CM Beginning
|
||
call asmcopy
|
||
dcx d
|
||
lhld ceqn ;prepare for col first
|
||
lda rcfirst ;get row/col flag
|
||
cpi 'C' ;col/row?
|
||
jz asmc1
|
||
lhld reqn ;row first, so store row
|
||
asmc1:
|
||
call asmcopy
|
||
dcx d ;skip 0
|
||
lhld cmmadr ;CM Middle
|
||
call asmcopy
|
||
dcx d ;skip 0
|
||
lhld reqn ;prepare for row first
|
||
lda rcfirst ;get row/col flag
|
||
cpi 'C' ;col/row?
|
||
jz asmc2
|
||
lhld ceqn ;col first, so store col
|
||
asmc2:
|
||
call asmcopy
|
||
dcx d ;skip 0
|
||
lhld cmeadr ;CM Ending
|
||
call asmcopy
|
||
lhld ceadr ;CE
|
||
call asmcopy
|
||
lhld soadr ;SO
|
||
call asmcopy
|
||
lhld seadr ;SE
|
||
call asmcopy
|
||
lhld tiadr ;TI
|
||
call asmcopy
|
||
lhld teadr ;TE
|
||
call asmcopy
|
||
xra a ;zero rest
|
||
asmzero:
|
||
stax d ;store 0
|
||
inx d
|
||
dcr c ;count down
|
||
jnz asmzero
|
||
dcr c ;return NZ for OK
|
||
ret
|
||
;
|
||
; Copy TCAP String from HL to DE
|
||
; Check for SCRATCH Area Overflow by Counting C Down
|
||
; Allow For Quotes
|
||
;
|
||
asmcopy:
|
||
mov a,m ;get char
|
||
stax d ;store it
|
||
inx h ;pt to next
|
||
inx d
|
||
ora a ;done?
|
||
rz
|
||
dcr c ;check for overflow
|
||
jz asmovfl
|
||
cpi qch ;quote?
|
||
jnz asmcopy
|
||
mov a,m ;get quoted byte
|
||
stax d ;store it
|
||
inx h ;pt to next
|
||
inx d
|
||
dcr c ;check for overflow
|
||
jnz asmcopy
|
||
asmovfl:
|
||
pop psw ;clear stack
|
||
call print
|
||
db cr,lf,'** Buffer Overflow **',0
|
||
xra a ;error code
|
||
ret
|
||
|
||
;
|
||
; Create Entries
|
||
;
|
||
create:
|
||
call print
|
||
db cr,lf
|
||
db cr,lf,' ** Z3TCAP Main Menu',0
|
||
call prfdata ;print file data
|
||
call print
|
||
db cr,lf
|
||
db cr,lf,'Define: 1. Clear Screen Sequence'
|
||
db cr,lf,' 2. Cursor Motion Sequence'
|
||
db cr,lf,' 3. Clear to End of Line Sequence'
|
||
db cr,lf,' 4. Standout Mode Sequences'
|
||
db cr,lf,' 5. Terminal Init/Deinit Sequences'
|
||
db cr,lf,' 6. Arrow Keys'
|
||
db cr,lf,' 7. Terminal Name'
|
||
db cr,lf
|
||
db cr,lf,'Status: S. Print Status (Definitions so far)'
|
||
db cr,lf
|
||
db cr,lf,'Exit: X. Exit and Write File'
|
||
db cr,lf,' Q. Quit and Abort Program without Writing File'
|
||
db cr,lf
|
||
db cr,lf,'Command? ',0
|
||
call capine ;get response
|
||
call crlf
|
||
lxi h,ctable ;pt to command table
|
||
call tscan ;scan table
|
||
call print
|
||
db ' Invalid Command: ',0
|
||
call cout ;print char
|
||
jmp create ;resume
|
||
;
|
||
; Print File Data
|
||
;
|
||
prfdata:
|
||
call print
|
||
db ' for File ',0
|
||
lxi d,fcb+1
|
||
call pfn1
|
||
call print
|
||
db ' **',0
|
||
ret
|
||
;
|
||
; Define Name of Terminal
|
||
;
|
||
namedef:
|
||
lxi h,tname ;space fill terminal name buffer
|
||
mvi a,' '
|
||
mvi b,16
|
||
call fillb
|
||
call print
|
||
db cr,lf,' Input Name of Terminal: ',0
|
||
xra a ;no caps
|
||
call bbline ;get line from user
|
||
call sksp ;skip over leading spaces
|
||
lxi d,tname ;save name in buffer
|
||
mvi b,16 ;16 bytes max
|
||
putname:
|
||
mov a,m ;get next char
|
||
ora a ;done?
|
||
jz pn1
|
||
stax d ;put next char
|
||
inx h ;pt to next
|
||
inx d
|
||
dcr b ;count down
|
||
jnz putname
|
||
pn1:
|
||
jmp create
|
||
;
|
||
; Define Arrow Keys
|
||
;
|
||
arrowdef:
|
||
call print
|
||
db 'Arrow Key Definition'
|
||
db cr,lf,' Your Terminal''s Arrow Keys may be defined ONLY'
|
||
db cr,lf,' if they generate only one character each. If they'
|
||
db cr,lf,' do, type Y to continue. If not, type anything else.'
|
||
db cr,lf,' Define Arrow Keys (Y/N)? ',0
|
||
call capine
|
||
cpi 'Y'
|
||
jnz create
|
||
call print
|
||
db cr,lf,' Strike the Appropriate Arrow Key'
|
||
db cr,lf,' 1. Arrow UP? ',0
|
||
lxi h,ku ;pt to first entry
|
||
call cin
|
||
mov m,a ;store it
|
||
inx h ;pt to next
|
||
call ccout
|
||
call print
|
||
db cr,lf,' 2. Arrow DOWN? ',0
|
||
call cin
|
||
mov m,a
|
||
inx h
|
||
call ccout
|
||
call print
|
||
db cr,lf,' 3. Arrow RIGHT? ',0
|
||
call cin
|
||
mov m,a
|
||
inx h
|
||
call ccout
|
||
call print
|
||
db cr,lf,' 4. Arrow LEFT? ',0
|
||
call cin
|
||
mov m,a
|
||
call ccout
|
||
jmp create
|
||
;
|
||
; Review Arrow Keys
|
||
;
|
||
arrowrev:
|
||
call print
|
||
db cr,lf,'Review of Arrow Key Definitions'
|
||
db cr,lf,' 1. Arrow UP = ',0
|
||
lxi h,ku ;pt to first
|
||
mov a,m
|
||
call ccout
|
||
inx h
|
||
call print
|
||
db cr,lf,' 2. Arrow DOWN = ',0
|
||
mov a,m
|
||
call ccout
|
||
inx h
|
||
call print
|
||
db cr,lf,' 3. Arrow RIGHT = ',0
|
||
mov a,m
|
||
call ccout
|
||
inx h
|
||
call print
|
||
db cr,lf,' 4. Arrow LEFT = ',0
|
||
mov a,m
|
||
call ccout
|
||
ret
|
||
|
||
;
|
||
; Quit Create Mode and Program
|
||
;
|
||
crquit:
|
||
call print
|
||
db 'Do you really want to quit (Y/N)? ',0
|
||
call capine ;get input from user
|
||
cpi 'Y' ;see if he typed a Y
|
||
jnz create ;resume if not
|
||
pop psw ;clear stack
|
||
;
|
||
; Exit Create Mode
|
||
;
|
||
crexit:
|
||
ret
|
||
;
|
||
; CL Definition
|
||
;
|
||
cldef:
|
||
call print
|
||
db 'Clear Screen Definition',cr,lf
|
||
db ' 1. Timing Delay',0
|
||
call getdelay ;get delay constant
|
||
sta cld ;save delay constant
|
||
call print
|
||
db cr,lf,' 2. Clear Screen Byte Sequence',0
|
||
lhld cladr ;pt to buffer
|
||
call getstr
|
||
jmp create
|
||
|
||
;
|
||
; CL Review
|
||
;
|
||
clreview:
|
||
call print
|
||
db cr,lf,'Review of Clear Screen Definition'
|
||
db cr,lf,' 1. Timing Delay = ',0
|
||
lda cld
|
||
call pafdc
|
||
call print
|
||
db ' Milliseconds'
|
||
db cr,lf,' 2. Clear Screen Sequence:',0
|
||
lhld cladr
|
||
call prtstr
|
||
ret
|
||
;
|
||
; CE Definition
|
||
;
|
||
cedef:
|
||
call print
|
||
db 'Clear to End of Line Definition',cr,lf
|
||
db ' 1. Timing Delay',0
|
||
call getdelay ;get delay constant
|
||
sta ced ;save delay constant
|
||
call print
|
||
db cr,lf,' 2. Clear to End of Line Byte Sequence',0
|
||
lhld ceadr ;pt to buffer
|
||
call getstr
|
||
jmp create
|
||
;
|
||
; CE Review
|
||
;
|
||
cereview:
|
||
call print
|
||
db cr,lf,'Review of Clear to End of Line Definition'
|
||
db cr,lf,' 1. Timing Delay = ',0
|
||
lda ced
|
||
call pafdc
|
||
call print
|
||
db ' Milliseconds'
|
||
db cr,lf,' 2. Clear to End of Line Sequence:',0
|
||
lhld ceadr
|
||
call prtstr
|
||
ret
|
||
;
|
||
; SO Definition
|
||
;
|
||
sodef:
|
||
call print
|
||
db 'Standout Mode Definition',cr,lf
|
||
db ' 1. Begin Standout Mode Byte Sequence',0
|
||
lhld soadr ;pt to buffer
|
||
call getstr
|
||
call print
|
||
db cr,lf,' 2. End Standout Mode Byte Sequence',0
|
||
lhld seadr ;pt to buffer
|
||
call getstr
|
||
jmp create
|
||
;
|
||
; SO Review
|
||
;
|
||
soreview:
|
||
call print
|
||
db cr,lf,'Review of Standout Mode Definition'
|
||
db cr,lf,' 1. Begin Standout Mode Sequence:',0
|
||
lhld soadr
|
||
call prtstr
|
||
call print
|
||
db cr,lf,' 2. End Standout Mode Sequence:',0
|
||
lhld seadr
|
||
call prtstr
|
||
ret
|
||
;
|
||
; TI Definition
|
||
;
|
||
tidef:
|
||
call print
|
||
db 'Terminal Init/Deinit Definition',cr,lf
|
||
db ' 1. Terminal Initialization Byte Sequence',0
|
||
lhld tiadr ;pt to buffer
|
||
call getstr
|
||
call print
|
||
db cr,lf,' 2. Terminal Deinitialization Byte Sequence',0
|
||
lhld teadr ;pt to buffer
|
||
call getstr
|
||
jmp create
|
||
;
|
||
; TI Review
|
||
;
|
||
tireview:
|
||
call print
|
||
db cr,lf,'Review of Terminal Init/Deinit Definition'
|
||
db cr,lf,' 1. Terminal Initialization Sequence: ',0
|
||
lhld tiadr
|
||
call prtstr
|
||
call print
|
||
db cr,lf,' 2. Terminal Deinitialization Sequence: ',0
|
||
lhld teadr
|
||
call prtstr
|
||
ret
|
||
;
|
||
; CM Definition
|
||
;
|
||
cmdef:
|
||
call print
|
||
db 'Cursor Motion Definition',cr,lf
|
||
db ' 1. Timing Delay',0
|
||
call getdelay ;get delay
|
||
sta cmd
|
||
cmcrdef:
|
||
call print
|
||
db cr,lf,' 2. Enter R if Row/Column or C for Column/Row: ',0
|
||
call capine
|
||
cpi 'C' ;col/row
|
||
jz cmdef1
|
||
cpi 'R'
|
||
jz cmdef1
|
||
call print
|
||
db ' - Invalid',0
|
||
jmp cmcrdef
|
||
cmdef1:
|
||
sta rcfirst ;set flag
|
||
call print
|
||
db cr,lf,' 3. Enter Equation for Row: ',0
|
||
xra a ;no caps
|
||
call bbline ;get input
|
||
call sksp ;skip spaces
|
||
xchg
|
||
lhld reqn
|
||
xchg
|
||
call copy0
|
||
call print
|
||
db cr,lf,' 4. Enter Equation for Column: ',0
|
||
xra a ;no caps
|
||
call bbline ;get input
|
||
call sksp ;skip spaces
|
||
xchg
|
||
lhld ceqn
|
||
xchg
|
||
call copy0
|
||
call print
|
||
db cr,lf,' 5. Enter Prefix Byte Sequence',0
|
||
lhld cmbadr ;beginning
|
||
call getstr
|
||
call print
|
||
db cr,lf,' 6. Enter Middle Byte Sequence',0
|
||
lhld cmmadr ;middle
|
||
call getstr
|
||
call print
|
||
db cr,lf,' 7. Enter Suffix Byte Sequence',0
|
||
lhld cmeadr ;ending
|
||
call getstr
|
||
jmp create
|
||
;
|
||
; Copy HL to DE until 0
|
||
;
|
||
copy0:
|
||
mov a,m ;copy
|
||
stax d
|
||
cpi qch ;quote?
|
||
jz copyq
|
||
ora a ;done if 0
|
||
rz
|
||
inx h ;pt to next
|
||
inx d
|
||
jmp copy0
|
||
copyq:
|
||
inx h ;copy quoted char
|
||
inx d
|
||
mov a,m ;copy
|
||
stax d
|
||
inx h ;advance
|
||
inx d
|
||
jmp copy0
|
||
;
|
||
; Review CM Data
|
||
;
|
||
cmreview:
|
||
call print
|
||
db cr,lf,'Review of Cursor Motion Data'
|
||
db cr,lf,' 1. Timing Delay = ',0
|
||
lda cmd
|
||
call pafdc
|
||
call print
|
||
db ' Milliseconds'
|
||
db cr,lf,' 2. Row or Column First: ',0
|
||
lda rcfirst
|
||
call cout
|
||
call print
|
||
db cr,lf,' 3. Row Equation: -->',0
|
||
lhld reqn
|
||
call pstr
|
||
call print
|
||
db '<--'
|
||
db cr,lf,' 4. Column Equation: -->',0
|
||
lhld ceqn
|
||
call pstr
|
||
call print
|
||
db '<--'
|
||
db cr,lf,' 5. Prefix Byte Sequence: ',0
|
||
lhld cmbadr
|
||
call prtstr
|
||
call print
|
||
db cr,lf,' 6. Middle Byte Sequence: ',0
|
||
lhld cmmadr
|
||
call prtstr
|
||
call print
|
||
db cr,lf,' 7. Suffix Byte Sequence: ',0
|
||
lhld cmeadr
|
||
call prtstr
|
||
ret
|
||
|
||
;
|
||
; Status Display
|
||
;
|
||
rstatus:
|
||
call print
|
||
db cr,lf,' Strike Any Key to Continue - ',0
|
||
call cin
|
||
status:
|
||
call print
|
||
db cr,lf,' ** Z3TCAP Status',0
|
||
call prfdata ;file data
|
||
call print
|
||
db cr,lf
|
||
db cr,lf,'Review: 1. Clear Screen Definition'
|
||
db cr,lf,' 2. Cursor Motion Definition'
|
||
db cr,lf,' 3. Clear to End of Line Definition'
|
||
db cr,lf,' 4. Standout Mode Definition'
|
||
db cr,lf,' 5. Terminal Init/Deinit Definition'
|
||
db cr,lf,' 6. Arrow Key Definition'
|
||
db cr,lf,' 7. Terminal Name Definition'
|
||
db cr,lf
|
||
db cr,lf,'Exit: X. Exit to Main Menu'
|
||
db cr,lf
|
||
db cr,lf,'Command? ',0
|
||
call capine
|
||
lxi h,rtable
|
||
call tscan
|
||
call print
|
||
db cr,lf,' Invalid Command: ',0
|
||
call cout
|
||
jmp status
|
||
;
|
||
; Review Name
|
||
;
|
||
rname:
|
||
call print
|
||
db cr,lf,'Terminal Name: ',0
|
||
lxi h,tname
|
||
mvi b,16
|
||
rname1:
|
||
mov a,m ;get char
|
||
call cout
|
||
inx h ;pt to next
|
||
dcr b ;count down
|
||
jnz rname1
|
||
jmp rstatus
|
||
;
|
||
; Review CL
|
||
;
|
||
rcl:
|
||
call clreview
|
||
jmp rstatus
|
||
;
|
||
; Review CE
|
||
;
|
||
rce:
|
||
call cereview
|
||
jmp rstatus
|
||
;
|
||
; Review CM
|
||
;
|
||
rcm:
|
||
call cmreview
|
||
jmp rstatus
|
||
;
|
||
; Review SO
|
||
;
|
||
rso:
|
||
call soreview
|
||
jmp rstatus
|
||
;
|
||
; Review TI
|
||
;
|
||
rti:
|
||
call tireview
|
||
jmp rstatus
|
||
;
|
||
; Review Arrow Keys
|
||
;
|
||
rarrow:
|
||
call arrowrev
|
||
jmp rstatus
|
||
;
|
||
; Status Review Commands
|
||
;
|
||
rtable:
|
||
db '1'
|
||
dw rcl
|
||
db '2'
|
||
dw rcm
|
||
db '3'
|
||
dw rce
|
||
db '4'
|
||
dw rso
|
||
db '5'
|
||
dw rti
|
||
db '6'
|
||
dw rarrow
|
||
db '7'
|
||
dw rname
|
||
db 'X'
|
||
dw create
|
||
db 0
|
||
|
||
;
|
||
; Scan Command Table
|
||
;
|
||
tscan:
|
||
mov b,a ;save char in B
|
||
tscan1:
|
||
mov a,m ;get char
|
||
ora a ;end of table?
|
||
jz tscanx ;exit
|
||
cmp b ;compare
|
||
jz tscanf ;found
|
||
inx h ;skip to next
|
||
inx h
|
||
inx h
|
||
jmp tscan1
|
||
tscanx:
|
||
mov a,b ;restore char and exit - not found
|
||
ret
|
||
tscanf:
|
||
inx h ;get address
|
||
mov a,m
|
||
inx h
|
||
mov h,m
|
||
mov l,a
|
||
pop psw ;clear stack
|
||
pchl ;branch to routine
|
||
;
|
||
; Command Table
|
||
;
|
||
ctable:
|
||
db '1' ;CL
|
||
dw cldef
|
||
db '2' ;CM
|
||
dw cmdef
|
||
db '3' ;CE
|
||
dw cedef
|
||
db '4' ;SO
|
||
dw sodef
|
||
db '5' ;TI
|
||
dw tidef
|
||
db '6' ;arrows
|
||
dw arrowdef
|
||
db '7' ;name
|
||
dw namedef
|
||
db 'S' ;status
|
||
dw status
|
||
db 'Q' ;quit
|
||
dw crquit
|
||
db 'X' ;exit
|
||
dw crexit
|
||
db 0
|
||
;
|
||
; Routine to Input Delay Constant
|
||
;
|
||
getdelay:
|
||
call print
|
||
db cr,lf,' Enter Delay Time in Milliseconds: ',0
|
||
mvi a,0ffh ;caps
|
||
call bbline
|
||
call sksp
|
||
call eval ;convert to binary
|
||
ret
|
||
;
|
||
; Routine to Define Text String
|
||
;
|
||
getstr:
|
||
shld firstch ;set ptr to first char
|
||
getfirst:
|
||
mvi b,1 ;set count
|
||
lhld firstch ;set next char to first
|
||
shld nxtchar
|
||
getnext:
|
||
call print
|
||
db cr,lf,' Char #',0
|
||
mov a,b ;get char number
|
||
call pafdc ;print it
|
||
inr b ;increment count
|
||
push b ;save it
|
||
;
|
||
; Prompt for Type of Input
|
||
;
|
||
call print
|
||
db ' - Type Char, .=Number, or <CR>=Done: ',0
|
||
call cin ;get response
|
||
cpi cr ;exit
|
||
jz getx
|
||
cpi '.' ;number?
|
||
jz getnum
|
||
;
|
||
; Input Character
|
||
;
|
||
call print
|
||
db 'Char ',0
|
||
call ccout ;echo character
|
||
jmp putch
|
||
;
|
||
; Input Number
|
||
;
|
||
getnum:
|
||
call print
|
||
db 'Enter Number: ',0
|
||
mvi a,0ffh ;caps
|
||
call bbline ;get input
|
||
call sksp ;skip spaces
|
||
call eval ;convert
|
||
;
|
||
; Save Character with Quoting
|
||
;
|
||
putch:
|
||
lhld nxtchar ;pt to next char
|
||
ora a ;quote if null
|
||
jz quote
|
||
cpi qch ;quote if quote
|
||
jz quote
|
||
putch1:
|
||
mov m,a ;store it
|
||
inx h ;pt to next
|
||
shld nxtchar ;set ptr
|
||
pop b ;get count
|
||
jmp getnext ;get next char
|
||
;
|
||
; Quote the Character
|
||
;
|
||
quote:
|
||
mvi m,qch ;save quote char
|
||
inx h
|
||
jmp putch1
|
||
;
|
||
; Exit
|
||
;
|
||
getx:
|
||
pop psw ;clear stack
|
||
lhld nxtchar ;store ending 0
|
||
mvi m,0
|
||
ret
|
||
;
|
||
; Print String Pted to by HL
|
||
;
|
||
prtstr:
|
||
mvi b,0 ;set count
|
||
call crlf ;new line
|
||
mov a,m ;empty?
|
||
ora a
|
||
jnz prts0
|
||
call print
|
||
db ' -- Empty --',0
|
||
ret
|
||
prts0:
|
||
mov a,m ;get next char
|
||
ora a ;done?
|
||
rz
|
||
call print
|
||
db ' (',0
|
||
mov a,b ;print count
|
||
inr a
|
||
call pafdc
|
||
call print
|
||
db ') ',0
|
||
mov a,m ;get next char
|
||
inx h ;pt to next
|
||
cpi qch ;check for quote
|
||
jnz prts1
|
||
mov a,m ;get char that is quoted
|
||
inx h ;pt to next
|
||
prts1:
|
||
call ccout
|
||
call print
|
||
db ' ',0
|
||
call pa2hc ;print as 2 hex chars
|
||
call print
|
||
db 'H ',0
|
||
inr b ;increment count
|
||
mov a,b ;get count
|
||
ani 3
|
||
cz crlf ;new line
|
||
jmp prts0
|
||
|
||
;
|
||
; Create Target File
|
||
;
|
||
wrfile:
|
||
lxi d,fcb ;pt to FCB
|
||
call z3log ;log into proper directory
|
||
call f$exist ;test of presence of file
|
||
jz make2 ;create file
|
||
call gfa ;get file attributes
|
||
ani 1 ;R/O?
|
||
jz make1
|
||
call print
|
||
db cr,lf,'File ',0
|
||
lxi d,fcb+1
|
||
call pfn1
|
||
call print
|
||
db ' is Read/Only - Saving as $$$.Z3T',0
|
||
lxi h,tempfcb ;set $$$.Z3T
|
||
lxi d,fcb+1
|
||
mvi b,11 ;11 chars
|
||
call moveb
|
||
lxi d,fcb ;reinit
|
||
call initfcb ;resume
|
||
make1:
|
||
call f$delete ;delete file
|
||
make2:
|
||
call f$make ;create file
|
||
cpi 0ffh ;error
|
||
jnz writef
|
||
call print
|
||
db cr,lf,'File Create Error',0
|
||
ret
|
||
;
|
||
; Write Block to File
|
||
;
|
||
writef:
|
||
lhld scratch ;pt to entry
|
||
lxi d,tbuff ;copy into buffer
|
||
mvi b,128 ;128 bytes
|
||
call moveb
|
||
lxi d,fcb ;pt to FCB
|
||
call f$write ;write block
|
||
jnz werr
|
||
call f$close ;close file
|
||
call print
|
||
db cr,lf,'File ',0
|
||
lxi d,fcb+1
|
||
call pfn1
|
||
call print
|
||
db ' Created',0
|
||
ret
|
||
;
|
||
; Can't Write File
|
||
;
|
||
werr:
|
||
call print
|
||
db cr,lf,'File Write Error',0
|
||
ret
|
||
;
|
||
; Print Entry Name Pted to by HL
|
||
;
|
||
prent:
|
||
mvi b,16 ;16 chars
|
||
prtname:
|
||
mov a,m ;get char
|
||
call cout
|
||
inx h ;advance
|
||
dcr b ;count down
|
||
jnz prtname
|
||
ret
|
||
;
|
||
; Print Char in A with Control Char Processing
|
||
;
|
||
ccout:
|
||
push psw ;save char
|
||
ani 7fh ;mask MSB
|
||
cpi 7fh ;DEL?
|
||
jz ccout2
|
||
cpi ' '
|
||
jnc ccout1
|
||
push psw ;save char
|
||
mvi a,'^'
|
||
call cout
|
||
pop psw
|
||
adi '@' ;convert to char
|
||
ccout1:
|
||
call cout
|
||
pop psw
|
||
ret
|
||
ccout2:
|
||
call print
|
||
db '<DEL>',0
|
||
pop psw
|
||
ret
|
||
|
||
;
|
||
; Buffers
|
||
;
|
||
crcmd:
|
||
db '%r',0
|
||
tempfcb:
|
||
db '$$$ '
|
||
db 'Z3T'
|
||
tname:
|
||
db '** Empty Name **' ;16 chars
|
||
ku:
|
||
ds 1 ;cursor up
|
||
kd:
|
||
ds 1 ;cursor down
|
||
kr:
|
||
ds 1 ;cursor right
|
||
kl:
|
||
ds 1 ;cursor left
|
||
cld:
|
||
ds 1 ;CL delay
|
||
cmd:
|
||
ds 1 ;CM delay
|
||
ced:
|
||
ds 1 ;CE delay
|
||
cladr:
|
||
ds 2 ;CL address
|
||
cmadr:
|
||
ds 2 ;CM address
|
||
ceadr:
|
||
ds 2 ;CE address
|
||
soadr:
|
||
ds 2 ;SO address
|
||
seadr:
|
||
ds 2 ;SE address
|
||
tiadr:
|
||
ds 2 ;TI address
|
||
teadr:
|
||
ds 2 ;TE address
|
||
cmbadr:
|
||
ds 2 ;CM Beginning
|
||
cmmadr:
|
||
ds 2 ;CM Middle
|
||
cmeadr:
|
||
ds 2 ;CM Ending
|
||
reqn:
|
||
ds 2 ;Row Equation
|
||
ceqn:
|
||
ds 2 ;Column Equation
|
||
rcfirst:
|
||
ds 1 ;R if Row First, C if Col First
|
||
deftyp:
|
||
db 'Z3T' ;default file type
|
||
firstch:
|
||
ds 2 ;ptr to first char in string
|
||
nxtchar:
|
||
ds 2 ;ptr to next char in string
|
||
scratch:
|
||
ds 2 ;ptr to scratch area
|
||
|
||
end
|
||
|