Compare commits

...

2 Commits

Author SHA1 Message Date
Wayne Warthen
c628ba10f2 Workaround Z280 CPU Bug for LZSA2
The LZSA2 decompressor invoked a known Z280 CPU bug.  A small modification to the code resolves this.
2023-05-07 17:45:43 -07:00
Wayne Warthen
9358299f14 Z280 Workaround for VGARC
Z280 is having an issue with OTDR instruction when loading the font for VGARC.  For now, the use of OTDR has been eliminated.
2023-05-07 16:27:25 -07:00
12 changed files with 67 additions and 21 deletions

View File

@@ -5,6 +5,7 @@ Version 3.3
- A?C: Support for SD PIO
- A?C: Support for Z80-Retro SD interface
- WBW: Support per-drive floppy configuration
- WBW: Support for Bill Shen's VGARC
Version 3.2.1
-------------

View File

@@ -3808,6 +3808,7 @@ the RomWBW HBIOS configuration.
- WDC Floppy Disk Controller w/ 3.5" HD Drives
- Onboard IDE Hard Disk Interface Module
- PPIDE Hard Disk Interface Module
- VGARC Video & Keyboard Module
- Serial baud rate is usually determined by hardware for ACIA and
SIO interfaces
@@ -3831,6 +3832,7 @@ the RomWBW HBIOS configuration.
- WDC Floppy Disk Controller w/ 3.5" HD Drives
- Onboard IDE Hard Disk Interface Module
- PPIDE Hard Disk Interface Module
- VGARC Video & Keyboard Module
- Serial baud rate is usually determined by hardware for ACIA and
SIO interfaces
@@ -3854,6 +3856,7 @@ the RomWBW HBIOS configuration.
- WDC Floppy Disk Controller w/ 3.5" HD Drives
- Onboard IDE Hard Disk Interface Module
- PPIDE Hard Disk Interface Module
- VGARC Video & Keyboard Module
- Serial baud rate is usually determined by hardware for ACIA and
SIO interfaces
@@ -3923,6 +3926,6 @@ may be discovered by RomWBW in your system.
| USB-FIFO | Char | FT232H-based ECB USB FIFO |
| VDU | Video | MC6845 Family Video Display Controller |
| VGA | Video | HD6445CP4-based Video Display Controller |
| VRC | Video | VGARC Video Display Controller s |
| VRC | Video | VGARC Video Display Controller |
| YM | Audio | YM2612 Programmable Sound Generator |
| Z2U | Char | Zilog Z280 CPU Built-in Serial Ports |

View File

@@ -11,8 +11,8 @@ echo Preparing compressed font files...
lzsa -f2 -r font8x8u.bin font8x8c.bin || exit /b
lzsa -f2 -r font8x11u.bin font8x11c.bin || exit /b
lzsa -f2 -r font8x16u.bin font8x16c.bin || exit /b
lzsa -f2 -r fontcgau.bin fontcgac.bin || exit /b
lzsa -f2 -r fontvgarcu.bin fontvgarcc.bin || exit /b
fonttool font8x8u.bin > font8x8u.asm || exit /b
fonttool font8x11u.bin > font8x11u.asm || exit /b
@@ -20,6 +20,7 @@ fonttool font8x16u.bin > font8x16u.asm || exit /b
fonttool font8x8c.bin > font8x8c.asm || exit /b
fonttool font8x11c.bin > font8x11c.asm || exit /b
fonttool font8x16c.bin > font8x16c.asm || exit /b
fonttool fontcgau.bin > fontcgau.asm || exit /b
fonttool fontcgac.bin > fontcgac.asm || exit /b
fonttool fontvgarcu.bin > fontvgarcu.asm || exit /b
fonttool fontvgarcc.bin > fontvgarcc.asm || exit /b

View File

