It is currently Tue Oct 17, 2017 10:47 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Thu Feb 23, 2017 12:42 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6277
Location: Seattle
Ok, so it looks similar to the CLK pin pad below it but it's missing the polysilicon connection to anything else. It's dark like the N-typed doped diffusion, so it probably is. So it seems to be wire bonded to an N+ region in a P-type substrate, so it should be equivalent to a diode pointing away from the substrate. I guess if anyone has a 2A03 it'd be easy enough to check for something that behaves like an undervoltage protection diode on that pin...

But thanks for the correction!


Top
 Profile  
 
PostPosted: Thu Feb 23, 2017 6:05 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 285
tepples wrote:
$4016 D2 is zero on NES-001 but open bus on NES-101.
OAM writing: Lines 241-260 for PAL NES; during vertical or forced blanking on other
I knew there was something with the input ports, but didn't know the specifics. Also, according to the wiki D3-D4 are not the same between the Famicom & NES-101?
About OAM, the wiki says:
Quote:
In the 2C07, sprite evaluation can never be fully disabled, and will always start 20 scanlines after the start of vblank[10] (same as when the prerender scanline would have been on the 2C02).
Does this imply that during scanlines 261-310 the PPU repeats the sprite evaluation logic that runs during the prerender scanline?

lidnariq wrote:
The palette is readable on later revisions of the 2C02 and not on earlier ones. I don't know when this changed, however.
I tried finding a reference to this on the wiki, but couldn't. I'm assuming reading 0x3Fxx in this case would return the latch's data & fill the latch with the next byte?

lidnariq wrote:
The 2C03/4/5, and thus presumably also early versions of the 2C02, don't have the OAMADDR bug.
So the 8-byte copy from OAMADDR & 0xF8 to the start of OAM ram does not occur even if OAMADDR >= 8?

I just found your oamtest3 test rom while looking up more information about this. Ended up noticing that my sprite DMA code was still using a very old inaccurate patch (for no good reason) and a couple more bugs thanks to it! I added it to the emulator test page on the wiki.


Top
 Profile  
 
PostPosted: Thu Feb 23, 2017 6:22 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6277
Location: Seattle
Sour wrote:
Does this imply that [on the 2C07] during scanlines 261-310 the PPU repeats the sprite evaluation logic that runs during the prerender scanline?
We don't actually know. I've been meaning to write a simple test that will fill OAM with a specific convenient table and just log the value read back from OAMDATA for a full vblank, but have had no focus.

Quote:
I tried finding a reference to [palette unreadability] on the wiki, but couldn't. I'm assuming reading 0x3Fxx in this case would return the latch's data & fill the latch with the next byte?
Yeah, exact same as in the rest of the 0x3xxx memory range.

Quote:
So the 8-byte copy from OAMADDR & 0xF8 to the start of OAM ram does not occur even if OAMADDR >= 8?
Correct. It definitely does happen in the 2C02G and some of the famiclones, doesn't happen in the 2C03, 2C04, 2C05, and 2C07.

If I've stated this correctly, Sachen's Huge Insect (the best-documented instance of relying on this bug) should fail on the Famicom Titler and any other console that uses one of the RGB PPUs.


Top
 Profile  
 
PostPosted: Fri Feb 24, 2017 12:21 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 798
Location: Sweden
Sour wrote:
tepples wrote:
$4016 D2 is zero on NES-001 but open bus on NES-101.
OAM writing: Lines 241-260 for PAL NES; during vertical or forced blanking on other
I knew there was something with the input ports, but didn't know the specifics. Also, according to the wiki D3-D4 are not the same between the Famicom & NES-101?

It seems that D3 and D4 are identical on the NES Toaster and the NES Toploader, only D2 on $4016 is different.


The wiki is a bit confusing, but if I understand the wiki correctly this should be the case:

Famicom (HVC-001)
$4016.3 and $4016.4: Open bus
These are also not available neither from the expansion port nor the controller ports.

$4017.3 and $4017.4: Input on Expansion Port pin 4 and 5 respectively

$4016.2: Input on Controller Port II pin 6 (used by the microphone)
$4017.2: Input on Expansion Port pin 6


AV Famicom (HVC-101)
$4016.3 and $4016.4: All 0
These pins are not available from the controller ports unlike on NES.

$4017.3 and $4017.4: Same as Famicom.
These pins are not available from the controller ports unlike on NES.
People often mod their AV Famicom so that these pins are connected to the controller port II as well. Makes Zapper and other NES peripherals work.

$4016.2: Open bus
$4017.2: Input on Expansion Port pin 6


NES-001
$4016.3 and $4016.4: Input on Controller Port I pin 6 and 5 respectively
$4017.3 and $4017.4: Input on Controller Port II pin 6 and 5 respectively

$4016.2: Always 0
$4017.2: Always 0
Not accesible from the controller ports either.

*The expansion port have accesss to most pins though.


NES-101
$4016.3 and $4016.4: Same as NES-001
$4017.3 and $4017.4: Same as NES-001

$4016.2: Open bus
$4017.2: Always 0


Pinouts:
Code:
Famicom Controller Port Pinout (front)

 Port I     Port II
  _____     ______   
 |12345|   |123456|
  ¯¯ ¯¯     ¯¯  ¯¯
P I   1: +5V, 2: CLK $4016, 3: P/S, 4: Data $4016.0, 5: GND
P II  1: +5V, 2: CLK $4017, 3: P/S, 4: Data $4017.0, 5: GND, 6: Mic $4016.2
Note: P/S is latch and comes from the $4016.0 output on both controllers.


