Language…
18 users online:  Ahrion, Anas, anonimzwx, autisticsceptile1993, Batata Douce, codfish1002, Foxy_9000_, Hammerer, LuigiTron, magianegra21, Mario's GameBase, Maw, NewPointless, playagmes169, ppp9q, sinseiga, Sokobansolver, The_Uber_Camper - Guests: 262 - Bots: 351
Users: 64,795 (2,376 active)
Latest user: mathew

Super FX Development Kit - Discontinued

Link Thread Closed
  • Pages:
  • 1
  • 2
In 2012, I released the Super FX Patch. It was pretty incomplete, only activated the chip but that's it. However, this new patch isn't a patch per se, it is a Development Kit.

What does that mean? Means that the programmer can easily create routines for Super FX and can set up patches and tools for it.
The kit remaps RAM addresses, so you can have better control over your stuff.



Kit Link

Here's the Readme:
Code
 ██████╗ ███████╗██╗   ██╗    ██████╗ ███████╗██╗   ██╗
██╔════╝ ██╔════╝██║   ██║    ██╔══██╗██╔════╝██║   ██║
██║  ███╗███████╗██║   ██║    ██║  ██║█████╗  ██║   ██║
██║   ██║╚════██║██║   ██║    ██║  ██║██╔══╝  ╚██╗ ██╔╝
╚██████╔╝███████║╚██████╔╝    ██████╔╝███████╗ ╚████╔╝
 ╚═════╝ ╚══════╝ ╚═════╝     ╚═════╝ ╚══════╝  ╚═══╝
                  ██╗  ██╗██╗████████╗
                  ██║ ██╔╝██║╚══██╔══╝
                  █████╔╝ ██║   ██║
                  ██╔═██╗ ██║   ██║
                  ██║  ██╗██║   ██║
                  ╚═╝  ╚═╝╚═╝   ╚═╝
   by DiscoTheBat                 Version 1.98

The new way of doing hacking, the GSU Dev Kit enables
Super FX on your Super Mario World ROM.
It also prepares your ROM to use Super FX in the
best way possible.
With minor modifications, you can use this kit in a
homebrew even!

;===================================================;
; Features                                          ;
;===================================================;

 - It features Super FX's CPU core with 21.47 MHz speed,
which is eight times faster than SNES. Super FX can run
parallel with SNES CPU making the game 10 times faster!

 - Pipelining system. With this system, you can sandwich
several instructions as they get loaded and executed, meaning
efficient processing of data.

 - Bitmap support. Allows the user to create any type of bitmap
that can be read by SNES PPU format, this allows for highly advanced
2D graphics or 3D.

 - Cache RAM allows Super FX to operate without need for ROM/RAM.
Also, it allows for 1 cycle opcode execution.

 - High speed arithmetic support, it even surpasses DSP-1 when it comes to
SNES to CPU (and vice versa) communication.
 
;===================================================;
; Changes                                           ;
;===================================================;

When patched, the following changes will take effect:

 - Super FX will undertake heavy operations that SNES
alone can't handle, this will reduce slowdowns and lags
caused by repetitive and/or slow operations such as loops.

 - Patches like VWF dialogues will run thrice as fast, taking
in account Super FX's efficiency, this will allow huge possibilities.
Remember to convert the patches as needed!

