It is currently Sat Jul 20, 2019 10:59 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Jan 09, 2019 4:34 pm 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
I updated the pinout on the wiki for MMC6 (MMC3 variant used only for Startropics 1/2).

https://wiki.nesdev.com/w/index.php/MMC6_pinout

I found pins 4 and 5 to have infinite resistance to all other pins (considering them n/c).

I found these 2 outputs:
Pin 6 = Inverted M2 output
Pin 16 = Non-inverted PPU A13 output

I also found that pin 26 is CHR A15.

The MMC6 has these additional input signals in Startropics, not present on the MMC3:

Pin 58 = CPU A12: Not used for the internal RAM -- this is something else.
Pin 28 = PPU /RD: Unknown purpose. Not being buffered through the MMC6 for the purpose of CHR /OE.
Pin 29 = PPU A13: Pin 16 is a buffered output of this signal, but not being used in Startropics. CHR /CE connects directly to PPU A13, so not sure why MMC6 still is getting this one as an input, or why the output was not used.


Top
 Profile  
 
PostPosted: Wed Jan 09, 2019 4:39 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8486
Location: Seattle
Sometimes they added an OR gate, like in Sunsoft 4, to combine PPU /RD and PPU A13 to use ROMs with a single enable.

And sometimes, like the VRC7, they appear to have tried to do that and screwed it up somehow.


Top
 Profile  
 
PostPosted: Wed Jan 09, 2019 4:53 pm 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
Yes, I verified you are exactly correct, pin 16 = PPU /RD || PPU A13. Will update.

For my testing, I have unknown pins (3,7,8,9,12) all floating, and all float to 0.


Top
 Profile  
 
PostPosted: Wed Jan 09, 2019 5:16 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8486
Location: Seattle
Have you found any reason to think that pins 28 and 29 are used for anything other than an OR gate?


Top
 Profile  
 
PostPosted: Wed Jan 09, 2019 6:53 pm 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
lidnariq wrote:
Have you found any reason to think that pins 28 and 29 are used for anything other than an OR gate?

No, I have found no other function affected by 28/29 yet but I also haven't tested much yet. I am thinking that at some point I should put the board back together and:

A. Disconnect 28/29, tie them low or high, see if it makes any difference
B. Try each combination of unknown input pins while playing the game.


Top
 Profile  
 
PostPosted: Wed Jan 09, 2019 7:21 pm 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
Ben Boldt wrote:
Pin 58 = CPU A12: Not used for the internal RAM -- this is something else.

CPU A12 is for internal RAM, my bad. MMC3 maps RAM from $6000-7FFF and MMC6 maps RAM $7000-7FFF, thus it needs CPU A12 to distinguish between $6xxx and $7xxx... So no surprises there after all.


Top
 Profile  
 
PostPosted: Fri Jan 11, 2019 5:53 pm 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
I reassembled the board with tape under these MMC6 pins:

3, 7, 8, 9, 12, 28, 29

I then soldered a magnet wire to each of these pins, through a 500 ohm resistor, each to its own switch that can be set to GND or 5V. I then tested with the title screen, flipping the switches.

I tried to see if I could find a RAM read protect or write protect by registering names and power cycling. I found no combination of switches that prevented me from reading or writing to the RAM.

I found that setting pin 3 high causes the CHR page to change and the triangle channel to always turn on to a particular note. The CPU will crash when attempting to exit the title screen to start the game with this pin high. CHR page returns to normal when switching back to GND but audio sometimes has some registers corrupted and sounds strange as it continues playing.

I found similar but different results with pin 12 when set low. With Pin 12, triangle channel always turns on with the same note as pin 3, but the CHR page is not affected. On the world map, the bottom 2 rows of tiles, which are normally black, become visible. When I walk around, which should scroll the map, the map does NOT scroll in any direction, but the bottom row of tiles updates like it normally would for scrolling. When I set pin 12 back high, instantly the background updates to where it should have scrolled to and the 2 bottom rows of tiles go back to black. Some tiles have the wrong palettes but causing the screen to scroll brings them back to normal. Sometimes a few tiles get changed from this and remain even when scrolling. When returning pin 12 high, triangle channel always remains on indefinitely and no additional music will play, even if I do it during the title and start the game where different music should start playing.

