Dall’MSX al TI-99/4A: smontare e rimontare Chrono Runner

da | 14 / Ott / 26 | Giochi, Programmazione, Software

Sono un appassionato del TI-99/4A, il computer con cui giocavo da ragazzino prima di mettere le mani su un MSX Philips VG-8020. Così ho pensato che non fosse impossibile convertire il gioco della nostra Associazione MSX Italia per questa macchina strana e affascinante.

L’originale è scritto in C con la libreria MSXgl, che offre moduli pronti per grafica, input, fisica dei personaggi, musica PT3 ed effetti AYFX. Per il port è stato riscritto un solo modulo, game/pawn, che gestisce fisica e collisioni del giocatore: con l’aiuto di Claude Code ne è stato replicato fedelmente il comportamento in CVBasic. Il resto del gioco è stato tradotto blocco per blocco dal C alle istruzioni native di CVBasic. Musica ed effetti sono convertiti da script Python per il chip audio SN76489.

Il codice è distribuito in una cartuccia da 128 KB a banchi. Il banco fisso contiene la logica di gioco. Gli altri tredici, intercambiabili, ospitano grafica, livelli, schermate, cutscene, audio e il boss finale. Le cutscene, che nell’originale sono script in C, sono diventate un piccolo bytecode letto da un interprete: una specie di copione da recitare. CVBasic, l’eccellente compilatore multipiattaforma di Oscar Toledo, ha permesso di scrivere gran parte del gioco in BASIC. Le parti critiche (nemici, rewind, boss, interrupt) sono invece in assembly TMS9900, inserito nel sorgente e richiamato da lì.

La fedeltà visiva si deve all’hardware. Il TI-99/4A monta lo stesso processore video dell’MSX1, il TMS9918A. Tileset, mappe, colori e sprite sono stati trasferiti 1:1 dall’originale, senza conversione di formato: ciò che si vede sul TI è, pixel per pixel, ciò che si vedeva su MSX. Il lavoro vero si è concentrato su ciò che cambia: CPU, chip audio, tastiera e memoria. Tra pazienza, debug e molte prove, la conversione ha richiesto qualche mese di serate libere e qualche weekend.

Secondo me il gioco è davvero bello, ed è un piacere poterlo mostrare agli appassionati che non conoscono l’MSX. Speriamo che qualcuno lo converta anche per altri computer. Per vederlo in funzione basta scaricare il file .bin della ROM e caricarlo nell’emulatore online cliccando QUI. I tasti sono gli stessi del gioco MSX, con in più FCTN+9 (ALT+9 su PC) per saltare l’intro e M per accendere o spegnere la musica.

Buon divertimento!

Fabrizio Luglio

Ringraziamo infine l’associazione TI99IUC (user club italia) che ha postato sulle sue pagine il gioco, potete trovare informazioni anche qui:

https://www.ti99iuc.it/web/index.php?pageid=database_cerca&archivioid=1320
https://www.ti99iuc.it/web/index.php?pageid=database_cerca&archivioid=1319

From MSX to TI-99/4A: taking Chrono Runner apart and putting it back together for the TI99/4a

I’m a TI-99/4A enthusiast: it’s the computer I played on as a kid, before I got my hands on a Philips VG-8020 MSX. So I thought it wouldn’t be impossible to convert our Associazione MSX Italia’s game to this strange and fascinating machine.

The original is written in C with the MSXgl library, which provides ready-made modules for graphics, input, character physics, PT3 music and AYFX sound effects. Only one module was rewritten for the port: game/pawn, which handles the player’s physics and collisions. With the help of Claude Code, its behaviour was faithfully replicated in CVBasic. The rest of the game was translated block by block from C into native CVBasic statements. Music and sound effects are converted by Python scripts for the SN76489 sound chip.

The code is spread across a 128 KB bank-switched cartridge. The fixed bank holds the game logic. The other thirteen, switchable, hold graphics, levels, screens, cutscenes, audio and the final boss. The cutscenes, which are C scripts in the original, became a small bytecode read by an interpreter: a sort of script for the game to act out. CVBasic, Oscar Toledo’s excellent cross-platform compiler, made it possible to write most of the game in BASIC. The critical parts (enemies, rewind, boss, interrupts) are written in TMS9900 assembly instead, embedded in the source and called from it.

The visual fidelity comes from the hardware. The TI-99/4A uses the same video chip as the MSX1, the TMS9918A. Tilesets, maps, colours and sprites were carried over 1:1 from the original, with no format conversion: what you see on the TI is, pixel for pixel, what you saw on the MSX. The real work went into what changes: CPU, sound chip, keyboard and memory. With patience, debugging and plenty of testing, the conversion took a few months of free evenings and the odd weekend.

I think it’s a really good game, and it’s a pleasure to be able to show it to fans who don’t know the MSX. Hopefully someone will port it to other computers too. To see it running, download the ROM .bin file, load it into the online emulator at click HERE. The controls are the same as in the MSX game, plus FCTN+9 (ALT+9 on a PC) to skip the intro and M to turn the music on or off.

Have fun!

Fabrizio Luglio

Il file è disponibile qui:(pacchetto con immagine ROM .bin, pacchetto MAME .rpk e manuale .pdf): SCARICALO QUI

Il sorgente CVBASIC è disponibile qui su Github: https://github.com/fablug-wq/chrono-runner-ti99

Qui di seguito i manuali, in italiano ed inglese:Chrono_Runner_TI99_manuale_IT oppure Chrono_Runner_TI99_manuale_EN.pdf

Ringraziamo infine l’associazione TI99IUC (user club italia) che ha postato sulle sue pagine il gioco, potete trovare informazioni anche qui:

https://www.ti99iuc.it/web/index.php?pageid=database_cerca&archivioid=1320
https://www.ti99iuc.it/web/index.php?pageid=database_cerca&archivioid=1319