It is currently Mon Sep 16, 2019 5:22 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Sep 02, 2019 3:40 pm 
Offline

Joined: Mon Sep 02, 2019 3:28 pm
Posts: 10
Hi guys,

I've been working on my NES emu for a few days now, and I have encountered a problem. It is very similar to this one here https://forums.nesdev.com/viewtopic.php?f=3&t=10762

As soon as the pixel 0,0 enters the 2nd Nametable, the UI starts to flicker, because of multiple writes of the base nametable address in PPUCTRL. Some of them are 0x2000 (as it is supposed to be, as the UI is still on NT1) and 0x2400 (which it should only be for everything below the UI).

I have a GIF of this right here

Image

(Don't mind the 'cut off' part, that was a sprite zero problem that has been fixed by now)

So, I thought I was able to fix this, by resetting the base nametable address [bits] to zero => 0x2000 on VBLANK. This will fix the flicker on Super Mario Bros., but will be responsible for a follow up bug in Ice Climber.

I was implementing Y-Scrolling in Ice Climber, when I realized this. With the reset-hack still in place, the upward-scrolls in Ice Climber will have glitches at the top, as soon as it is inside NT2 [again]. (Note, this is only coarse-scroll for now, fine-scroll has not been implemented yet)

Image

When I remove this hack, the Y-Scroll happens as it is supposed to.

Image

Now I am a bit stumped on how to proceed, and what might cause this exactly.

Side note: I did not implement the LoopyV/T stuff, as it confuses the hell out of me (I'm not a native speaker), and I'm not quite sure if I would have to refactor my whole PPU.
E.g. right now, the first write to 0x2005 is stored as uint8_t variable called scr_x. 'coarse x' is scr_x / 8 right now, 'fine x' is scr_x % 8. And in the loopy description I can't even figure out where to pull this from :-(

Any help would be greatly appreciated. Will provide logs, screenshots, whatever is necessary.

Thanks in advance!

LilaQ


Top
 Profile  
 
PostPosted: Tue Sep 03, 2019 5:52 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21591
Location: NE Indiana, USA (NTSC)
How are you emulating the effect of writes to $2006 on the base nametable address? Are you doing it through the t and v as described in The skinny on NES scrolling?

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Tue Sep 03, 2019 8:53 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4211
PPUCTRL affects "Loopy T" only, not "Loopy V".

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Tue Sep 03, 2019 10:40 am 
Offline

Joined: Mon Sep 02, 2019 3:28 pm
Posts: 10
I tried to implement the "v" and "t" mechanism now (as I didn't to this before), but now my Nametables don't get populated at all.

I did something like this before that:
Code:
//0x2006
void writePPUADDR(int adr) {
PPUADDR = adr
}
//0x2007
void writePPUDATA(int data) {
VRAM[PPUDATA] = data
}


Am I just supposed to use "v" instead of PPUADDR now? Sorry, but this really confuses me.


Top
 Profile  
 
PostPosted: Tue Sep 03, 2019 11:03 am 
Offline

Joined: Mon Sep 02, 2019 3:28 pm
Posts: 10
Also, how will this affect the wrong base nametable address in PPUCTRL? :| :?:


Top
 Profile  
 
PostPosted: Wed Sep 04, 2019 6:43 am 
Offline

Joined: Mon Sep 02, 2019 3:28 pm
Posts: 10
Okay, so I managed to get the flicker away with the use of v and t, to get the proper base nametable address.

Can someone please do me a favor, and tell me the coarse Y-scroll value of ice climbers, as soon as the game screen appears (where the bird is)? Mine is at 19, but it seems like it's supposed to be 18 - or 20 (I am one tile off).

Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group