@Turtle_Quality
Thank you for your kind words. I still have lots to do. My current implementation is still very basic.
It does support the entire Z80 instruction set, both documented and undocumented, however as far as flags are concerned only the documented ones are handled for now. Floating bus, contention, proper timing... all these are currently still missing.
I was as surprised as excited when I saw that so many games are actually working even with such a basic emulation
.
@scoppack ,
@Turtle_Quality
One of the biggest mistakes I made was to not develop a proper debugger for the project, but then again, the entire project pretty much evolved on the fly, without much planning. Basically, my rudimentary 'debugger', when enabled, just dumps the state of the registers to the console after an executed instruction.
Mazeball works too. However, behind the scenes it seems to exhibit the same 'ROM-write attempt' behavior as
8bitTris.
More and more, I'm starting to have the feeling that maybe some well hidden bug is lurking inside my emulator
.
I would definitely not rule out that possibility
.
I managed to collect some logs from
8bitTris when the 'ROM-write attempt' happened, but they seem to be kind of strange.
It seems that NOPs are executed in a loop while a counter is running (as shown by the PC and the BC reg pair). I encountered the same thing while running Mazeball too.
Maybe we should take a look at this on a well established and "
trusted to work correctly" emulator
Code: Select all
ROM write attempted at: 0x0 , data: 0xf9
37918. OP: 0 NOP PC: B6BA SP: FF23 BC: 0008 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 3C F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37919. OP: 0 NOP PC: B6BC SP: FF23 BC: 0008 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 3E F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37920. OP: 0 NOP PC: B6BE SP: FF23 BC: 0008 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 40 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37921. OP: 0 NOP PC: B6BF SP: FF23 BC: 0008 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 41 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37922. OP: 0 NOP PC: B6C0 SP: FF25 BC: 0008 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 42 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37923. OP: 0 NOP PC: B6B4 SP: FF25 BC: FF08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 43 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37924. OP: 0 NOP PC: B6B5 SP: FF23 BC: FF08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 44 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37925. OP: 0 NOP PC: B6B8 SP: FF23 BC: FF08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 45 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37926. OP: 0 NOP PC: B6BA SP: FF23 BC: FF08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 47 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37927. OP: 0 NOP PC: B6BC SP: FF23 BC: FF08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 49 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37928. OP: 0 NOP PC: B6BE SP: FF23 BC: FF08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 4B F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37929. OP: 0 NOP PC: B6BF SP: FF23 BC: FF08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 4C F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37930. OP: 0 NOP PC: B6C0 SP: FF25 BC: FF08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 4D F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37931. OP: 0 NOP PC: B6B4 SP: FF25 BC: FE08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 4E F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37932. OP: 0 NOP PC: B6B5 SP: FF23 BC: FE08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 4F F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37933. OP: 0 NOP PC: B6B8 SP: FF23 BC: FE08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 50 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37934. OP: 0 NOP PC: B6BA SP: FF23 BC: FE08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 52 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37935. OP: 0 NOP PC: B6BC SP: FF23 BC: FE08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 54 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37936. OP: 0 NOP PC: B6BE SP: FF23 BC: FE08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 56 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37937. OP: 0 NOP PC: B6BF SP: FF23 BC: FE08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 57 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37938. OP: 0 NOP PC: B6C0 SP: FF25 BC: FE08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 58 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37939. OP: 0 NOP PC: B6B4 SP: FF25 BC: FD08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 59 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37940. OP: 0 NOP PC: B6B5 SP: FF23 BC: FD08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 5A F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37941. OP: 0 NOP PC: B6B8 SP: FF23 BC: FD08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 5B F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37942. OP: 0 NOP PC: B6BA SP: FF23 BC: FD08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 5D F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37943. OP: 0 NOP PC: B6BC SP: FF23 BC: FD08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 5F F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
ROM write attempted at: 0x0 , data: 0xf9
37944. OP: 0 NOP PC: B6BE SP: FF23 BC: FD08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 61 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37945. OP: 0 NOP PC: B6BF SP: FF23 BC: FD08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 62 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37946. OP: 0 NOP PC: B6C0 SP: FF25 BC: FD08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 63 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37947. OP: 0 NOP PC: B6B4 SP: FF25 BC: FC08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 64 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37948. OP: 0 NOP PC: B6B5 SP: FF23 BC: FC08 DE: 0101 HL: 0101 IX: 013C IY: 5C3A AF: 0885 R: 65 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
37949. OP: 0 NOP PC: B6B8 SP: FF23 BC: FC08 DE: 0101 HL: 0000 IX: 013C IY: 5C3A AF: 0885 R: 66 F: 10000101. AF': 0044 BC': 0000 DE': 369B HL': 2758
...
COUNTER CONTINUED
...
On the other hand, it does seem to be a somehow "organized" loop, in the sense that it doesn't seem to be a random "code ran of the tracks" one.
I'm not yet sure what to make of this, to be honest
. If anybody recognizes this kind of loop-pattern, let us know