Author Topic: Running the BIOS for the Super System CD Card  (Read 11789 times)

0 Members and 1 Guest are viewing this topic.

aloram

  • Guest
Running the BIOS for the Super System CD Card
« on: November 24, 2015, 07:53 PM »
I have a PC Engine Duo, and instead of taking out my Turbo Everdrive v1 to play a CD game, I run the BIOS ROM for the Super System CD card on the Everdrive, and that starts the CD. A person who's VERY knowledgeable about the PC Engine recommended I do this. But today I read a comment on the PCEngineFX forum that says to NOT do this. (They were talking about the v2, but I'm not sure if they give the same advice about the v1.) Krikzz, what do you recommend?

Here's what the forum said:

"NO!!! Please do NOT do this!!!

Some information has come to light recently that strongly suggests that doing this is a VERY-BAD-THINGâ„¢.

All indications are that running an un-modified Super System Card image on the TED2 will cause bus-fighting between the TED2 and the built-in 192KB of SCD RAM.

It looks like the SCD RAM wins the fight, and that it works ... but you are putting unusual stresses on both the built-in RAM chip and the TED2's RAM/level-shifters.  That is a bad thing, and may well lead to premature failure of either the TED2 or the console itself.

The patch that I've done fixes the problem so that there is no bus-fighting, and so that it is safe to use the TED2 to run CD games.

It is actually more important for DUO/DUO-R/SuperCDROM owners to use the patch than it is for Briefcase owners to take advantage of the ability to use it as a Super System Card.

See this thread in the Development Section for details of the problem ...

http://www.pcenginefx.com/forums/index.php?topic=20009.msg433149#msg433149

And this thread for the patch itself (now for both Japanese and USA Super System Cards) ...

http://www.pcenginefx.com/forums/index.php?topic=20120.msg436169#msg436169

P.S. It is possible that KRIKzz worked-around this issue in his hardware ... but all the indications lead to the conclusion that he's not done this. After all ... the card was never designed for, or meant for, running CD games."
« Last Edit: November 24, 2015, 07:55 PM by Heathcliff »

Offline elmer

  • Newbie
  • *
  • Posts: 45
  • Karma: +9/-0
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #1 on: November 24, 2015, 10:08 PM »
Well, I guess that you beat me here to post about this!

If you want KRIKzz to give a meaningful response, then you better quote some of the other messages, too.

It's an obscure technical issue ... and he's going to need all the details.

I'll post more later if you don't, but I'm too busy now.


aloram

  • Guest
Re: Running the BIOS for the Super System CD Card
« Reply #2 on: November 24, 2015, 10:22 PM »
Well, I guess that you beat me here to post about this!

If you want KRIKzz to give a meaningful response, then you better quote some of the other messages, too.

It's an obscure technical issue ... and he's going to need all the details.

I'll post more later if you don't, but I'm too busy now.
There's a lot of information on the other forum, and I'm not knowledgeable on this stuff, so I'd rather you post what Krikzz needs to read. I'm definitely curious if this is an issue with v1 as well. Thanks.

Offline elmer

  • Newbie
  • *
  • Posts: 45
  • Karma: +9/-0
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #3 on: November 25, 2015, 01:14 AM »
This all follows on from investigations into when & how the DUO/DUO-R/SuperCDROM unlock the built-in SCD RAM chip.

Chris Covell confirmed that the DUO/DUO-R/SuperCDROM SCD RAM (at banks $68-$7F) can be unlocked, and both written and read, on any 1MB-FLASH card (Turbo Everdrive, TotoTek PCE Pro, GameOfYou Flash Card, etc).

This was confirmed on a "GameOfYou Flash Card" where the circuit diagram is available, and we can see that it ties the HuCard CARD-DETECT line permanently low to disable the built-in System Card.  This apparently does not effect the SCD RAM unlocking.

This means that when you run an un-modified Super System Card image on the Turbo Everdrive, the unlocking sequence is executed by writing $AA, $55 to address $FF:18C0.

When the SCD RAM is unlocked, any CPU read request to an SCD RAM location in bank $68-$7F will cause both the Everdrive and the SCD RAM to try to respond at the same time, and you'll get both chips fighting to put a different byte value on the data bus.

