Skip to content

Commit

Permalink
ACIA Interrupt Fix & ROMless APPBOOT Fix
Browse files Browse the repository at this point in the history
- ACIA driver was not properly returning ZF to indicate if it handled an interrupt.
- APPBOOT was failing on ROMless systems because it was copying the HBIOS code overtop of itself.
  • Loading branch information
wwarthen committed Nov 9, 2023
1 parent 7e9191f commit 10ff97b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Source/HBIOS/acia.asm
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ ACIA_INTRCV:
; CHECK TO SEE IF SOMETHING IS ACTUALLY THERE
LD C,(IY+3) ; CMD/STAT PORT TO C
IN A,(C) ; GET STATUS
RRA ; READY BIT TO CF
RET NC ; NOTHING AVAILABLE ON CURRENT CHANNEL
AND $01 ; ISOLATE READY BIT
RET Z ; IF NOT READY, RET W/ ZF SET (INT NOT HANDLED)
;
ACIA_INTRCV1:
; RECEIVE CHARACTER INTO BUFFER
Expand Down
34 changes: 13 additions & 21 deletions Source/HBIOS/hbios.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1602,51 +1602,43 @@ MBC_SINGLE:
;
#ENDIF
;
; IF ALREADY EXECUTING IN RAM, BYPASS RAM BANK INSTALLATION
;
LD A,(HB_RAMFLAG)
OR A
JR NZ,HB_START1
;
; IF BID_BOOT AND BID_BIOS ARE THE SAME, THEN IT IS NEVER APPROPRIATE
; TO COPY THE HBIOS IMAGE FROM BID_BOOT TO BID_BIOS. THIS IS TYPICALLY
; THE CASE FOR A ROMLESS SYSTEM.
;
#IF (BID_BOOT != BID_BIOS)
;
; INSTALL HBIOS IN RAM BANK
;
LD A,(HB_CURBNK)
;
; CHECK TO SEE IF WE ARE ALREADY RUNNING IN THE HBIOS
; BANK AND SKIP THE COPY IF SO (DON'T COPY OVER OURSELVES).
; THIS SITUATION OCCURS ON A ROMLESS STARTUP OR WHEN DOING A
; FULL RESTART OF A SYSTEM USING THE EXISTING HBIOS COPY.
CP BID_BIOS
JR Z,HB_START1
;
LD (HB_SRCBNK),A
LD A,BID_BIOS
LD (HB_DSTBNK),A
LD HL,0
LD DE,0
LD BC,$8000
#IF (MEMMGR == MM_Z280)
#IF (MEMMGR == MM_Z280)
CALL Z280_BNKCPY
#ELSE
#ELSE
CALL HBX_BNKCPY
#ENDIF
#ENDIF
;
; TRANSITION TO HBIOS IN RAM BANK
;
#IF (MEMMGR == MM_Z280)
#IF (MEMMGR == MM_Z280)
LD A,BID_BIOS
LD B,$10 ; FIRST SYSTEM PDR
CALL Z280_BNKSEL
JR HB_START1
#ELSE
#ELSE
LD A,BID_BIOS ; BIOS BANK ID
LD IX,HB_START1 ; EXECUTION RESUMES HERE
CALL HBX_BNKCALL ; CONTINUE IN RAM BANK, DO NOT RETURN
HALT ; WE SHOULD NOT COME BACK HERE!
#ENDIF
;
#ENDIF
;
HB_RAMFLAG .DB FALSE ; INITIALLY FALSE, SET TO TRUE BELOW AFTER RAM TRANSITION
;
; EXECUTION RESUMES HERE AFTER SWITCH TO RAM BANK
;
HB_START1: ; BNKCALL ARRIVES HERE, BUT NOW RUNNING IN RAM BANK
Expand Down
2 changes: 1 addition & 1 deletion Source/ver.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#DEFINE RMN 4
#DEFINE RUP 0
#DEFINE RTP 0
#DEFINE BIOSVER "3.4.0-dev.16"
#DEFINE BIOSVER "3.4.0-dev.17"
#define rmj RMJ
#define rmn RMN
#define rup RUP
Expand Down
2 changes: 1 addition & 1 deletion Source/ver.lib
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ rmn equ 4
rup equ 0
rtp equ 0
biosver macro
db "3.4.0-dev.16"
db "3.4.0-dev.17"
endm

0 comments on commit 10ff97b

Please sign in to comment.