mirror of
https://github.com/romychs/Ocean-240.2-Emulator.git
synced 2026-04-21 11:03:21 +03:00
Fix c99 Z80 impl to accept ZEXALL test.
This commit is contained in:
parent
ed43a19a10
commit
db6ca6e0f8
@ -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)
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user