Skip to content

[GB Video] VRAM locking not emulated #1109

@ISSOtm

Description

@ISSOtm

mGB does not prevent writes to VRAM during LCD Mode 3. (For some reason, OAM is properly locked out.)

gb/memory.c:242 return gb->video.vramBank[address & (GB_SIZE_VRAM_BANK0 - 1)];

This should be appended to

if(gb->video.mode == 3) {
    return 0xFF;
}

This needs to also be applied to lines 312-313 (blocking VRAM writes), and to gb/io.c, lines 491/492 and 500/501, peppering

if(gb->video.mode == 3) {
    return;
}

(This blocks GBC palettes during Mode 3)

Example ROM, which exhibits this behavior: https://github.com/eevee/anise-cheezball-rising

Note that even with this applied (on my local fork), the output doesn't match BGB's. Implies timing errors, maybe tested by gekkio's ROMs. But that's a different problem.
image

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