10/31/2023: Localization News - Dead of the Brain 1!

No, NOT a trick, a Halloween treat! Presenting the Dead of the Brain 1 English patch by David Shadoff for the DEAD last official PC Engine CD game published by NEC before exiting the console biz in 1999! I helped edit/betatest and it's also a game I actually finished in 2023, yaaay! Shubibiman also did a French localization. github.com/dshadoff/DeadoftheBrain
twitter.com/NightWolve/PCENews
Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - gameblabla

#1
Yup ! :P
Now its even faster, i optimized the rendering code to operate on 16-bits instead of 8-bits. Game went from 7 FPS to 14 FPS.

Link has also been updated
#2
IMG

Anarch is a raycasted fps by drummyfish and ported to many platforms.
Capitalism has taken over the world and destroyed everything on earth.
It's up to you to save the world !

This PC-FX has music and sound effects. There's also a version for the fxuploader if you own one.

IMG
Download link
https://github.com/gameblabla/anarch-PCFX/releases/tag/1.1
#3
angels_scr1.webp

NSFW : Do not play this in a public room

The PC-FX was sorely missing a new NSFW game... thus this wrong has been addressed.
It is a short PC-FX visual novel game, done in the same fashion as PC-98/PC-FX games.

Plot
Dark Pit and Pit fight each other but unfortunately, Pit loses the battle and is taken to Dark Pit's lair.
Dark Pit decided he shouldn't just lock him up, he should... "have fun" with him.

How to run this
Burn this on a CD-R with ImgBurn or play it on an emulator like Mednafen.
The game has been confirmed to work on real hardware but note that i was not able to confirm if it works on a PCFX-GA.

The game supports both the mouse and the FXpad.

Technical details
The game was made with liberis/v810-gcc.
I also had to extend it to add support for ADPCM samples, CD-DA and minor things (thanks Optimus for the timer code).
There's quite a lot of voice samples streamed from the CD and plenty of backgrounds that use the 16 millions color mode.
The 256 colors/4 colors mode are parsely used here and there as well.

There were quite a lot of technical hurdles as well, with most of my time spent on SCSI bugs and behaviour... and some bugs within liberis also that needed workarounds.


Download link
https://bafybeiddt3avurpt56xnoynrcvbwy4j3mdhtzhny4qw3bvyb7pb5oxvfae.ipfs.w3s.link/ipfs/bafybeiddt3avurpt56xnoynrcvbwy4j3mdhtzhny4qw3bvyb7pb5oxvfae/18%2B_angelspcfx.7z
#4
I wanted to see just how badly (or good) the PC-FX would perform with software rendering.
I tried to find a simple program to start with and one that could work in 256px wide mode as well.
I've eventually found the old nCraft attempt to the TI nspire CX and found the source code to be small and easy to mess around with.

So here it is :
Source code is available here :
https://github.com/gameblabla/ncraft

You can download it here (including for the backup memory) :
https://github.com/gameblabla/ncraft/releases/tag/1

The colors are a bit wrong but that's because i didn't really set a proper palette for it and it was just done for testing.

I'm planning at some point of making a separate CD for writing the backup memory version to the FX-BMP.
The whole game fits on 20kb so it's very feasible.
That way, you won't need to rely on an external flasher. (after all, games can save to it as well !)
The only thing i'm not sure if whenever or not i can basically flash the whole thing.

I'm also open to some suggestions when it comes to improving performance.
RAM to KRAM is especially slow and i wonder if there's a way of using DMA. (the SCSI DMA uses DMA but from CD to KRAM)
#5
Some newsworthy progress !
Finally decided to take a closer look at the 8bpp and 16bpp KING BG formats to see what the hardware expects.

8bpp
For 8bpp, you need two things :
- A 256 colors palette with Y8U4V4 colors.
- An 8-bits buffer that is byte-swapped (big endian)

Even though the CPU (V810) is little endian, KING's 8bpp mode expects a big endian framebuffer.
This makes it really annoying to work with, as not only you need to convert from RGB to YUV,
but you also need to swap the bytes manually.
If you're not careful about it, this can result into a noticeable performance penalty.
Given that the CPU isn't that strong compared to the Saturn's SH-2, you ought to be careful :P

16bpp
For 16bpp, no color palette is needed (obviously).
However, it still expects Y8U4V4 pixels.
Unlike 8bpp, framebuffer is little endian so it does not need to be byte swapped. (Good)
However this may or may not be ideal for software rendering as it consumes twice as much memory.

