Search found 6 matches

by LuckyLuke
Thu Mar 26, 2020 4:23 am
Forum: NESemdev
Topic: NES APU synchronization problems
Replies: 1
Views: 1071

NES APU synchronization problems

Hi, I'm writing a NES emulator, and I'm trying to implement the APU. I'm using SDL to communicate with the sound card, and I sync my emu with the audio thread by calling the main clock function inside the audio callback: void Game::UpdateStateSyncWithAudio() { double cyclesPerBuffer = 5.369318 * 100...
by LuckyLuke
Thu Mar 26, 2020 4:00 am
Forum: NESemdev
Topic: NES PPU pixel accurate rendering problems
Replies: 7
Views: 2985

Re: NES PPU pixel accurate rendering problems

Oh wow that's a nasty bug haha. Did you happen to debug and see what values it was producing?? It was storing adjacent bit fields without crossing allocation unit boundaries. I learned the hard way that bit fields are implementation (aka compiler) defined behavior, I'm using Visual Studio 2019. So ...
by LuckyLuke
Fri Mar 13, 2020 2:04 pm
Forum: NESemdev
Topic: NES PPU pixel accurate rendering problems
Replies: 7
Views: 2985

Re: NES PPU pixel accurate rendering problems

You can post your code here. The increment may be fine but how the Y value is used could be questioned. Have you tried placing a breakpoint on rendering the second scanline? I just noticed that the nametable is repeated twice before showing the next nametable. So I'm assuming you're recalculating Y...
by LuckyLuke
Thu Mar 12, 2020 5:14 am
Forum: NESemdev
Topic: NES PPU pixel accurate rendering problems
Replies: 7
Views: 2985

Re: NES PPU pixel accurate rendering problems

First thing I recommend fixing is the fine Y coordinate, it seems stuck on a constant value. Coarse Y seems to have a shifting error, maybe 2 too many bits to the right. Palette and X seem fine. I double and triple checked the code and the fine Y seems to increment correctly and so does the coarse ...
by LuckyLuke
Wed Mar 11, 2020 10:31 am
Forum: NESemdev
Topic: NES PPU pixel accurate rendering problems
Replies: 7
Views: 2985

NES PPU pixel accurate rendering problems

Hi, I'm writing my NES emulator in C++, but I'm stuck implementing the PPU. I 'm trying to implement pixel accurate rendering, but iI have some problems with timing. If I display the nametable manually fetching the tiles and the palettes at the end of the frame I get a correct output: https://i.imgu...
by LuckyLuke
Fri Feb 14, 2020 9:09 am
Forum: NESemdev
Topic: using nes test ROM to test 6502 CPU
Replies: 1
Views: 1984

using nes test ROM to test 6502 CPU

Hi, I'm writing my own NES emulator in C++, trying to make it work on Windows and (if all goes well) I'll port it to some MCU platform (AVR/Microchip or ARM). I'm doing this as a learning experience. I wrote the CPU part, and I'm using nestest.nes to test the instructions, but I don't have graphics ...