(SNES) Changing Chrono Trigger (J) into (U)

A place that you can discuss reproduction of classic titles or "licensed-for-reproduction" homebrew for personal use.

Moderators: B00daW, Moderators

Forum rules
1. NO BLATANT PIRACY. This includes reproducing homebrew less than 10 years old, with the exception of free software.
2. No advertising your reproductions, with the exception of free software.
3. Be nice. See RFC 1855 if you aren't sure what this means.
User avatar
Ben Boldt
Posts: 592
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

(SNES) Changing Chrono Trigger (J) into (U)

Post by Ben Boldt » Sat Jan 18, 2020 9:07 pm

I got snowed in yesterday and today without much to do and I decided to get my old Japanese Chrono Trigger converted to English. So basically, do a repro on a Chrono Trigger cart to turn it into... Chrono Trigger. I thought it would be easier than learning Japanese but I may have been mistaken.

This is a 4 megabyte game, so I used the old tried and true M27C322-100F1 EPROM, plus 2x 74HCT257 (quad 2-input multiplexers with 3-state output) to turn the EPROM from 16-bit into 8-bit.

I got the game "working" sort of, but there were graphical glitches and the game would hang easily. It would not usually make it through the demo. Since the original game had the ROM split into 2 mask ROMs, it was using the MAD-1 chip to provide separate /CS's for each ROM (i.e. /CS1, /CS2). Initially, I had done the logic to combine /CS1, /CS2, and /OE into 1 /OE signal for the multiplexers. !( (!(CS1*CS2)) * (!OE) ) or something like that.

After a little further research, I found that I could just /RD OR'd with /CART, both directly from the edge connector, to drive /OE of the multiplexers. When I did this the game IMPROVED. Less glitches and less crashes.

So I got intrigued by that, how it could have made any difference, and it made me think about speed, propogation delays, etc. I tried 3 different M27C322-100's, and they all kind of behaved differently. One of them was a shrunk die version (easy to tell, haha), and that one performed noticeably the best. All 3 EPROMS got erased, verified erased, programmed, verified programmed with my TOP3000. I even came back later and blindly did a dump of the EPROM and compared it to the original SMC file and it was indeed still identical.

I was using a 74S32 OR chip, and I dug a little deeper and found a 74HC32 and swapped it out. This made ANOTHER big improvement. It took me a while to realize it wasn't perfect this time. To me, it points to speed or logic thresholds. The 27C322 is a 100ns part, and the multiplexers are apparently 30ns parts -- could I be over the 120ns FastROM maximum somehow? I mean, I am definitely not the first person to do this, it seems I must be doing something wrong because I googled and nobody ever thinks speed is an issue with the 100ns EPROM. Does anyone have a clue what might be wrong here?
IMG_1845.JPG
IMG_1846.JPG
IMG_1847.JPG
IMG_1848.JPG

Ice Man
Posts: 546
Joined: Fri Jul 04, 2014 2:34 pm

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ice Man » Sun Jan 19, 2020 8:47 am

2x 74HC(T)257 + 1x 27C322 has always worked for me in any situation.

Is that a SHVC-BJ3M board by any chance? If so, I'm sure your wiring to the MAD-1 is the problem because you really only need to connect the 74HC257 Pin 15 (/OE) to pin 4 of the MAD-1. I have had issues with a BA3M Super Metroid myself when trying to connect the 27C322 to the wrong outputs of the MAD-1 (namely pin 1 or 16) giving me glitches for sprites and eventually crashing the game.

Also make sure all address lines are connected properly on the EPROM as well as having MAD-1 Pin13 connected to A21 and Pin 12 connected to A22.

User avatar
Ben Boldt
Posts: 592
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ben Boldt » Sun Jan 19, 2020 9:58 am

Yes, this is a SHVC-BJ3M-20 board. I followed your instruction and connected the 74HCT257 /OE directly to MAD-1 pin 4. This returned it to the pretty bad glitching I had initially:
IMG_1854.JPG
IMG_1852.JPG
In fact, the game would not run at all with the die shrunk EPROM. I heard the audio pop indicating the audio coprocessor got initialized, but then just black screen. I swapped to one of my large die EPROMs and it was able to run enough to get those screenshots. Using the OR gate, the only visible glitch was the 3 gamesave slots -- those have always been glitched like that no matter what I do. The glitching pattern is not always the same, especially as I swap different EPROMs.

I have quadruple checked all of my address lines and tested continuity all the way to the edge connector. My board is a little bit fluxxy but not too bad. This is no-wash flux in the solder I used so it shouldn't be a problem. I have found no effect from pushing and touching on various parts of the board.

Ice Man
Posts: 546
Joined: Fri Jul 04, 2014 2:34 pm

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ice Man » Sun Jan 19, 2020 11:07 am

