Author Topic: 8Mbit Flash HuCard FAQ  (Read 2614 times)

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: 8Mbit Flash HuCard FAQ
« Reply #30 on: June 16, 2012, 01:16:48 PM »
I guess this is where we implore someone to try out Parasol Stars on one of the older generation flash cards to see what happens there.
<a href="http://www.pcedaisakusen.net/2/34/103/show-collection.htm" class="bbc_link" target="_blank">My meager PC Engine Collection so far.</a><br><a href="https://www.pcenginefx.com/forums/" class="bbc_link" target="_blank">PC Engine Software Bible</a><br><a href="http://www.racketboy.com/forum/" c

ConHuevos

  • Jr. Member
  • **
  • Posts: 97
Re: 8Mbit Flash HuCard FAQ
« Reply #31 on: June 16, 2012, 01:41:50 PM »
I will try out Parasol Stars, when I get a chance, & see if I get similar results.

I have tried Parasol Stars, & I get the same result (graphic glitches).  I'm not sure of the reason.  But if any commercial games have extra circuitry (logic, decoders, ram, ...) other than ROM memory, then the Flash HuCard will not be able to play them.  As long as the commercial game contained only ROM chips (up to 8Mbit), they should work on the Flash HuCard.  But there are bound to be some games that won't work because of these reasons.  Hopefully it will turn out to be a very small percentage.
 
If anyone has any further insights, let us know.

Overall, I'm pleased with the compatiblity, it's the only US game I've encountered with any problem.  The other games mentioned, Ninja warrior and Cybercore are far worse at the glitches!  You literally only get opaque boxes on the screen.

Aladar

  • Newbie
  • *
  • Posts: 39
Re: 8Mbit Flash HuCard FAQ
« Reply #32 on: June 16, 2012, 02:21:11 PM »
I think the problem is the /WR signal.
Years ago I discovered that the HuC6280 generates spurious writings during the START and RESET sequences.
More info tomorrow, I'm going to sleep.

ConHuevos

  • Jr. Member
  • **
  • Posts: 97
Re: 8Mbit Flash HuCard FAQ
« Reply #33 on: June 16, 2012, 02:23:38 PM »
I (mostly Vec) has indentified the problem, he's the author who wrote the TG16/Duo emulation core for Bizhawk!

All the roms that are 384KB in size require special loading code for some reason.They need to be laid out as a 640KB rom file.  So you need to mirror the rom data.

You basically insert the first 256KB of the rom at the beginning... and then start over, the last 128KB are not where you would normally expect them to be.  

So it would be:

[1-256KB][1-384KB]  = 640KB rom file.

Here is the C# code he provided that he does in his emulation core, and can easily be added to your software gameof:

Code: [Select]
if (rom.Length == 0x60000)
                        {
                                // 384k roms require special loading code. Why ;_;
                                // In memory, 384k roms look like [1st 256k][Then full 384k]
                                RomData = new byte[0xA0000];
                                var origRom = rom;
                                for (int i = 0; i < 0x40000; i++)
                                        RomData[i] = origRom[i];
                                for (int i = 0; i < 0x60000; i++)
                                        RomData[i + 0x40000] = origRom[i];
                                RomLength = RomData.Length;
                        }


So as you can imagine, the system is looking for rom data to load that isn't present which is why the artifacts occur.

Just tried this and neutopia booted up fine!

Parasol stars also works without artifacts now!

Cyber core works with this.

And....So does ninja warrior.

Thankfully this is not a hardware issue!
« Last Edit: June 16, 2012, 02:48:31 PM by ConHuevos »

gameofyou

  • Full Member
  • ***
  • Posts: 119
Re: 8Mbit Flash HuCard FAQ
« Reply #34 on: June 16, 2012, 02:46:15 PM »
That is an awesome bit of detective work, ConHuevos !!
 
Maybe this is also something that can be added to the PC software:  To automatically format the 384K games correctly, before initiating the download.

ConHuevos

  • Jr. Member
  • **
  • Posts: 97
Re: 8Mbit Flash HuCard FAQ
« Reply #35 on: June 16, 2012, 02:49:06 PM »
Yes, it's a very simple fix.

cabbage

  • Sr. Member
  • ****
  • Posts: 342
Re: 8Mbit Flash HuCard FAQ
« Reply #36 on: June 16, 2012, 02:51:42 PM »
Yes, the problem with 3Mb games is also present on the Neo Flash carts. There have been some tools posted on the neo flash forums that can mirror them and output a new ROM that will work.

I just tried that with Parasol Stars and got both US and JP version working on a neo flash in a duo-r. First I stripped headers from both, then for the US version I ran it through ucon64 with --pce -nint -f (to fix region for my unmodded duo-r), and finally mirrored them both with neopcepad.exe. The resulting files were 6Mb each and seemed to work just fine, while the originals were heavily glitched.


