Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPUSim Register access Corruption ($2007 I/F Bug) #196

Open
ogamespec opened this issue Jun 19, 2022 · 7 comments
Open

PPUSim Register access Corruption ($2007 I/F Bug) #196

ogamespec opened this issue Jun 19, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@ogamespec
Copy link
Member

Sometimes there are some white strips under the menu. Scrolling bug? SPR0 Hit?

image

image

Super Mario Bros. (JU) [!]_RegDump.zip

Reported by @eugene-s-nesdev

@ogamespec ogamespec changed the title [PPUSim] Strange artifacts on the menu border (SPR0 Hit?) [Super Mario Bros. (JU) [!]] [PPUSim] Strange artifacts on the menu border (SPR0 Hit?) Feb 10, 2023
@ogamespec ogamespec added the wtf label Feb 10, 2023
@ogamespec
Copy link
Member Author

ogamespec commented Feb 26, 2023

It looks like the model to use CPU-PPU I/F is unsatisfactory and needs to be converted to CPU clock (PHI0) so that the registers writes are not different from the real 6502.

@Gumball2415 made a demo with palette entries "flying by" for this reason:
https://github.com/Gumball2415/nes-scribbles/tree/main/nrom-composite-waveform

@ogamespec
Copy link
Member Author

Remade the model in CPU Clock (identical to how the CPU does LDA/STA in the PPU registers), but it did not help.
After some research it turned out that most likely it is inaccurate simulation of PPU DB internal bus impedance (values from it do not go where they should after turning off CPU I/F).
Obviously it is somewhere in our favorite VRAM controller ($2007 I/F) (vram_ctrl.cpp).
Further research is needed.

@ogamespec ogamespec changed the title [Super Mario Bros. (JU) [!]] [PPUSim] Strange artifacts on the menu border (SPR0 Hit?) PPU Register Corruption Mar 13, 2023
@ogamespec ogamespec changed the title PPU Register Corruption PPUSim Register access Corruption Mar 13, 2023
@ogamespec ogamespec changed the title PPUSim Register access Corruption PPUSim Register access Corruption ($2007 I/F Bug) Mar 18, 2023
@ogamespec ogamespec added bug Something isn't working and removed wtf labels Mar 22, 2023
@ogamespec
Copy link
Member Author

Fixed. Bug in TVZB signal evaluation:

        // TVZ/TVZB

        temp[0] = NOT(BLNK);
        temp[1] = NOT(TVIN);
        temp[2] = ppu->wire.n_TVO[0];
        temp[3] = ppu->wire.TVO[1];            // !!!   --- bug, should be in TVZ only
        temp[4] = ppu->wire.n_TVO[2];
        temp[5] = ppu->wire.n_TVO[3];
        temp[6] = ppu->wire.n_TVO[4];
        TVZB = NOR7(temp);

        temp[0] = BLNK;
        TVZ = NOR7(temp);

image

@ogamespec ogamespec reopened this Jul 26, 2023
@ogamespec
Copy link
Member Author

it's back :/

image

@ogamespec
Copy link
Member Author

mariwa_ppu.zip

@ogamespec
Copy link
Member Author

image
On the full NESBoard simulator, everything is ok.

@ogamespec
Copy link
Member Author

Add the PPU regdump to breaknes and compare it to what comes out of Nintendulator. Maybe the problem is in the writes to registers, which are not very correctly performed from regdump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant