Help iron out some quirks (in Blargg's Flowing Palette demo)

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Help iron out some quirks (in Blargg's Flowing Palette demo)
by on (#161759)
Hi guys.

I've been working on my NES emulator PeNES for a while now, and am nearing a state where it's becoming somewhat solid. It passes all CPU and PPU timing test ROMs I've thrown at it (including cpu_timing_test, ppu_vbl_nmi, vbl_nmi_timing, sprite_hit_timing, sprite_hit_tests and blargg_ppu_tests) so that's cool, but I have some oddities going on in some ROMs that I'd really appreciate if you could help me with.

This is PeNES running Blargg's Flowing Palette demo: https://vid.me/pb7k
[EDIT: Updated link, accidentally uploaded an older movie first]

As you can see every blue section is offset vertically by one pixel. Can anyone think of a reason why that would be happening? Also, there's some horizontal scrolling jitter at the beginning of the demo that I don't see in Nestopia. I don't really know what exactly to look for as I can't see these artefacts in other games, and I have to my knowledge passed the relevant test ROMs in order to be able to run Flowing Palette properly. I can for example run Marble Madness flawlessly which is to my knowledge very timing dependent.

Any pointers would be appreciated!

Thanks so much guys,
- Tommi
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161762)
What was that cool bulging CRT-like filter at the start of the video?

On a side note, I've been waiting for someone to have the balls to create an emulator by that name for a while now.
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161771)
Nearly two years ago, koitsu and I managed to talk the developer of phibiaNES out of using that name.

Image
Compensating for something?
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161775)
Phew, the 'gap' was due to a small quirk in the implementation of the palette hack. I think this looks correct now - compared it side-by-side with output from other emulators:
https://vid.me/rapD

Can anyone spot any discrepancies?

Thanks guys,
- Tommi
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161779)
I like that CRT effect. It reminds me of this.
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161792)
Funny, he's requesting help/opinions and you're ALL going offtopic! :evil: :evil: :evil:

:mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161845)
Zepper wrote:
Funny, he's requesting help/opinions and you're ALL going offtopic! :evil: :evil: :evil:

:mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:


:D
Thanks for the input guys, I may rename it if people find it offensive. What about ShiNES?

I have one more action item on my list of strange behaviour in games. Battletoads, Marble Madness, Blargg's flowing palette all work (all timing-sensitive games), and so do Rad Racer and similar "3D" games. However, I get this artefact in Slalom:
http://i.imgur.com/uJKS8fw.png

If I stand in the middle of the road there's no artefact, but it gets more and more pronounced the more to the sides of the road I take the character. If I go to the left the lines go to the right and vice versa. Does anyone know what could be causing that?
Any help on this would be greatly appreciated.

zeroone: I'm glad you liked the effect. It's still very much work in progress but it can turn into something cool. It actually uses the web camera to plaster your reflection onto the dark areas of the screen for maximum CRT shininess :) It looks really cool at times.
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161850)
Does F1 Race give the same glitches as Slalom? If so, it might have something to do with applying fine X scroll immediately but not applying coarse X scroll until the next line.
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161851)
tepples wrote:
Does F1 Race give the same glitches as Slalom? If so, it might have something to do with applying fine X scroll immediately but not applying coarse X scroll until the next line.


Thanks Tepples! F1 Race has indeed the same pattern. I had tried with numerous other similar games and none of them exposed that behaviour, so it's great to have another repro case. I'll look into what you suggested.

Big thumbs up!
- Tommi
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161865)
Tommigun wrote:
tepples wrote:
Does F1 Race give the same glitches as Slalom? If so, it might have something to do with applying fine X scroll immediately but not applying coarse X scroll until the next line.


Thanks Tepples! F1 Race has indeed the same pattern. I had tried with numerous other similar games and none of them exposed that behaviour, so it's great to have another repro case. I'll look into what you suggested.

Big thumbs up!
- Tommi


I have gone through the code numerous times and can't see coarse X being applied too late. It is still possible that the problem has to do with it somehow but I don't think it's applied too late, or it would also show up in other places. Here's a video of the effect:
https://vid.me/e/d5j3

The jaggies get placed more and more close together the longer they are as well. I don't really know what more to look for as only these two games showcase this behaviour. Are there any test ROMs that could help me isolate the problem, or does anyone have a keen enough eye to help me out?

Thanks again.
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161896)
How did you setup the images when you pick the game from that menu?
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161909)
And does this mean I'll need to go back and design box art for my games?
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161933)
zeroone wrote:
How did you setup the images when you pick the game from that menu?


I download them from http://www.thecoverproject.net. However, that's quite a hack as The Cover Project doesn't have an API so first I need to guess the file name, and then use another server to scale the images down before downloading to the client. Then they the image is cached, and finally skinned on top of a 3D box model :P I will of course need to ask for permission to use their service before I can release my emulator. The box art can also be manually downloaded and placed in a specific folder if the user prefers that.

I also use bootgod's NES XML for fetching info about the ROMs, which can be downloaded from http://bootgod.dyndns.org:7777/xml.php

Tepples: Custom box art for homebrewn games is amongst the coolest things I know, so please go ahead and conjure up some really cheesy box art!

Oh, and I solved the Slalom issue. I had just missed to apply fine x scroll instantly, instead of at PPU cycle 257 (copy horizontal T to V). Thanks for your help, it helped me narrow down the root cause. Now I just need to put MMC3 IRQ and APU back (after some refactoring) and I think this is ready for release.

Bonus question: The Fantastic Adventures of Dizzy works flawlessly, except that the status bar jumps up and then down one pixel every minute or so. Once it starts doing that it does it more frequently. Does anyone know exactly what is going on there? I read somewhere that Dizzy uses $2004 reads to sync stuff but I am not sure that is the case?
[EDIT] It only seems to happen when running in NTSC, forcing the game to PAL remedies it. Maybe it has to do with even/odd frames? I do pass the tests for those, though.
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161939)
Tommigun wrote:
Tepples: Custom box art for homebrewn games is amongst the coolest things I know, so please go ahead and conjure up some really cheesy box art!

What are the sizes, formats, etc. that I'll need to follow?

Quote:
Oh, and I solved the Slalom issue. I had just missed to apply fine x scroll instantly, instead of at PPU cycle 257 (copy horizontal T to V). Thanks for your help, it helped me narrow down the root cause.

You're welcome.
Re: Help iron out some quirks (in Blargg's Flowing Palette d
by on (#161999)
tepples wrote:
What are the sizes, formats, etc. that I'll need to follow?

http://www.thecoverproject.net/uploads/ ... jack42.psd