As one can see, those changes RAM to match even addresses, improving Super FX's
operations. (The changed RAM Map is presented down at this Readme, be sure to access
in order to understand Super FX's new mappings!)

;===================================================;
; Warnings                                          ;
;===================================================;

GSU Dev Kit is probably the most highly advanced and complex
patch in existence, the reason why is because that most routines
have been rewritten to use Super FX ASM language, which isn't
similar to SNES one. Therefore, high caution should be taken
when using patches or tools that modifies areas that this patch
modifies.

However, this Dev Kit allows the user/programmer to successfully
edit/create new routines on top of those modified, allowing new
works without the need of patches and hijacks. It also makes easier
to pinpoint hijacks and then adapt routines to Super FX without
the need of supplemental help.

This patch remaps several addresses and therefore caution
should be done about compatibility, I'm personally converting
several patches to either GSU format or GSU compatible format
for uses, the link will be down this readme.

Some emulators won't properly emulate some custom routines,
mainly because of lack of accuracy.

Also, contrary to popular belief, Super FX ROMs CAN reach 8MB in size!
According to patents and Nintendo Development Book, only Super FX
is limited to 2MB ($00-$3F being Normal ROM area and $40-$5F being the 'HiROM Mirror' area)
aside from banks $70-$71, that being Super FX's RAM area.
SNES on the other hand is virtually unlimited, though on hardware bankswitch (MAD-1?) SNES can access areas
beyond Super FX control, that area is called
Additional ROM (or SNES CPU ROM) aside from Additional Backup RAM ($78-$79).
One using Higan or schematics to modify cartridges can implement those extra features for the Super FX ROM,
overcoming the 2MB limit. Why Nintendo didn't do that?
Stop making games way expensive, nowadays with hacking and knowledge, one can extend
the capabilities of the poor underrated Super FX chip and ROM/Flash chips are pretty cheaper.

;===================================================;
; Usage                                             ;
;===================================================;

Super FX can be quite troubling when dealing with it,
mostly due to size limitations and harder ASM language
but once you get the logic to work, you can do unlimited
stuff with it.

To get started, grab your clean, (U) 1.0 SMW ROM, open
Lunar Magic and expand to at a maximum of 2MB.

Using asar, simply patch 'superfx.asm' in your ROM and open
it in any emulator to test.

If you did everything right, Snes9X/ZSNES will respectively
display ROM+RAM+SRAM+Super FX or Type: Super FX

;===================================================;
; F.A.Q                                             ;
;===================================================;

 Q: Is it really hard to work with Super FX?

 A: At the start, it's very hard to get the grip of how
the ASM language and logic works on Super FX, considering
the pipelining system, cache, bitmap emulation and so on...
But after getting used to that, everything should be very clear
and easy for you. ^^

 Q: I don't understand Super FX ASM, what could I do?
 
 A: Well, I included a link for my Super FX programming tutorial
you can read it and study it's contents to learn how to program
for Super FX, as said above, while it's a bit hard and tricky to learn
it's pretty much doable! There are examples in this very own development
kit for you to study, want a hint? Check every Super FX ASM routines designed
for SMW's engine, almost all files have detailed comments with their respective
SNES codes, allowing a better comparison and visualization. If lack of understanding
is the issue you can't get Super FX ASM, those comments will surely kick in!

 Q: Is Super FX incompatible with my stuff?
 
 A: At the time, unfortunately since developing stuff alone strains heavily on a programmer's
back but never fear! I designed a way to know exactly if something will break or not!
Let's take Lunar Magic for example, we all know Lunar Magic hijacks certain areas of the ROM
to implement it's ASM code, however, the code is mostly SNES ASM. Knowing this, the reworked
engine, zeroes all unused routines, allowing tools to "hijack" the empty area, allowing the user
to easily pinpoint where the ASM will be placed without anything breaking! You can easily study the code
and recreate it's own version using Super FX ASM without much worry! This is how you can easily
turn your works compatible with Super FX!

;===================================================;
; Programming                                       ;
;===================================================;

Unlike Super FX Pack, this development kit is way more complex
because of the various RAM remapping and several routines converted
especially for Super FX.

That means that in order to make stuff compatible with Super FX,
several instances should be taken in mind:

DP values from $XX:0000-$XX:1FFF to $XX:6000-$XX:7FFF
Remembering that XX must be from $00-$3F and from $80-$BF

-----------------------------------------------------

Considering that you know how ROM/SRAM works in the ROM,
you may be asking, how to make Super FX work?

Entering Super FX mode is a piece of cake.
Store the 16-bit address to Accumulator (A) and the
8-bit bank on Index Y (Y), after that just JSR (or JMP)
to $1E80, i.e.:

REP #$20
LDY.b #Label>>16		;\ Put address in the proper place...
LDA.w #Label			;/
JSR $1E80				; Call Super FX and wait.
[...]					; *other code*

arch superfx			; REMEMBER! Use asar to easily create routines
						; using Super FX's ASM language
Label:
[...]					; Code goes here
STOP					; Finish processing data.
arch 65816				; Return to SNES ASM mode

When you switch to Super FX side, things works way differently:

 - You can't access the PPU and CPU registers,
which are located at $2100-$21FF, $4200-$42FF and around $4000 too.

 - You can't access WRAM (Work RAM) in banks $7E and $7F.
Addresses ranging from $0000-$1FFF can only be accessed on SNES side.
Any attempt of doing so in Super FX side means to load from $7x0000 to $7x1FFF
depending of your RAMB setup. (7x ranging from 70 to 71.)

 - You can access the $700000-$71FFFF range, which is the Super FX's
BW-RAM. (The manual states Game Pak RAM but it can act as SRAM as well.)

 - The CPU runs 8x times faster than usual, specifically at 21.47 MHz
instead of 2.68 or 3.56 MHz (FastROM).

Unfortunately, unlike SA-1, Super FX don't have registers for multiplication
and division, let alone DMA operations BUT if you had read from the above explanation
you can easily set up routines that don't need waiting and you can do other stuff
while calculations are being done and they aren't slow either, multiplication on Super FX
takes 1 cycle, while division you have to code yourself (unfortunately).

Super FX can't rely on DMA (since it don't have any DMA operation) but it have ROM/RAM buffering
which means that for example, Super FX while is getting ROM data, it's saving data on RAM in multiple
operations, making faster for plotting operations or general related ones.