Based on my findings, i've released a (better) tool for 8/16bpp so i don't have to use the official SDK tools just to convert an image.

github.com/gameblabla/bmp2huc

For 16bpp, image quality is greatly improved compared to b2k.
Check this out :
b2kBMP2HUC (my own)

I'm not sure how they screwed up that badly but i must assume they must do some internal converting down to RGB555 or something before converting to Y8U4V4.
Due to the YUV nature of the PC-FX, it's a better idea to convert from 24/32bpp rather than 16bpp directly.
Of course though, if you are doing software rendering on the hardware itself, then you should go directly with 16bpp.
#6
Well i'm glad that i don't have to go through that SCSI trouble... :P

There have been a few updates since then :

- I was able to come up with a tool for allowing liberis executable to boot from backup memory.
The only limitation is the size being limited to 2MB because you cannot execute code from ROM
and it has to be copied to RAM first.

My tool is released here as source code (i can compile a windows executable if anyone is interested) :
https://github.com/gameblabla/bin2backup

- Thanks to another person, i was able to get my hands on GMAKER PLUS and its AGE executable.
This was needed as i have no other means rn to convert graphics to 8bpp.
This means that i can now pretty much cover all graphical modes (except for the "block" mode ones that i have yet to try)

This is all here : https://github.com/gameblabla/liberis/tree/cdrom

- I also rewrote oldrover's pal2yuv tool as his tool was wonky to use and annoying for liberis development.
I rewrote one so that it can take a palette from BMP files and export it as a C array for use in liberis.
This can be found here : https://github.com/gameblabla/bmp2yuv



There is still a lot to be figured out but so far, i've made some nice progress.
I hope this make other people interested as well.
#7
I figured out how to play a CD-DA track and loop it.
It turns out the PC-FX was not fully compliant with the SCSI-2 standard !
This is apparently because it was based upon an earlier (free) draft of the standard.
Instead, if you want to have a CD-DA track looping, you have to use the vendor-specific 0xD8 and 0xD9 modes.

The first one specifies the starting track and the other one specifies if it should loop or not and the ending track.
So yes, if you feel like it, you can make it play through 2 tracks and then loop.
I was able to figure this one out thanks to Mednafen's source code on the matter. (and i used mednafen to catch the SCSI calls games were making to figure it out)

The next issue i was encountering when using those is that there is a bug within liberis itself with the low levels SCSI commands : they would just freeze the software or be ignored if a second call to it was made.
I have been told to look into the cd_read and the other high level functions that Marshall worked on as those work fine.
There was the issue of me not knowing any V810 assembly but then i realized that i could simply make a copy of the known working functions, have GCC compile my C code and output it as V810 assembly and then transplant that onto my new function.
Shitty idea actually worked it seems and it's no longer freezing the hardware.

Why it's doing this, i'm not too sure :
I had taken a look at it and it seems to check for the CD-ROM drive status before it goes on.

In any case, the only thing i have to do is make the second ADPCM channel work properly.
#8
I was always interested in the PC-FX but the state of liberis unfortunately prevented me from doing anything
besides a very basic game, Simple Battle FX, for it.

The official SDK that was released for the PCFX-GA was certainly interested
but was said to only work on said hardware without modifications.
Besides, it only works on DOS/V (it always returns DOS16M errors for me) so this was a big pain in the arse.

I'm happy to say however, that i'm starting to get a bit more familiar with the (quirky) hardware.
Well yes and no lol... i'm not exactly experienced in all of this.

I wish i had discovered this older thread as Oldrover's posts and code samples were very interesting and
it's what helped me get CD-DA and ADPCM working in the first place.
https://www.pcengine-fx.com/forums/index.php?topic=18435.50

