Skip to content

Commit

Permalink
Update cvdu.asm
Browse files Browse the repository at this point in the history
- Improves compatibility with high speed CPUs.
  • Loading branch information
wwarthen committed Jan 8, 2025
1 parent a27f247 commit 8a16b85
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions Source/HBIOS/cvdu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
; - IMPLEMENT SET CURSOR STYLE (VDASCS) FUNCTION
; - IMPLEMENT ALTERNATE DISPLAY MODES?
; - IMPLEMENT DYNAMIC READ/WRITE OF CHARACTER BITMAP DATA?
; - IMPLEMENT TIMEOUT ON PROBE
;
;======================================================================
; CVDU DRIVER - CONSTANTS
Expand Down Expand Up @@ -295,6 +294,16 @@ CVDU_WR:
PUSH AF ; SAVE VALUE TO WRITE
LD A,C ; SET A TO CVDU REGISTER TO SELECT
OUT (CVDU_REG),A ; WRITE IT TO SELECT THE REGISTER
;
#IF (CPUMHZ > 8)
; FASTER CPUS NEED A SMALL DELAY BEFORE THEY CAN START
; POLLING THE CVDU STATUS. THIS IS NOT IDEAL BECAUSE THE
; CONDITIONAL IS BASED ON THE CPU CONFIG SPEED, NOT THE
; DYNAMIC CPU SPEED.
NOP
NOP
#ENDIF
;
CVDU_WR1:
IN A,(CVDU_STAT) ; GET CVDU STATUS
BIT 7,A ; CHECK BIT 7
Expand All @@ -320,6 +329,16 @@ CVDU_WRX:
CVDU_RD:
LD A,C ; SET A TO CVDU REGISTER TO SELECT
OUT (CVDU_REG),A ; WRITE IT TO SELECT THE REGISTER
;
#IF (CPUMHZ > 8)
; FASTER CPUS NEED A SMALL DELAY BEFORE THEY CAN START
; POLLING THE CVDU STATUS. THIS IS NOT IDEAL BECAUSE THE
; CONDITIONAL IS BASED ON THE CPU CONFIG SPEED, NOT THE
; DYNAMIC CPU SPEED.
NOP
NOP
#ENDIF
;
CVDU_RD1:
IN A,(CVDU_STAT) ; GET CVDU STATUS
BIT 7,A ; CHECK BIT 7
Expand Down Expand Up @@ -350,13 +369,13 @@ CVDU_PROBE1:
LD A,(HL) ; BYTE
INC HL
OUT (C),A ; WRITE IT
LD DE,25
LD DE,50
CALL VDELAY
DJNZ CVDU_PROBE1
;
IN A,(CVDU_DATA)
LD C,A
LD DE,25
LD DE,50
CALL VDELAY
IN A,(CVDU_DATA)
CPL
Expand Down

0 comments on commit 8a16b85

Please sign in to comment.