Notris: A Tetris clone for the PlayStation 1

2 months ago (github.com)

Excellent accomplishment, and wonderful writeup!

I appreciate the quote at the bottom of the article:

> Those of us who love computers need to have something slightly wrong with us, an irrationality to our rationality, a way to deny all the evidence of our eyes and ears that the hostile box of silicon is dead and unyielding. And fashion by cunning machinery the illusion that it lives.

  • That and this wonderful tongue-in-cheek advice:

    > Writing your own PlayStation game in C is actually very simple: all it requires is to make no mistakes whatsoever.

  • I'm late to the party but, as a prolific contributor to PSn00bSDK and the PS1 homebrew scene more in general, I feel obliged to shamelessly plug my own "PlayStation 1 demystified at the absolute lowest level" repo:

    https://github.com/spicyjpeg/ps1-bare-metal

    It's still very work in progress - I have only covered a tiny fraction of what the console's hardware can do - but I find it fascinating to explore how little code you actually need to get started on such a simple platform, even with no external SDKs or tools (aside from a completely standard MIPS GCC toolchain).

Every. Single. Tetris clone which has -tris in the title ends up receiving a very scary cease and desist.

Rename your project if you don’t want to receive such a letter or worse, if you don’t want GitHub to be hit with a DMCA against your project.

I know. It sucks.

God damn do I love playstation 1. I just dug up my old PS4 controller, installed OpenEmu on my Mac, and started on Silent Hill 1.

I used OpenEmu way back in the day, it was the best emulator experience I'd ever had. Glad to see it is actively supported and as good as ever.

  • Wait, is that easy? I have a Mac, and a old PS4 controller.

    • Like the other dude said you need a bios. OpenEmu will tell you exactly what files it needs and ask you to drag and drop them into the app window, you'll easily find them on GitHub.

      Other than that, it has all the emulators you'll ever need built-in, and controller pairing/config is super easy. For a PS4 controller, you just hold down the PS button and share button until the light starts flickering to put it in pairing mode, then bring up the bluetooth menu on your Mac to connect. The whole process is super quick and painless.

      The interface looks so good too. Add roms and you get a nice little UI with all the box art for each game automagically.

      I implore you to set aside a few minutes and give it a try, you won't be disappointed.

      3 replies →

“More precisely: I was worried that if I tried to learn C, and failed, I'd discover that I wasn't actually a very good programmer after all.”

To everyone reading HN: Most people feel this way when they step into something new.

Please don’t ever let it stop you from trying

Props for doing a self organised retro hardware hack and writing up in so much glorious and gory detail! You might mention some of the PSX game jams on itch.io and GGJ for those preferring a more social setting.