When setting pin 12 low when talking to Chief Coralcola, the background disappears, except for his mouth which keeps moving. The status bar on the bottom moves up by about 4 or 5 pixels. It does not move up by a full tile and Chief's mouth does not change position.

Setting pin 12 low and pin 3 high at the same time causes the screen go a little crazy. The tile data changes rapidly, not with any recognizable pattern. The screen looks like it is jerkily scrolling vertically but the palettes stay in place. You can clearly see the 2x2 tile palettes colors staying completely still on the screen. Flipping both switches back, everything goes pretty much back to normal, with slight corruptions and the triangle channel stuck with no music playing like before.

I was not able to find any effect during gameplay from toggling pins 7,8,9 (unknown pins) or 28/29 (normally PPU /RD, PPU A13)


Top
 Profile  
 
PostPosted: Fri Jan 11, 2019 5:59 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8486
Location: Seattle
That sounds like pins 3 and 12 somehow break banking.


Top
 Profile  
 
PostPosted: Fri Jan 11, 2019 6:59 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1467
lidnariq wrote:
That sounds like pins 3 and 12 somehow break banking.

Perhaps they're specialized chip reset signals?

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
PostPosted: Fri Jan 11, 2019 8:06 pm 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
lidnariq wrote:
That sounds like pins 3 and 12 somehow break banking.

I should look at the CHR A10-A17 pins while doing this for clues.

Quietust wrote:
lidnariq wrote:
That sounds like pins 3 and 12 somehow break banking.

Perhaps they're specialized chip reset signals?

I thought that MMC3 started up in an unknown state, suggesting it didn't have a reset mechanism? Interesting thought, maybe they added it.

What really baffles me is how this can trigger the triangle channel to turn on, always the same note, and the other channels to turn off. Always the same every time. How can this be possible?


Top
 Profile  
 
PostPosted: Fri Jan 11, 2019 9:43 pm 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
I measure the triangle channel at 500 Hz when this happens.

Something new I found is if I power cycle lots of times with pins 7,8,9 = 1,0,0, (which is the opposite of how the PCB is wired), once in a while it will cause the game to crash right away. Once it has done this, it seems the MMC6 is latched in a condition where 1,0,0 causes it to crash. I can press reset repeatedly and it will crash every time. Changing 7,8,9 and pressing reset again:

000 crashes when entering town
001 OK
010 crashes at title
011 OK -- PCB's combo
100 crashes at title
101 OK
110 OK
111 OK

Switching to 1,0,0 or 0,1,0, it crashes again right away, before pressing reset, but I pressed reset anyway to make sure I didn't catch an intermediate combination or trigger something with switch bounces, etc. I repeated these tests many times, especially trying to get 110 to crash but it never did for me. Power cycling again clears this behavior and no combination of 7,8,9 can cause any noticeable effect or crash.

I tried again power cycling with the original PCB's combo 0,1,1, then once running, change the switches to 1,0,0. It was able to get latched that way, showing that the power-on values of 7,8,9 does not affect getting into this mode or not.

I power cycled 55 times, and it got into the mode 15 / 55 times = 27.27%, which seems reasonably close to 25%, potentially suggesting 4 modes, 1 of which listens to 7,8,9 and triggers this crash. That is making a lot of assumptions but still worth considering.

Playing a bit more with this, I got into the crashy mode again, with switches set to an OK combo, then got to the menu where you enter your name. I switched to a crash combo and it didn't crash, but the sound effects when entering characters were glitchy and distorted. Switching back to an OK combo, the sound effects are normal again. both crashy combos distorted the character entry sound effects the same way. Combo 000 did not have any effect on this screen that I could tell.


Top
 Profile  
 
PostPosted: Sat Jan 12, 2019 8:23 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8486
Location: Seattle
Ben Boldt wrote:
What really baffles me is how this can trigger the triangle channel to turn on, always the same note, and the other channels to turn off. Always the same every time. How can this be possible?
(sorry about the delay, I missed seeing this the first several times I read through) If PRG banking is somehow broken, and it jumps into the wrong code, all bets are off. Once on this bad code path, the only thing noteworthy about it is that it appears to be consistent ... which only implies that PRG banking is predictably broken, not random.


Top
 Profile  
 
PostPosted: Sat Jan 19, 2019 3:55 pm 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
I am looking at the MMC6 again today. I hooked up more signals to help understand these unknown pins.

