How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Ronian53
Posts: 9
Joined: Mon Oct 12, 2020 12:26 pm

How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by Ronian53 » Sun Oct 18, 2020 2:25 pm

These games, Tales of Phantasia and Star Ocean have sprite scaling. You see in when you get gold and items, in Star Ocean and the characters sometimes scale in both games. How is this done?

User avatar
Nikku4211
Posts: 131
Joined: Sun Dec 15, 2019 1:28 pm
Location: Bronx, New York
Contact:

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by Nikku4211 » Sun Oct 18, 2020 2:48 pm

They use the SNES' own CPU itself to scale the sprites, having the sprites be loaded into WRAM and then writing to WRAM, stretching the sprites vertically before uploading the vertically stretched sprite to VRAM.
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.

User avatar
Señor Ventura
Posts: 150
Joined: Sat Aug 20, 2016 3:58 am

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by Señor Ventura » Mon Oct 19, 2020 11:53 am

I would like to know how expensive to cpu processing time are this routines, and how many tiles could be scaled at the same time.

Maxwelthuthu
Posts: 6
Joined: Mon Mar 12, 2018 9:58 pm

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by Maxwelthuthu » Mon Oct 19, 2020 1:18 pm

Chrono Trigger does that too with some large sprites.

Image

Image

User avatar
olddb
Posts: 121
Joined: Thu Oct 26, 2017 12:29 pm
Contact:

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by olddb » Mon Oct 19, 2020 3:56 pm

How do you know if the game is using the cpu to scale the sprites or if there is a set of pre-scaled graphics in rom though?
...

User avatar
Señor Ventura
Posts: 150
Joined: Sat Aug 20, 2016 3:58 am

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by Señor Ventura » Mon Oct 19, 2020 5:13 pm

olddb wrote:
Mon Oct 19, 2020 3:56 pm
How do you know if the game is using the cpu to scale the sprites or if there is a set of pre-scaled graphics in rom though?
Common sense. There is so much content in that rom, and isn't much reiterative of content there, so, repeating those tiles until this point would have had an spending of memory that is not very usual all along this same rom itself... and, adding content like that increases the rom size quickly. That doesn't happens, so, is scaling.

And one thing more. When a graphic is scaled there are some imperfections as the result of the calculations, but when the sprites are redrawn the aspect is not that imperfect like that.

User avatar
Nikku4211
Posts: 131
Joined: Sun Dec 15, 2019 1:28 pm
Location: Bronx, New York
Contact:

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by Nikku4211 » Mon Oct 19, 2020 5:40 pm

olddb wrote:
Mon Oct 19, 2020 3:56 pm
How do you know if the game is using the cpu to scale the sprites or if there is a set of pre-scaled graphics in rom though?
If you get to that part, you can use BSNES-plus to check the debugger's tileset viewer. If you can't see the pre-scaled graphics in there, it's likely done in software.
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.

turboxray
Posts: 115
Joined: Thu Oct 31, 2019 12:56 am

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by turboxray » Mon Oct 19, 2020 7:13 pm

Señor Ventura wrote:
Mon Oct 19, 2020 5:13 pm
olddb wrote:
Mon Oct 19, 2020 3:56 pm
How do you know if the game is using the cpu to scale the sprites or if there is a set of pre-scaled graphics in rom though?
Common sense. There is so much content in that rom, and isn't much reiterative of content there, so, repeating those tiles until this point would have had an spending of memory that is not very usual all along this same rom itself... and, adding content like that increases the rom size quickly. That doesn't happens, so, is scaling.

And one thing more. When a graphic is scaled there are some imperfections as the result of the calculations, but when the sprites are redrawn the aspect is not that imperfect like that.
Says who??? If you're scaling a sprite, you don't have the colors to do anti-aliasing, so it's going to be nearest neighbor scaling artifacts regardless (if the steps aren't course).

Also, the snes has 128k of vram. The game can easily 'pre-scale' the sprites during a loading portion of the game, using the cpu, and just use the rendered frames in realtime for the game sequence. There are other tricks you can mix in realtime as well (tepples covered it multiple times on this forum - using 8x8 cells).

User avatar
Nikku4211
Posts: 131
Joined: Sun Dec 15, 2019 1:28 pm
Location: Bronx, New York
Contact:

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by Nikku4211 » Mon Oct 19, 2020 7:43 pm

turboxray wrote:
Mon Oct 19, 2020 7:13 pm
Says who??? If you're scaling a sprite, you don't have the colors to do anti-aliasing, so it's going to be nearest neighbor scaling artifacts regardless (if the steps aren't course).
You'd redraw the entire sprite from scratch if each step is pre-drawn, so there'd be no scaling artefacts.
turboxray wrote:
Mon Oct 19, 2020 7:13 pm
Also, the snes has 128k of vram. The game can easily 'pre-scale' the sprites during a loading portion of the game, using the cpu, and just use the rendered frames in realtime for the game sequence. There are other tricks you can mix in realtime as well (tepples covered it multiple times on this forum - using 8x8 cells).
Well, either way, real-time or not, if the CPU's being used to 'pre-scale' the sprites, the CPU's being used to scale the sprites full-stop, so the answer is still correct.
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.

