Skip to content

Newly released Populous ROM has bad graphics #787

Open
@awjackson

Description

@awjackson

The newly released ROM of the unreleased game Populous has completely garbled graphics in FCEUX.

The game uses MMC1 with CHR RAM--it seems to be intended for a bog standard SNROM PCB. It never initializes either of the first two MMC1 registers, control or CHR bank 0. Instead it writes 0 to the CHR bank 1 register ($C000-DFFF) on reset, then afterwards only ever writes to the PRG register ($E000-$FFFF).

This would work if the MMC1 were to power up either in 8KB CHR bank mode or with the low bit of CHR bank 0 set. However, FCEUX forces the MMC1 to power up in the following state:

static void MMC1CMReset(void) {
        int i;

        for (i = 0; i < 4; i++)
                DRegs[i] = 0;
        Buffer = BufferShift = 0;
        DRegs[0] = 0x1F;

        DRegs[1] = 0;
        DRegs[2] = 0;   // Should this be something other than 0?
        DRegs[3] = 0;

This initial state combined with the incomplete mapper initialization Populous does means that the first half of CHR RAM ends up mirrored at both $0000 and $1000 and the second half of CHR RAM ends up not mapped at all. This seems to be the cause of the incorrect graphics.

Simple fix would be to change the power-on state of DRegs[0] to 0x0F (8KB CHR banking mode) which is what other NES emulators like Mesen seem to do. I expect there are very few if any other MMC1 games, either commercial or homebrew, that never initialize this register.

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