Discuss Scratch

Jonathan50
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

I got a PlayStation 3 some months back (I've never owned a console before). I was wondering what fun things I could do on it without jailbreaking, which made me think of compiling for Flash 9. Turns out you only needed the latest Apache Flex and the appropriate SWCs. So…how about making Scratch 2 run on new platforms? It requires at least Flash Player 10.2, but after a tiny bit of commenting-out it compiled for Flash 10.0. (I picked a somewhat old version, v441, at random just because I was lazy and wanted Ant instead of Gradle…though apparently the newest on GitHub is only v448.)

Much more commenting out and changing Vector -> Array, and it compiled for Flash 9, but the SWF didn't work…some mysterious error about illegal override of z. After much fiddling to no avail, it turned out just using framework.swc from the Flex 2.0.1 SDK (download the SDK from Adobe here! you need framework.swc and playerglobal.swc) instead of the libraries that came with Apache Flex produced a working SWF!

Links:
Source
Direct download for Flash 9 SWF
Direct download for Flash 10 SWF

The Flash 10.0 version needed very little changes and should be 100% functional compared to 10.2. By contrast I broke, for now, at least these things with Flash 9:
  • Sound stuff
  • Costume/PNG/vector stuff
  • ZIP stuff (if not for JSON sb2s would work as long as they're uncompressed ZIPs…)
  • Local files (no direct file I/O in Flash 9)
  • JSON
  • Got rid of video sensing
Some of these (JSON, PNG) will be a bit more difficult since Scratch depends on a library built for Flash 10. (I've gotten loading Scratch 1.4 projects to pretty much work.)

But it still works fine, and sure enough here's Scratch on the PlayStation 3 for probably the first time:

Sorry, I don't have an HDMI capture thing.
Also, I guess Flash on the PS3 is a native BSD version of Flash, maybe the only one. Though I'm sure it wouldn't be practical to get it to work on a different PPC system, even if it doesn't use the coprocessor thingy.

You can use it fine with the controller, with X instead of left-click. Mouse and keyboard do make it easier to use (although it's still a bit difficult since the mouse sensitivity is rather high). You need to double-X/double-click a field to type (even if you have a physical keyboard, you still need to do that and bring up the on-screen keyboard).

It will also work on Windows 98 although Scratch 2 on Win98 was almost certainly already possible with Flash on KernelEx. The Flash 10 version will work on PowerPC Macs (PPC is supported up to 10.1; Scratch requires 10.2). I happen to have Flash 9 on my eMac:

Another way to run Scratch 2 on PPC would be to emulate Windows XP or x86 Linux

Also, I would love to know if there are other interesting platforms that can run Flash 9-10.1 but not 10.2.

Last edited by Jonathan50 (April 14, 2024 08:04:40)

Mr_rudy
Scratcher
100+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

i wonder if the Nintendo Wii would be possible
MagicCrayon9342
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Mr_rudy wrote:

i wonder if the Nintendo Wii would be possible
I think the Wii browser is Opera 9 but modified. I guessed 9 since it released in 2007 like the Wii browser did. I haven't been able to figure out what flash version it supports but most likely 9/10 like what Scratch 2 is being ported to here.

Should be possible.

Last edited by MagicCrayon9342 (April 13, 2024 02:37:33)

Jonathan50
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Alright, links now in OP.

It would've been great if blooddy_crypto could be made to work on Flash 9 (Scratch depends on it for PNG, JSON, MD5, etc.) but unfortunately the really old version used doesn't seem to have source code, and a somewhat newer version won't compile because of >100 references to something in avm.intrinsics (might be in the AIR SDK or something, or it might be something really trivial). At least importing Scratch 1.4 projects, sans proper costumes, works. (Also sorry for the very messy commenting-out)

Flashvar project can be used for loading a project file. Happily the bitmap editor seems to work.

also how the heck were there like 688,000 Scratch projects made since yesterday

Mr_rudy wrote:

i wonder if the Nintendo Wii would be possible
According to Wikipedia it has Flash 8 and “limited support” for Flash 9. So I don't know. If you have a Wii you can try, just download the SWF to your computer, make an HTML file something like
<embed type="application/x-shockwave-flash" src="s2-flash9.swf" width="800" height="600">
</embed>
then start a web server (the easiest way to do this is to run python3 -m http.server in a terminal) in that folder, and go to your computer's IP address followed by “:8000” or whatever on the Wii.

Edit: Or maybe just going to this URL on your Wii would be easier. Then again, that method might not work due to needing modern HTTPS.

Last edited by Jonathan50 (April 14, 2024 10:06:14)

Jonathan50
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Canthiar's raytracer works (it's sloooooow)
_nix
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Oh my gosh, this is actually incredible. Congrats! I'm stunned lol

I guess since PPC Mac is supported by Flash up to 10.1, then if you had a Flash 10 player, you could get the far-less-modified version of Scratch running?

It's really fun to see Flash explored as a reasonably portable runtime for, well, Scratch. Kind of inspiring? We're sure we've seen Scratch 1.4 on a whole lot of systems, so seeing what systems can handle Flash (and only older versions at that) and thus Scratch (with a lot of code-commenting lol)—that's fun. Awesome work
dynamicsofscratch
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

You should try compiling SB2 for FP8 or something
Mr_rudy
Scratcher
100+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Jonathan50 wrote:

Alright, links now in OP.

It would've been great if blooddy_crypto could be made to work on Flash 9 (Scratch depends on it for PNG, JSON, MD5, etc.) but unfortunately the really old version used doesn't seem to have source code, and a somewhat newer version won't compile because of >100 references to something in avm.intrinsics (might be in the AIR SDK or something, or it might be something really trivial). At least importing Scratch 1.4 projects, sans proper costumes, works. (Also sorry for the very messy commenting-out)

Flashvar project can be used for loading a project file. Happily the bitmap editor seems to work.

also how the heck were there like 688,000 Scratch projects made since yesterday

Mr_rudy wrote:

i wonder if the Nintendo Wii would be possible
According to Wikipedia it has Flash 8 and “limited support” for Flash 9. So I don't know. If you have a Wii you can try, just download the SWF to your computer, make an HTML file something like
<embed type="application/x-shockwave-flash" src="s2-flash9.swf" width="800" height="600">
</embed>
then start a web server (the easiest way to do this is to run python3 -m http.server in a terminal) in that folder, and go to your computer's IP address followed by “:8000” or whatever on the Wii.

Edit: Or maybe just going to this URL on your Wii would be easier. Then again, that method might not work due to needing modern HTTPS.
i tried it, the internet channel kept crashing everytime i opened my ip address

Last edited by Mr_rudy (April 14, 2024 18:13:35)

Jonathan50
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

_nix wrote:

Oh my gosh, this is actually incredible. Congrats! I'm stunned lol
Thanks ATer
I guess since PPC Mac is supported by Flash up to 10.1, then if you had a Flash 10 player, you could get the far-less-modified version of Scratch running?
Yes, that's what I meant. Just not what happens to be installed on my Mac :package:

dynamicsofscratch wrote:

You should try compiling SB2 for FP8 or something
What's FP8?

Mr_rudy wrote:

i tried it, the internet channel kept crashing everytime i opened my ip address
OK, if it actually loaded the page – that would be the case if you called it index.html, or you went to /whatever.html or clicked the link – then the problem would be with Flash. Otherwise, that's pretty strange.
Jonathan50
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Turns out I uploaded a sorta broken SWF, sorry. Fixed, same link as before.

Also, the GitHub pages link works on PS3 now. I guess Sony managed to keep HTTPS sorta up-to-date-ish.
Redstone1080
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Reminds me of how MattKC ported .NET to Windows 95 and enabled thousands of apps to run on there. This seems really cool! I wonder what other stuff we can get running on PS3 now that we have this. Old flash games maybe? Then again, you need access to the source code, which might be a problem.

Last edited by Redstone1080 (April 15, 2024 00:05:05)

_nix
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Jonathan50 wrote:

_nix wrote:

Oh my gosh, this is actually incredible. Congrats! I'm stunned lol
Thanks ATer

Redstone1080 wrote:

Reminds me of how MattKC ported .NET to Windows 95 and enabled thousands of apps to run on there. This seems really cool! I wonder what other stuff we can get running on PS3 now that we have this. Old flash games maybe? Then again, you need access to the source code, which might be a problem.
I know JPEXS is pretty good for extracting representations of the “source” code (really just ActionScript-ified bytecode), and for extracting assets too… I don't know if that's enough to recompile from scratch (ha) using Flex, but if it is, it would be really cool to build up sort of a knowledge base of porting Flash 10 stuff to Flash 9 (or even earlier).

I kind of wonder if there were any threads about that concept from way back in the day?? But there probably weren't nearly as good tools for extracting stuff out of a flash at that time, so we're better equipped now than back then!
Jonathan50
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Redstone1080 wrote:

Reminds me of how MattKC ported .NET to Windows 95 and enabled thousands of apps to run on there. This seems really cool! I wonder what other stuff we can get running on PS3 now that we have this. Old flash games maybe? Then again, you need access to the source code, which might be a problem.
Lol, I had no clue who MattKC was, till yesterday I saw that exact video
Jonathan50
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Jonathan50 wrote:

dynamicsofscratch wrote:

You should try compiling SB2 for FP8 or something
What's FP8?
this may be my most intelligent post of all time

Anyway, apparently I don't know what AS2 is like (very different) and Scratch is AS3 all along. So long story short no Scratch on Flash Player 8 without pretty much rewriting everything from scratch Flash 9 is from 2006 and it's already pretty ancient to begin with, so no surprise… So if this doesn't work on Wii as is there isn't much that can be done.

also the best part of that .NET video is Greedo saying his new catchphrase (underrated)
Heatherhat123
Scratcher
2 posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Jonathan50 wrote:

According to Wikipedia it has Flash 8 and “limited support” for Flash 9.
Well, the Kirby TV Channel is almost entirely coded in Flash 9 Actionscript 3. However, when I tried injecting it, it threw an error about not being able to connect to the server, which is odd since it worked when I tried with a Flash 8 game (Super Mario 63).
Jonathan50
Scratcher
1000+ posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Heatherhat123 wrote:

Well, the Kirby TV Channel is almost entirely coded in Flash 9 Actionscript 3. However, when I tried injecting it, it threw an error about not being able to connect to the server, which is odd since it worked when I tried with a Flash 8 game (Super Mario 63).
I'm wondering what you were injecting into what? Because if you mean Scratch threw an error about not being able to connect to the server then I'm stumped.
Heatherhat123
Scratcher
2 posts

Compiling Scratch 2 for Flash Player 9 – PS3 & PPC Mac

Jonathan50 wrote:

Heatherhat123 wrote:

Well, the Kirby TV Channel is almost entirely coded in Flash 9 Actionscript 3. However, when I tried injecting it, it threw an error about not being able to connect to the server, which is odd since it worked when I tried with a Flash 8 game (Super Mario 63).
I'm wondering what you were injecting into what? Because if you mean Scratch threw an error about not being able to connect to the server then I'm stumped.
I tried injecting Scratch 2 into the Kirby TV Channel, but the channel complained about not being able to connect to the server and trying with a WiiLink patched version threw emulation errors, even with Super Mario 63.

Powered by DjangoBB