NES Controller Port Pinout (front)

 Port I               Port II
               _                            _
       GND -- |1\                   GND -- |1\
 CLK $4016 <- |27\ -- +5V     CLK $4017 <- |27\ -- +5V
       P/S <- |36| <- $4016.3       P/S <- |36| <- $4017.3
   $4016.0 -> |45| <- $4016.4   $4017.0 -> |45| <- $4017.4
               ¯¯                           ¯¯
Note: P/S is latch and comes from the $4016.0 output on both controllers.

HVC-101 have the same ports as NES but is missing D3 and D4.

Famicom Expansion Port Pinout (front)

  1___________________8
   \ o o o o o o o o /
  9 \ o o o o o o o / 15
     ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
1: GND, 2: Sound >, 3: IRQ <>, 4: $4017.4 <, 5: $4017.3 <, 6: $4017.2 <,
7: $4017.1 <, 8: $4017.0 <, 9: $4017 CLK >, 10: $4016.2 >, 11: $4016.1 >,
12: $4016.0 > (latch), 13: $4016.1 <, 14: $4016 CLK >, 15: +5V
 <: Input, >: Output, <>: Bidirectional



Did I get everything right? I think the wiki should be updated to include this kind of information more clearly.


Top
 Profile  
 
PostPosted: Fri Feb 24, 2017 9:07 pm 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 285
Between your post and the info on the wiki, I tried putting this all together and got this (as far as possible read values):
Code:
Port     $4016      $4017
Bit      76543210   76543210
NES-001  ---CC00C   ---CC00C
NES-101  ---CC-0C   ---CC00C
HVC-001  -----MEC   ---EEEEC
HVC-101  -----0EC   ---EEEEC

- = Open bus
0 = always 0
E = expansion port data
C = controller port data
M = famicom controller 2 microphone
Did I get something wrong?

Also added a few more options ("Do not reset PPU on console reset", "Disable palette reads", "Disable OAMADDR bug emulation") and implemented a guess at what might be the PAL OAM behavior for scanlines 261+. The console-specific input ports are more or less the only thing left to implement I think.

EDIT: Fixed mistake in HVC-101 $4016 info


Last edited by Sour on Sun Feb 26, 2017 7:15 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Feb 24, 2017 9:10 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19093
Location: NE Indiana, USA (NTSC)
Quote:
Code:
HVC-101  ---00-EC   ---EEEEC

I thought it was this:
Code:
HVC-101  -----0EC   ---EEEEC


Top
 Profile  
 
PostPosted: Sat Feb 25, 2017 3:09 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 798
Location: Sweden
Why did you think that? According to the wiki, Sour is correct I think?
And of course you can mod the AV Famicom's second controller port so that it has all pins that the NES has.

Not sure if you can mod controller port I for $4016.3 and $4016.4 as well though. Only game that I heard is using them is the unlicenced game Chiller. It allows to use two Zappers using both NES controller ports. And Tepple's controller detecting program that can detect about any kind of input device in any port.


Top
 Profile  
 
PostPosted: Sat Feb 25, 2017 7:12 am 
Offline

Joined: Sun Feb 07, 2016 6:16 pm
Posts: 285
At the very least, for the AllPads test to detect the HVC-101 (Family Computer + 0 or 1 dogbone), it needs to be:
HVC-101 -----0EC ---EEEEC

This also makes Mesen match the results given for the HVC-101 here: https://forums.nesdev.com/viewtopic.php ... 71#p183871
1P: 40 B8 40 B8
2P: 40 A0 40 A0

If using:
HVC-101 ---00-EC ---EEEEC

Then it always detects it as NES-101:
1P: 40 A4 40 A4
2P: 40 A0 40 A0

So it looks like tepples is correct?


Top
 Profile  
 
PostPosted: Sat Feb 25, 2017 3:47 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 798
Location: Sweden
So then the wiki must be wrong. Where did Tepples get this information from though if not from the wiki?


Top
 Profile  
 
PostPosted: Sat Feb 25, 2017 3:54 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19093
Location: NE Indiana, USA (NTSC)
I got the info from making a test ROM, whose source code is available, and having other members run it. What wiki page needs to be corrected?


Top
 Profile  
 
PostPosted: Sat Feb 25, 2017 4:13 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6277
Location: Seattle
Before Tepples wrote his test ROM, I could have sworn I had seen some reason to conclude that the HVC-101 and NES-101 had the same open-bus behavior on reads from $4016. Evidently not!


Top
 Profile  
 
PostPosted: Sun Feb 26, 2017 3:10 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 798
Location: Sweden
Hehe good thing he made that test ROM.

tepples wrote:
I got the info from making a test ROM, whose source code is available, and having other members run it. What wiki page needs to be corrected?

Oh I see, it's just the test results from your test program.

The incorrect part I know of is this one:
Quote:
Famicom $4016 and Top-loading NES $4016:
7 bit 0
---- ----
OOOx xMFD
|||| ||||
|||| |||+- Player 1 serial controller data
|||| ||+-- If connected to expansion port (and available), player 3 serial controller data (0 otherwise)
|||| |+--- Microphone in controller 2 on traditional Famicom, open bus on AV Famicom and top-loader
|||+-+---- Open bus on traditional Famicom, all 0s on AV Famicom and top-loader
+++------- Open bus

Here it says that the Microphone bit is open bus on AV Famicom, and D3 & D4 are allways 0.


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

All times are UTC - 7 hours


Who is online

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