This is a VERY-BAD-THINGâ„¢.

Now, it turns out the the built-in RAM seems to win the fight, and everything seems to work ... but you are putting unusual stress on the output drivers in the RAM chip and in the Everdrive card, and that could lead to early failure of one or the other.

There are various possible solutions to this situation that will stop this bus-fighting.

*********

1) If the Everdrive has a mapping register and only responds to read requests below 512KB when it is running a HuCard image that is 512KB or less ... then there won't be a conflict.

Unfortunately, when I tested a Turbo Everdrive 2 with a 256KB System Card image, I could still see the remains of data in banks $40-$67. This suggests that it either doesn't have a mapping register like that, or that it's not using it.

Now it could be that the TED 2 OS is smart enough to map out just banks $68-$7F when it sees you loading a Super System Card image ... but only KRIKzz can answer that.

I no longer own a Turbo Everdrive 1, so I don't know if it has such a mapping register, and if it uses it. Again, only KRIKzz can answer that.

*********

2) The other solution is to patch the Super System Card image so that it doesn't write the unlocking sequence, and so the SCD RAM stays hidden, and only the Turbo Everdrive responds to read/write requests to banks $68-$7F.

This patching could be done automatically in the TED2 OS when it sees that you are loading a Super System Card image ... or the image itself can be patched/customized.

What I've done is to write such a patch and make it available both in xdelta and in assembly source form.

The patch stops the Super System Card from writing the SCD RAM unlocking sequence, and instead changes the TED2 configuration bits to make it's entire RAM in banks $00-$7F writable.

It also includes some extra code to repair the System Card image after "Gate of Thunder" overwrites an important byte at $00:1FF5.

As a side-effect, it also means that translation teams and homebrew programmers have a full 512KB of RAM to use.

The other side-effect is that it means that Turbo Grafx CDROM and PCE Briefcase owners can use the TED2 instead of buying/using a Super System Card.

*********

Current Patch Version 3.01 - Initial version

Patch file for USA System Card 3.0 (in xdelta format) ...

https://www.dropbox.com/s/zcz384fj47xu84u/TED2%20System%20Card%203.01%20USA.xdelta?dl=0

Patch file for JPN System Card 3.0 (in xdelta format) ...

https://www.dropbox.com/s/nuctz90ra9aoo3k/TED2%20System%20Card%203.01%20JPN.xdelta?dl=0

Source code file (for pceas assembler) ...

https://www.dropbox.com/s/6ufsomh9z683xwb/syscard3-ted2.asm?dl=0

*********

What I'd like to know is if KRIKzz is aware of this issue, and already has a work-around in place in the current TED v1/v2 OS?

I'd also like to know if either the TED v1 or TED v2 contain a mapping register that can restrict them to only responding in the first 512KB of HuCard space ... and if so, where is it, and what value needs to be set?

I'd also like to know if the TED v2 has some way to make banks $00-$3F read-only while still leaving banks $40-$7F read-write?

Lastly, I'd like to know how to access the TED v2's memory in the region 2.5MB-4.0MB ... but I'll repeat that request in the TED2 Programming thread.

BTW, the source code for the patch is released under the Boost License, and so can be easily used by KRIKzz to update the TED2 OS if it doesn't already handle this issue.

Offline elmer

  • Newbie
  • *
  • Posts: 45
  • Karma: +9/-0
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #4 on: November 27, 2015, 08:02 PM »
The bios.s file that KRIKzz kindly posted in the "Turbo Everdrive 2 Programming" thread has helped give me some idea of what's going on in the TED2's mapping register.

If I'm right, it just confirms that the bus-fighting is going to happen on a TED2 if you don't use the patched System Card image that I posted about.

The TED1 is still a mystery ... but if its mapper register is like the TED2's, then there's not a lot that can be done about it.

AFAIK, this really is something that only KRIKzz is in a position to answer definitively.

Since I can't see much reason for KRIKzz to have designed the TED1 hardware to allow itself to be disabled in the banks $68-$7F (or $40-$7F), then my guess is that every owner will just have to decide for themselves whether they want to risk the potential long-term damage of the bus-fighting, or risk the potential long-term damage of constantly inserting and removing the TED1 from the HuCard slot.