@@ -1,8 +1,8 @@
OBJECTS = \
font8x8u.asm font8x11u.asm font8x16u.asm fontcgau.asm \
font8x8c.asm font8x11c.asm font8x16c.asm fontcgac.asm
font8x8u.asm font8x11u.asm font8x16u.asm fontcgau.asm fontvgarcu.asm \
font8x8c.asm font8x11c.asm font8x16c.asm fontcgac.asm fontvgarcc.asm
OTHERS = font8x8c.bin font8x11c.bin font8x16c.bin fontcgac.bin
OTHERS = font8x8c.bin font8x11c.bin font8x16c.bin fontcgac.bin fontvgarcc.bin
TOOLS = ../../Tools
@@ -26,5 +26,8 @@ font8x16c.bin: font8x16u.bin
fontcgac.bin: fontcgau.bin
$(BINDIR)/lzsa -f2 -r $< $@
fontvgarcc.bin: fontvgarcu.bin
$(BINDIR)/lzsa -f2 -r $< $@
%.asm: %.bin
$(BINDIR)/bin2asm $< > $@

BIN
Source/Fonts/fontvgarcu.bin Normal file

Binary file not shown.

View File

@@ -24,7 +24,8 @@ endif
include $(TOOLS)/Makefile.inc
FONTS := font8x11c.asm font8x11u.asm font8x16c.asm font8x16u.asm font8x8c.asm font8x8u.asm fontcgac.asm fontcgau.asm
FONTS := font8x11c.asm font8x11u.asm font8x16c.asm font8x16u.asm font8x8c.asm font8x8u.asm \
fontcgac.asm fontcgau.asm fontvgarcc.asm fontvgarcu.asm
ifeq ($(CPUFAM),2)
TASM=$(BINDIR)/uz80as -t hd64180

View File

@@ -20,7 +20,7 @@ CPUFAM .EQU CPU_Z280 ; CPU FAMILY: CPU_[Z80|Z180|Z280]
BIOS .EQU BIOS_WBW ; HARDWARE BIOS: BIOS_[WBW|UNA]
BATCOND .EQU FALSE ; ENABLE LOW BATTERY WARNING MESSAGE
HBIOS_MUTEX .EQU FALSE ; ENABLE REENTRANT CALLS TO HBIOS (ADDS OVERHEAD)
USELZSA2 .EQU FALSE ; ENABLE FONT COMPRESSION
USELZSA2 .EQU TRUE ; ENABLE FONT COMPRESSION
TICKFREQ .EQU 50 ; DESIRED PERIODIC TIMER INTERRUPT FREQUENCY (HZ)
;
BOOT_TIMEOUT .EQU -1 ; AUTO BOOT TIMEOUT IN SECONDS, -1 TO DISABLE, 0 FOR IMMEDIATE

View File

@@ -6225,6 +6225,16 @@ FONTCGA:
.ECHO " CGA"
#ENDIF
;
#IFDEF USEFONTVGARC
FONTVGARC:
#IF USELZSA2
#INCLUDE "fontvgarcc.asm"
#ELSE
#INCLUDE "fontvgarcu.asm"
#ENDIF
.ECHO " VGARC"
#ENDIF
;
SIZ_FONTS .EQU $ - ORG_FONTS
.ECHO " occupy "
.ECHO SIZ_FONTS

View File

