Browse Source

Workaround Z280 CPU Bug for LZSA2

The LZSA2 decompressor invoked a known Z280 CPU bug.  A small modification to the code resolves this.
patch v3.3.0-dev.12
Wayne Warthen 3 years ago
parent
commit
c628ba10f2
  1. 2
      Source/HBIOS/cfg_rcz280.asm
  2. 6
      Source/HBIOS/unlzsa2s.asm
  3. 2
      Source/ver.inc
  4. 2
      Source/ver.lib

2
Source/HBIOS/cfg_rcz280.asm

@ -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

6
Source/HBIOS/unlzsa2s.asm

@ -167,8 +167,12 @@ ExtraByte ld a,15 \ add a,c \ add a,(hl) \ NEXT_HL \ ret nc
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&

2
Source/ver.inc

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

2
Source/ver.lib

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

Loading…
Cancel
Save