Is there an Electrical Engineer here that could comment on the long-term effects of the bus-fighting on the 30-year-old chips in consoles that were never designed for it?

aloram

  • Guest
Re: Running the BIOS for the Super System CD Card
« Reply #5 on: November 27, 2015, 11:54 PM »
The bios.s file that KRIKzz kindly posted in the "Turbo Everdrive 2 Programming" thread has helped give me some idea of what's going on in the TED2's mapping register.

If I'm right, it just confirms that the bus-fighting is going to happen on a TED2 if you don't use the patched System Card image that I posted about.

The TED1 is still a mystery ... but if its mapper register is like the TED2's, then there's not a lot that can be done about it.

AFAIK, this really is something that only KRIKzz is in a position to answer definitively.

Since I can't see much reason for KRIKzz to have designed the TED1 hardware to allow itself to be disabled in the banks $68-$7F (or $40-$7F), then my guess is that every owner will just have to decide for themselves whether they want to risk the potential long-term damage of the bus-fighting, or risk the potential long-term damage of constantly inserting and removing the TED1 from the HuCard slot.

Is there an Electrical Engineer here that could comment on the long-term effects of the bus-fighting on the 30-year-old chips in consoles that were never designed for it?
If I understand correctly, this is probably the same problem on the v1, but you're not sure. And if it is a problem, the v1 can't handle your patch, so those of us with a v1 have to either risk damage by running the Super System 3.0 BIOS, or remove the card to use the CD drive. Is that right elmer?

Offline elmer

  • Newbie
  • *
  • Posts: 45
  • Karma: +9/-0
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #6 on: November 28, 2015, 01:32 AM »
If I understand correctly, this is probably the same problem on the v1, but you're not sure. And if it is a problem, the v1 can't handle your patch, so those of us with a v1 have to either risk damage by running the Super System 3.0 BIOS, or remove the card to use the CD drive. Is that right elmer?

Yes, that's basically the situation as-far-as-I-know-it.

IMHO, it's much more likely that the same problem exists with the TED1 as the TED2, than that they're different.

From what I can see, KRIKzz's design just makes sense ... it's NEC's design of the built-in SCD RAM on the DUO/DUO-R/SuperCDROM that seems strange.

aloram

  • Guest
Re: Running the BIOS for the Super System CD Card
« Reply #7 on: November 28, 2015, 03:05 AM »
Do you plan to make a similar patch for v1? Is it even possible?

Offline phoenixdownita

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +28/-7
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #8 on: November 28, 2015, 04:00 AM »
The TEDv1 has absolutely no RAM, so I am not sure what it maps there, the flash?

Offline elmer

  • Newbie
  • *
  • Posts: 45
  • Karma: +9/-0
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #9 on: November 28, 2015, 05:05 AM »
Do you plan to make a similar patch for v1? Is it even possible?

AFAIK, there is no simple patch that's possible for the TED1, but KRIKzz may know a way to map out the top 512KB of cartridge space on it so that it doesn't respond to "read" requests.

If I get that information, then I can have a patched System Card in a few hours.

But I suspect that we're going to find that it's just not possible.


The TEDv1 has absolutely no RAM, so I am not sure what it maps there, the flash?

Yes, it's the TED1's flash memory ... from 832KB-1024KB of cartridge space.

The TED2 has RAM there ... which the Turbo Everdrive OS uses to simulate a 1MB HuCard.

On the TED1 it's flash ROM ... which the Turbo Everdrive OS uses to simulate a 1MB HuCard.

Same idea, different technology. It's that difference that makes a simple patch possible for the TED2.

aloram

  • Guest
Re: Running the BIOS for the Super System CD Card
« Reply #10 on: November 29, 2015, 04:20 PM »
Sounds good. Hopefully you'll get the necessary information from Krikzz. Thanks.

Offline phoenixdownita

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +28/-7
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #11 on: November 30, 2015, 12:04 AM »
If the BIOS is  NOT loaded from the TED is that a problem?

I ask because aside loading the USA version of the SysCard3 on Jap Duo to handle the BRAM (Format/Delete) I don't really bother to load anything before playing the games.