Unlike SA-1, Super FX can't directly interrupt the CPU program
to get data when needed, although it can do IRQ when it's own processing
is done but Super FX have a very interesting function that allows
sidetracking on SNES, meaning that Super FX can be interrupted while SNES
provides Super FX anything it needs!

How can this be useful? When you can't access something from Super FX side,
of course. Using this method, you can make a quick access on something
from SNES side, then come back with the value. Example: Super FX wants to
read from an APU port, but logically, it can't access it. To make it accessible,
stop processing on Super FX, then call the the SNES so you can read from the APU
port and then send the value to Super FX. See below:

[...]
STOP			; I need APU ports, can't access, temporarily halt processing
NOP				; Prefetch dummy but don't execute it
[...]			; Read below: After Super FX is called again (using R15 data which is after NOP)
				; It'll start processing after that NOP, simply as that
arch 65816
LDA $2140				; \ Read $2140-$2143
STA $3000				; | and save in $3100-$3106 (even)
LDA $2141				; | Save in registers R0-R3
STA $3002				; |
LDA $2142				; |
STA $3004				; |
LDA $2143				; |
STA $3006				; /
JSR $1Exx				;<> Continue Super FX routine...

Using this method you can get rid of almost all Super FX
limitations, but remember SNES have a slow CPU,
calling it too many times, means that you may waste some time.

WARNING: Unlike the RON/RAN method, it is ADVISABLE you use the STOP
opcode if you want to get data and use it later on your routine. Why?
By simply clearing the flags, you stop Super FX but you don't know exactly
where Super FX is halted, therefore you can easily break any operations Super FX
may be doing at the time, using RON/RAN method it's risky and only advisable if you
know exactly what you are doing!

-----------------------------------------------------
Super FX Tutorial: http://www.smwcentral.net/?p=viewthread&t=81548
-----------------------------------------------------

;===================================================;
; Credits                                           ;
;===================================================;

Without these people, it would have been impossible for the GSU Dev Kit 
to be created perfectly:

 - Mayonnai
 - Mirann
 - anonimzwx
 - K3fka
 - Vitor Vilela
 - DiscoTheBat


The kit will be updated, so more features will be added. That includes a 3D engine and more sprites!