gameofyou

  • Full Member
  • ***
  • Posts: 119
Re: 8Mbit Flash HuCard FAQ
« Reply #37 on: June 16, 2012, 02:53:55 PM »
I can help you with that if you'd like to release the source to the software.  It's written in VB I assume since it requires an .OCX?

It is written in an older version of VB (VB6), which is just the tool I happen to have.  I don't have any problem sharing the source code with people.  It's probably not something I will post online (it was written quite quickly), but I can provide it to anyone interested, just shoot  me an email.
 
In fact, I would like to get the software eventually ported to MAC and Linux, also.  So if anyone has the skills/tools to take that on, let me know  :)
 
I would actually appreciate the help.  I am getting overwhelmed, just trying to keep up with assembly.

Aladar

  • Newbie
  • *
  • Posts: 39
Re: 8Mbit Flash HuCard FAQ
« Reply #38 on: June 16, 2012, 06:57:56 PM »
I think the problem is the /WR signal.
Years ago I discovered that the HuC6280 generates spurious writings during the START and RESET sequences.
More info tomorrow, I'm going to sleep.
Oops, I was wrong... but still can be a problem.

Any news on the reset button?

ConHuevos

  • Jr. Member
  • **
  • Posts: 97
« Last Edit: June 19, 2012, 10:47:44 AM by ConHuevos »

gameofyou

  • Full Member
  • ***
  • Posts: 119
Re: 8Mbit Flash HuCard FAQ
« Reply #40 on: June 17, 2012, 03:24:13 AM »
Also, I notice that for every rom, regardless of Japanese or US, I always have to check the 'Swap Data Bits' to get it to run on my Japanese Duo. The instructions lead you to believe that you only do this when a rom does not match the country you are using it with, which is not correct, unless every Japanese rom I have has been hacked to US region....unlikely.


The instructions are correct.  As unlikely as it seems, your Japanese ROMs have apparently already been converted to US region.  It is the only possible explanation.
 
...and you're welcome!

I am rethinking this now, & you may be right.  You might have to swap bits, only if you're playing on a JPN system.  I don't have a USA system to try it on, but if this turns out to be the case, then I will change the instructions.  Thanks!

sunteam_paul

  • Hero Member
  • *****
  • Posts: 4732
Re: 8Mbit Flash HuCard FAQ
« Reply #41 on: June 17, 2012, 04:21:15 AM »
Works brilliantly. Tested Parasol Stars and plays with no glitches so far.

It would be awesome if the flashcard software could be updated to combine this and the header removal features.
The PC Engine Software Bible
Quote from: Tatsujin
I just felt in a hole!

gameofyou

  • Full Member
  • ***
  • Posts: 119
Re: 8Mbit Flash HuCard FAQ
« Reply #42 on: June 17, 2012, 06:08:37 AM »
Works brilliantly. Tested Parasol Stars and plays with no glitches so far.

It would be awesome if the flashcard software could be updated to combine this and the header removal features.

That is definately the plan.  Along with the Secondary protection feature (changing the 0xF0 to 0x80).
 
ConHuevos has volunteered to help me out with these PC updates, while I complete the hardware builds.  I think we should still allow all these new functions to be deselected, though.  Since the initial purpose for this card was for homebrew, I don't want the software to automatically jack up someone's 384K homebrew, without them knowing it.

ConHuevos

  • Jr. Member
  • **
  • Posts: 97
Re: 8Mbit Flash HuCard FAQ
« Reply #43 on: June 17, 2012, 11:54:12 AM »
Ya, I'll work on it a bit tonight, I'll need some more information from you about the serial port data and how the card expects the upload gameof, if you've got a skype that would be a great way to discuss, just PM me, e-mail me, or post it here.   In the mean time, I'll start writing up removing the header, fixing 384KB roms, and the bit swap.
« Last Edit: June 17, 2012, 12:32:22 PM by ConHuevos »

NightWolve

  • Hero Member
  • *****
  • Posts: 5277
Re: 8Mbit Flash HuCard FAQ
« Reply #44 on: June 17, 2012, 12:35:22 PM »
Hm, I wonder if Krizz knows about this 384KB issue and took it into account with his upcoming HuFlashCard. I'm gonna link him this thread to be on the safe side - it's now or never. So basically, emulators have always known to do this, to double the first 256KB of data then append the remaining 128KB of data to force a 640KB size ?? I guess the simplest way would be to ask Krikzz if he tested his card with Neutopia, Parosol Stars, Cyber Core, etc. and if not, to quickly grab a ROM that's 384/385 KB in size and try it!