Fix c99 Z80 impl to accept ZEXALL test.

This commit is contained in:
Роман Бойков 2026-03-10 16:37:30 +03:00
parent ed43a19a10
commit db6ca6e0f8
3 changed files with 3 additions and 20 deletions

View File

@ -304,16 +304,12 @@ func (f *FloppyDriveController) Drq() byte {
}
func (f *FloppyDriveController) LoadFloppy() {
log.Debug("Load Floppy B")
loadFloppy(&f.sectors[0], f.floppyBFile)
log.Debug("Load Floppy C")
loadFloppy(&f.sectors[1], f.floppyCFile)
}
func (f *FloppyDriveController) SaveFloppy() {
log.Debug("Save Floppy B")
saveFloppy(&f.sectors[0], f.floppyBFile)
log.Debug("Save Floppy C")
saveFloppy(&f.sectors[1], f.floppyCFile)
}
@ -373,8 +369,7 @@ func (f *FloppyDriveController) Sector() byte {
return f.sectorNo
}
//
// loadFloppy load floppy image to sector buffer from file
func loadFloppy(sectors *[SizeInSectors]SectorType, fileName string) {
log.Debugf("Load Floppy content from file %s.", fileName)
file, err := os.Open(fileName)

View File

@ -2,19 +2,6 @@ package c99
import log "github.com/sirupsen/logrus"
// GetBit return bit "n" from byte "val"
func getBit(n byte, val byte) byte {
return ((val) >> (n)) & 1
}
func getBit3(val byte) bool {
return (val & 0x08) != 0
}
func getBit5(val byte) bool {
return (val & 0x20) != 0
}
func (z *Z80) rb(addr uint16) byte {
return z.core.MemRead(addr)
}

View File

@ -356,7 +356,8 @@ func (z *Z80) ldi() {
// for the calculation of xf/yf on LDI
result := val + z.a
z.updateXY(result)
z.xf = result&0x08 != 0 // bit 3
z.yf = result&0x02 != 0 // bit 1
z.nf = false
z.hf = false