It is currently Tue Oct 17, 2017 4:38 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 218 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 15  Next
Author Message
 Post subject:
PostPosted: Thu Jun 10, 2010 2:45 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
- Sorry, but if I'm not making any confusion, reading/writing $2005/6/7 is not allowed during rendering, an old info.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2010 3:19 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6273
Location: Seattle
Right, but now he's documented the specifics of what happens when you read from $2007 during rendering -- and, better & worse, found a game that uses this 'prohibited' behavior.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2010 3:35 pm 
Offline
User avatar

Joined: Sat Jun 27, 2009 11:05 pm
Posts: 711
Location: New Mexico, USA
lidnariq wrote:
Right, but now he's documented the specifics of what happens when you read from $2007 during rendering -- and, better & worse, found a game that uses this 'prohibited' behavior.

Exactly.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2010 4:07 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
*Amen* :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2010 4:11 pm 
Offline

Joined: Fri May 21, 2010 4:10 pm
Posts: 260
sorry if this a stupid or newb question as obviously i dont have any idea on ppu inner workings but besides the relevant code in this thread is there any way to try this out with like an ips patch or let's say a hex edit of the rom?

just curious and if this comes off as a stupid question i do apologize...

once again excellent work! looks like theres always something new with the nes eh? lol


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2010 5:12 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
Well the change presented in this thread is one that would need to be applied to emulators, not to the ROM. So no, there's no way to put it in an IPS patch.

You could probably hack the ROM another way to remove the glitch, but that would be a completely different task.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2010 6:48 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
You know this behavior seems like it'd be relatively easy to test and confirm with a dev cart / Powerpak.

Code:
; assume rendering is disabled
LDA  #>SomeAddress
STA $2006
LDA #<SomeAddress
STA $2006

LDA #$18
LDX #$00

STA $2001 ; enable (should probably be timed, see below)
BIT $2007 ; read
STX $2001 ; disable

; confirm how PPU address changed from SomeAddress here


You should probably time this so the write happens between dots 260-320 (when the PPU is unlikely to change the PPU address on its own).

This wouldn't cover possible edge cases when the $2007 read happens at the same time that the PPU is adjusting the address for rendering, but it could at least confirm the basic idea is right.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 10, 2010 7:40 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19084
Location: NE Indiana, USA (NTSC)
It is the 2010s and there is time for Boing 2007. Put this on a PowerPak, put the PowerPak in an NTSC NES, and follow the bouncing ball. As they used to say on alt.aol-sucks: "Your will be amasing."


EDIT: Attached here too


Attachments:
boing2k7.zip [17.6 KiB]
Downloaded 33 times
Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 11, 2010 2:46 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7224
Location: Chexbres, VD, Switzerland
Now the question is "what happens when there is a warp arround" ? Is the circuitry that detects the end of name-table (and warp it to the top/left of the next nametable) is still active when it comes to $2007 reads during rendering ?

When a column is skipped, does the horizontal scroll become back to normal value next line ? (I'm pretty sure so, else Zelda would be f** up when scrolling vertically)

And last, but not least : Is there a way to predict WHAT the $2007 read will return ? A new way of synchronization maybe ?

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 11, 2010 5:14 am 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
I wrote a test that runs what Disch suggested and added the output to the Wiki for group analysis: Reading 2007 during rendering

It sets the VRAM address to 141F before the code, since that seemed to reveal the most operation. If I set it to 0000 for example, you wouldn't see bit 10 getting toggled. the 1F allows that to happen. And the 0400 allows you to see it toggle 1000 sometimes, etc. I'm not up to speed on all the PPU details, so I was mostly just trying values and choosing this one as the most useful.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 11, 2010 5:40 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19084
Location: NE Indiana, USA (NTSC)
Yeah, I saw it clock both the H and V positions at some points on the scanline when I was testing boing $2007.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 11, 2010 7:30 am 
Offline
User avatar

Joined: Sat Jan 22, 2005 8:51 am
Posts: 427
Location: Chicago, IL
blargg wrote:
And the 0400 allows you to see it toggle 1000 sometimes

Can you explain this? I'm assuming that, in your test, 2000.2 is set (i.e. address increment = 32). In that case, any read of $2007 would clock FV (bits 12-13), toggling 0x1000, no?

Do you think the +1 increment relative to dummy, in most of the reads, is simply a timing difference?

BTW, YIJC doesn't actually do anything with the $2007 read:
Code:
$FB66:8D 00 20  STA $2000
$FB69:AD 02 20  LDA $2002
$FB6C:A5 A7     LDA $00A7
$FB6E:8D 05 20  STA $2005
$FB71:A9 00     LDA #$00
$FB73:8D 05 20  STA $2005
$FB76:A5 A9     LDA $00A9
$FB78:8D 06 20  STA $2006
$FB7B:A5 AA     LDA $00AA
$FB7D:8D 06 20  STA $2006
$FB80:A5 A8     LDA $00A8
$FB82:29 04     AND #$04
$FB84:F0 0C     BEQ $FB92
$FB86:AD 07 20  LDA $2007
$FB89:AD 07 20  LDA $2007
$FB8C:AD 07 20  LDA $2007
$FB8F:AD 07 20  LDA $2007
$FB92:AC 9F 04  LDY $049F
$FB95:A9 00     LDA #$00

Looks like it's there to simply increment VT by one based on the value of $00A8. Why this couldn't be done before writing to $2005/$2006 is unclear to me.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 11, 2010 7:51 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3941
Sounds like they did the monkeys and typewriters approach - Keep trying something until it works.

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 11, 2010 8:19 am 
Offline
User avatar

Joined: Sat Jan 22, 2005 8:51 am
Posts: 427
Location: Chicago, IL
I may be off in my analysis... FV is a 3-bit counter, so clocking it 4 times won't necessarily cause a carry into the VT counter.

Maybe they're doing this so that can draw data from 2 halves of different tiles?

Code:
tile 1:   tile 2:   new tile:
aaaaaaaa  xxxxxxxx  aaaaaaaa
aaaaaaaa  xxxxxxxx  aaaaaaaa
aaaaaaaa  xxxxxxxx  aaaaaaaa
aaaaaaaa  xxxxxxxx  aaaaaaaa
bbbbbbbb  yyyyyyyy  xxxxxxxx
bbbbbbbb  yyyyyyyy  xxxxxxxx
bbbbbbbb  yyyyyyyy  xxxxxxxx
bbbbbbbb  yyyyyyyy  xxxxxxxx


?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 11, 2010 9:20 am 
Offline
User avatar

Joined: Sat Jan 22, 2005 8:51 am
Posts: 427
Location: Chicago, IL
tepples wrote:
It is the 2010s and there is time for Boing 2007.

Very cool!

_________________
get nemulator
http://nemulator.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 218 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6 ... 15  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] 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