MitchellSternke / SuperMarioBros-C

An attempt to translate the original Super Mario Bros. for the NES to readable C/C++
625 stars 70 forks source link

Some minor inaccuracies with how things are rendered. (Also some graphical and sound issues.) #9

Open Mario0051 opened 5 years ago

Mario0051 commented 5 years ago

Mario is supposed to be in front of the flag, not behind the flag.

SuperMarioBros-C: image BizHawk: image

(I don't know why the graphics output looks like that and the sound that is there, is only popping noises.)

Mario0051 commented 5 years ago

Also defeating a piranha plant, it tries to come up again, causing this to happen (probably): image EDIT2: It stays on-screen and doesn't disappear until you scroll past it.

MitchellSternke commented 5 years ago

Thanks for opening this issue. I'm not really an expert in emulating the NES, so my implementations of the PPU (graphics) and APU (sound) are going to have bugs like this 😃

The graphical issues you mention are related to sprite rendering. The first one is because I am not rendering sprites in the correct order, and the second one you mention is probably either rendering the piranha plant one pixel too high or because I am not honoring a sprite flag to make it invisible. I will look into fixing both of these.

For the sound issues, I'll need some help from someone with a greater understanding of the NES APU and audio programming.

Again thank you for reporting these. Please continue to let me know what other issues you find.

Mario0051 commented 5 years ago

The first issue is fixed now, but the second issue still persists in the latest commit.

MitchellSternke commented 5 years ago

Thanks for confirming @Mario3264 . Still need to root cause what is causing the piranha plants to remain in the pipes.

Mario0051 commented 5 years ago

Apparently the weird graphics output is due to "scan-lines" that you have implemented in your code. I commented out the code and it seems to still work without them.

Mario0051 commented 5 years ago

Also, the pixels behind the coin icon in the coin counter is missing.

SuperMarioBros-C: image

BizHawk: image

MitchellSternke commented 5 years ago

I've added a configuration option video.scanlines that you can use to turn off the scanlines without needing to modify the code. (1a3a66b22bf47bfe1df6c34c5b98d5268ed6a6dc)

For the pixels behind the coin counter being missing, I think that is because there is a special sprite rendered on that line that I am missing. I will investigate.

Mario0051 commented 5 years ago

The bullet bill sticks out of the launcher by one pixel when it spawns and visibly lowers by one pixel after it exits the launcher, which doesn't happen in BizHawk.

SuperMarioBros-C: image

BizHawk: image

MitchellSternke commented 5 years ago

I have fixed the pixels near the coin counter as well as the issue with the Piranha Plants in the latest commit (958e430d2e954182fd0aa73b07dbb043afd19816).

I did not test it, but I believe that the problem impacting the Piranha Plants was also causing the Bullet Bills to appear one pixel higher while in the launcher. Sprites behind the background tiles were being rendered one pixel too high.

Mario0051 commented 5 years ago

That technically means the graphical issues have been solved.

Anonymous3-a commented 9 months ago

Please close this issue, it seems to be solved.