Also, it is open for new members, if you want to help on the creation of routines and everything else, feel free to post in here. Your help is appreciated!
Cool video. I don't do a lot of hacking these days, unfortunately, but I look forward to seeing all sorts of crazy stuff that can be created using this!
SMW C:\\user_19007_shree\posts >> target.display('layout_mathos','Sea of Science')
Hey, this looks great! Nice to see you've finished up with this ^^
The video reminds me of super Mario advance 2, if you are Luigi on yoshi, eat an enemy (but don't wait till yoshi swallows it), and spits it out, that rotation effect rolling across the ground.
Give thanks to RPG hacker for working on Asar.
Well, technically you can use the rotation and resize to create such effects, I have disassembled the codes for the rotation/resize and I will be releasing soon.

Also, I am working on a few sprite routines, I might submit an upgrade soon.
GHB's idea is not impossible. Storing SP1-SP4 to SRAM and then rotate the respective sprite tiles and the OAM x/y position (by hijacking OAM finish drawing routine probably), both relative to sprite center position should work. However it won't work if, for example, there is two koopas in screen and one is being threw by Yoshi, because all of them share the same sprite tiles.

Graphics rotating/scaling pseudo code, should be easily adaptable to any language:

Code
cos = cosine of the rotation angle * scaling (1.0 for 100%)
sin = sine of the rotation angle * scaling (1.0 for 100%)

width = the width of image
height = the height of image

variables needed: x1, y1, x, y, cos, sin, rowx, rowy.

for (int y = 0; y < height; y++)
{
	x1 = rowx;
	y1 = rowy;

	for (int x = 0; x < width; x++)
	{
		if ((int)y1 < 0 || (int)y1 >= height) goto dontdraw;
		if ((int)x1 < 0 || (int)x1 >= width) goto dontdraw;

		dest[y * width + x] = src[(int)y1 * width + (int)x1];

		dontdraw:
		x1 += cos;
		y1 -= sin;
	}

	rowx += sin;
	rowy += cos;
}


Make sure to calculate center x/y on rowx and rowy or otherwise the graphics will rotate relative to top left point and not center point.
The code I have in already does that, the code stores the SPx to SRAM and it rotates and resizes as well.

I just need to release everything, I don't have the code in my laptop but it is on my computer.
More work on SuperFX I see? I'm sure this'll be a very welcome introduction to SMW hacking eventually! It may even be implemented into Lunar Magic. Probably not soon, but hopefully one day.

21.4 MHz isn't all you're limited to; The SuperFX chip was once overclocked all the way up to 60MHz - very, very close to the N64's clock speed without its 1.5 multiplier (62.5 MHz).

SF Overclocked (60MHz)

Now, imagine what you could do with the SMW engine running on a 60MHz SuperFX chip. . .
Sometimes, I like to hack SMW. This is rare though, but I always try something new.


-------------------------
Image and video hosting by TinyPic

~Developer for "Mario Enters the Void", an abandoned hack. The thread for the hack can be found Here ~
Actually, the Super FX mapping is partially integrated on Lunar Magic, FuSoYa forgot to add a few mappings here and there but it is nothing extremely bad. It just point things to the wrong way but I am working on that right now.

Also, a new update, I might be releasing a new version with More Sprites and sprite routines optimized and also faster overworld animations.

This means that slowdown for the overworld and sprites would be greatly reduced!

Well, overclocking the GSU is pretty much possible, as well implementing 8MB support as well, I don't have knowledge for building an emulator with such capabilities but speaking in terms of hardware, it can pretty much get at this size.

Update: It is known that Super FX don't have hardware stack, I fixed that by assigning R3 as SP. I may provide a GSU macro in the patch as well. For example, if you want to save a value for R0, you would do %PUSH(R0) and if you want to restore this value in register R9, you'd do %POP(R9).

Code
macro PUSH(register)
	arch superfx
	MOVEW (R3),<register>
	REP 2 : DEC R3
endmacro

macro POP(register)
	arch superfx
	MOVEW <register>,(R3)
	REP 2 : INC R3
Originally posted by DiscoTheBat
Actually, the Super FX mapping is partially integrated on Lunar Magic, FuSoYa forgot to add a few mappings here and there but it is nothing extremely bad. It just point things to the wrong way but I am working on that right now.

Also, a new update, I might be releasing a new version with More Sprites and sprite routines optimized and also faster overworld animations.

This means that slowdown for the overworld and sprites would be greatly reduced!

Well, overclocking the GSU is pretty much possible, as well implementing 8MB support as well, I don't have knowledge for building an emulator with such capabilities but speaking in terms of hardware, it can pretty much get at this size.


What I believe is, if it's there, it can be manipulated in almost any way. No doubt someone could program a whole new custom coprocessor for a custom SNES emulator, something like a 20MHz SA1 with even better RAM or something like that.

Also, SuperFX is somewhat supported by Lunar Magic? That's good to hear! Also knowing SuperFX will speed up more things in the future is great!

Heck, with a SA1 SMW ROM and a emulator with pseudo-overclocking, the game runs near-perfectly, with very little slowdown even on the path revealing animations on the world maps. SuperFX could well be the final push to make SMW run at "Absolutely perfect performance".

And at that speed? May the SMW hacking gods know what you can do with the SMW engine at that point.
Heck, look at Seiken Densetsu 3, a really graphically impressive SNES game, even running on stock hardware, no coprocessors!

SD3 - Black Rabite battle

Though, some animations do lag a bit and the action pauses for a bit during spell animations. SMW running on the SuperFX chip could probably well handle effects of this quality in real-time without pausing everything else, and maybe even more graphically intense effects.

That probably won't be the end of it though if someone takes the time to program a custom coprocessor into a custom SNES emulator for SMW
Sometimes, I like to hack SMW. This is rare though, but I always try something new.


-------------------------
Image and video hosting by TinyPic

~Developer for "Mario Enters the Void", an abandoned hack. The thread for the hack can be found Here ~
I am helping to DiscoTheBat making resources for Super FX, we will make a 3D system for snes and a tool to use Meshes in format .obj, here is one of the tool.

Video

It is a Mesh Simplifier, It can take a 3D Model in format .obj and reduce its number of triangules and transform it into a format usable for snes.

------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources
Originally posted by anonimzwx
I am helping to DiscoTheBat making resources for Super FX, we will make a 3D system for snes and a tool to use Meshes in format .obj, here is one of the tool.

Video

It is a Mesh Simplifier, It can take a 3D Model in format .obj and reduce its number of triangules and transform it into a format usable for snes.


It looks pretty nice! Simple, but nice!
Again, back to the 60MHz Overclocked SuperFX from an earlier post.

Even if you had SuperFX running at this speed, would you still need to greatly simplify a model due to possible crashing from lack of RAM?
I mean, you'll always have to do it a lot, but even at triple clock speed, would you still have to simplify it just as much?
Sometimes, I like to hack SMW. This is rare though, but I always try something new.


-------------------------
Image and video hosting by TinyPic

~Developer for "Mario Enters the Void", an abandoned hack. The thread for the hack can be found Here ~
Originally posted by zack30
Originally posted by anonimzwx
I am helping to DiscoTheBat making resources for Super FX, we will make a 3D system for snes and a tool to use Meshes in format .obj, here is one of the tool.

Video

It is a Mesh Simplifier, It can take a 3D Model in format .obj and reduce its number of triangules and transform it into a format usable for snes.


It looks pretty nice! Simple, but nice!
Again, back to the 60MHz Overclocked SuperFX from an earlier post.

Even if you had SuperFX running at this speed, would you still need to greatly simplify a model due to possible crashing from lack of RAM?
I mean, you'll always have to do it a lot, but even at triple clock speed, would you still have to simplify it just as much?


Snes can't use a lot of triangules if you don't reduce the number of triangules then you can have lag, Super FX with overclocking allows you to 50 000 triangules without lag.

------------------------------------------------------

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources
Originally posted by anonimzwx
Originally posted by zack30
Originally posted by anonimzwx
I am helping to DiscoTheBat making resources for Super FX, we will make a 3D system for snes and a tool to use Meshes in format .obj, here is one of the tool.

Video

It is a Mesh Simplifier, It can take a 3D Model in format .obj and reduce its number of triangules and transform it into a format usable for snes.


It looks pretty nice! Simple, but nice!
Again, back to the 60MHz Overclocked SuperFX from an earlier post.

Even if you had SuperFX running at this speed, would you still need to greatly simplify a model due to possible crashing from lack of RAM?
I mean, you'll always have to do it a lot, but even at triple clock speed, would you still have to simplify it just as much?


Snes can't use a lot of triangules if you don't reduce the number of triangules then you can have lag, Super FX with overclocking allows you to 50 000 triangules without lag.


50k Tris? I dunno. . . I heard that it only handles polys in the multiple-hundreds counts. If that's how it is though, I guess so.
(Unless i'm confusing triangles for polygons)
Sometimes, I like to hack SMW. This is rare though, but I always try something new.


-------------------------
Image and video hosting by TinyPic

~Developer for "Mario Enters the Void", an abandoned hack. The thread for the hack can be found Here ~
Well, the N64 GPU, SGI RCP, runs @ 62.5 MHz and this chip have an estimative of 100,000 polygons per second. Taking in mind that GSU can be overclocked @ 60 MHz, it can reach closer to this value.

Take in mind as well the GSU is NOT being used for graphics only and that SNES is being properly handled instead of being ran into a loop until it finishes processing, so speed can be increased to greater levels.

Also, take in mind RCP does have special 3D hardware while GSU relies on software for processing, thus, me and anonimzwx are coding a special "graphics driver" for the GSU, in order to enable SMW (and other games, such as homebrew) to have 3D or at least 2.5D effects without hassle.
Originally posted by DiscoTheBat
Well, the N64 GPU, SGI RCP, runs @ 62.5 MHz and this chip have an estimative of 100,000 polygons per second. Taking in mind that GSU can be overclocked @ 60 MHz, it can reach closer to this value.

Take in mind as well the GSU is NOT being used for graphics only and that SNES is being properly handled instead of being ran into a loop until it finishes processing, so speed can be increased to greater levels.

Also, take in mind RCP does have special 3D hardware while GSU relies on software for processing, thus, me and anonimzwx are coding a special "graphics driver" for the GSU, in order to enable SMW (and other games, such as homebrew) to have 3D or at least 2.5D effects without hassle.

Graphics drivers for SuperFX, huh? The amount of effort going into SMW is incredible. 2.5D levels may just be the future of SMW.
What about pure 2D graphics though? What kinds of huge sprite counts could we have going on with these drivers? And what kind of insane HDMA graphics could happen? The SNES is already a beast with its default hardware as proven by some games.

My question is though, would ingame hi-res mode be viable with this driver? Hi-res mode is used in rare cases like the menus of Seiken Densetsu 2 and 3.
(The resolution is about 512x448)
Sometimes, I like to hack SMW. This is rare though, but I always try something new.


-------------------------
Image and video hosting by TinyPic

~Developer for "Mario Enters the Void", an abandoned hack. The thread for the hack can be found Here ~
Well, the Super FX Dev Kit doesn't only work for graphics related codes, but SNES routines as well. For example, sprite processing routines are mostly done by Super FX in order to fix slowdown and enhance functions, but overall, GSU can be and will be used for any function it can be worked on.
Originally posted by DiscoTheBat
Well, the Super FX Dev Kit doesn't only work for graphics related codes, but SNES routines as well. For example, sprite processing routines are mostly done by Super FX in order to fix slowdown and enhance functions, but overall, GSU can be and will be used for any function it can be worked on.


So all in all, it can really speed up everything, huh?
That said, it could allow for Hi-res mode in SMW, am I correct? There'll hopefully be enough power for that as the end result.

(And it would look SO much better! SMW only runs at the default 256x224 resolution if i'm right. 512x448 mode would allow for twice as detailed graphics and tilesets, or double the screensize to see twice as much.)
Sometimes, I like to hack SMW. This is rare though, but I always try something new.


-------------------------
Image and video hosting by TinyPic

~Developer for "Mario Enters the Void", an abandoned hack. The thread for the hack can be found Here ~



Sucks there's no uberASM support yet to (easily) test out this damn awesome patch and its capabilities.


Also, I don't think this is how levels are supposed to look after editing one with Lunar Magic.

"I see you as a person of the opposite sex"
"I didn't know about the second half"
"Asymmetry"

What version of Lunar Magic you do have? This happened to me before.

Also, there IS an UberASM support version, you need to:
Code
!basefx = $0000
if read1($00FFD6) == $15
sa1rom
!basefx = $6000
endif

Since I remapped stuff, it happens to be like this (yes, it almost uses the same remapping as the SA-1 patch).

Edit: And for now, you need to use sa1rom for any patch you use because freespace find on asar is broken.
  • Pages:
  • 1
  • 2
Link Thread Closed