Homepage->Blog index
[PC-98][Demoscene] Enter "Lemonspin", break all the emulators!
Date written: 2023/05/11

The one lost wanderer who might actually be visiting this website might have noticed the new "Demoscene prods" section.
That's right, I'm makin' prods now, and what better way to start than with the quintessential JPC platform: NEC PC-98.... Yeah nobody really cares about it, good luck finding any prods that aren't Honwaka Soft's Dance98 from 1995.

For a few years I've been nudging other sceners, both Japanese and others, into checking the platform out. Fruitless endeavor, and I quickly learned that you have to take things into your own hands if you wanna stir up some competition.
My plan was to cook something up for Revision 2023, but.... various unfortunate life events put a stop to that, and all I could do is take a peek at a handful of compos (PC Demo certainly wasn't one of them... over 40 demos at 3 in the morning, good lord).

But, not long after, I was reminded that the SESSIONS 2023 party was gonna be held at Twin Messe Shizuoka, Japan at the end of April. Sounds good, but I had only a few weeks to get something done, and even then most of that time I already knew was gonna be spent doing life shit. I had to do something fast and within appropriate scope, while also being something I could do with my limited programming skills. Immediately I had conceptualized the basic idea: Simple looping animation with a text scroller. A go-to type of demo for beginners, while also showing off one of the key sellings points of the PC-98, it being the dual uPD7220 video system.

For those who don't know, the NEC PC-9800 video system consists of two uPD7220 chips, one responsible for displaying text, the other for bitmap graphics. Text is overlaid over the bitmap, displays 80x25 text at an effective resolution of 640x400 with 8 fixed colors to choose from. The bitmap chip had similar color limitations at first, but with the release of the PC-9801-24 color board, and it's subsequent integration into the 1985 PC-9801VM model and all of it's successors, 16 redefinable colors from a total of 4096 became the standard. It's resolution can be set to 640x400 or 640x200 independently of the text chip, and two 640x400 VRAM pages are available for use, although using 200-line mode provides a pseudo 4 page VRAM configuration.

TL;DR, we can display high resolution graphics with moving text at no processing cost whatsoever since we're not blitting anything, and at 640x200 we can flip between 4 full-screen frames for absolutely free! Excellent for a looping animation with a text scroller!
With the fundamental idea formed, I now needed the actual meat and potatoes. Hmm... what could be a good 4-frame looping animation... oh, of course:

Now for the text. The contents aren't important, but rather how they're displayed. At this point I had remembered that there exists an obscure set of functions within MASTER.LIB with the "text_smooth" prefix. As the name implies, these functions allow smoothly scrolling select lines of text on screen by a specified amount of pixels up or down instead of cell-by-cell. There we go, now we're making things interesting!

After some amount of coding, figuring out how to actually flip the VRAM pages (and the extra "pages", which wasn't intuitive at all), adding some looping PCM sound with PMD86, yadda yadda yadda, the end result was this:


Seemed decent enough for me so far. This is when I decided to actually check the rules of the party I was gonna submit to, and well....



F U C K ! Panic mode ensues! Both the audio and animation had to be scrapped, and now I had to create something myself.

This is when I PM'ed my friend ShinkoNet to vent out my frustration a bit. To my surprise, he was quick to offer me a "short Eurobeat thing" he had in the backlog. It sounded alright, so I went with it. For the graphics, I tried to go with whatever I could find. Didn't want to go with yet another leek, so I picked what I thought would be the next best thing: a carrot that I would fling back and forth like a metronome. I showed the new version to him, to which he responded with: "i dunno but flicking the carrot back and forth like that feels like an innuendo".... yeah back to square one.

It didn't take long for the real inspiration to arrive, as I had stumbled upon this old NEC PC-98 commercial that's... centered around a lemon of all things. Hmm... bingo! It just so happened that I had a chunky lemon lying around, and I knew exactly what I was gonna do with it!


And now I have my meat and potatoes! At this point I wanted to consult with another friend and experienced scener jbit, who gave me some sound advice like improving visibility, adding some more "flashiness", and the likes. The end result of that turned out to be:


Everything seemed to be ready, but he advised me to do a real hardware test just in case. Up until this point I felt too lazy to hook my Valuestar up, but it had to be done. When I commenced the test, I couldn't believe what I saw...

The text scroller was all jumpy, it turns out np21 (with which I hosted my dev environment) has a text GDC emulation inaccuracy! I got curious and tried pretty much every other emulator under the sun. SL9821, T98-Next, Takeda Toshiya's CSCP, DOSBox-X, all the forks of np2, Anex86, all of them allowed the text to smooth scroll further than real hardware! Epson 98/V, the very first PC-98 emulator ever made, didn't emulate smooth scroll at all, which is to be expected of an emu from 1994.
Saying that I expected to break all emulators on my first try would be a complete lie, heheh.

Eventually all the quirks were ironed out, and the demo was submitted. I scored second to last place at the Wild compo, but at least I won in the video thumbnail race! That's a win in my book.


Overall, I'm pleased with how everything turned out, but my next prod will definitely have to raise the bar in the JPC scene as well as the overall demoscene.