interesting perspective of someone who is presumably quite competent in javascript and learning/seeing c for the first time. i guess i'm just old but i'm used to everyone having exposure to c (or a c-style language) as their first language.

  • I am used to thinking that if i want to post code that "anyone" would understand it'd be in C but i wonder if nowadays JavaScript would be a better choice (as long as it applies to JS anyway) for a "lingua franca".

    (Python might be another choice but i don't really like writing it :-P)

    • One problem with C or C style code like JavaScript is that it often uses opaque special characters like various different brackets where the meaning isn't self-explanatory. E.g. "if (A) {B}". This can be expressed more naturally with "if A then B end if" in pseudocode. Or another C offender: "a = b". In pseudocode this would typically be "a ← b" or perhaps "a := b".

      2 replies →

notably sony also made a handful of "yaroze" units for hobbyist developers. you couldn't ship, but you could write, compile, run and i believe share within the yaroze community.

yaroze was outside of my budget, but thankfully there was another option, there was a commercial game cheat device that could be reflashed with a "caetla" rom which when hooked up to the parallel port on a pc, could be used to ship binaries over from linux. the gcc-mips toolchain worked a treat and there was a header file laying around that implemented the user space wrappers for making system calls into the in-rom kernel.

my fun exploratory project: porting the mpg123 decoder over to the psx1, thereby bringing mp3s to the living room. i was able to get it to decode one frame at a time very slowly on the r3000 (25mhz) cpu with no fpu, but didn't have the skill at the time to embark on an optimization project that maybe could have made use of the rudimentary graphics acceleration (it was some kind of limited integer math accelerator, iirc).

  • You didn't even need Caetla. You could do that straight-up with the original ROMs for some of the cartridge series (FCD), and X-Link from DOS (or, if you were prepared to get involved with a bit of spicy linux 2.3, bitbang the parallel port yourself from the /dev/ interface for it at the time, the protocol was really simple). You get a live memory monitor you can watch (made it really easy to make cheat codes or look inside stuff for fun), and you can write and debug anything you want - in many ways it was nicer than the official Psy-Q kit Sony adopted, I thought.

    Except to be fair, I didn't have a C toolchain, but R3000 assembly language is really nice when you get used to the delay slot.

    • i guess you'd discover that protocol by playing with a yaroze/caetla/etc with some of of device listening in between and recording the words?

      never really got into using the parallel port as a cheap dio until building science rigs years later... (and some fun experiments with using it to do cheap adc when in college)

  • I wanted one of those things so badly. It inspired me to buy a used DECstation 5000 to get my hands on something with an R3000 CPU to try writing code for the CPU until I could hopefully someday get a Yaroze. That idea didn't really go anywhere though. Thinking that the DECstation was a useful step towards a Yaroze was probably only wishful thinking. I wish I still had the computer, but then there are a lot of things I wish I still had.

  • yeah, it's called the gameshark, for about $20. You could hook it up to your PC and hack on it, best of all the toolkits were Linux/FreeBSD. outside of SPIM, psx introduced a bunch of hackers to r3k and showed us that the future didn't have to be x86.

    • it was this whole exercise that convinced me to pick up a book on mips "see mips run" which was a first self-study deepdive into microprocessor architecture.

      fun times!

Is there an open, simple, handheld gaming platform that is cheap, and has good documentation so hobbyists and kids can make games for it?

I know people will say pick up a cheap Android phone. And perhaps they're right, but Android is not simple. It has so many things going on that you just can't write a C program and start playing with it. You have to learn a dozen Android quirks and deal with the Android operating system.

Is there something where you can just upload a program to flash and the device just boots into the program and you start playing?

  • Well, if you don't put too much emphasis on the "hand" part of "handheld", Steam Deck is basically a PC running Linux and you can program it in any language you want.

    As a bonus you can gain some muscle by carrying it around.

    Alternatively, some of Anbernic's and other similar manufacturers of "retro handhelds"'s machines run plain Linux (usually derived from OpenDingux for MIPS-based devices, but most newer stuff are ported to ARM) with a simple launcher. I have one of the older MIPS-based devices running OpenDingux (GCW Zero from ~2013)[0] and you can use SDL and C/C++ (or Free Pascal in my case). Anbernic RG350 is basically a remake of it (same hardware, just better screen) and there are some variations at a software level (running the same or a similar MIPS CPU). Other devices are based on ARM (IIRC the devices ending in 1 - like RG351/RG351M/RG351P/etc - use ARM with an OS derived from OpenDingux). Note that some use Android, though they also use a different naming scheme (and they mention it).

    Sadly Android-based devices are the most common and since they are largely used for emulators, the manufacturers rarely post full tech specs but there are dedicated communities and YouTube channels from where you can find what exactly OS they run and with what architecture.

    But all that said, Steam Deck might be the simplest choice (though not the lightest, both in terms of weight and price).

    [0] https://img.itch.zone/aW1hZ2UvNjM4NTE4LzQ3MDk2MTguanBn/origi...

  • Idk if it’s the best recommendation in the space but there are consoles like the Miyoo Mini (and many more) that are capable of running anything from Atari to PSX in the palm of your hand.

  • The Panic Playdate isn't entirely open, but there is an excellent simulator, and itch.io support for titles.

    • +1 for the Playdate. The thing is incredibly friendly to developers and sideloaded games are first-class citizens. In addition to a really pleasant SDK there's also Pulp which is very easy for kids to use to make simple games (and has enough depth to be used to make real games).

      https://play.date/pulp/

  • You can indirectly target Android / iOS devices using frameworks like https://love2d.org/ - there's apps like Love2D Studio which can launch packaged applications, or you can build a standalone application.

Great write up and very interesting!

Slightly off-topic but I literally just bought a PS2 purely to play the original Track and Field games. So much nostalgia! I really wish they would redo these games for the modern consoles!

  • This is brining back memories of playing with my older siblings. For the long jump, I would smash the buttons as quick as possible and then my sibling would time (triangle?) to jump before the line....looking back at it they probably just wanted me to do the most tiring task.

I used to think writing a game to PC was the best idea but the more I write the more I respect consoles. Especially considering all the retro game preservation going on, both in terms of emulation and FPGA.

I did a PS1 project for GGJ 2024 and found it rather difficult to do in the 2 days I allocated! I did get as far as building and running and used the ps1n00b. I'm the end I was able to burn a CD and launch into a 3D environment where you could fly around a checkerboard flat plane. Very exhausting but fun.

Next time I'll budget more time for a PS1 project, especially 3D even if my original goal was just a simple flight around some very simple terrain I barely got anything working. Nevertheless it was magical to see the project boot on real hardware!

  • That’s a difficult project. Congratulations for even getting a 3D environment you can fly around!

    My own experience is that it’s so difficult to make homebrew games not just because of the technical challenges you have to solve making the game, but also because of the poor experience with tools and debugging. Pretty soon, you find your project taking up more time than you can reasonably spare. I think it’s impressive when people manage to get something interactive working on these old consoles, anything at all beyond a “hello world” template.

    • Indeed the art pipeline alone is a huge challenge - and particularly so on these first generation 3D consoles. There is some GL like aspects to the rendering side as well but with a _lot_ of idiosyncracies. I was sweating it. I feel like N64 would be slightly easier.

      1 reply →

  • Could you run the CD with the project on original stock hardware? Or was it a modded PlayStation?

    • People are edging closer to figuring out how to burn CDs that can boot on unmodified hardware but it's still unsolved for the average person. I used a modded PS1.

      It's still very stock other than the bypass.

> Last year I got my hands on a rare, black PlayStation 1. This is called a Net Yaroze and is a special console that can play homebrew games as well as ordinary PSX titles. It was part of a special Sony project to get hobbyists and students into the games industry.

I wonder what the post-mortem on this initiative was like. Seems like they didn't pursue it in future consoles but dang it would be pretty cool if there was a hobbyist section of the PS5 store that anyone could put small games in.

  • Sony released a linux kit for PS2 [1], which was conceptually similar to Yaroze, but I think PS2 Linux didn't have apis for all of the PS2 hardware. The PS3 initially shipped with an OtherOS option[2], which was later removed, but is also conceptually similar again without access to all the hardware.

    I haven't heard of anything similar with the PS4 or PS5; I'm guessing Sony is unlikely to provide similar widely available options in the future, but who knows. They did PR expanded access for "indie developers", but I don't know what the process looks like to get that.

    [1] https://en.wikipedia.org/wiki/Linux_for_PlayStation_2

    [2] https://en.wikipedia.org/wiki/OtherOS

    • At least some of these efforts were supposedly related to Sony's attempts at getting various Playstation models classified as computers instead of video game consoles for import tariff or tax reasons.

      While the tariff classification plot never seems to have worked out, Sony did also around the same time apparently succeed in creating a perception of the PS2 as being so dangerously fast as to needing export controls as a munition(!): https://www.zdnet.com/article/google-pixel-9-pro-xl-vs-samsu...

      With the PS3, both attempts eventually succeeded, but in a way that backfired at Sony gloriously: The US Navy actually did end up using the PS3 as a supercomputer! https://phys.org/news/2010-12-air-playstation-3s-supercomput...

      The only problem: They were selling the console as a loss leader, making money only via games and game licenses. Once somebody had finally taken them up on their "it's a computer, not just a game console!", they were very quick to remove the "Other OS" boot capability in a firmware retroactively.

  • Microsoft offers a an Xbox "developer mode" that lets users run their own software on their consoles.

    https://learn.microsoft.com/en-us/windows/uwp/xbox-apps/devk...

    • it's unfortunately quite gimped, basically UWP-only and running with the system capped to around 1/4th of the typical performance, so it's not really that useful.

      if the EU hadn't specifically exempted games consoles, it would be legally incompliant with the gatekeeping requirements.

      1 reply →

  • > Seems like they didn't pursue it in future consoles

    I don't think this is entirely true.

    Sure, there was nothing like the Net Yaroze, but the PS2 came with Yabasic[1] on the demo disk and had a Linux distro[2], and the PS3 also had a Unix support[3].

    While some of this might have been for tax benefits, I still think it fits in the spirit of Net Yaroze.

    1: https://en.wikipedia.org/wiki/Yabasic#PlayStation_2

    2: https://en.wikipedia.org/wiki/Linux_for_PlayStation_2

    3: https://en.wikipedia.org/wiki/OtherOS

  • > Seems like they didn't pursue it in future consoles

    FWIW, they did:

    PS2 had an official linux distro, which was intended to be a sequel

    PS3 had an "other os" mode, which allowed you to run your own, unsigned OS. This was eventually removed in a firmware update, due to piracy.

Is there any information about the tilting in the demo video? How does that work?

  • It has to do with the laser being worn out. This method slows the CD motor down, helping the burned game be read. People have done it by pressing firmly on the lid, which puts pressure on the top of the spindle, causing motor strain. Some people put the whole unit on its side. Other methods include adding two CDs to the spindle, obviously with the data one on the bottom, to add the strain.

    There is also a 3D-printed weight disk people use at https://www.thingiverse.com/thing:4838168 .