Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - redguy

Pages: 1 [2] 3 4
FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: April 06, 2018, 02:58 PM »
I have no problem with the gsu being part of the main code.  It could use some cleanup after the bugs are fixed, but otherwise it's standalone and won't impact the existing code too much.  The usb2snes stuff is quirky and more of a developer's tool.  It needs to be redesigned and rewritten before it can be considered for the main code.

Thanks for the cache injection test.  It found a cache indexing bug which was fixed prior to v01.

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: April 06, 2018, 04:21 AM »
On v01 you had to disable just in-game hooks.  On v02 you can leave them enabled since the firmware disables them behind the scenes for gsu games.  I have an idea why it causes a crash, but haven't had a chance to confirm and see if a fix is possible.

Thanks megari.  I fixed the associated branch by recreating the tag.

I haven't looked at sa-1 and can't comment on it.  The memory system of the gsu is where all the complication is.  The instruction set is pretty simple with a few messy instructions (plot) and concepts (branch delay slots).  But there is an execute pipe, instruction cache, store buffer, write buffers for plot, and a prefetcher that all operate in parallel and make requests to the rom and ram.  This the source of most of the bugs and performance differences between the sd2snes and original cart.

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: April 05, 2018, 04:27 PM »
I'm not sure what the bug is, but it will be fixed in the next version.

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: April 05, 2018, 04:19 PM »
The latest tag points at the last usb2snes release.  I've only setup the one prelease gsu_v02 tag for now.

It doesn't look like the doom fix helped with the crash on start bug so I'll continue to look into that.

The original fpga_base.bit file was included for 2 reasons:
- I gave some people a modified fpga_base.bit in the past and wanted them to be using the correct version from 0.1.7e.
- It removes the issue where someone isn't using 0.1.7e before copying the gsu files over.

Not sure how close to cycle accurate it will get.  There's a trade-off between detail and getting it to fit.  It will never be an exact match.

Holding down reset should only be required to save the SRM to SD for gsu games in v02.  Non-gsu games work as they do with the original 0.1.7e firmware.

The v02 firmware disables in-game hooks automatically if it detects a gsu game is loaded.  It allows you to leave the in-game hooks enabled in the menu but avoid the problems associated with gsu games.  Hopefully this is temporary.

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: April 05, 2018, 08:43 AM »
Give this version a try.  I fixed the doom graphics glitch bug which may have also fixed stunt race fx and the startup crash.  You can turn the in-game hooks back on, but they are now temporarily disabled in gsu games.  I still need to fix that bug.

Fixed doom graphical glitch.
Fixed in-game hooks by temporarily disabling with gsu games.
Fixed save problem with non-gsu games.

See the first post for the latest version:

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: April 05, 2018, 03:52 AM »
If anyone has a rom that doesn't work at all and works in an emulator then send me a message with the name, file size, checksum.  I doubt I've run anything with the 0x200 byte copier header and there may be a problem with the scoring code.

With DEBUG defined the debug config registers are added in and default to stepping instructions.  So the first gsu instruction causes it to halt in the wait/registerwrite/retire stage until you increment the stepCnt register.  Originally, I planned to have it default to running and never reset, but there were some problems with that I never debugged.  So now it resets that register state on a snes reset assertion which makes it more convenient to default to stepping.  Now that it runs more often than it crashes I suppose I should change the default.  :)

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: April 03, 2018, 04:10 PM »
The usb changes don't fit on the fpga at the same time as the superfx chip.  So the best I can do is allow the usb2snes firmware to load the superfx chip but not support all the usb features at the same time.  This will be done in the future.

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: April 03, 2018, 03:58 PM »;topic=7451.0;attach=1110
(You can also click the link in the attached files section below)
See first post for latest file:

* This is a beta.  Expect crashes and unusual behavior on superfx games. *

This is a beta version of the sd2snes firmware with support for the superfx (gsu) chip.  To install
copy the files in the sd2snes/ (firmware.img, fpga_gsu.bit, fpga_base.bit) directory into the sd2snes/ directory on your SD card.
You should have a working version of the sd2snes 0.1.7e firmware on the SD card before doing this.

- Verify the version says 0.1.7e-gsu-v01 in the sd2snes menu.  Do this by pressing X->System Information.
- Turn off in-game hooks in the sd2snes menu.  They crash several games.
- Saving to SD is temporarily disabled.  Make sure to hold down the reset button for a few seconds to write a save file to the SD.
- PAL games and systems are not well tested.  Try a NTSC game on a NTSC compatible console if you have problems.