This is what was possible with liberis so far :
- Text on all background layers
- Simple 16 colors background image loaded from CD directly to KRAM
- Controllers (although it is apparently not working properly without a hack)
- Sprites (i'm having a bit of trouble with the 7up examples however)
- PSG soundchip (very low level functions)

However as you can see, this was not enough for me to make, say, a basic visual novel game.
Besides, the NEC PC-FX really needs Adol Christin being stuffed things up his ass.
In order to achieve this noble goal, i set out to find out more about the hardware.

32bpp

Initially i wanted to just go ahead with the 16 colors example that was there for a while.
And it has been confirmed to work on real hardware as well.
Unfortunately i had no idea how he converted his picture from a BMP or similar. When i asked him on twitter,
he said that he couldn't remember other than the fact it was his own tool.
Things were not going so well so far.

I took a look at GMAKER's tools and i eventually found b2k.
This tool however only supports the 16 & 32bpp color modes, not the 256/16 color modes. (this will be a problem as you will find out later)
The tool thankfully does work under dosbox and i was able to get something out of it.

However, there was still the problem of actually getting the whole thing to work in the first place.
I went under the assumption that the 16 color example just needed some modifications to it for it to really work.
I was able to get somewhere but it would only parse part of my image on the screen.
I immediatly suspected the microcode but i was not familiar with it so i read the translated documentation here :
http://daifukkat.su/pcfx/

Eventually in the KING section under Common microcode, i found these :
16M color mode / 64k color mode microprogram
Code Operation
0000 +0 from CG is accessed
0001 +1 from CG is accessed
0002 +2 from CG is accessed
0003 +3 from CG is accessed
0004 +4 from CG is accessed
0005 +5 from CG is accessed
0006 +6 from CG is accessed
0007 +7 from CG is accessed

16 color mode microprogram
Code Operation
0000 +0 from CG is accessed
0001 +1 from CG is accessed

The 16 color mode microprogram was suspiciously similar to the one that was in the example.
What if i reimplement it as they said instead ?

So yeah, this is basically how i got my 32bpp image to work.
I should note that there is also support for 16bpp but as you can see, it seems to take the same amount of memory for some bizarre reasons.
So there does not seem to be much point in using it.

I later figured out 8bpp and also wrote a tool for converting BMP palettes to a C array suitable for my needs.

CD-DA/ADPCM

In the same thread, Oldrover posted a bunch of code on how to playback an ADPCM sample as well as CD-DA.
It was mostly straight forward to get his code up and running though as he said, there were a few issues which i have now fixed.

As for AD-PCM, it was working fine but i can't get my head around the bits so for now it's only working at 16khz and the first channel. (the PC-FX has 2 channels and can support up to 32Khz)
Using the wav2vox tool, it was sounding OK but not particularly great... In fact, this sounds much worse than ADPCM on the Dreamcast.
The lower frequency could be the reason why but oh well.

Conclusion

All of my code is here if you want to take a look or even use it :
https://github.com/gameblabla/liberis/tree/cdrom

We are not exactly covering the whole hardware yet.
For example, the MJPEG side of things is still a mystery and woefully documented.
I don't think i can get MJPEG working on that thing sadly, even if it would be nice.

Doing software rendering (ala VGA) for 3D on the PC-FX would be nice but this would require converting the colors from RGB to Y8U4V4..
As a result, a performance penalty may occur.
Perhaps it wouldn't be so bad in 16/256 colors mode but the routine elmer posted would be too slow on the hardware.
I'm not even sure why i'm even talking about this when we don't even have a proper open source image converter for it lol...

There are some examples for the 7up/VCE/VDC chips but i'm not too familiar with those.
Most retail games use them because honestly, they don't have much of a choice given the constraints the KING chip has.

I'm also looking for artists etc... potentially interested in my project. : P
As it is, i don't think i can really port a game like Evil australians unless i mess around with the 7up chip. (the KING chip doesn't really have sprites and doing software rendering for small sprites is well, probably not a good idea lol)

Sidenote : Consolizing the PCFX-GA would be nice but it seems that it could only be easily done with the DOS/V version, which is unfortunately not cheap and rare.
Perhaps instead we could desolder the 3D chip from it and manually wiring it up to a PC-FX. This sounds like a terrible idea though, i have to admit.

I will get my PC-FX (as well as my 3DO) in a few months so until then, i won't be able to test on real hardware. (I need to try in particular the input code as it's said to be partially broken in liberis)
#9
QuoteI was confused what you meant at first, but I understand now: So this is a PC Engine emulation layer (albeit WIP, very slow, unfinished) whereby the user can take PC Engine ROMs, burn a CD-R with it, and actually load it on their NEC PC-FX console for play! I'm imagining Bonk's Revenge loading on a PC-FX, and other games people would actually wanna play on it, haha!
Yes, this basically allows you to play some PC Engine games on your PC-FX. If people have suggestions for other games to try, i can try those as well.
I probably need to think of a solution to automatically insert roms in the CD image without having the whole compiler suite so people can
actually do it with their own ROMs.