With all unknown input pins set the same as the Startropics PCB, except setting pin 3 = 1, I find that all CHR-ROM address bits (A10-A17) follow exactly CPU R/W. I tried writes to several different addresses. Setting pin 3 back to 0, the previously selected CHR bank is restored on A10-A17. In both of the screenshots, I had my CHR bank set to $AA.


Attachments:
tek00048.png
tek00048.png [ 30.82 KiB | Viewed 3875 times ]
tek00049.png
tek00049.png [ 37.21 KiB | Viewed 3875 times ]
Top
 Profile  
 
PostPosted: Sat Jan 19, 2019 5:36 pm 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
It seems that when pin 3 = 1, the CHR bank is overridden by either all 0s or all 1s, depending on M2, R/W, and pin 12.

The bank value overwritten follows (M2 && R/W) || (12 && R/W)

Code:
  3  | 12  | M2  | R/W | Effect on CHR bank
-----+-----+-----+-----+-------------------------------------------
  0  |  0  |  0  |  0  | Normal (Audio/CPU crash)
  0  |  0  |  0  |  1  | Normal (Audio/CPU crash)
  0  |  0  |  1  |  0  | Normal (Audio/CPU crash)
  0  |  0  |  1  |  1  | Normal (Audio/CPU crash)
  0  |  1  |  0  |  0  | Normal (Same as Startropics PCB)
  0  |  1  |  0  |  1  | Normal (Same as Startropics PCB)
  0  |  1  |  1  |  0  | Normal (Same as Startropics PCB)
  0  |  1  |  1  |  1  | Normal (Same as Startropics PCB)
  1  |  0  |  0  |  0  | CHR A10-A17 all 0
  1  |  0  |  0  |  1  | CHR A10-A17 all 0  <- yes, zero
  1  |  0  |  1  |  0  | CHR A10-A17 all 0
  1  |  0  |  1  |  1  | CHR A10-A17 all 1, except CHR A13 = 0
  1  |  1  |  0  |  0  | CHR A10-A17 all 0
  1  |  1  |  0  |  1  | CHR A10-A17 all 1
  1  |  1  |  1  |  0  | CHR A10-A17 all 0
  1  |  1  |  1  |  1  | CHR A10-A17 all 1

The MMC6 never appears to lose track of its original CHR bank, it will always restore the bank when returning to any 'normal' combination in the table. I did not find any sort of latching or edge triggering behavior. Everything seemed combinational. All of the tests I did were with function generator hooked to pin 3 or 12, doing CPU reads and writes.


Edit:
Revised combination 1,0,1,1. Specifically CHR A13 = 0, all others = 1 in this combination.

Value overwritten (CHR A10-A17, except A13):
(M2 && R/W) || (12 && R/W)

Value overwritten (CHR A13):
(12 && R/W)

All of this testing was done with PPU A10,11,12,13 all driven = 0. Will try other PPU addresses and see what happens.


Edit 2:
I have tested each and every case with all combinations of PPU A10, A11, and A12 and found no violation of the table above. In cases where I am in a 2kbyte CHR bank, CHR A10 is in fact still overridden per the table, even though it is behaving with its normal passthrough from PPU A10 to CHR A10 when not overridden.

The above testing was with PPU A13 always = 0. I also tried a couple additional combinations with PPU A13 = 1 and found no differences.


Top
 Profile  
 
PostPosted: Mon Jan 21, 2019 11:53 am 
Offline
User avatar

Joined: Tue Mar 22, 2016 8:27 pm
Posts: 335
Location: Minnesota, USA
Attached example scope shots of how I built the table. I ran these tests with each combination of PPU A10,11,12.


Attachments:
File comment: This is how the Startropics board is configured.
normal 3=0,12=1.png
normal 3=0,12=1.png [ 33.83 KiB | Viewed 3747 times ]
3=toggle,12=1.png
3=toggle,12=1.png [ 40.93 KiB | Viewed 3747 times ]
3=toggle,12=0.png
3=toggle,12=0.png [ 39.65 KiB | Viewed 3747 times ]
3=1,12=toggle.png
3=1,12=toggle.png [ 40.78 KiB | Viewed 3747 times ]
3=0,12=toggle.png
3=0,12=toggle.png [ 36.82 KiB | Viewed 3747 times ]
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

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