Loonies 8192 Port

Start a log and update it occasionally with your projects progress
Post Reply
thp
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: February 19th, 2020, 1:33 am

Loonies 8192 Port

Post by thp » February 25th, 2020, 6:13 am

Last week I tried Lameguy64's PSn00bSDK and started porting my mini retro puzzle Loonies 8192 to the PS1. It started out as DOS game two years ago, and so isn't too taxing on the hardware, has CD-Audio support and uses an old subset of C++ (since I still build the DOS version in Borland C++ for some reason):

Image

CD Audio had some issues, which I tracked down to CDGetToc handling the CdlGetTD in a wrong way pull request #14 should fix this. There's also some missing libc functions that were easy enough to add, see pull request #16. In certain emulators, SpuInit() locks up for some reason, but I got to test it on real hardware this weekend and it worked just fine. mkpsxiso was used to create the image (EXE + 3 audio tracks).

It works in a few emulators I've tested (NO$PSX seems especially useful with its VRAM inspector), I couldn't get it working on the PSP's PS1 emulator (using PSX2PSP), not sure how to debug that. It works fine on a real PAL PS1 (had to fiddle a bit with the screen size/position, as the game originally is 320x240 in resolution, so it needs to be offset a bit for the additional PAL lines).

Background music using CD-Audio works fine now, including looping (there's a short pause when looping due to the way I've implemented looping of tracks by polling the position). Also, I probably want to add memory card saving and loading of the high scores, which I haven't looked into yet; according to the readme, that is still a work in progress for PSn00bSDK (psxmcrd).

Not sure when/if/how it is going to be released, but thought I'd post this here as PSn00bSDK was very easy to get set up, and I haven't seen many recent new ports using it in this subforum, so maybe this is useful/motivating :)

User avatar
sickle
C Programming Expert
C Programming Expert
Posts: 230
Joined: July 17th, 2013, 9:32 pm
I am a: Chocolate-fueled pug fetish robot.
Location: Scotland

Re: Loonies 8192 Port

Post by sickle » February 26th, 2020, 3:41 pm

Hah nice!
How small have you managed to squeeze it on the PSX :p?

thp
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: February 19th, 2020, 1:33 am

Re: Loonies 8192 Port

Post by thp » February 26th, 2020, 9:05 pm

sicklebrick wrote:
February 26th, 2020, 3:41 pm
How small have you managed to squeeze it on the PSX :p?
For the original release of the game in 2018 the target was 8 KiB (hence the name) for DOS (compressed with aPACK), since then it grew bigger with every new release.

Last year I ported it to PSP and 3DS, I didn't care much about the binary size there (242 KiB for 3DS and 640 KiB for PSP, likely dragging in lots of standard library stuff, I didn't check).

This year I did a GBA port a few weeks ago and added new backgrounds into the game. Because of GBA hardware limitations that had to fit into 256 KiB RAM so right now it doesn't have all the artwork (although I could use the cartridge ROM to store a few megs worth of additional assets there). Right now, the GBA binary is at 152 KiB for the multiboot (load directly into RAM) version and 316 KiB for the "cart" build (additional read-only memory on the cartridge ROM).

The PSX port contains all the background artwork and the EXE is 240 KiB at the moment of which 148 KiB are used for the background data (in the original build, those were algorithmically generated at load time, but I opted for generating them still algorithmically but at build time to save loading time and have more "artistic freedom" [read: not caring about runtime performance] for generating the background art), and there's stuff like Adlib and MIDI data that's not stripped out, but unused at the moment, which could bring the binary size down -- maybe I'll invest time in that when I get the serial cable set up for testing on real hardware and uploads take too long; right now I'm burning CDs whenever I want to test on real hardware.

The music in the case of the PSX version is CDDA tracks, so the size there doesn't matter (there's still lots of room for audio if I wanted to fill a whole CD-ROM worth of data... -- one option would be to record the DOS Adlib (OPL-2) and MIDI variants of the soundtrack and make those features do something in the PSX version, alternatively I could look into how easy it is to get MIDI playback working with the SPU and custom samples).

User avatar
sickle
C Programming Expert
C Programming Expert
Posts: 230
Joined: July 17th, 2013, 9:32 pm
I am a: Chocolate-fueled pug fetish robot.
Location: Scotland

Re: Loonies 8192 Port

Post by sickle » March 1st, 2020, 5:31 am

thp wrote:
February 26th, 2020, 9:05 pm
sicklebrick wrote:
February 26th, 2020, 3:41 pm
How small have you managed to squeeze it on the PSX :p?
For the original release of the game in 2018 the target was 8 KiB (hence the name) for DOS (compressed with aPACK), since then it grew bigger with every new release.

Last year I ported it to PSP and 3DS, I didn't care much about the binary size there (242 KiB for 3DS and 640 KiB for PSP, likely dragging in lots of standard library stuff, I didn't check).

This year I did a GBA port a few weeks ago and added new backgrounds into the game. Because of GBA hardware limitations that had to fit into 256 KiB RAM so right now it doesn't have all the artwork (although I could use the cartridge ROM to store a few megs worth of additional assets there). Right now, the GBA binary is at 152 KiB for the multiboot (load directly into RAM) version and 316 KiB for the "cart" build (additional read-only memory on the cartridge ROM).

The PSX port contains all the background artwork and the EXE is 240 KiB at the moment of which 148 KiB are used for the background data (in the original build, those were algorithmically generated at load time, but I opted for generating them still algorithmically but at build time to save loading time and have more "artistic freedom" [read: not caring about runtime performance] for generating the background art), and there's stuff like Adlib and MIDI data that's not stripped out, but unused at the moment, which could bring the binary size down -- maybe I'll invest time in that when I get the serial cable set up for testing on real hardware and uploads take too long; right now I'm burning CDs whenever I want to test on real hardware.

The music in the case of the PSX version is CDDA tracks, so the size there doesn't matter (there's still lots of room for audio if I wanted to fill a whole CD-ROM worth of data... -- one option would be to record the DOS Adlib (OPL-2) and MIDI variants of the soundtrack and make those features do something in the PSX version, alternatively I could look into how easy it is to get MIDI playback working with the SPU and custom samples).
LMAO, been busy. What's next?
GameBoy classic could be a lot of fun with good scope for tinyfying things :lol:

thp
Interested PSXDEV User
Interested PSXDEV User
Posts: 5
Joined: February 19th, 2020, 1:33 am

Re: Loonies 8192 Port

Post by thp » June 11th, 2020, 6:46 pm

Finally submitted to the Homebrew section: viewtopic.php?f=66&t=3617
Download is available from itch.io: https://thp.itch.io/loonies-8192

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests