[XCSSA] XCSSA Feb 19th Meeting, 7pm at SAC
xcssa@xcssa.org
xcssa@xcssa.org
Sat, 17 Feb 2007 09:44:06 -0600
On Feb 17, 2007, at 9:21 AM, xcssa-admin@xcssa.org wrote:
> o Z80 and 68000 code "transcoding"
I'm not exactly sure what you mean by this. Though I am porting
stuff over that used to be on the Z80 (and the 6502 as well), I
pretty much just re-wrote everything from scratch. The Z80 code was
so full of pushes and pops due to its small register set that it
wasn't worth "transcoding" anything. About the only thing I kept
intact was the data structures, though I did adjust them for word
alignment.
Really, the most important thing was that the Genesis (and Sega
Master System) uses a video chip design that is derived from the TMS
9918A (a variant of which is used in the Colecovision). It
quadruples the memory, changes all graphics to 4-bit pixels, adds
more sprites, palette registers, and a simple copy/fill DMA, but it
still uses the same basic principles. It even has the same sound
chip (more or less) as the Coleco, plus an FM synth chip with a PCM
channel.
Random trivia: one minor annoying thing about the Genesis is that it
doesn't have a bus error timeout. Most CPUs, and basically all 8-bit
CPUs, expect data transfers to happen in the proper clock window
unless a wait state is asserted. In contrast, the 68000 has a DTACK
(data acknowledge) input which is used by the memory or I/O device to
indicate when a transfer has been completed. Apparently, if DTACK
never gets asserted, the 68000 will just sit there forever, waiting
for a response. Because of this, there needs to be a circuit to
detect the condition and assert BERR (bus error). From what I've
seen, this needs to be a sort of watchdog timer.
But the Genesis doesn't have anything to generate BERR. If you read
an address in a range that isn't assigned to anything, it just locks up.
However, you can ground DTACK and have the 68000 behave just like an
8-bitter with a faster bus, which is where the old 68000 newsletter
"DTACK Grounded" got its name.
- Bruce -