mirror of
https://github.com/wwarthen/RomWBW.git
synced 2026-02-06 22:43:15 -06:00
Cleanup
This commit is contained in:
@@ -45,8 +45,8 @@ PORT_EZZ80 .EQU $C0 ; RTC port for EZZ80 (actually does not have one!!!)
|
||||
BDOS .EQU 5 ; BDOS invocation vector
|
||||
FCB .EQU 05CH ; Start of command line
|
||||
|
||||
BID_BOOT .EQU $00
|
||||
HB_BNKCALL .EQU $FFF9
|
||||
;BID_BOOT .EQU $00
|
||||
;HB_BNKCALL .EQU $FFF9
|
||||
|
||||
BF_SYSRESET .EQU $F0 ; RESTART SYSTEM
|
||||
|
||||
@@ -1331,9 +1331,13 @@ DELAY_LOOP: ; LOOP IS 26TS
|
||||
OR L ; 4TS
|
||||
JR NZ,DELAY_LOOP ; 12TS
|
||||
; RESTART SYSTEM FROM ROM BANK 0, ADDRESS $0000
|
||||
LD A,BID_BOOT ; BOOT BANK
|
||||
LD HL,0 ; ADDRESS ZERO
|
||||
CALL HB_BNKCALL ; DOES NOT RETURN
|
||||
;LD A,BID_BOOT ; BOOT BANK
|
||||
;LD HL,0 ; ADDRESS ZERO
|
||||
;CALL HB_BNKCALL ; DOES NOT RETURN
|
||||
LD B,BF_SYSRESET ; SYSTEM RESTART
|
||||
LD C,BF_SYSRES_COLD ; COLD START
|
||||
CALL $FFF0 ; CALL HBIOS
|
||||
|
||||
|
||||
RTC_TOP_LOOP_WARMSTART:
|
||||
LD B,BF_SYSRESET ; SYSTEM RESTART
|
||||
|
||||
77
Source/Apps/XM/XModem Xfer Anomaly
Normal file
77
Source/Apps/XM/XModem Xfer Anomaly
Normal file
@@ -0,0 +1,77 @@
|
||||
XModem 12.5 & Tera Term Anomaly Analysis
|
||||
----------------------------------------
|
||||
|
||||
Protocol Notes:
|
||||
|
||||
- During protocol startup, the receiver NAKs the sender repeatedly
|
||||
to let the sender know it can start sending.
|
||||
- Normally, the receiver sends a NAK character to ask the sender to
|
||||
resend a packet.
|
||||
- Prior to receiving the first packet, the receiver may send a "C"
|
||||
or a "CK" instead of a NAK. This mechanism is used to inform the
|
||||
sender that the receiver wants to use (C)RC error detection
|
||||
instead of checksum error detection and optionally 1(K) packet sizes.
|
||||
- After the first packet exchange, a NAK is always used to
|
||||
request a packet be resent.
|
||||
|
||||
Anomalous Exchange Description:
|
||||
|
||||
XModem on RomWBW is being used to receive a file being sent
|
||||
by Tera Term on a Windows PC...
|
||||
|
||||
- XModem is started in receive mode
|
||||
- User starts process of selecting a file to send on Tera Term
|
||||
- XModem begins sending "CK" sequences as described above
|
||||
to wake up the sender
|
||||
- Tera Term buffers incoming "CK" sequences while user is selecting
|
||||
a file to send
|
||||
- User completes file selection
|
||||
- Tera Term receives the first "CK" which was buffered while user
|
||||
was selecting a file
|
||||
- Tera Term correctly receives the first "CK", sets itself to
|
||||
use CRC and 1K packets, then sends the first packet
|
||||
- While waiting for Tera Term to send the first packet, XModem
|
||||
is repeatedly timing out and resending the "CK" sequence
|
||||
- For each timeout, XModem spends 1 second flushing any incoming
|
||||
characters from the sender (it assumes it is flushing line garbage).
|
||||
- IFF the first packet from Tera Term starts to arrive during this
|
||||
1 second flushing interval, XModem gobbles up and discards the
|
||||
first packet sent by Tera Term
|
||||
- XModem then sends a new "CK" because it is still waiting for the
|
||||
first packet (having just flushed the actual first packet)
|
||||
- Tera Term has already switched out of "first packet" mode and will
|
||||
now only respond to an actual NAK character, so it ignores all of
|
||||
the CKs send from XModem
|
||||
- XModem continues to send CKs and Tera Term continues to ignore them
|
||||
until XModem hits a retry threshold
|
||||
- When XModem hits the retry threshold, it attempts to switch from
|
||||
CRC to Checksum assuming the sender was not capable of using
|
||||
CRCs
|
||||
- XModem now sends a NAK character because that is what is used for
|
||||
for first packet NAKing in Checksum mode
|
||||
- Tera Term sees the NAK and resends the first packet, but appends a
|
||||
CRC instead of a Checksum because Tera Term is still in CRC mode
|
||||
- XModem fails the Tera Term first packet resends because it is
|
||||
looking for a Checksum and Tera Term is appending CRCs.
|
||||
- XModem eventually gives up.
|
||||
|
||||
Summary of failure:
|
||||
|
||||
If Tera Term happens to start sending the first packet during the
|
||||
one second "flush" window of XModem, the exchange will fail during
|
||||
the startup sequence.
|
||||
|
||||
Since the precise start timing of the first packet is dependent on
|
||||
the time the user takes to select a file, the occurrence of the
|
||||
failure is essentially random.
|
||||
|
||||
The timeout used by XModem is about 5 seconds followed by the 1
|
||||
second line flush. So, there is a 1 in 6 chance that the protocol
|
||||
will fail to startup successfully.
|
||||
|
||||
Mitigation:
|
||||
|
||||
- Modified the receive timeout recovery to *not* flush the incoming
|
||||
buffer for one second. Flushing in this scenario makes no sense
|
||||
anyway because a timeout just occurred meaning no data is being
|
||||
received.
|
||||
@@ -67,16 +67,24 @@ MINIT:
|
||||
;
|
||||
; Neither UNA nor RomWBW
|
||||
LD DE,ERR_BIO ; BIOS error message
|
||||
LD C,9 ; BDOS string display function
|
||||
CALL BDOS ; Do it
|
||||
JP 0 ; Bail out!
|
||||
JP FAIL ; Print msg and bail out
|
||||
;
|
||||
MINIT_RET:
|
||||
PUSH HL ; Save HL (JP table adr)
|
||||
|
||||
; Display port notification string
|
||||
; Display handler label
|
||||
LD C,9 ; BDOS string display function
|
||||
CALL BDOS ; Do it
|
||||
;
|
||||
; Display port (unit number)
|
||||
LD DE,COM_LBL ; Prefix
|
||||
LD C,9 ; BDOS string display function
|
||||
CALL BDOS ; Do it
|
||||
LD A,(UNIT) ; Get unit number
|
||||
ADD A,'0' ; Make displayable
|
||||
LD E,A ; Put in E for display
|
||||
LD C,2 ; BDOS console write char
|
||||
CALL BDOS ; Do it
|
||||
;
|
||||
; Declare experimental
|
||||
LD DE,EXP_LBL ; Declare experimental
|
||||
@@ -112,7 +120,7 @@ HINIT:
|
||||
LD A,L ; Move it to A
|
||||
LD (CPUSPD),A ; Save it
|
||||
;
|
||||
JP H_INIT ; Otherwise, use HBIOS I/O
|
||||
JP H_INIT ; HBIOS init
|
||||
;
|
||||
UINIT:
|
||||
; Display UNA notification string
|
||||
@@ -137,9 +145,7 @@ UINIT1:
|
||||
HWERR:
|
||||
; Failed to identify target comm hardware
|
||||
LD DE,ERR_HW ; Hardware error message
|
||||
LD C,9 ; BDOS string display function
|
||||
CALL BDOS ; Do it
|
||||
JP 0 ; Bail out!
|
||||
JP FAIL ; Print message and bail out
|
||||
;
|
||||
; Identify active BIOS. RomWBW HBIOS=1, UNA UBIOS=2, else 0
|
||||
;
|
||||
@@ -178,6 +184,12 @@ IDBIO2:
|
||||
XOR A ; Setup return value of 0
|
||||
RET ; and done
|
||||
;
|
||||
FAIL:
|
||||
; DE has error string address
|
||||
LD C,9 ; BDOS string display function
|
||||
CALL BDOS ; Do it
|
||||
JP 0 ; Bail out!
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Uninitialize modem
|
||||
@@ -193,7 +205,8 @@ UNINIT:
|
||||
H_UNINIT:
|
||||
; HBIOS: Reset character device 0
|
||||
LD B,04H ; HBIOS CIOINIT function 0x04
|
||||
LD C,80H ; Unit = 80 (console)
|
||||
LD A,(UNIT) ; HBIOS serial unit number
|
||||
LD C,A ; Put in C for func call
|
||||
LD DE,-1 ; Reset w/ current settings
|
||||
RST 08 ; Do it
|
||||
RET ; not initialized, so no 'UN-INITIALIZE'
|
||||
@@ -201,7 +214,8 @@ H_UNINIT:
|
||||
U_UNINIT:
|
||||
; UBIOS: Reset character device 0
|
||||
LD C,10H ; UNA INIT function 0x10
|
||||
LD B,0 ; Unit = 0
|
||||
LD A,(UNIT) ; UBIOS serial unit number
|
||||
LD B,A ; Put in B for func call
|
||||
LD DE,-1 ; Reset w/ current settings
|
||||
RST 08 ; Do it
|
||||
RET ; not initialized, so no 'UN-INITIALIZE'
|
||||
@@ -226,10 +240,13 @@ EXTRA3:
|
||||
BIOID DB 0 ; BIOS ID, 1=HBIOS, 2=UBIOS
|
||||
CPUSPD DB 10 ; CPU speed in MHz
|
||||
RCVSCL DW 6600 ; RECV loop timeout scalar
|
||||
UNIT DB 0 ; HBIOS serial device unit number
|
||||
;
|
||||
TAG DB "RomWBW, 23-May-2020$"
|
||||
;
|
||||
COM_LBL DB ", HBIOS FastPath on COM?:$"
|
||||
H_LBL DB ", HBIOS FastPath$"
|
||||
U_LBL DB ", UNA UBIOS$"
|
||||
COM_LBL DB " on COM$"
|
||||
EXP_LBL DB 13, 10, 13, 10, "*** Experimental ***$"
|
||||
;
|
||||
UBTAG DB " [UNA]$"
|
||||
@@ -239,6 +256,7 @@ CRLF DB 13, 10, "$"
|
||||
;
|
||||
ERR_BIO DB 13, 10, 13, 10, "++ Unknown BIOS ++", 13, 10, "$"
|
||||
ERR_HW DB 13, 10, 13, 10, "++ Unknown Hardware ++", 13, 10, "$"
|
||||
ERR_API DB 13, 10, 13, 10, "++ BIOS API Error ++", 13, 10, "$"
|
||||
;
|
||||
;=======================================================================
|
||||
;=======================================================================
|
||||
@@ -272,53 +290,64 @@ H_INIT:
|
||||
; Get HBIOS bank id
|
||||
LD BC,0F8F2H ; HBIOS SYSGET, Bank Info
|
||||
RST 08 ; do it
|
||||
JR NZ,H_APIERR ; handle API error
|
||||
LD A,D ; BIOS bank id to A
|
||||
LD (H_BNKID),A ; save it
|
||||
;
|
||||
; Lookup current console to use as default for transfer
|
||||
LD B,0FAH ; HBIOS PEEK
|
||||
LD A,(H_BNKID) ; get BIOS bank id
|
||||
LD D,A ; ... and put in D
|
||||
LD HL,100H + 12H ; HCB console unit address
|
||||
RST 08 ; E := value
|
||||
LD A,E ; put in A
|
||||
LD (UNIT),A ; save it
|
||||
;
|
||||
; Patch SENDR w/ FastPath addresses
|
||||
LD BC,0F801H ; Get CIO func/data adr
|
||||
LD D,01H ; Func=CIO OUT
|
||||
LD A,(H_UNIT) ; get desired char unit
|
||||
LD A,(UNIT) ; get desired char unit
|
||||
LD E,A ; and put in E
|
||||
RST 08
|
||||
; handle error?
|
||||
LD (H_SCDAT),DE ; Plug in data adr
|
||||
JR NZ,H_APIERR ; handle API error
|
||||
LD (H_UDAT),DE ; Plug in data adr
|
||||
LD (H_SCFN),HL ; Plug in func adr
|
||||
;
|
||||
; Patch GETCHR/MDIN w/ FastPath addresses
|
||||
LD BC,0F801H ; Get CIO func/data adr
|
||||
LD D,00H ; Func=CIO IN
|
||||
LD A,(H_UNIT) ; get desired char unit
|
||||
LD A,(UNIT) ; get desired char unit
|
||||
LD E,A ; and put in E
|
||||
RST 08
|
||||
; handle error?
|
||||
LD (H_GCDAT),DE ; Plug in data adr
|
||||
JR NZ,H_APIERR ; handle API error
|
||||
LD (H_GCFN),HL ; Plug in func adr
|
||||
;
|
||||
; Patch RCVRDY w/ FastPath addresses
|
||||
LD BC,0F801H ; Get CIO func/data adr
|
||||
LD D,02H ; Func=CIO IST
|
||||
LD A,(H_UNIT) ; get desired char unit
|
||||
LD A,(UNIT) ; get desired char unit
|
||||
LD E,A ; and put in E
|
||||
RST 08
|
||||
; handle error?
|
||||
LD (H_RRDAT),DE ; Plug in data adr
|
||||
JR NZ,H_APIERR ; handle API error
|
||||
LD (H_RRFN),HL ; Plug in func adr
|
||||
;
|
||||
; Patch SNDRDY w/ FastPath addresses
|
||||
LD BC,0F801H ; Get CIO func/data adr
|
||||
LD D,03H ; Func=CIO OST
|
||||
LD A,(H_UNIT) ; get desired char unit
|
||||
LD A,(UNIT) ; get desired char unit
|
||||
LD E,A ; and put in E
|
||||
RST 08
|
||||
; handle error?
|
||||
LD (H_SRDAT),DE ; Plug in data adr
|
||||
JR NZ,H_APIERR ; handle API error
|
||||
LD (H_SRFN),HL ; Plug in func adr
|
||||
;
|
||||
LD HL,H_JPTBL
|
||||
LD DE,COM_LBL
|
||||
LD DE,H_LBL
|
||||
JP MINIT_RET
|
||||
;
|
||||
H_APIERR:
|
||||
LD DE,ERR_API
|
||||
JP FAIL
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
;
|
||||
; Send character on top of stack
|
||||
@@ -329,10 +358,9 @@ H_SENDR:
|
||||
PUSH DE
|
||||
PUSH HL
|
||||
LD E,A ; character to E
|
||||
LD IY,0000H
|
||||
H_SCDAT EQU $-2
|
||||
LD IY,(H_UDAT)
|
||||
LD A,(H_BNKID) ; call into HBIOS bank
|
||||
LD HL,0000H
|
||||
LD IX,0000H
|
||||
H_SCFN EQU $-2
|
||||
CALL 0FFF9H ; HBIOS bank call
|
||||
POP HL
|
||||
@@ -362,10 +390,9 @@ H_MDIN:
|
||||
PUSH BC
|
||||
PUSH DE
|
||||
PUSH HL
|
||||
LD IY,0000H
|
||||
H_GCDAT EQU $-2
|
||||
LD IY,(H_UDAT)
|
||||
LD A,(H_BNKID) ; call into HBIOS bank
|
||||
LD HL,0000H
|
||||
LD IX,0000H
|
||||
H_GCFN EQU $-2
|
||||
CALL 0FFF9H ; HBIOS bank call
|
||||
LD A,E ; byte received to A
|
||||
@@ -384,10 +411,9 @@ H_RCVRDY:
|
||||
PUSH BC
|
||||
PUSH DE
|
||||
PUSH HL
|
||||
LD IY,0000H
|
||||
H_RRDAT EQU $-2
|
||||
LD IY,(H_UDAT)
|
||||
LD A,(H_BNKID) ; call into HBIOS bank
|
||||
LD HL,0000H
|
||||
LD IX,0000H
|
||||
H_RRFN EQU $-2
|
||||
CALL 0FFF9H ; HBIOS bank call
|
||||
SUB 1 ; CF set IFF zero
|
||||
@@ -407,10 +433,9 @@ H_SNDRDY:
|
||||
PUSH BC
|
||||
PUSH DE
|
||||
PUSH HL
|
||||
LD IY,0000H
|
||||
H_SRDAT EQU $-2
|
||||
LD IY,(H_UDAT)
|
||||
LD A,(H_BNKID) ; call into HBIOS bank
|
||||
LD HL,0000H
|
||||
LD IX,0000H
|
||||
H_SRFN EQU $-2
|
||||
CALL 0FFF9H ; HBIOS bank call
|
||||
SUB 1 ; CF set IFF zero
|
||||
@@ -431,8 +456,8 @@ H_SPEED:
|
||||
;
|
||||
;
|
||||
;
|
||||
H_BNKID DB 0 ; HBIOS bank id
|
||||
H_UNIT DB 80H ; HBIOS unit id
|
||||
H_BNKID DB 00H ; HBIOS bank id
|
||||
H_UDAT DW 0000H ; Unit data address
|
||||
;
|
||||
;
|
||||
;=======================================================================
|
||||
@@ -470,7 +495,7 @@ U_INIT:
|
||||
LD (RCVSCL),HL ; ... to compensate for BIOS overhead
|
||||
;
|
||||
LD HL,U_JPTBL
|
||||
LD DE,COM_LBL
|
||||
LD DE,U_LBL
|
||||
JP MINIT_RET
|
||||
;
|
||||
;-----------------------------------------------------------------------
|
||||
|
||||
@@ -1335,8 +1335,10 @@ DSK_MBR0:
|
||||
LD (STKSAV),SP ; SAVE CUR STACK
|
||||
LD SP,STACK ; NEW STACK IN HI MEM
|
||||
LD A,(BNKBIOS) ; ACTIVATE HBIOS BANK
|
||||
LD HL,DSK_MBR1 ; ROUTINE TO RUN
|
||||
PUSH IX ; SAVE IX
|
||||
LD IX,DSK_MBR1 ; ROUTINE TO RUN
|
||||
CALL HB_BNKCALL ; DO IT
|
||||
POP IX ; RESTORE IX
|
||||
LD SP,(STKSAV) ; RESTORE ORIGINAL STACK
|
||||
RET
|
||||
#ENDIF
|
||||
|
||||
@@ -1774,6 +1774,31 @@ available along with the registers/information returned.
|
||||
| A: Status (0=OK, else error)
|
||||
| E: Count of Serial Device Units
|
||||
|
||||
#### SYSGET Subfunction 0x01 -- Get Serial Unit Function (CIOFN)
|
||||
|
||||
| _Entry Parameters_
|
||||
| BC: 0xF801
|
||||
| D: CIO Function
|
||||
| E: Unit
|
||||
|
||||
| _Returned Values_
|
||||
| A: Status (0=OK, else error)
|
||||
| HL: Driver Function Address
|
||||
| DE: Unit Data Address
|
||||
|
||||
This function will lookup the actual driver function address and
|
||||
unit data address inside the HBIOS driver. On entry, place the
|
||||
CIO function number to lookup in D and the CIO unit number in E.
|
||||
On return, HL will contain the address of the requested function
|
||||
in the HBIOS driver (in the HBIOS bank). DE will contain the
|
||||
associated unit data address (also in the HBIOS bank).
|
||||
|
||||
This function can be used to speed up HBIOS calls by looking up the
|
||||
function and data address for a specific driver function. After this,
|
||||
the caller can use interbank calls directly to the function in the
|
||||
driver which bypasses the overhead of the normal function invocation
|
||||
lookup.
|
||||
|
||||
#### SYSGET Subfunction 0x10 -- Get Disk Device Unit Count (DIOCNT)
|
||||
|
||||
| _Entry Parameters_
|
||||
@@ -1783,6 +1808,31 @@ available along with the registers/information returned.
|
||||
| A: Status (0=OK, else error)
|
||||
| E: Count of Disk Device Units
|
||||
|
||||
#### SYSGET Subfunction 0x11 -- Get Disk Unit Function (DIOFN)
|
||||
|
||||
| _Entry Parameters_
|
||||
| BC: 0xF811
|
||||
| D: DIO Function
|
||||
| E: Unit
|
||||
|
||||
| _Returned Values_
|
||||
| A: Status (0=OK, else error)
|
||||
| HL: Driver Function Address
|
||||
| DE: Unit Data Address
|
||||
|
||||
This function will lookup the actual driver function address and
|
||||
unit data address inside the HBIOS driver. On entry, place the
|
||||
DIO function number to lookup in D and the DIO unit number in E.
|
||||
On return, HL will contain the address of the requested function
|
||||
in the HBIOS driver (in the HBIOS bank). DE will contain the
|
||||
associated unit data address (also in the HBIOS bank).
|
||||
|
||||
This function can be used to speed up HBIOS calls by looking up the
|
||||
function and data address for a specific driver function. After this,
|
||||
the caller can use interbank calls directly to the function in the
|
||||
driver which bypasses the overhead of the normal function invocation
|
||||
lookup.
|
||||
|
||||
#### SYSGET Subfunction 0x20 -- Get Disk Device Unit Count (RTCCNT)
|
||||
|
||||
| _Entry Parameters_
|
||||
@@ -1801,6 +1851,31 @@ available along with the registers/information returned.
|
||||
| A: Status (0=OK, else error)
|
||||
| E: Count of Video Device Units
|
||||
|
||||
#### SYSGET Subfunction 0x41 -- Get Video Unit Function (VDAFN)
|
||||
|
||||
| _Entry Parameters_
|
||||
| BC: 0xF841
|
||||
| D: VDA Function
|
||||
| E: Unit
|
||||
|
||||
| _Returned Values_
|
||||
| A: Status (0=OK, else error)
|
||||
| HL: Driver Function Address
|
||||
| DE: Unit Data Address
|
||||
|
||||
This function will lookup the actual driver function address and
|
||||
unit data address inside the HBIOS driver. On entry, place the
|
||||
VDA function number to lookup in D and the VDA unit number in E.
|
||||
On return, HL will contain the address of the requested function
|
||||
in the HBIOS driver (in the HBIOS bank). DE will contain the
|
||||
associated unit data address (also in the HBIOS bank).
|
||||
|
||||
This function can be used to speed up HBIOS calls by looking up the
|
||||
function and data address for a specific driver function. After this,
|
||||
the caller can use interbank calls directly to the function in the
|
||||
driver which bypasses the overhead of the normal function invocation
|
||||
lookup.
|
||||
|
||||
#### SYSGET Subfunction 0x50 -- Get Sound Device Unit Count (SNDCNT)
|
||||
|
||||
| _Entry Parameters_
|
||||
@@ -1810,6 +1885,31 @@ available along with the registers/information returned.
|
||||
| A: Status (0=OK, else error)
|
||||
| E: Count of Sound Device Units
|
||||
|
||||
#### SYSGET Subfunction 0x51 -- Get Sound Unit Function (SNDFN)
|
||||
|
||||
| _Entry Parameters_
|
||||
| BC: 0xF851
|
||||
| D: SND Function
|
||||
| E: Unit
|
||||
|
||||
| _Returned Values_
|
||||
| A: Status (0=OK, else error)
|
||||
| HL: Driver Function Address
|
||||
| DE: Unit Data Address
|
||||
|
||||
This function will lookup the actual driver function address and
|
||||
unit data address inside the HBIOS driver. On entry, place the
|
||||
SND function number to lookup in D and the SND unit number in E.
|
||||
On return, HL will contain the address of the requested function
|
||||
in the HBIOS driver (in the HBIOS bank). DE will contain the
|
||||
associated unit data address (also in the HBIOS bank).
|
||||
|
||||
This function can be used to speed up HBIOS calls by looking up the
|
||||
function and data address for a specific driver function. After this,
|
||||
the caller can use interbank calls directly to the function in the
|
||||
driver which bypasses the overhead of the normal function invocation
|
||||
lookup.
|
||||
|
||||
#### SYSGET Subfunction 0xD0 -- Get Timer Tick Count (TIMER)
|
||||
|
||||
| _Entry Parameters_
|
||||
|
||||
@@ -3,7 +3,7 @@ CIOIN EQU 00h ; CHARACTER INPUT
|
||||
CIOOUT EQU 01h ; CHARACTER OUTPUT
|
||||
CIOIST EQU 02h ; CHARACTER INPUT STATUS
|
||||
BID_BOOT EQU 00h
|
||||
HB_BNKCALL EQU 0fff9h
|
||||
;HB_BNKCALL EQU 0fff9h
|
||||
BF_SYSRESET EQU 0F0h ; RESTART SYSTEM
|
||||
|
||||
BF_SYSRES_INT EQU 00h ; RESET HBIOS INTERNAL
|
||||
|
||||
@@ -45,10 +45,20 @@ GET ($F8):
|
||||
BC=Function/Subfunction A=Result
|
||||
E=Serial Unit Count
|
||||
|
||||
CIOFN ($01):
|
||||
BC=Function/Subfunction A=Result
|
||||
HL=Function Address
|
||||
DE=Unit Data Address
|
||||
|
||||
DIOCNT ($10):
|
||||
BC=Function/Subfunction A=Result
|
||||
E=Disk Unit Count
|
||||
|
||||
DIOFN ($11):
|
||||
BC=Function/Subfunction A=Result
|
||||
HL=Function Address
|
||||
DE=Unit Data Address
|
||||
|
||||
RTCCNT ($20):
|
||||
BC=Function/Subfunction A=Result
|
||||
E=RTC Unit Count
|
||||
@@ -57,6 +67,20 @@ GET ($F8):
|
||||
BC=Function/Subfunction A=Result
|
||||
E=Video Unit Count
|
||||
|
||||
VDAFN ($41):
|
||||
BC=Function/Subfunction A=Result
|
||||
HL=Function Address
|
||||
DE=Unit Data Address
|
||||
|
||||
SNDCNT ($50):
|
||||
BC=Function/Subfunction A=Result
|
||||
E=Sound Unit Count
|
||||
|
||||
SNDFN ($51):
|
||||
BC=Function/Subfunction A=Result
|
||||
HL=Function Address
|
||||
DE=Unit Data Address
|
||||
|
||||
TIMER ($D0):
|
||||
BC=Function/Subfunction A=Result
|
||||
DE:HL=Timer Value (32 bit)
|
||||
|
||||
@@ -488,20 +488,18 @@ HBX_BC_ITER:
|
||||
; CALLER MUST ENSURE STACK IS ALREADY IN HIGH MEMORY AND HAS ADEQUATE SPACE.
|
||||
; IF IM1 INTERRUPTS ARE POSSIBLE, CALLER MUST EITHER DISABLE THEM PRIOR TO
|
||||
; BNKCALL OR MAKE SURE THAT PAGE ZERO IN TARGET BANK IS PREPARED FOR THEM.
|
||||
; ON INPUT A=TARGET BANK, HL=TARGET ADDRESS
|
||||
; ON INPUT A=TARGET BANK, IX=TARGET ADDRESS
|
||||
;
|
||||
HBX_BNKCALL:
|
||||
LD (HBX_TGTBNK),A ; STUFF TARGET BANK TO CALL INTO CODE BELOW
|
||||
LD (HBX_TGTADR),HL ; STUFF ADDRESS TO CALL INTO CODE BELOW
|
||||
LD (HBX_TGTADR),IX ; STUFF ADDRESS TO CALL INTO CODE BELOW
|
||||
LD A,(HB_CURBNK) ; GET CURRENT BANK
|
||||
PUSH AF ; SAVE FOR RETURN
|
||||
HBX_TGTBNK .EQU $ + 1
|
||||
LD A,$FF ; LOAD BANK TO CALL ($FF OVERLAID AT ENTRY)
|
||||
CALL HBX_BNKSEL ; ACTIVATE THE NEW BANK
|
||||
|
||||
HBX_TGTADR .EQU $ + 1
|
||||
CALL $FFFF ; CALL ROUTINE ($FFFF IS OVERLAID ABOVE)
|
||||
|
||||
EX (SP),HL ; SAVE HL AND GET BANK TO RESTORE IN HL
|
||||
PUSH AF ; SAVE AF
|
||||
LD A,H ; BANK TO RESTORE TO A
|
||||
@@ -953,7 +951,7 @@ HB_START:
|
||||
; TRANSITION TO HBIOS IN RAM BANK
|
||||
;
|
||||
LD A,BID_BIOS ; BIOS BANK ID
|
||||
LD HL,HB_START1 ; EXECUTION RESUMES HERE
|
||||
LD IX,HB_START1 ; EXECUTION RESUMES HERE
|
||||
CALL HBX_BNKCALL ; CONTINUE IN RAM BANK, DO NOT RETURN
|
||||
HALT ; WE SHOULD NOT COME BACK HERE!
|
||||
;
|
||||
@@ -1556,7 +1554,7 @@ INITSYS3:
|
||||
#IFDEF ROMBOOT
|
||||
; PERFORM BANK CALL TO OS IMAGES BANK IN ROM
|
||||
LD A,BID_IMG0 ; CHAIN TO OS IMAGES BANK
|
||||
LD HL,0 ; ENTER AT ADDRESS 0
|
||||
LD IX,0 ; ENTER AT ADDRESS 0
|
||||
CALL HBX_BNKCALL ; GO THERE
|
||||
HALT ; WE SHOULD NEVER COME BACK!
|
||||
#ELSE
|
||||
@@ -1582,7 +1580,7 @@ INITSYS3:
|
||||
;
|
||||
; PERFORM BANK CALL TO USER BANK
|
||||
LD A,BID_USR ; CHAIN TO OS IMAGES BANK
|
||||
LD HL,0 ; ENTER AT ADDRESS 0
|
||||
LD IX,0 ; ENTER AT ADDRESS 0
|
||||
CALL HBX_BNKCALL ; GO THERE
|
||||
HALT ; WE SHOULD NEVER COME BACK!
|
||||
;
|
||||
@@ -2372,7 +2370,7 @@ SYS_RESWARM:
|
||||
; PERFORM BANK CALL TO OS IMAGES BANK IN ROM
|
||||
LD SP,HBX_LOC ; STACK JUST BELOW HBIOS PROXY
|
||||
LD A,BID_IMG0 ; CHAIN TO OS IMAGES BANK
|
||||
LD HL,0 ; ENTER AT ADDRESS 0
|
||||
LD IX,0 ; ENTER AT ADDRESS 0
|
||||
CALL HBX_BNKCALL ; GO THERE
|
||||
HALT ; WE SHOULD NEVER COME BACK!
|
||||
;
|
||||
@@ -2382,7 +2380,7 @@ SYS_RESCOLD:
|
||||
DI
|
||||
LD SP,HBX_LOC ; STACK JUST BELOW HBIOS PROXY
|
||||
LD A,BID_BOOT ; BOOT BANK
|
||||
LD HL,0 ; ADDRESS ZERO
|
||||
LD IX,0 ; ADDRESS ZERO
|
||||
CALL HB_BNKCALL ; DOES NOT RETURN
|
||||
;
|
||||
; GET THE CURRENT HBIOS VERSION
|
||||
@@ -2481,20 +2479,18 @@ SYS_GET:
|
||||
JP Z,SYS_GETCIOFN
|
||||
CP BF_SYSGET_DIOCNT
|
||||
JP Z,SYS_GETDIOCNT
|
||||
;CP BF_SYSGET_DIOFN
|
||||
;JP Z,SYS_GETDIOFN
|
||||
CP BF_SYSGET_DIOFN
|
||||
JP Z,SYS_GETDIOFN
|
||||
CP BF_SYSGET_RTCCNT
|
||||
JP Z,SYS_GETRTCCNT
|
||||
;CP BF_SYSGET_RTCFN
|
||||
;JP Z,SYS_GETRTCFN
|
||||
CP BF_SYSGET_VDACNT
|
||||
JP Z,SYS_GETVDACNT
|
||||
;CP BF_SYSGET_VDAFN
|
||||
;JP Z,SYS_GETVDAFN
|
||||
CP BF_SYSGET_VDAFN
|
||||
JP Z,SYS_GETVDAFN
|
||||
CP BF_SYSGET_SNDCNT
|
||||
JP Z, SYS_GETSNDCNT
|
||||
;CP BF_SYSGET_SNDFN
|
||||
;JP Z,SYS_GETSNDFN
|
||||
CP BF_SYSGET_SNDFN
|
||||
JP Z,SYS_GETSNDFN
|
||||
CP BF_SYSGET_TIMER
|
||||
JP Z,SYS_GETTIMER
|
||||
CP BF_SYSGET_SECS
|
||||
@@ -2601,27 +2597,26 @@ SYS_GETCIOCNT:
|
||||
XOR A ; SIGNALS SUCCESS
|
||||
RET
|
||||
;
|
||||
; GET SERIAL UNIT API FN ADR AND BLOB ADR
|
||||
; GET SERIAL UNIT API FN ADR AND DATA ADR
|
||||
; ENTRY:
|
||||
; D: FUNCTION
|
||||
; E: UNIT
|
||||
; RETURNS:
|
||||
; HL: FUNCTION ADDRESS
|
||||
; DE: DATA BLOB ADDRESS
|
||||
;
|
||||
SYS_GETCIOFN:
|
||||
LD A,D ; GET CIO FUNC NUM FROM D
|
||||
LD B,A ; AND PUT IN B
|
||||
LD A,E ; GET CIO UNIT NUM FROM E
|
||||
LD C,A ; AND PUT IN C
|
||||
BIT 7,C ; CHECK FOR SPECIAL UNIT CODE
|
||||
BIT 7,E ; CHECK FOR SPECIAL UNIT CODE
|
||||
CALL NZ,SYS_GETCIOFN1 ; IF SO, HANDLE IT
|
||||
PUSH IY ; SAVE IY VALUE
|
||||
LD IY,CIO_TBL ; POINT TO UNIT TABLE
|
||||
CALL HB_DISPCALC ; CALC FN ADR & BLOB ADR
|
||||
EX (SP),IY ; RESTORE IY, BLOB ADR -> TOS
|
||||
POP DE ; BLOB ADR -> DE
|
||||
RET ; AF STILL HAS RESULT OF CALC
|
||||
JP SYS_GETFN ; GO TO COMMON CODE
|
||||
;
|
||||
SYS_GETCIOFN1:
|
||||
LD A,(CB_CONDEV) ; UNIT $80 -> CONSOLE UNIT
|
||||
LD C,A ; REPLACE UNIT VALUE IN C
|
||||
LD E,A ; REPLACE UNIT VALUE IN C
|
||||
RET ; AND BACK TO REGULAR FLOW
|
||||
;
|
||||
;
|
||||
; GET DISK UNIT COUNT
|
||||
;
|
||||
SYS_GETDIOCNT:
|
||||
@@ -2630,6 +2625,18 @@ SYS_GETDIOCNT:
|
||||
XOR A ; SIGNALS SUCCESS
|
||||
RET
|
||||
;
|
||||
; GET DISK UNIT API FN ADR AND DATA ADR
|
||||
; ENTRY:
|
||||
; D: FUNCTION
|
||||
; E: UNIT
|
||||
; RETURNS:
|
||||
; HL: FUNCTION ADDRESS
|
||||
; DE: DATA BLOB ADDRESS
|
||||
;
|
||||
SYS_GETDIOFN:
|
||||
LD IY,DIO_TBL ; POINT TO UNIT TABLE
|
||||
JP SYS_GETFN ; GO TO COMMON CODE
|
||||
;
|
||||
; GET RTC UNIT COUNT
|
||||
;
|
||||
SYS_GETRTCCNT:
|
||||
@@ -2649,13 +2656,57 @@ SYS_GETVDACNT:
|
||||
LD E,A ; PUT IT IN E
|
||||
XOR A ; SIGNALS SUCCESS
|
||||
RET
|
||||
|
||||
;
|
||||
; GET VIDEO UNIT API FN ADR AND DATA ADR
|
||||
; ENTRY:
|
||||
; D: FUNCTION
|
||||
; E: UNIT
|
||||
; RETURNS:
|
||||
; HL: FUNCTION ADDRESS
|
||||
; DE: DATA BLOB ADDRESS
|
||||
;
|
||||
SYS_GETVDAFN:
|
||||
LD IY,VDA_TBL ; POINT TO UNIT TABLE
|
||||
JP SYS_GETFN ; GO TO COMMON CODE
|
||||
;
|
||||
; GET SOUND UNIT COUNT
|
||||
;
|
||||
SYS_GETSNDCNT:
|
||||
LD A,(SND_CNT) ; GET DEVICE COUNT (FIRST BYTE OF LIST)
|
||||
LD E,A ; PUT IT IN E
|
||||
XOR A ; SIGNALS SUCCESS
|
||||
RET
|
||||
|
||||
;
|
||||
; GET SOUND UNIT API FN ADR AND DATA ADR
|
||||
; ENTRY:
|
||||
; D: FUNCTION
|
||||
; E: UNIT
|
||||
; RETURNS:
|
||||
; HL: FUNCTION ADDRESS
|
||||
; DE: DATA BLOB ADDRESS
|
||||
;
|
||||
SYS_GETSNDFN:
|
||||
LD IY,SND_TBL ; POINT TO UNIT TABLE
|
||||
JP SYS_GETFN ; GO TO COMMON CODE
|
||||
;
|
||||
; SHARED CODE TO COMPLETE A FUNCTION LOOKUP
|
||||
; ENTRY:
|
||||
; IY: DISPATCH FUNCTION TABLE
|
||||
; D: FUNCTION ID
|
||||
; E: UNIT NUMBER
|
||||
; EXIT:
|
||||
; HL: DRIVER FUNCTION ADDRESS
|
||||
; DE: DRIVER UNIT DATA ADDRESS
|
||||
;
|
||||
SYS_GETFN:
|
||||
LD A,D ; GET FUNC NUM FROM D
|
||||
LD B,A ; AND PUT IN B
|
||||
LD A,E ; GET UNIT NUM FROM E
|
||||
LD C,A ; AND PUT IN C
|
||||
CALL HB_DISPCALC ; CALC FN ADR & BLOB ADR
|
||||
PUSH IY ; MOVE DATA ADR
|
||||
POP DE ; ... TO DE
|
||||
RET ; AF STILL HAS RESULT OF CALC
|
||||
;
|
||||
; SET SYSTEM PARAMETERS
|
||||
; PARAMETER(S) TO SET INDICATED IN C
|
||||
@@ -2987,7 +3038,7 @@ HB_BADINTCNT .DB 0
|
||||
; AND CALL THE SPECIFIC FUNCTION REQUESTED IN THE DRIVER.
|
||||
;
|
||||
HB_DISPCALL:
|
||||
PUSH HL ; SAVE INCOMING IY VALUE
|
||||
PUSH HL ; SAVE INCOMING HL VALUE
|
||||
CALL HB_DISPCALC ; IY = BLOB ADR, HL = FN ADR
|
||||
JR NZ,HB_DISPCALL1 ; ABORT ON ERROR
|
||||
EX (SP),HL ; RESTORE HL & FN ADR TO TOS
|
||||
|
||||
@@ -100,7 +100,6 @@ BF_SYSGET_CIOFN .EQU $01 ; GET CIO UNIT FN/DATA ADR
|
||||
BF_SYSGET_DIOCNT .EQU $10 ; GET DISK UNIT COUNT
|
||||
BF_SYSGET_DIOFN .EQU $11 ; GET DIO UNIT FN/DATA ADR
|
||||
BF_SYSGET_RTCCNT .EQU $20 ; GET RTC UNIT COUNT
|
||||
BF_SYSGET_RTCFN .EQU $21 ; GET RTC UNIT FN/DATA ADR
|
||||
BF_SYSGET_VDACNT .EQU $40 ; GET VDA UNIT COUNT
|
||||
BF_SYSGET_VDAFN .EQU $41 ; GET VDA UNIT FN/DATA ADR
|
||||
BF_SYSGET_SNDCNT .EQU $50 ; GET VDA UNIT COUNT
|
||||
|
||||
@@ -527,10 +527,14 @@ reboot:
|
||||
call DSKY_SHOWSEG ; display message
|
||||
#endif
|
||||
;
|
||||
; switch to rom bank 0 and jump to address 0
|
||||
ld a,BID_BOOT ; boot bank
|
||||
ld hl,0 ; address zero
|
||||
call HB_BNKCALL ; does not return
|
||||
;; switch to rom bank 0 and jump to address 0
|
||||
;ld a,BID_BOOT ; boot bank
|
||||
;ld ix,0 ; address zero
|
||||
;call HB_BNKCALL ; does not return
|
||||
; cold boot system
|
||||
LD B,BF_SYSRESET ; SYSTEM RESTART
|
||||
LD C,BF_SYSRES_COLD ; COLD START
|
||||
rst 08 ; do it, no return
|
||||
#endif
|
||||
;
|
||||
#if (BIOS == BIOS_UNA)
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
#DEFINE RMN 1
|
||||
#DEFINE RUP 1
|
||||
#DEFINE RTP 0
|
||||
#DEFINE BIOSVER "3.1.1-pre.15"
|
||||
#DEFINE BIOSVER "3.1.1-pre.16"
|
||||
|
||||
@@ -3,5 +3,5 @@ rmn equ 1
|
||||
rup equ 1
|
||||
rtp equ 0
|
||||
biosver macro
|
||||
db "3.1.1-pre.15"
|
||||
db "3.1.1-pre.16"
|
||||
endm
|
||||
|
||||
Reference in New Issue
Block a user