tepples
Posts: 22086
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by tepples » Mon Oct 19, 2020 7:48 pm

Real-time sprite scaling in software is practical. I've done it on NES.

creaothceann
Posts: 266
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by creaothceann » Mon Oct 19, 2020 10:12 pm

turboxray wrote:
Mon Oct 19, 2020 7:13 pm
Also, the snes has 128k of vram.
https://en.wikipedia.org/wiki/Super_Nin ... stem#Video
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10

User avatar
Gilbert
Posts: 407
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by Gilbert » Mon Oct 19, 2020 10:46 pm

Yeah, AFAIK the SFC/SNES only has 64kb of video RAM, so it's not much better than the PCE or the MD in this department.

I think the misunderstanding came from the fact that the SFC hardware could support 128kb (I'm not sure, correct me if I was wrong yes, see edit below*) but somehow it never came with as much RAM (probably due to cost, the same reason the PCE never got 128kb of VRAM (unless it's the better forgotten SG) ).

At least the PCE has an advantage that you can freely place stuff (tile maps, bg tiles, sprites) anywhere in the RAM space (the difference in format between bg and sprite patterns could be a disadvantage though).

Edit:
*From Martin's document:
...the PPU could theoretically address up to 64K-words (128K-bytes), in practice, only 32K-words (64K-bytes) are installed in SNES consoles (VRAM address bit15 is not connected, so addresses 8000h-FFFFh are mirrors of 0-7FFFh).
Last edited by Gilbert on Mon Oct 19, 2020 10:55 pm, edited 1 time in total.

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

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by lidnariq » Mon Oct 19, 2020 10:51 pm

Megadrive also could have had 128KB of VRAM but didn't. But there it was designed with cost reduction in mind (one or two 64Ki x 8bit DRAMs), while the SNES always had to use two SRAMs.

Also, I think I remember reading some comment from Nemesis about the extra 64KB was harder to use than you might hope.

User avatar
Gilbert
Posts: 407
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by Gilbert » Mon Oct 19, 2020 11:22 pm

Anyway, for these consoles, maybe after a few years of their release, it was not practical to enhance them by doubling the amount of video RAM anymore (even after memory price had dropped), as a couple of the already released games could break (those that relied on the mirroring of the video RAM, among other things).

As far as I remember, the PCE SG has a switch that you have to flip to select mirrored 64kb or full 128kb of memory for compatibility, which is not a very elegant solution. It could be much better if supported software can set this in software, but then no software actually supports 128kb except the native SG games so this is a moot point anyway. IMO it would have a lot of potential if there are games that could optionally support 128kb of VRAM if available but obviously no one cared.

Anyway... Back to topic:
As tepples mentioned, real time sprite scaling on these system is very doable, especially when you can afford to work with a look up table.
Also:
Common sense. There is so much content in that rom, and isn't much reiterative of content there, so, repeating those tiles until this point would have had an spending of memory that is not very usual all along this same rom itself... and, adding content like that increases the rom size quickly. That doesn't happens, so, is scaling.

And one thing more. When a graphic is scaled there are some imperfections as the result of the calculations, but when the sprites are redrawn the aspect is not that imperfect like that.
Unless you analyse the game, it may not be always that obvious whether it's real time or not.
Games using pre-scaled sprites do not necessarily have them touched up or redrawn (it would cost time, manpower and money), especially since from the SFC onwards the carts are usually much larger (usually at least 8Mbit, compared to the usual 1/2Mbit in Famicom games and 4Mbit of PCE games) that it may not be much to have these stored in the cart (also, compression).
Even the MD(it has blast processing!) and the PCE (especially CD games) have games with seemingly real-time scaling of graphics assets(in actuality they may be "really real time in software", "load, prescaled in software and then display" or "already prescaled and stored in the media).
The lesson to be learned though, is DON'T OVERDO THIS TO INSTEAD SHOW THE SHORTCOMING OF THE HARDWARE OR YOUR SOFTWARE.

93143
Posts: 1239
Joined: Fri Jul 04, 2014 9:31 pm

Re: How does Tales of Phantasia and Star Ocean scale sprites on stock hardware?

Post by 93143 » Tue Oct 20, 2020 5:54 am

The SNES does have 128 KB of WRAM. Perhaps that's what he meant - I believe psycopathicteen has demonstrated smooth sprite rotation by calculating everything before it's needed, in parallel with the game, and dumping the results into WRAM so they're available when required.

Post Reply