Skip to content

Invalid memory writes #2

@dtabacaru

Description

@dtabacaru

I am trying to integrate these tests in my emulator, but I keep having to make changes that I would rather not have to in order to accommodate these.

The main problem is writing to invalid memory addresses.

At first, I noticed a few writes to the fixed ROM bank sections. My emulator throws an exception if attempting to write to these other than in the initial ROM loading phase.

I said fine - I guess these tests should test the ROM bank areas so I changed my emulator accordingly.

However, I am at test "02 0093" and here it is trying to write to the prohibited section - address 65216 = 0xFEC0.

What's worse, is the test expects now to read the value it wrote - 252 at that address 0xFEC0.

Not only is this a prohibited read - but according to pandocs, there would be no way to read '252' on the official hardware:

"Nintendo indicates use of this area is prohibited. This area returns $FF when OAM is blocked, and otherwise the behavior depends on the hardware revision.

On DMG, MGB, SGB, and SGB2, reads during OAM block trigger OAM corruption. Reads otherwise return $00."

Am I missing something here? I would expect the read to be $FF or $00.

If not, is there any way to update these to be pseudo-random as to not hit restricted memory areas?

I will for now temporarily consider these areas as regular RAM for the sake of running the tests, but the code is getting ugly having to support all these cases!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions