View Single Post
Old 06 September 2019, 22:34   #8
SyX
Registered User
 
Join Date: Sep 2004
Location: Brasil
Age: 49
Posts: 181
Something like DanScott says, you can put the z80 registers in memory and use an address register for offsets.

Or you can put them in the 68000 registers, something like this:
Code:
F/F' -> D3 (Z80 Flag register) | 2 * 8 bits

A/A' -> D4 (Z80 Accumulator) | 2 * 8 bits

BC/BC' -> D5 | 2 * 16 bits

DE/DE' -> D6 | 2 * 16 bits

HL/HL' -> D7 | 2 * 16 bits

IX -> A3 (Index registers are usually used as pointers) 16 bits

IY -> A4 (Index registers are usually used as pointers) 16 bits

PC -> A5 (Z80 PC) 16 bits

SP -> A6 (Z80 Stack) 16 bits
Pacman arcade doesn't use the R or I registers, because that you only need to consider the normal registers and their shadow copy. And you have available the rest of 68000 registers for all the math and logical operations (use rotate and swap for extract z80 registers fast).

The Spectrum emulator from Peter McGavin, than drHirudo posted, it has a nice interface for using. Includes a function that you call and say how many z80 instructions you want to execute... although you will need to modify a few specific instructions (OUT, IN and HALT mainly) because they are specialized to do zx spectrum things.

Although i would not discard the source code conversion yet. In the atari 800 world, that approach has made possible a few zx games conversions with great success (a lot of those conversion look faster in Atari 800 than in the original ZX).

They pass the z80 disassembly source through a c tool that generated the 6502 source that can be assembled later + a few routines that "emulate" the most complex z80 instructions (LDIR, ...) and specific atari code for handling input, graphics, ...

You can get more information about this approach here.
SyX is offline  
 
Page generated in 0.04318 seconds with 11 queries