@@ -60,8 +60,8 @@
; 3. This notice may not be removed or altered from any source distribution.
;
; #DEFINE BACKWARD_DECOMPRESS ; uncomment for data compressed with option -b (+5 bytes, -3% speed)
; #DEFINE AVOID_SELFMODIFYING_CODE ; uncomment to disallow self-modifying code (-1 byte, -4% speed)
; #DEFINE BACKWARD_DECOMPRESS ; uncomment for data compressed with option -b (+5 bytes, -3% speed)
; #DEFINE AVOID_SELFMODIFYING_CODE ; uncomment to disallow self-modifying code (-1 byte, -4% speed)
#IFNDEF BACKWARD_DECOMPRESS
@@ -79,7 +79,7 @@
#DEFINE ADD_OFFSET \
#DEFCONT \ ld a,e \ sub l \ ld l,a
#DEFCONT \ ld a,d \ sbc h \ ld h,a ; 6*4 = 24t / 6 bytes
#DEFCONT \ ld a,d \ sbc h \ ld h,a ; 6*4 = 24t / 6 bytes
#DEFINE BLOCKCOPY \
#DEFCONT \ lddr
@@ -118,7 +118,7 @@ MatchLen: and %00000111 \ add a,2 \ cp 9
call z,ExtendedCode
CopyMatch: ld c,a
push hl ; BC = len, DE = dest, HL = -offset, SP -> [src]
push hl ; BC = len, DE = dest, HL = -offset, SP -> [src]
#IFNDEF AVOID_SELFMODIFYING_CODE
PrevOffset .EQU $+1 \ ld hl,0
@@ -126,8 +126,8 @@ PrevOffset .EQU $+1 \ ld hl,0
push ix \ pop hl
#ENDIF
ADD_OFFSET
BLOCKCOPY ; BC = 0, DE = dest
pop hl ; HL = src
BLOCKCOPY ; BC = 0, DE = dest
pop hl ; HL = src
ReadToken: ld a,(hl) \ NEXT_HL \ push af
and %00011000 \ jr z,NoLiterals
@@ -163,12 +163,16 @@ ExtendedCode: call ReadNibble \ inc a \ jr z,ExtraByte
ExtraByte ld a,15 \ add a,c \ add a,(hl) \ NEXT_HL \ ret nc
ld a,(hl) \ NEXT_HL
ld b,(hl) \ NEXT_HL \ ret nz
pop bc ; RET is not needed, because RET from ReadNibble is sufficient
pop bc ; RET is not needed, because RET from ReadNibble is sufficient
ReadNibble: ld c,a
skipLDCA xor a \ ex af,af' \ ret m
skipLDCA xor a \ nop \ ex af,af' \ ret m ; NOP for Z280 bug
ld a,(hl) \ or $F0 \ ex af,af'
ld a,(hl) \ NEXT_HL \ or $0F
rrca \ rrca \ rrca \ rrca \ ret
; The extraneous NOP instruction above is to workaround a bug in the
; Z280 processor where ex af,af' can copy rather than swap the flags
; register.
; See https://www.retrobrewcomputers.org/forum/index.php?t=msg&goto=10183&

View File

@@ -21,8 +21,8 @@ VRC_KBDST .EQU $F5
VRC_ROWS .EQU 48
VRC_COLS .EQU 64
;
#DEFINE USEFONT8X8
#DEFINE VRC_FONT FONT8X8
#DEFINE USEFONTVGARC
#DEFINE VRC_FONT FONTVGARC
;
TERMENABLE .SET TRUE ; INCLUDE TERMINAL PSEUDODEVICE DRIVER
;
@@ -283,9 +283,14 @@ VRC_LOADFONT:
LD HL,VRC_FONT ; START OF FONT DATA
#ENDIF
;
#IF 0
; THIS APPROACH TO LOADING FONTS IS BEST (FASTEST), BUT IS
; CAUSING ARTIFACTS ON THE DISPLAYED FONTS WHEN RUN ON A
; Z280. IT IS NOT CLEAR WHAT THE PROBLEM IS (POSSIBLY
; Z280 BUG), BUT FOR NOW WE AVOID THIS AND USE AN
; ALTERNATIVE APPROACH BELOW.
LD DE,0+(128*8)-1 ; LENGTH OF FONT DATA - 1
ADD HL,DE ; ADD TO HL
; LD HL,ENDFONT-1
LD BC,VRC_FONTBASE+3 ; WORK BACKWARDS
OTDR ; DO 4 PAGES
DEC C
@@ -295,6 +300,24 @@ VRC_LOADFONT:
DEC C
OTDR
DEC C
#ENDIF
;
#IF 1
; ALTERNATIVE APPROACH TO LOADING FONTS. THIS ONE AVOIDS
; THE USE OF OTDR WHICH SEEMS TO CAUSE PROBLEMS ON Z280.
LD B,0
LD C,VRC_FONTBASE
VRC_LOADFONT1:
LD A,(HL)
OUT (C),A
INC HL
INC B
JR NZ,VRC_LOADFONT1
INC C
LD A,C
CP VRC_FONTBASE + 4
JR NZ,VRC_LOADFONT1
#ENDIF
;
#IF USELZSA2
LD HL,(VRC_STACK) ; ERASE DECOMPRESS BUFFER

View File

@@ -2,7 +2,7 @@
#DEFINE RMN 3
#DEFINE RUP 0
#DEFINE RTP 0
#DEFINE BIOSVER "3.3.0-dev.10"
#DEFINE BIOSVER "3.3.0-dev.12"
#define rmj RMJ
#define rmn RMN
#define rup RUP

View File

@@ -3,5 +3,5 @@ rmn equ 3
rup equ 0
rtp equ 0
biosver macro
db "3.3.0-dev.10"
db "3.3.0-dev.12"
endm