mirror of
https://github.com/wwarthen/RomWBW.git
synced 2026-02-06 22:43:15 -06:00
Implement Auto PROFILE.SUB Execution on Boot
Updated CBIOS to look for PROFILE.SUB on the boot drive and SUBMIT it automatically at cold boot if it exists. Also patched SUBMIT.COM to force temporary file onto A: to ensure immediate execution of SUBMITed files.
This commit is contained in:
399
Source/Apps/Startup.asm
Normal file
399
Source/Apps/Startup.asm
Normal file
@@ -0,0 +1,399 @@
|
||||
;===============================================================================
|
||||
; STARTUP - Application run automatically at OS startup
|
||||
;
|
||||
;===============================================================================
|
||||
;
|
||||
; Author: Wayne Warthen (wwarthen@gmail.com)
|
||||
;_______________________________________________________________________________
|
||||
;
|
||||
; Usage:
|
||||
; MODE [/?]
|
||||
;
|
||||
; Operation:
|
||||
; Determines if STARTUP.CMD exists on startup drive, user 0. If it is
|
||||
; found, it is run via SUBMIT.
|
||||
;_______________________________________________________________________________
|
||||
;
|
||||
; Change Log:
|
||||
; 2017-12-01 [WBW] Initial release
|
||||
;_______________________________________________________________________________
|
||||
;
|
||||
; ToDo:
|
||||
; 1) Detect OS type (CP/M or ZSYS) and run different batch files as a result.
|
||||
;_______________________________________________________________________________
|
||||
;
|
||||
;===============================================================================
|
||||
; Definitions
|
||||
;===============================================================================
|
||||
;
|
||||
stksiz .equ $40 ; Working stack size
|
||||
;
|
||||
restart .equ $0000 ; CP/M restart vector
|
||||
bdos .equ $0005 ; BDOS invocation vector
|
||||
;
|
||||
ident .equ $FFFE ; loc of RomWBW HBIOS ident ptr
|
||||
;
|
||||
rmj .equ 2 ; intended CBIOS version - major
|
||||
rmn .equ 8 ; intended CBIOS version - minor
|
||||
;
|
||||
bf_cioinit .equ $04 ; HBIOS: CIOINIT function
|
||||
bf_cioquery .equ $05 ; HBIOS: CIOQUERY function
|
||||
bf_ciodevice .equ $06 ; HBIOS: CIODEVICE function
|
||||
bf_sysget .equ $F8 ; HBIOS: SYSGET function
|
||||
;
|
||||
;===============================================================================
|
||||
; Code Section
|
||||
;===============================================================================
|
||||
;
|
||||
.org $100
|
||||
;
|
||||
; setup stack (save old value)
|
||||
ld (stksav),sp ; save stack
|
||||
ld sp,stack ; set new stack
|
||||
;
|
||||
; initialization
|
||||
call init ; initialize
|
||||
jr nz,exit ; abort if init fails
|
||||
;
|
||||
; process
|
||||
call process ; do main processing
|
||||
jr nz,exit ; abort on error
|
||||
;
|
||||
exit: ; clean up and return to command processor
|
||||
call crlf ; formatting
|
||||
ld sp,(stksav) ; restore stack
|
||||
;jp restart ; return to CP/M via restart
|
||||
ret ; return to CP/M w/o restart
|
||||
;
|
||||
; Initialization
|
||||
;
|
||||
init:
|
||||
;
|
||||
initx
|
||||
; initialization complete
|
||||
xor a ; signal success
|
||||
ret ; return
|
||||
;
|
||||
; Process
|
||||
;
|
||||
process:
|
||||
; skip to start of first parm
|
||||
ld ix,$81 ; point to start of parm area (past len byte)
|
||||
call nonblank ; skip to next non-blank char
|
||||
jp z,runcmd ; no parms, do command processing
|
||||
;
|
||||
process1:
|
||||
; process options (if any)
|
||||
cp '/' ; option prefix?
|
||||
jp nz,erruse ; invalid option introducer
|
||||
call option ; process option
|
||||
ret nz ; some options mean we are done (e.g., "/?")
|
||||
inc ix ; skip option character
|
||||
call nonblank ; skip whitespace
|
||||
jr nz,process1 ; continue option checking
|
||||
jp runcmd ; end of parms, do cmd processing
|
||||
;
|
||||
;
|
||||
;
|
||||
runcmd:
|
||||
call ldfil ; load executable
|
||||
ret nz ; abort on error
|
||||
;
|
||||
xor a
|
||||
ret
|
||||
;
|
||||
; Load file for execution
|
||||
;
|
||||
ldfil:
|
||||
ld c,15 ; BDOS function: Open File
|
||||
ld de,fcb ; pointer to FCB
|
||||
call bdos ; do it
|
||||
inc a ; check for err, 0xFF --> 0x00
|
||||
jp z,errfil ; handle file not found err
|
||||
;
|
||||
ld c,16 ; BDOS function: Close File
|
||||
ld de,fcb ; pointer to FCB
|
||||
call bdos ; do it
|
||||
inc a ; check for err, 0xFF --> 0x00
|
||||
jp z,errfil ; handle file close err
|
||||
;
|
||||
xor a ; signal success
|
||||
ret ; done
|
||||
|
||||
|
||||
;
|
||||
; Handle options
|
||||
;
|
||||
option:
|
||||
;
|
||||
inc ix ; next char
|
||||
ld a,(ix) ; get it
|
||||
cp '?' ; is it a '?' as expected?
|
||||
jp z,usage ; yes, display usage
|
||||
jp errprm ; anything else is an error
|
||||
;
|
||||
; Display usage
|
||||
;
|
||||
usage:
|
||||
;
|
||||
call crlf ; formatting
|
||||
ld de,msgban ; point to version message part 1
|
||||
call prtstr ; print it
|
||||
call crlf2 ; blank line
|
||||
ld de,msguse ; point to usage message
|
||||
call prtstr ; print it
|
||||
or $FF ; signal no action performed
|
||||
ret ; and return
|
||||
;
|
||||
; Print character in A without destroying any registers
|
||||
;
|
||||
prtchr:
|
||||
push bc ; save registers
|
||||
push de
|
||||
push hl
|
||||
ld e,a ; character to print in E
|
||||
ld c,$02 ; BDOS function to output a character
|
||||
call bdos ; do it
|
||||
pop hl ; restore registers
|
||||
pop de
|
||||
pop bc
|
||||
ret
|
||||
;
|
||||
prtdot:
|
||||
;
|
||||
; shortcut to print a dot preserving all regs
|
||||
push af ; save af
|
||||
ld a,'.' ; load dot char
|
||||
call prtchr ; print it
|
||||
pop af ; restore af
|
||||
ret ; done
|
||||
;
|
||||
; Print a zero terminated string at (DE) without destroying any registers
|
||||
;
|
||||
prtstr:
|
||||
push de
|
||||
;
|
||||
prtstr1:
|
||||
ld a,(de) ; get next char
|
||||
or a
|
||||
jr z,prtstr2
|
||||
call prtchr
|
||||
inc de
|
||||
jr prtstr1
|
||||
;
|
||||
prtstr2:
|
||||
pop de ; restore registers
|
||||
ret
|
||||
;
|
||||
; Print the value in A in hex without destroying any registers
|
||||
;
|
||||
prthex:
|
||||
push af ; save AF
|
||||
push de ; save DE
|
||||
call hexascii ; convert value in A to hex chars in DE
|
||||
ld a,d ; get the high order hex char
|
||||
call prtchr ; print it
|
||||
ld a,e ; get the low order hex char
|
||||
call prtchr ; print it
|
||||
pop de ; restore DE
|
||||
pop af ; restore AF
|
||||
ret ; done
|
||||
;
|
||||
; print the hex word value in bc
|
||||
;
|
||||
prthexword:
|
||||
push af
|
||||
ld a,b
|
||||
call prthex
|
||||
ld a,c
|
||||
call prthex
|
||||
pop af
|
||||
ret
|
||||
;
|
||||
; print the hex dword value in de:hl
|
||||
;
|
||||
prthex32:
|
||||
push bc
|
||||
push de
|
||||
pop bc
|
||||
call prthexword
|
||||
push hl
|
||||
pop bc
|
||||
call prthexword
|
||||
pop bc
|
||||
ret
|
||||
;
|
||||
; Convert binary value in A to ascii hex characters in DE
|
||||
;
|
||||
hexascii:
|
||||
ld d,a ; save A in D
|
||||
call hexconv ; convert low nibble of A to hex
|
||||
ld e,a ; save it in E
|
||||
ld a,d ; get original value back
|
||||
rlca ; rotate high order nibble to low bits
|
||||
rlca
|
||||
rlca
|
||||
rlca
|
||||
call hexconv ; convert nibble
|
||||
ld d,a ; save it in D
|
||||
ret ; done
|
||||
;
|
||||
; Convert low nibble of A to ascii hex
|
||||
;
|
||||
hexconv:
|
||||
and $0F ; low nibble only
|
||||
add a,$90
|
||||
daa
|
||||
adc a,$40
|
||||
daa
|
||||
ret
|
||||
;
|
||||
; Print value of A or HL in decimal with leading zero suppression
|
||||
; Use prtdecb for A or prtdecw for HL
|
||||
;
|
||||
prtdecb:
|
||||
push hl
|
||||
ld h,0
|
||||
ld l,a
|
||||
call prtdecw ; print it
|
||||
pop hl
|
||||
ret
|
||||
;
|
||||
prtdecw:
|
||||
push af
|
||||
push bc
|
||||
push de
|
||||
push hl
|
||||
call prtdec0
|
||||
pop hl
|
||||
pop de
|
||||
pop bc
|
||||
pop af
|
||||
ret
|
||||
;
|
||||
prtdec0:
|
||||
ld e,'0'
|
||||
ld bc,-10000
|
||||
call prtdec1
|
||||
ld bc,-1000
|
||||
call prtdec1
|
||||
ld bc,-100
|
||||
call prtdec1
|
||||
ld c,-10
|
||||
call prtdec1
|
||||
ld e,0
|
||||
ld c,-1
|
||||
prtdec1:
|
||||
ld a,'0' - 1
|
||||
prtdec2:
|
||||
inc a
|
||||
add hl,bc
|
||||
jr c,prtdec2
|
||||
sbc hl,bc
|
||||
cp e
|
||||
ret z
|
||||
ld e,0
|
||||
call prtchr
|
||||
ret
|
||||
;
|
||||
; Start a new line
|
||||
;
|
||||
crlf2:
|
||||
call crlf ; two of them
|
||||
crlf:
|
||||
push af ; preserve AF
|
||||
ld a,13 ; <CR>
|
||||
call prtchr ; print it
|
||||
ld a,10 ; <LF>
|
||||
call prtchr ; print it
|
||||
pop af ; restore AF
|
||||
ret
|
||||
;
|
||||
; Get the next non-blank character from (HL).
|
||||
;
|
||||
nonblank:
|
||||
ld a,(ix) ; load next character
|
||||
or a ; string ends with a null
|
||||
ret z ; if null, return pointing to null
|
||||
cp ' ' ; check for blank
|
||||
ret nz ; return if not blank
|
||||
inc ix ; if blank, increment character pointer
|
||||
jr nonblank ; and loop
|
||||
;
|
||||
; Convert character in A to uppercase
|
||||
;
|
||||
ucase:
|
||||
cp 'a' ; if below 'a'
|
||||
ret c ; ... do nothing and return
|
||||
cp 'z' + 1 ; if above 'z'
|
||||
ret nc ; ... do nothing and return
|
||||
res 5,a ; clear bit 5 to make lower case -> upper case
|
||||
ret ; and return
|
||||
;
|
||||
; Add the value in A to HL (HL := HL + A)
|
||||
;
|
||||
addhl:
|
||||
add a,l ; A := A + L
|
||||
ld l,a ; Put result back in L
|
||||
ret nc ; if no carry, we are done
|
||||
inc h ; if carry, increment H
|
||||
ret ; and return
|
||||
;
|
||||
; Jump indirect to address in HL
|
||||
;
|
||||
jphl:
|
||||
jp (hl)
|
||||
;
|
||||
; Errors
|
||||
;
|
||||
erruse: ; command usage error (syntax)
|
||||
ld de,msguse
|
||||
jr err
|
||||
;
|
||||
errprm: ; command parameter error (syntax)
|
||||
ld de,msgprm
|
||||
jr err
|
||||
;
|
||||
errfil: ; STARTUP.CMD file not present
|
||||
ld de,msgfil
|
||||
jr err
|
||||
;
|
||||
err: ; print error string and return error signal
|
||||
call crlf ; print newline
|
||||
;
|
||||
err1: ; without the leading crlf
|
||||
call prtstr ; print error string
|
||||
;
|
||||
err2: ; without the string
|
||||
; call crlf ; print newline
|
||||
or $FF ; signal error
|
||||
ret ; done
|
||||
;
|
||||
;===============================================================================
|
||||
; Storage Section
|
||||
;===============================================================================
|
||||
;
|
||||
fcb .db 0 ; Drive code, 0 = current drive
|
||||
.db "START " ; File name, 8 chars
|
||||
.db "COM" ; File type, 3 chars
|
||||
.fill 36-($-fcb),0 ; zero fill remainder of fcb
|
||||
;
|
||||
cmdblk .db cmdlen ; length
|
||||
cmdtxt .db " B:SUBMIT START"
|
||||
.db 0 ; null terminator
|
||||
cmdlen .equ $ - cmdtxt
|
||||
cmdend .equ $
|
||||
;
|
||||
stksav .dw 0 ; stack pointer saved at start
|
||||
.fill stksiz,0 ; stack
|
||||
stack .equ $ ; stack top
|
||||
;
|
||||
; Messages
|
||||
;
|
||||
msgban .db "STARTUP v1.0, 01-Dec-2017",13,10
|
||||
.db "Copyright (C) 2017, Wayne Warthen, GNU GPL v3",0
|
||||
msguse .db "Usage: STARTUP [/?]",0
|
||||
msgprm .db "Parameter error (STARTUP /? for usage)",0
|
||||
msgfil .db "STARTUP.CMD file missing",0
|
||||
;
|
||||
.end
|
||||
@@ -14,11 +14,11 @@ set ZXINCDIR=%TOOLS%/cpm/include/
|
||||
echo.
|
||||
echo Building CBIOS for RomWBW...
|
||||
echo.
|
||||
tasm -t80 -b -g3 -fFF -dPLTWBW cbios.asm cbios_wbw.bin cbios_wbw.lst
|
||||
tasm -t80 -g3 -dPLTWBW cbios.asm cbios_wbw.bin cbios_wbw.lst
|
||||
if errorlevel 1 goto :eof
|
||||
|
||||
echo.
|
||||
echo Building CBIOS for UNA...
|
||||
echo.
|
||||
tasm -t80 -b -g3 -fFF -dPLTUNA cbios.asm cbios_una.bin cbios_una.lst
|
||||
tasm -t80 -g3 -dPLTUNA cbios.asm cbios_una.bin cbios_una.lst
|
||||
if errorlevel 1 goto :eof
|
||||
|
||||
@@ -6,9 +6,15 @@
|
||||
; ROMWBW ADAPTATION BY WAYNE WARTHEN
|
||||
;__________________________________________________________________________________________________
|
||||
;
|
||||
; TODO:
|
||||
; 1) STACK LOCATION DURING BOOT OR WBOOT???
|
||||
; 2) REVIEW USE OF DI/EI IN INIT
|
||||
;
|
||||
FALSE .EQU 0
|
||||
TRUE .EQU ~FALSE
|
||||
;
|
||||
BDOS .EQU 5 ; BDOS FUNC INVOCATION VECTOR
|
||||
;
|
||||
; DEFINE PLATFORM STRING
|
||||
;
|
||||
#IFDEF PLTWBW
|
||||
@@ -283,18 +289,31 @@ DPBCNT .EQU ($ - DPBMAP) / 2
|
||||
;__________________________________________________________________________________________________
|
||||
BOOT:
|
||||
; STANDARD BOOT INVOCATION
|
||||
;DI
|
||||
;IM 1
|
||||
LD SP,STACK ; STACK FOR INITIALIZATION
|
||||
|
||||
;
|
||||
CALL INIT ; EXECUTE COLD BOOT ROUTINE
|
||||
; COPY INITIALIZATION CODE TO RUNNINT LOCATION $8000
|
||||
LD HL,BUFPOOL
|
||||
LD DE,$8000
|
||||
LD BC,CBIOS_END - BUFPOOL
|
||||
PUSH HL ; SAVE START ADR FOR BELOW
|
||||
PUSH HL ; SAVE START ADR AGAIN FOR BELOW
|
||||
PUSH BC ; SAVE LENGTH FOR BELOW
|
||||
LDIR ; COPY THE CODE
|
||||
;
|
||||
; CLEAR BUFFER SPACE STARTING AT DIRBUF TO TOP OF CBIOS
|
||||
; INIT SETS UP HL AND BC SO WE ARE READY TO CALL FILL
|
||||
LD SP,$100 ; MOVE STACK OUT OF THE WAY TEMPORARILY
|
||||
CALL FILL ; CLEAR DISK BUFFER AREA
|
||||
; CLEAR BUFFER
|
||||
POP BC ; RECOVER LENGTH
|
||||
POP HL ; RECOVER START
|
||||
POP DE ; RECOVER START AS DEST
|
||||
LD (HL),0 ; SET FIRST BYTE TO ZERO
|
||||
INC DE ; OFFSET DEST
|
||||
DEC BC ; REDUCE LEN BY ONE
|
||||
LDIR ; USE LDIR TO FILL
|
||||
;
|
||||
CALL INIT ; PERFORM COLD BOOD ROUTINE
|
||||
CALL RESCPM ; RESET CPM
|
||||
CALL AUTOSUB ; PREP AUTO SUBMIT, IF APPROPRIATE
|
||||
;
|
||||
LD SP,STACK ; PUT STACK BACK WHERE IT BELONGS
|
||||
JR GOCPM ; THEN OFF TO CP/M WE GO...
|
||||
;
|
||||
;__________________________________________________________________________________________________
|
||||
@@ -317,9 +336,6 @@ REBOOT:
|
||||
;
|
||||
;__________________________________________________________________________________________________
|
||||
WBOOT:
|
||||
;DI
|
||||
;IM 1
|
||||
;
|
||||
LD SP,STACK ; STACK FOR INITIALIZATION
|
||||
;
|
||||
#IFDEF PLTUNA
|
||||
@@ -339,16 +355,13 @@ WBOOT:
|
||||
RST 08 ; DO IT
|
||||
#ELSE
|
||||
; RESTORE COMMAND PROCESSOR FROM CACHE IN HB BANK
|
||||
;LD B,BF_SYSXCPY ; HBIOS FUNC: SYSTEM EXTENDED COPY
|
||||
LD B,BF_SYSSETCPY ; HBIOS FUNC: SETUP BANK COPY
|
||||
LD DE,(BNKBIOS) ; D = DEST (USER BANK), E = SRC (BIOS BANK)
|
||||
LD HL,CCP_SIZ ; HL = COPY LEN = SIZE OF COMMAND PROCESSOR
|
||||
RST 08 ; DO IT
|
||||
;LD B,BF_SYSCPY ; HBIOS FUNC: SYSTEM COPY
|
||||
LD B,BF_SYSBNKCPY ; HBIOS FUNC: PERFORM BANK COPY
|
||||
LD HL,(CCPBUF) ; COPY FROM FIXED LOCATION IN HB BANK
|
||||
LD DE,CCP_LOC ; TO CCP LOCATION IN USR BANK
|
||||
;LD IX,CCP_SIZ ; COPY CONTENTS OF COMMAND PROCESSOR
|
||||
RST 08 ; DO IT
|
||||
#ENDIF
|
||||
;
|
||||
@@ -362,10 +375,11 @@ WBOOT:
|
||||
XOR A
|
||||
CALL FILL
|
||||
;
|
||||
; FALL THRU TO INVOKE CP/M
|
||||
CALL RESCPM ; RESET CPM
|
||||
JR GOCPM ; THEN OFF TO CP/M WE GO...
|
||||
;
|
||||
;__________________________________________________________________________________________________
|
||||
GOCPM:
|
||||
RESCPM:
|
||||
;
|
||||
LD A,$C3 ; LOAD A WITH 'JP' INSTRUCTION (USED BELOW)
|
||||
;
|
||||
@@ -401,6 +415,11 @@ GOCPM:
|
||||
; DEFAULT DMA ADDRESS
|
||||
LD BC,$80 ; DEFAULT DMA ADDRESS IS $80
|
||||
CALL SETDMA ; SET IT
|
||||
;
|
||||
RET
|
||||
;
|
||||
;__________________________________________________________________________________________________
|
||||
GOCPM:
|
||||
;
|
||||
; ENSURE VALID DISK AND JUMP TO CCP
|
||||
LD A,(CDISK) ; GET CURRENT USER/DISK
|
||||
@@ -1779,13 +1798,9 @@ BUFPOOL .EQU $ ; START OF BUFFER POOL
|
||||
;
|
||||
;==================================================================================================
|
||||
;
|
||||
HCB .EQU $8000 ; LOCATION OF TEMP COPY OF HCB DURING INIT (256 BYTES)
|
||||
INIBUF .EQU $8800 ; LOCATION OF TEMP WORK BUF DURING INIT (512 BYTES)
|
||||
.ORG $8000 ; INIT CODE RUNS AT $8000
|
||||
;
|
||||
HEAPEND .EQU CBIOS_END - 64 ; TOP OF HEAP MEM, END OF CBIOS LESS 32 ENTRY STACK
|
||||
;
|
||||
.FILL 16 * 4,0 ; SKIP DRVMAP TABLE AREA
|
||||
.FILL 16 * 16,0 ; SKIP DPH TABLE AREA
|
||||
;
|
||||
INIT:
|
||||
DI ; NO INTERRUPTS FOR NOW
|
||||
@@ -1933,25 +1948,19 @@ INIT:
|
||||
#ENDIF
|
||||
;
|
||||
; DISPLAY FREE MEMORY
|
||||
LD DE,STR_LDR2 ; FORMATTING
|
||||
CALL WRITESTR ; AND PRINT IT
|
||||
;LD HL,CBIOS_END ; SUBTRACT HIGH WATER
|
||||
LD HL,HEAPEND ; SUBTRACT HIGH WATER
|
||||
LD DE,(HEAPTOP) ; ... FROM TOP OF CBIOS
|
||||
OR A ; ... WITH CF CLEAR
|
||||
SBC HL,DE ; ... SO HL GETS BYTES FREE
|
||||
CALL PRTDEC ; PRINT IT
|
||||
LD DE,STR_MEMFREE ; ADD DESCRIPTION
|
||||
CALL WRITESTR ; AND PRINT IT
|
||||
;
|
||||
LD A,(DEFDRIVE) ; GET DEFAULT DRIVE
|
||||
LD (CDISK),A ; ... AND SETUP CDISK
|
||||
;
|
||||
; SETUP AUTOSTART COMMAND
|
||||
LD HL,CMD ; ADDRESS OF STARTUP COMMAND
|
||||
LD DE,CCP_LOC + 7 ; START OF COMMAND BUFFER IN CCP
|
||||
LD BC,CMDLEN ; LENGTH OF AUTOSTART COMMAND
|
||||
LDIR ; INSTALL IT
|
||||
LD DE,STR_LDR2 ; FORMATTING
|
||||
CALL WRITESTR ; AND PRINT IT
|
||||
;LD HL,CBIOS_END ; SUBTRACT HIGH WATER
|
||||
LD HL,HEAPEND ; SUBTRACT HIGH WATER
|
||||
LD DE,(HEAPTOP) ; ... FROM TOP OF CBIOS
|
||||
OR A ; ... WITH CF CLEAR
|
||||
SBC HL,DE ; ... SO HL GETS BYTES FREE
|
||||
CALL PRTDEC ; PRINT IT
|
||||
LD DE,STR_MEMFREE ; ADD DESCRIPTION
|
||||
CALL WRITESTR ; AND PRINT IT
|
||||
;
|
||||
LD A,(DEFDRIVE) ; GET DEFAULT DRIVE
|
||||
LD (CDISK),A ; ... AND SETUP CDISK
|
||||
;
|
||||
; OS BANNER
|
||||
CALL NEWLINE2 ; FORMATTING
|
||||
@@ -1972,20 +1981,35 @@ INIT2:
|
||||
LD DE,STR_TPA2 ; AND TPA SUFFIX
|
||||
CALL WRITESTR
|
||||
CALL NEWLINE ; FORMATTING
|
||||
RET ; DONE
|
||||
;
|
||||
; SETUP HL & DE TO CLEAR BUFFER AFTER RETURN (VIA CALL TO FILL)
|
||||
; HL: START OF BUFFER AREA TO CLEAR (DIRBUF)
|
||||
; BC: LENGTH OF BUFFER AREA TO CLEAR CBIOS_END - (DIRBUF)
|
||||
; CLEAR BUFFER SPACE STARTING AT DIRBUF TO TOP OF CBIOS
|
||||
LD HL,CBIOS_END ; CALC SIZE TO CLEAR BY
|
||||
LD DE,(DIRBUF) ; ... SUBTRACTING DIRBUF START
|
||||
SBC HL,DE ; ... FROM TOP OF CBIOS
|
||||
PUSH HL ; MOVE SIZE
|
||||
POP BC ; ... TO BC
|
||||
LD HL,(DIRBUF) ; START OF AREA TO CLEAR -> HL
|
||||
XOR A ; FILL WITH ZEROES
|
||||
;
|
||||
RET ; DONE
|
||||
;__________________________________________________________________________________________________
|
||||
AUTOSUB:
|
||||
;
|
||||
; SETUP AUTO SUBMIT COMMAND (IF REQUIRED FILES EXIST)
|
||||
LD A,(DEFDRIVE) ; GET DEFAULT DRIVE
|
||||
INC A ; CONVERT FROM DRIVE NUM TO FCB DRIVE CODE
|
||||
LD (FCB_SUB),A ; SET DRIVE OF SUBMIT.COM FCB
|
||||
LD (FCB_PRO),A ; SET DRIVE OF PROFILE.SUB FCB
|
||||
;
|
||||
LD C,17 ; BDOS FUNCTION: FIND FIRST
|
||||
LD DE,FCB_SUB ; CHECK FOR SUBMIT.COM
|
||||
CALL BDOS ; INVOKE BDOS TO LOOK FOR FILE
|
||||
INC A ; CHECK FOR ERR, $FF --> $00
|
||||
RET Z ; ERR, DO NOT ATTEMPT AUTO SUBMIT
|
||||
;
|
||||
LD C,17 ; BDOS FUNCTION: FIND FIRST
|
||||
LD DE,FCB_PRO ; CHECK FOR PROFILE.SUB
|
||||
CALL BDOS ; INVOKE BDOS TO LOOK FOR FILE
|
||||
INC A ; CHECK FOR ERR, $FF --> $00
|
||||
RET Z ; ERR, DO NOT ATTEMPT AUTO SUBMIT
|
||||
;
|
||||
LD HL,CMD ; ADDRESS OF STARTUP COMMAND
|
||||
LD DE,CCP_LOC + 7 ; START OF COMMAND BUFFER IN CCP
|
||||
LD BC,CMDLEN ; LENGTH OF AUTOSTART COMMAND
|
||||
LDIR ; PATCH COMMAND LINE INTO CCP
|
||||
RET ; DONE
|
||||
;
|
||||
;
|
||||
;__________________________________________________________________________________________________
|
||||
@@ -2843,20 +2867,28 @@ DEV15 .EQU DEVUNK
|
||||
;
|
||||
#ENDIF
|
||||
;
|
||||
DPHTOP .DW 0 ; CURRENT TOP OF DPH POOL
|
||||
DIRBUF .DW 0 ; DIR BUF POINTER
|
||||
HEAPTOP .DW BUFPOOL ; CURRENT TOP OF HEAP
|
||||
BOOTVOL .DW 0 ; BOOT VOLUME, MSB=BOOT UNIT, LSB=BOOT SLICE
|
||||
BNKRAMD .DB 0 ; STARTING BANK ID FOR RAM DRIVE
|
||||
HDSPV .DB 2 ; SLICES PER VOLUME FOR HARD DISKS (MUST BE >= 1)
|
||||
DPHTOP .DW 0 ; CURRENT TOP OF DPH POOL
|
||||
DIRBUF .DW 0 ; DIR BUF POINTER
|
||||
HEAPTOP .DW BUFPOOL ; CURRENT TOP OF HEAP
|
||||
BOOTVOL .DW 0 ; BOOT VOLUME, MSB=BOOT UNIT, LSB=BOOT SLICE
|
||||
BNKRAMD .DB 0 ; STARTING BANK ID FOR RAM DRIVE
|
||||
HDSPV .DB 2 ; SLICES PER VOLUME FOR HARD DISKS (MUST BE >= 1)
|
||||
;
|
||||
CMD .DB CMDLEN - 1
|
||||
#IFDEF AUTOCMD
|
||||
.TEXT AUTOCMD
|
||||
#ENDIF
|
||||
CMD .DB CMDLEN - 2
|
||||
.TEXT "SUBMIT PROFILE"
|
||||
.DB 0
|
||||
CMDLEN .EQU $ - CMD
|
||||
;
|
||||
FCB_SUB .DB '?' ; DRIVE CODE, 0 = CURRENT DRIVE
|
||||
.DB "SUBMIT " ; FILE NAME, 8 CHARS
|
||||
.DB "COM" ; FILE TYPE, 3 CHARS
|
||||
.FILL 36-($-FCB_SUB),0 ; ZERO FILL REMAINDER OF FCB
|
||||
;
|
||||
FCB_PRO .DB '?' ; DRIVE CODE, 0 = CURRENT DRIVE
|
||||
.DB "PROFILE " ; FILE NAME, 8 CHARS
|
||||
.DB "SUB" ; FILE TYPE, 3 CHARS
|
||||
.FILL 36-($-FCB_PRO),0 ; ZERO FILL REMAINDER OF FCB
|
||||
;
|
||||
STR_BANNER .DB "CBIOS v", BIOSVER, " [", PLTSTR, "]$"
|
||||
STR_INITRAMDISK .DB "Formatting RAMDISK...$"
|
||||
STR_LDR2 .DB "\r\n"
|
||||
@@ -2869,10 +2901,18 @@ STR_CPM .DB "CP/M-80 v2.2$"
|
||||
STR_ZSDOS .DB "ZSDOS v1.1$"
|
||||
STR_TPA1 .DB ", $"
|
||||
STR_TPA2 .DB "K TPA$"
|
||||
|
||||
#IFDEF PLTUNA
|
||||
INIBUF .FILL 512,0 ; LOCATION OF TEMP WORK BUF DURING INIT (512 BYTES)
|
||||
#ELSE
|
||||
HCB .FILL HCB_SIZ,0 ; LOCATION OF TEMP COPY OF HCB DURING INIT (256 BYTES)
|
||||
#ENDIF
|
||||
;
|
||||
;==================================================================================================
|
||||
;
|
||||
; END OF COLD BOOT INITIALIZATION
|
||||
;==================================================================================================
|
||||
;
|
||||
.ORG BUFPOOL + ($ - $8000)
|
||||
;
|
||||
SLACK .EQU (CBIOS_END - $)
|
||||
.ECHO "INIT code slack space: "
|
||||
|
||||
@@ -5,8 +5,6 @@ CLRRAMDISK .EQU CLR_AUTO ; CLR_ALWAYS, CLR_NEVER, CLR_AUTO (CLEAR IF INVALID DIR
|
||||
WRTCACHE .EQU TRUE ; ENABLE WRITE CACHING IN CBIOS (DE)BLOCKING ALGORITHM
|
||||
DSKTRACE .EQU FALSE ; ENABLE TRACING OF CBIOS DISK FUNCTION CALLS
|
||||
;
|
||||
#DEFINE AUTOCMD "" ; AUTO STARTUP COMMAND FOR CP/M
|
||||
;
|
||||
CPM_LOC .EQU $D000 ; LOCATION OF START OF CCP
|
||||
;
|
||||
#IFDEF PLTWBW
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
#DEFINE RMN 8
|
||||
#DEFINE RUP 6
|
||||
#DEFINE RTP 0
|
||||
#DEFINE BIOSVER "2.8.6-pre.0"
|
||||
#DEFINE BIOSVER "2.8.6-pre.1"
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
#DEFINE RMN 8
|
||||
#DEFINE RUP 6
|
||||
#DEFINE RTP 0
|
||||
#DEFINE BIOSVER "2.8.6-pre.0"
|
||||
#DEFINE BIOSVER "2.8.6-pre.1"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user