Known Issues
- Games may crash on startup.  Power cycle and try again if they do this.  Make sure in-game hooks are disabled in the sd2snes menu.
- Random graphical glitches may happen on game startup.  Power cycle and try again if they do this.
- Doom has graphical glitches.
- Stunt Race FX may have graphical glitches at the beginning of a race.
- Games may not run at exactly the same speed as the original cart.  This may improve in future versions.
- Not currently compatible with usb2snes or other sd2snes firmware modifications.  This will be fixed for usb2snes in the future.

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: April 03, 2018, 02:36 PM »
I'm going to fix 1 more bug before posting it up for everyone to try.

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: March 31, 2018, 05:49 AM »
I just fixed a bug that was randomly crashing Yoshi's Island and several other games.  The games run faster now than in the star fox video, but they still lag too much in parts to be fun to test.

Played through most of one route before Andross blew me up (I blame the lag):
Star Fox

Plays fine, but haven't tested a lot:
Star Fox 2
Yoshi's Island
Stunt Race FX
Dirt Trax FX
Dirt Racer

Random pixels go bad, but playable:

Bad background graphics.  Not playable:
Winter Gold

First I'm going to fix Winter Gold and hope it fixes Doom.  Then the performance will be fixed.

FXPAK (SD2SNES) / Re: gsu (superfx) support [work in progress]
« on: March 30, 2018, 03:19 PM »
mario64, thanks, but no donations necessary.  This is just a hobby for me.

PityOnU, you should continue your project.  My goals were to get it working as quickly as possible and have it fit on the fpga.  This resulted in overlooking lots of pipeline details.  It would be great to have a more cycle accurate implementation.

krom, most of the bugs have been caused by gsu memory addressing (PLOT, LD/ST, GET*) and snes/gsu synchronization issues.  I also haven't tested the cache injection stuff where the snes is allowed to write code into the instruction cache and tell the gsu to run it.  If you have the time, any tests in these areas would be a big help.

If someone is familiar with the sd2snes menu code it would help me to have support added for gsu configuration options.  A gsu "Normal"/"Fast" option to match ikari's cx4 option is useful.  A temporary (only available during development) gsu debug "Off"/"On" option would also be great.

Lots of progress has been made after several days of fixing bugs.  The instruction cache is implemented which significantly improved the speed of games.  star fox still lags when it's drawing a lot, though.  I think that's due to the data prefetcher missing.  Not having the prefetcher is also causing major graphics bugs and crashes in other games due to how it works.  It's next on the list to implement.

FXPAK (SD2SNES) / gsu (superfx) support [work in progress]
« on: March 26, 2018, 08:04 AM »
Latest version is here:

A few weeks back I decided to learn about the superfx chip and this is the result.  It's still quite buggy, but I figured it's far enough along to show a video (ignore the bad gameplay).  The various caches haven't been fully implemented which causes moderate slowdown.  There are also several graphical glitches that need to be worked out as well as getting the other gsu games working.  The fpga is quite full and hopefully it all fits.

It's not ready for people to test, yet.  Once it gets to that point I will post a set of files.  Thanks to those who have offered to help.

The development platform uses usb2snes to read out gsu state, step instructions, set breakpoints, collect an instruction trace, and other useful stuff.  It's been extremely useful in finding many bugs.

Source is here, but I haven't checked in the firmware changes necessary to run the fpga file correctly.

One area that would help a lot is some self-checking assembly tests.  krom has a suite here that all pass, but it would be great to have more tests.  After the caches are implemented I plan on writing some myself.

Huge thanks to all the bsnes and bsnes-plus developers, the nocash fullsnes docs, krom and his gsu tests which found several bugs early on in development, and ikari for making the sd2snes.

FXPAK (SD2SNES) / Re: Implementing GSU Chip (SuperFX) in Verilog
« on: March 25, 2018, 12:54 AM »
The firmware changes aren't checked in, yet.  It goes off in the weeds almost immediately on star fox so there's not much to see.  It does run some basic self-checking assembly microbenchmarks including ones that test PLOT and RPIX bitmap instructions.

I will start another thread on the topic if it gets to the point where it can run something.  At this point it's hard to tell if it will all fit in the FPGA as currently implemented so I don't want to set expectations too high.

FXPAK (SD2SNES) / Re: usb support
« on: March 06, 2018, 05:03 AM »
I should mention that the latest version (currently v7) can be found here:

I haven't had time to work on it lately so it will stay at v7 for a while.

FXPAK (SD2SNES) / Re: usb support
« on: March 04, 2018, 05:31 AM »
Unfortunately, Claymates doesn't appear to use NMIs (Non Maskable Interrupt) to generate a frame and the save state relies on that.

The good news is I was able to make a really simple change to the US version (attached) that enables an empty NMI.  It seems to work, but I only tested it for a few minutes.  Make sure to create a backup of the original.  Use something like lunar IPS to patch it.

You also need the attached save_state patch.  The patch will only work if you apply it while the game is started.  A bit of a hack, but that's to avoid it running more code.

Pages: 1 [2] 3 4