Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!comp.vuw.ac.nz!windy!srwmpnm From: srwmpnm@windy.dsir.govt.nz Newsgroups: comp.sys.amiga.emulations Subject: Re: 8 methods to emulate a Z80 Summary: Recode system calls in 68000 Keywords: Spectrum Emulator Z80 68000 Message-ID: <18851.27dcddaf@windy.dsir.govt.nz> Date: 12 Mar 91 13:54:54 GMT References: <18847.27d80900@windy.dsir.govt.nz> <18850.27dbf20e@windy.dsir.govt.nz> Organization: DSIR, Wellington, New Zealand Lines: 22 > One method that might help to speed up your emulator is to recode >the spectrum rom into 68000 calls to AmigaDOS. Yes, that works extremely well for CP/M and IBM emulators. But the Spectrum ROM does not have (many) well defined entry points, which makes that harder to do. The emulator has to be prepared for programs that jump in to the ROM anywhere, or which use any part of it as data. With threaded code (method 8, 1st post), what needs to be done, at each known ROM entry point, is to set the vector for that location to point to a system-call handling routine instead of to an instruction handling routine. That totally eliminates the overhead required in other methods to check for system calls. Most machine-code programs on the Spectrum ignore the ROM and bang on the hardware to do IO. Fortunately the Spectrum hardware (keyboard, screen) is relatively easy to emulate. I would prefer some sort of automatic compiler to recoding the ROM in 68000 by hand. I haven't looked at the ROM code, and I probably shouldn't anyway. Peter McGavin. (srwmpnm@wnv.dsir.govt.nz)