The exclusions would be Populous (if it tries to map both RAMs, but on TEDv1 on Duo it used to work, not sure how/why and if it does bus clash), and Altered Beast that plays on SysCard 1.0 only .... but then it does not need the extra RAM so I expect o bus clash here (or even the 64KB base are a risk)?.
In short aside real SuperCDROM games that actually do take advanatge of the extra RAM of SysCard3.0, would anything else really clash?
[one case is for the PCExpress CD games that do use the extra RAM indirectly available on the Duo etc... not sure if that also triggers the clash]

Offline elmer

  • Newbie
  • *
  • Posts: 45
  • Karma: +9/-0
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #12 on: November 30, 2015, 07:46 PM »
If the BIOS is  NOT loaded from the TED is that a problem?

I ask because aside loading the USA version of the SysCard3 on Jap Duo to handle the BRAM (Format/Delete) I don't really bother to load anything before playing the games.

When you run the unpatched Super System Card image on a DUO/DUO-R/SuperCDROM, the card unlocks the SCD RAM as part of it's startup. It doesn't matter if you actually run any games, or just manuipulate the BRAM.

If you want to run HuCard games afterwards, you should turn your system off to relock/hide the SCD RAM first.

Just pressing the "reset" button on the TED is not enough.


Quote
The exclusions would be Populous (if it tries to map both RAMs, but on TEDv1 on Duo it used to work, not sure how/why and if it does bus clash), and Altered Beast that plays on SysCard 1.0 only .... but then it does not need the extra RAM so I expect o bus clash here (or even the 64KB base are a risk)?.

There shouldn't be any problem with regular CD2 games, or with using a System Card 2 or System Card 1 image on either the TED1 or the TED2.

I've not checked Populous to see if it does the SCD unlocking sequence ... but I can't see why it would, since I thought that it included it's own RAM rather than using the SCD RAM.

The TED2 specifically supports Populous, so there shouldn't be any problem.

If you are running Populous on the TED1, then I can only assume that you are running the Super System Card image first to unlock the RAM ... which sounds like it will cause the bus-fighting.


Quote
In short aside real SuperCDROM games that actually do take advantage of the extra RAM of SysCard3.0, would anything else really clash?

[one case is for the PCExpress CD games that do use the extra RAM indirectly available on the Duo etc... not sure if that also triggers the clash]

If the PCExpress CD games enable the SCD RAM (which sounds likely), then they will cause the same bus-fighting if you run the PCExpress HuCard image on the TED2 (and presumably the TED1 - we're still waiting for KRIKzz to post something in this thread).

I've never run the PCExpress games, so I've not looked. If there is a problem, then it can probably be patched, just like I've done on for the Super System Card.

Offline phoenixdownita

  • Sr. Member
  • ****
  • Posts: 383
  • Karma: +28/-7
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #13 on: November 30, 2015, 08:37 PM »
Regarding Populous on Duo you don't need to run anything before it.
It is possible it is happy with the std 64K of DRAM of the CD (no need for the remaining 192 of the Sys v3, not sure).

Regarding the "bus clash", if the RAM (TEDv2 only at thi point) is set to FF it would look like a pull up on the bus so that would not matter and the clash would be immaterial, right?
[I don't know if the flash (TEDv1 only) upon erasing/reflashing is set to FF if unused, I am not even sure the erase clears it all (likely it does not)].

Offline nuu

  • Hero Member
  • *****
  • Posts: 947
  • Karma: +45/-2
    • View Profile
Re: Running the BIOS for the Super System CD Card
« Reply #14 on: December 01, 2015, 11:10 PM »
There are at least two versions of the Populous Hucard game (in the no-intro set they are named "Populous (Japan)" and "Populous (Japan) (Alt 1)"). One doesn't have a battery and seems to use the bram for saving (although it has the romram marking on it, the battery isn't there if you open it). I'm assuming the other one has an on-board battery-backed ram like Tennokoe Bank. I don't think any of them are using any CD RAM.

It's a good thing that only the Super CD BIOS is causing troubles. One of the nice things with TED is that you can use any system card with it, including Game Express and CD BIOS v1 for Altered Beast CD.