QuoteA PCE fellow turbro of many turbo names - Tom/Malducci/Tomaitheous/Bonknuts and now Super TurboXray - actually did something similar: a NES "hackulation/emulation" layer that allowed running games like MegaMan, Contra, Jackal, Dragon Warrior on PC Engine/TurboGrafx-16. It was actually very cool to load Contra or MegaMan on my TurboExpress portable, so it was kind of useful beyond a novelty experiment to "see what's possible."
You can also (if they work) play those on the PCE emulator as well :P

Feel free to play around with it. I just got my PC-FX and intend to do more on it.
#10
I'm not sure if this has been talked about here as i don't see a mention of it anywhere else.

So almost 8 years ago, Marshall worked on a PC Engine emulator for the NEC PC-FX.
His last commit on it dates back to 2018 and he was trying to get his JIT working but sadly it doesn't compile as is...

But there is still the ASM-based interpreter that can be compiled and used.

The source code was posted here: bitbucket.org/trap15/pcfxengine

Here's a video of it running under Mednafen:
Here's a link to a precompiled build of his emulator provided with a bunch of games :
gitlab.com/pcfx/pcfxengine-homebrew-samples.zip

Note that obviously i can't compile official roms with it so it will be only homebrew games.

So far, it seems to be only suited for slower based games. It was provided with Shangai but other commercial games are playable.
If you are a homebrew developer, this could be potentially used for PC-FX homebrew development as well.

If you do want to make a PC engine game to target the PC-FX however, make sure to force the CPU mode to 1.79Mhz and avoid having too many sprites on-screen.

Anyway, i was surprised no one mentioned this... : P
Btw, the PC-FX and PCE share a lot in common. The major differences are mostly the CPU and the Motion JPEG hardware decoder in the PC-FX as well as the increased color count but you can still find the same PSG, same VDC/VCE...


wayback.twitter.com/gameblabla/status/1483292369176956933

#11
Thank you guys, i really hope elmer makes progress on liberis and his tools !
btw, did anyone tried it on real hardware ?

I have released a video of the game in case you're too lazy to try (or you're at work) :
And no, this game has no porn. (Just in case if anyone asks)
#12
QuoteRename game to "Fist of the North Star", rename attacks to Hokuto Shinken attacks, put Heart of Madness on CDDA playing during the game on loop.
Thank me later.
i knew someone would ask something like this, lol.
I guess you will have to wait for the CDDA track though.

Quote from: elmer on 09/14/2015, 11:53 PMI think that you're going to have to wait for me to implement all the missing functionality.  :(
Alex has abandoned liberis, but is happy for me to keep on developing it ...
I was wondering why he didn't updated the repo since last year...
I guess we'll never see his pc-engine emulator for PCFX even close to Alpha state.

Other than GCC 4.5, what have you done already on liberis ?
Do you have a repo for it ?
Because i personally would like to check your progress on liberis.

Anyways, it's good someone is working on it, even slowly.
I hope in the future i can come up with something better than this game.
Good luck
#13
Why guys, thanks !
Hopefully trap15 can implement proper support for CDDA tracks so you can have kickass music for this game.
(yes, a text-based game with CD quality music... Never saw that in my life i've got to say lol)

I wish Liberis had better support for graphics because everything else is low-level, i think all we can do is wait...
Anyways, i think i should work on that Tetris clone real fast.
#14
It was really sad seeing the PC-FX with not a single homebrew working on real hardware.
trap15 then released liberis but it still is much work-in-progress but it can be used for text-based games.

So i worked on my very simple game and i thought my game was going to be the first working homebrew game for PCFX. I later learned that matej did it first with Soviet Union 2010 (Also see: http://matejhorvat.si/en/pcfx/index.htm). Yeah... But it's still the first homebrew game programmed in ANSI C for PCFX ! lol

Simple Battle FX is a RPG but without towns, shops or anything like that, just the fightings.
There's a DUEL mode, where you just fight a regular enemy with standard stats.
Then, there's the SURVIVAL mode, where you try to go as far as you can until you lose.

Like i said, it's very simple.

Video:
Screenshots:

IMG IMG
IMG IMG

Updated:  8/21/2021
https://github.com/gameblabla/simplebattlefx-pcfx
Download link

My next goal is to make a Tetris clone using the text mode
with some PSG music. (i hope)