That glitching looks like a defective EPROM tbh.

lidnariq
Posts: 9697
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by lidnariq » Sun Jan 19, 2020 12:20 pm

If I remember, UVEPROMs get slower each time they're erased...

User avatar
Ben Boldt
Posts: 592
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ben Boldt » Sun Jan 19, 2020 12:22 pm

Ice Man wrote:
Sun Jan 19, 2020 11:07 am
That glitching looks like a defective EPROM tbh.
It does change things slightly when I swap different EPROMs -- that does point to that I guess. It verifies though... :?: :?: Making my 74HCT247 /OE faster by using a faster OR gate helped a LOT though; that seems to point father away from the EPROM. Do you suppose these EPROMs are defective in that they are slower than usual?
lidnariq wrote:
Sun Jan 19, 2020 12:20 pm
If I remember, UVEPROMs get slower each time they're erased...
Uh oh I didn't know that. These come from Chinese back alley, possibly sitting exposed to the sun for several decades...

User avatar
Ben Boldt
Posts: 592
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ben Boldt » Sun Jan 19, 2020 12:57 pm

How can it help so much to use a 74HC32 OR gate instead of the MAD-1 chip? All that I am doing is speeding up the multiplexers when I do that and it is a night and day difference. I don't understand how that can affect it if the EPROM is the only problem. I did have to remove the RAM chip and dead bug it onto the other side of the board to make things fit. I don't actually know if this cart worked perfectly before modifying it. Maybe I have a bad RAM? Again, not sure how speeding up the muxes has any effect on a bad RAM. Or bad EPROM for that matter... Why on earth the speed of the mux matters, there has to be something there.

I have a 4th EPROM that was very stubborn to erase, but I kept throwing it back into the eraser and checking it each half hour and it did erase completely blank after about 3 hours total. That can't be normal. It is another shrunk die version. I burned it today and it is running the same as the other shrunk die one -- better than the big die ones with the OR gate, but not working at all when using MAD-1 pin 4.

lidnariq
Posts: 9697
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by lidnariq » Sun Jan 19, 2020 1:21 pm

Ben Boldt wrote:
Sun Jan 19, 2020 12:57 pm
How can it help so much to use a 74HC32 OR gate instead of the MAD-1 chip? All that I am doing is speeding up the multiplexers when I do that and it is a night and day difference. I don't understand how that can affect it if the EPROM is the only problem.
I mean, that's huge, if it's marginal behavior. If you have a deadline of 3/(21477kHz)=140ns from when /RD falls to when data needs to be on the bus, and some words in the ROM are taking 120ns to get out, a 74HC32 that has a tpd of 10ns, instead of a MAD-1 that has a tpd of 30ns, will be the difference between the CPU getting the byte and not.
I have a 4th EPROM that was very stubborn to erase, but I kept throwing it back into the eraser and checking it each half hour and it did erase completely blank after about 3 hours total. That can't be normal.
You're right, it isn't.

User avatar
Ben Boldt
Posts: 592
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ben Boldt » Sun Jan 19, 2020 2:02 pm

Here is how I am looking at it:

I haven't measured any timings, but for the sake of example, let's say that from the point in time when the address appears on the address bus, it takes 0ns for A0 to be valid (i.e. the mux select signal), 120ns for the data to come out the EPROM (i.e. the mux data inputs), and 10ns for the signal to come out of my OR gate (i.e the mux /OE signal).

So, the mux is going to have its /OE correct in 10ns, and for the next 110ns, it will have the old or invalid data from the EPROM, which then changes, and then the output of the mux changes after the propagation delay of the mux, let's say 30ns. So valid data comes out at 120+30ns = 150ns, took too long, I think we are on the same page there.

Where I am confused, if you slow down the OR gate to 40ns, now the /OE was correct in 40ns, and for the next 80ns it has old data from the EPROM. But who cares? Why does it matter how long the OR gate takes as long as it's ready before the EPROM?? That is the part I don't get. From my testing, the speed of the OR gate is critical. I did another experiment just now, where I ran the signal through all 4 OR gates in the 74HC32:
IMG_1855.JPG
As you can see, it makes it way worse, even though it should still be ready way faster than the EPROM.


Edit:
I swapped to a different RAM chip, a skinny one that fits on the correct side of the board, it made no difference. (This was included in the previous screenshot.)


Edit 2:
Here it is on a different SNES, still with all 4 or gates and the 3-hour-erase EPROM (cart not modified since previous screenshot):
IMG_1856.JPG
IMG_1857.JPG

Edit 3:
I have 8 more M27C322-100F1's coming from AliExpress now. When they come in a few weeks, I will try them and let you know.

