It is currently Thu Dec 14, 2017 3:10 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 58 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
PostPosted: Mon Feb 22, 2016 9:59 am 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Tracelogs tracelogs tracelogs.

If your scroll is off, make trace dumps of all parts of your code that's touching the scroll so you can see how it's changing and see where the problem is.

Emu dev is all about analyzing trace logs. You've never seen so many tracelogs


Top
 Profile  
 
PostPosted: Mon Feb 22, 2016 10:21 am 
Offline
User avatar

Joined: Sun Mar 19, 2006 3:06 am
Posts: 584
Location: Gothenburg/Sweden
Current plan is to write a simple test rom that outputs a static nametable and create some logs. :)
My vram address really likes to go above $4000 for some reason so I'll see what I can find. A little exciting actually . :)

_________________
http://nes.goondocks.se/


Top
 Profile  
 
PostPosted: Mon Feb 22, 2016 10:24 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19342
Location: NE Indiana, USA (NTSC)
VRAM address in $4000-$7FFF means the PPU is rendering the bottom half of a row of tiles. During nametable fetches, bits 14-12 are ignored, and during pattern table fetches, they're moved down to bits 2-0.


Top
 Profile  
 
PostPosted: Mon Feb 22, 2016 10:51 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
During rendering, the VRAM address assumes the following structure:

Code:
0yyyNNYY YYYXXXXX

yyy - fine vertical scroll;
NN - name table;
YYYYY - coarse vertical scroll;
XXXXX - coarse horizontal scroll;

Bits 0 to 11 are used in that exact same order to read from the nametables (using a base address of $2000), but bits 12 to 14 are used to select the correct row of pixels from the pattern tables. When reading patterns, an address with this structure is used:

Code:
000BIIII IIIIPyyy

B - base address ($0000 or $1000, as defined by bit 4 of PPUCTRL);
IIIIIIII - tile index read from the name table;
P - low plane or high plane;
yyy - pattern row;


Top
 Profile  
 
PostPosted: Mon Feb 22, 2016 1:11 pm 
Offline
User avatar

Joined: Sun Mar 19, 2006 3:06 am
Posts: 584
Location: Gothenburg/Sweden
Progressreport. :)


Attachments:
File comment: Mario Bros titlescreen (2 bits only)
mb.png
mb.png [ 8.83 KiB | Viewed 1468 times ]

_________________
http://nes.goondocks.se/
Top
 Profile  
 
PostPosted: Tue Feb 23, 2016 6:39 am 
Offline
User avatar

Joined: Sun Mar 19, 2006 3:06 am
Posts: 584
Location: Gothenburg/Sweden
Fixed a few more issues and probably introduced a few more bugs.. Current status is that the screen tends to "fall down" (like your flipping pages in a book or so). My gut feeling is that it hopefully won't be that hard to fix..
If I only had more sparetime! :)

EDIT:
Getting alot of strange midscreen $2005-writes which probably explains why the screen is moving even if it shouldn't.. To be continued..

_________________
http://nes.goondocks.se/


Top
 Profile  
 
PostPosted: Tue Feb 23, 2016 1:52 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
Midscreen 2005 writes only affect fine scroll and X scroll for the next line.

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


Top
 Profile  
 
PostPosted: Tue Feb 23, 2016 2:47 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Yeah, remember that $2005 only changes fine-X and "ppu temp". It does not ever actually touch the real ppu address.


Top
 Profile  
 
PostPosted: Tue Feb 23, 2016 5:51 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
boring. :evil:
let's toast when finished :shock: :shock:


Top
 Profile  
 
PostPosted: Wed Feb 24, 2016 12:02 am 
Offline
User avatar

Joined: Sun Mar 19, 2006 3:06 am
Posts: 584
Location: Gothenburg/Sweden
Obviously got issues with $2006/$2007.. Here's the old NESStress-ROM that has problems with positioning "OK"..


Attachments:
File comment: NESStress CPU test, buggy
nestress.png
nestress.png [ 7.16 KiB | Viewed 1366 times ]

_________________
http://nes.goondocks.se/
Top
 Profile  
 
PostPosted: Mon Mar 07, 2016 9:28 pm 
Offline

Joined: Wed Mar 31, 2010 12:40 pm
Posts: 207
Not sure if this will help, or if you're interested, but I recently started writing a half-cycle accurate stand-alone PPU emulator. The goal was for it to be used as a reference implementation for other emulators. If you're anything like me, seeing the code can be more valuable than any number of wiki pages.


Top
 Profile  
 
PostPosted: Mon Mar 21, 2016 9:52 am 
Offline
User avatar

Joined: Wed Aug 26, 2015 8:24 am
Posts: 21
Location: Ontario, Canada
Sorry to be that guy but what is the difference between Scanline and PixelEngine rendering in this context? Thanks.

_________________
Aliasmk- GitHub :: Twitter :: Website
Current ALIAneS Emulator Progress: CPU complete, PPU indev - we have graphics and sprites!


Top
 Profile  
 
PostPosted: Mon Mar 21, 2016 10:33 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
A scanline engine draws entire scanlines at a time, using the same set of PPU parameters (scroll, pattern banks, emphasis bits, etc.) all the way through. This is not how the real console works though... Since the PPU and the CPU run in parallel, most PPU parameters can be changed at any time, so emulating the PPU with finer granularity (pixel by pixel) while simulating the individual memory fetches the actual PPU does, at the correct times, results in more accuracy. Most games don't need this kind of accuracy, but some special effects do, and developers also need it to make sure they're respecting the constraints of the real hardware.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 58 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 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