It is currently Thu Nov 23, 2017 3:56 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon Oct 09, 2006 11:39 pm 
Offline
User avatar

Joined: Sat Jul 22, 2006 12:06 pm
Posts: 96
Location: USA
Just to make sure everyone is aware:

http://www.bannister.org/ubb/ultimatebb ... p=1#000005

There appears to be a request to get more information on what writes to $2007 do during rendering, specifically in the context of the game "Saint Seiya - Ougon Densetsu Kanketsu Hen."

_________________
Warning: I am not a serious developer (yet), but CS and EE really interest me.
I was -_pentium5.1_- until I screwed up. This is why I screwed up. ^_^


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 10, 2006 8:46 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3075
Location: Brazil
Go hack the game, trace it... *bump*

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 11, 2006 1:07 am 
Offline
User avatar

Joined: Sat Jul 22, 2006 12:06 pm
Posts: 96
Location: USA
Sorry, I don't have the skills to do that, nor the equipment to HW test, so unless a dev has something to contribute, I will allow this thread to be locked.

_________________
Warning: I am not a serious developer (yet), but CS and EE really interest me.
I was -_pentium5.1_- until I screwed up. This is why I screwed up. ^_^


Top
 Profile  
 
PostPosted: Wed Oct 11, 2006 8:37 pm 
Offline
User avatar

Joined: Sat Oct 29, 2005 2:09 am
Posts: 501
Location: Indianapolis
85cocoa wrote:
Just to make sure everyone is aware:

http://www.bannister.org/ubb/ultimatebb ... p=1#000005

There appears to be a request to get more information on what writes to $2007 do during rendering, specifically in the context of the game "Saint Seiya - Ougon Densetsu Kanketsu Hen."


I'm not sure about that game, but writing to 2007 during rendering is very bad news. There appears to be two "control units" so to speak on the PPU that can operate the memory interface.

The main "rendering" control interface, and the 2007 read/write control interface. The two are simply OR'd together on the control lines. It is possible to do both a read AND write cycle at the same time because of this. I used my "3 in 1 tester" to monitor the PPU's address, data, and control lines during rendering to see what happened when reads and writes were performed during rendering.

The result is very unpredictable as you can imagine, since the timing of the CPU read/write and the timing of the PPU data fetch both come into play. The net result of writing during rendering could be corruption of at least 2 memory locations and possible corruption of the address counter/pointer. Reading isn't so bad but it too could corrupt the address counter during rendering and if nothing else, cause glitchy video due to improper data being fetched for display.

_________________
/* this is a comment */


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 12, 2006 7:12 am 
Offline

Joined: Wed Mar 22, 2006 8:00 am
Posts: 354
The game in question here is apparently trying to write to $3F00-3FFF during rendering. I suspect that side-effects would be minimized here since writes in this range don't go out into VRAM. On the other hand, palette memory may be adversely affected. Has any testing occurred to this regard?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 13, 2006 12:38 am 
Offline
User avatar

Joined: Sat Jul 22, 2006 12:06 pm
Posts: 96
Location: USA
So Marty's diagnosis of the game is probably wrong?
(EDIT: Oops, I forgot about the way the PPU regs are mirrored. What I meant is that real game companies probably wouldn't try such a dangerous programming technique, so maybe the bug is really related to timing or something else.)

_________________
Warning: I am not a serious developer (yet), but CS and EE really interest me.
I was -_pentium5.1_- until I screwed up. This is why I screwed up. ^_^


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 13, 2006 5:59 am 
Offline

Joined: Fri Nov 12, 2004 5:02 am
Posts: 40
Yeah, it could be related to timing as well (but that's still risky business), resulting in VRAM address trashing. I noticed that delaying the $2007 write by 4 PPU clocks (no less) also fixes the game. Incidentally, Micro Machines will cause screen-shaking in the finished course screen if $2001 writes (BG/SP enable) are delayed by 1 PPU clock. I guess PPU internals and different duty cycle timings plays a large role here. Makes me I wonder if there are more quirks for certain timed PPU register reads/writes, resulting in special behaviour similiar to the ones for the VBL flag and NMI supression.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 14, 2006 8:57 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3075
Location: Brazil
kevtris, did you analyse the cartridge board? Just to be sure we're not speaking of an emulator "obscure" bug. -_-;; You know, if this latency occurs in the NES, so it's ok.

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 14, 2006 7:49 pm 
Offline
User avatar

Joined: Sat Oct 29, 2005 2:09 am
Posts: 501
Location: Indianapolis
dvdmth wrote:
The game in question here is apparently trying to write to $3F00-3FFF during rendering. I suspect that side-effects would be minimized here since writes in this range don't go out into VRAM. On the other hand, palette memory may be adversely affected. Has any testing occurred to this regard?


Oh, that's "legal" so to speak... if you time your writes juuuuust right, you can update the palette mid-frame. Micromachines does this as I think was already said. Micromachines uses the 2004 read to synch up, and it's insane critical. Any little timing screwup will cause you to bleed off into rendering which can cause graphic corruption.

_________________
/* this is a comment */


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 15, 2006 1:02 am 
Offline

Joined: Wed Mar 09, 2005 9:08 am
Posts: 348
Quote:
Oh, that's "legal" so to speak... if you time your writes juuuuust right, you can update the palette mid-frame. Micromachines does this as I think was already said. Micromachines uses the 2004 read to synch up, and it's insane critical. Any little timing screwup will cause you to bleed off into rendering which can cause graphic corruption.


Yes it's legal, but ONLY if you turn off rendering thru $2001, in which case anything legal in vblank should be as legal mid-frame. Though you have to keep in mind that pointing $2006 to the palette registers will output the color pointed to rather than BG0. Micro Machines does turn off rendering before doing it's palette updates, and I am pretty sure there's no other way to do it.


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

All times are UTC - 7 hours


Who is online

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