User avatar
Ben Boldt
Posts: 592
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ben Boldt » Tue Jan 21, 2020 8:15 pm

Well I guess I ordered some of these earlier because I just got 5pcs M27C322-100F1 in the mail today. I tested, all 5 were blank. I burned one of them, put it into the cart, and it acts the same. The backgrounds of the text windows have garbage on them... I guess I should hook my scope up to the muxes and see what is going on with the /OE.

Edit:
I ordered up some MAX4674 quad analog mux, I think they should have a faster propagation delay than the 74HC257, but I would be using the /E and /G inputs on the 27C322, so not sure how slow it is to do that. I can't really even say that I know what is wrong yet, even though we have some good ideas here. Some combination of something is bound to work. This game might be for my nephew, I think he would like it, so I'm pretty determined to get it to work. And I'll be darned if I am going to just go buy a real USA one. Giant EPROM chip sticking out the back is way cooler.

User avatar
Ben Boldt
Posts: 592
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ben Boldt » Mon Jan 27, 2020 8:05 pm

Update on this: The MAX4674's were a winner. The game works perfectly with these multiplexers. I don't think most people use the 74HCT257s, there might be a reason there why it didn't work right. The HCTs are slightly slower per the spec sheet but not by much. I connected /RD to the MAX4674 /EN inputs, and I connected /CART to /E of the M27C322, and GND to /G of the M27C322.
IMG_1868.JPG

Markfrizb
Posts: 532
Joined: Sun Dec 02, 2012 8:17 am
Location: East Texas

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Markfrizb » Wed Jan 29, 2020 10:45 am

Ben Boldt wrote:
Mon Jan 27, 2020 8:05 pm
Update on this: The MAX4674's were a winner. The game works perfectly with these multiplexers. I don't think most people use the 74HCT257s, there might be a reason there why it didn't work right. The HCTs are slightly slower per the spec sheet but not by much. I connected /RD to the MAX4674 /EN inputs, and I connected /CART to /E of the M27C322, and GND to /G of the M27C322.

IMG_1868.JPG
There's no need to connect /CART to the rom's enable line. The HC32 is the ultimate gate keeper of when the data is transmitted (or not) going by your earlier schematic drawing, so it's better to just ground both enable lines (as your schematic showed earlier), to reduce any delays. The speed of the '32 can also cause an issue of delay too.

User avatar
Ben Boldt
Posts: 592
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ben Boldt » Thu Jan 30, 2020 12:27 pm

Sorry I don't think I mentioned that I had removed the 74HC32 in the latest one where it is working now.

I am not very familiar with SNES, this is kind of a first for me. From what I saw, the original ROMs were hooked up like this:

ROM 0
/CE <- Mad-1 /CE_0
/OE <- /RD from card edge

ROM 1
/CE <- Mad-1 /CE_1
/OE <- /RD from card edge

And from what I understand from looking at the MAD-1 truth table is that MAD-1 /CE_0 and /CE_1 are just a product of /CART and an address bit. So this is why I gated the ROM from driving the data bus using both /CART and /RD. Would you please point out which part of that was wrong or unnecessary? thanks

User avatar
Ben Boldt
Posts: 592
Joined: Tue Mar 22, 2016 8:27 pm
Location: Minnesota, USA

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by Ben Boldt » Tue Feb 04, 2020 4:42 pm

Thanks again for the help Markfrizb. I have another one I am trying, this time with 74HC157 (not HCT), just out of curiosity mostly, just to see if it makes a difference getting my slow EPROMs to work with these Muxes with a HiROM, FastROM game. I am faced with the same dilemma again, ROM /OE is coming from the MAD-1 chip pin 4, and ROM /CE is coming from Edge pin 23 (/RD). What is the best way to connect these to the '157 /CE's? Should I be using an OR gate for that or would I be OK just using MAD-1 pin 4 on its own? In this cart, I have MAD-1 hooked up like this:

Code: Select all

MAD |
Pin | Connection
----+------------
  1 | n/c
  2 | RAM /CE
  3 | n/c
  4 | Mux /E
  5 | RAM Vcc
  6 | +5V
  7 | Vbat
  8 | GND
  9 | Edge 26 (/Reset)
 10 | GND (Mode)
 11 | Edge 49 (/Cart)
 12 | Edge 47 (HiROM A22)
 13 | Edge 46 (HiROM A21)
 14 | Edge 39 (A14)
 15 | Edge 38 (A13)
 16 | n/c

lidnariq
Posts: 9697
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: (SNES) Changing Chrono Trigger (J) into (U)

Post by lidnariq » Tue Feb 04, 2020 4:45 pm

74'157s, unlike 74'257s, leave their output driven when disabled. So they're not suitable for this sort of thing...

Post Reply