Emulador de Commodore MAX Machine con Lilygo TTgo VGA32

El mítico Commodore 64 tuvo un hermano que suele pasar desapercibido en la historia de la informática.

En este artículo vamos a emular un MAX Machine sobre un módulo TTgo VGA32 de Lilygo.

+ Commodore + Retroinformática

Sobre el Commodore MAX Machine

El Commodore MAX Machine se presentó en Japón en 1982 como respuesta al empuje en aquel país de las consolas de videojuegos y ordenadores domésticos de bajo coste. Prácticamente no tuvo recorrido al tener que competir con un VIC-20 totalmente implantado en los mercados y el rotundo éxito del C64, llegando a cancelarse sus versiones para Norteamérica, Ultimate, y Alemania, VC-10.

Compartía la misma arquitectura que su hermano C64, salvo que solo llevaba 2 KB de RAM, no incluía chips CIA para control de E/S y dependía de cartuchos, pues no incluía ROM alguna en su placa base.

Entorno e instalación del emulador

Emulador

Vamos a basarnos en el emulador Tiny C64, que ya utilizamos en otro artículo, cuyo código fuente adaptaremos para este ordenador según estos criterios:

  • MAX no tiene ROM interna, por lo que depende 100% de cartuchos para arrancar.
  • Mapa de memoria:
    • $0000-$07FF: RAM (2KB) – Única memoria de trabajo
    • $0800-$7FFF: Bus abierto (no mapeado)
    • $8000-$9FFF: Cartucho ROM (opcional, 8KB)
    • $A000-$DFFF: Bus abierto (no mapeado)
    • $E000-$FFFF: Cartucho ROM (OBLIGATORIO, 8KB)

Por cuestiones de simplificación, se integran en el código varios cartuchos de ejemplo.

Elementos

Vamos a necesitar los siguientes elementos:

  • Placa Lilygo TTgo VGA32 v1.4.
  • Monitor con entrada VGA.
  • Teclado con conector PS/2 o, en su defecto, convertidor USB a teclado PS/2.

Instalación

Vamos a descargar el código fuente del emulador desde GitHub en nuestro directorio de trabajo:

$ git clone https://github.com/RafaGS/ESP32TinyCMAX.git

Si no hemos instalado aún PlatformIO, procederemos a ello:

$ paru -Ss platformio platformio-udev-rules

Entramos al directorio donde acabamos de descargar los fuentes del emulador del Commodore MAX Machine.

$ cd ESP32TinyCMAX

Conectamos la placa VGA32 al PC, sin microSD, y procedemos a generar y subir los binarios.

$ pio run --target upload

Emulación

Una vez realizada la subida, desconectamos la TTgo del PC y la conectamos a un monitor y teclado.

Una vez encendida la alimentación, vía microUSB, veremos el proceso de arranque de nuestro «Commodore MAX» con el cartucho MiniBASIC conectado por defecto.

Este BASIC es plenamente funcional y permite escribir nuestro código sin problemas.

Si pulsamos [Ctrl][F2] podremos acceder al cartucho MaxBASIC, que incluía todos los comandos de la versión 2 de CBM BASIC y acceso a cinta de casete.

Por supuesto, también podremos escribir nuestro código en BASIC.

Con [Ctrl][F3] hasta [Ctrl][F6] podremos acceder a cartuchos de juegos. El primero sería Omega Race.

El siguiente, Wizard of Wor.

También estaría Radar Rat Race.

Que, como podemos ver, no parece demasiado atractivo.

Y, por último, Clowns.

Se observa que los cartuchos de juegos no son muy fluidos, debido posiblemente a la ausencia de joystick o a algún elemento no considerado en la emulación.

#1982 #Commodore #LilygoTTgoVGA32 #MOS6510 #OrdenadoresDomésticos

What's not in my profile?

I used to be a huge Wirth-ian in the 1990s and spewed excellent tirades against the evils of C. Niklaus Wirth is also my "PhD grandfather" via Michael Franz at #UCIrvine.

I prefer lecturing sitting down in front of a laptop and talking while I do stuff on said laptop. I very much dislike slides and prefer chalk and blackboard for things like data structures.

I got my "15 minutes of fame" served unexpectedly:

https://www.insidehighered.com/news/2013/02/12/students-boycott-final-challenge-professors-grading-policy-and-get
https://boingboing.net/2013/02/19/students-get-class-wide-as-by.html
https://archive.nytimes.com/economix.blogs.nytimes.com/2013/02/14/gaming-the-system/

But it still was fun.

I got my undergraduate degree from https://www.cs.hm.edu/ which back then was not allowed to feed into PhD programs. It's a thing in Germany: Everything is tiered and changing the tiers requires a change to the constitution of the republic (I am joking, but not really) so it takes a while. (Nowadays it would be easier to go on to a PhD from there.) The "plus" was that I spent two semesters in industry. In one I quickly out-FORTRAN-ed my boss, in the other I learned C++ from Stroustrup in two weeks while riding the bus. Beat that Ivy League!

I grew up on #c64 #basic and #mos6502 (well, #mos6510 I guess) assembly, went on to #m68k assembly, #gfabasic and lots of #oberon. Of course I was dabbling in #modula2, #prolog, #scheme, and more. Then it was mostly whatever I needed so #fortran, #cpp, #java, lots of #python, lots more #c, lots more #arm and #x86 assembly, some #golang, some #ocaml, some #csharp even if you can believe it. Nowadays it's pretty much #c all day with chunks of #python and bits of #rust now and then. And chunks of #bash too.

(Proudly self-plagiarized off of a few 2023/2024 posts from my previous account.) #introduction #SorryItsLate

Students boycott final to challenge professor's grading policy (and get As)

To test limits of Johns Hopkins professor's scaled grading policy, all of his students boycott the final -- and all get As as a result.

Inside Higher Ed | Higher Education News, Events and Jobs

Toolbox

#opcodes #mos6510

a9 lda#
ad lda$4
bd lda$4,x
b9 lda$4,y
a5 lda$2
b1 lda($2),y

8d sta$4
9d sta$4,x
99 sta$4,y
85 sta$2
91 sta($2),y

a2 ldx#
a0 ldy#
ae ldx$4
ac ldy$4
a6 ldx$2
a4 ldy$2

8e stx$4
8c sty$4
86 stx$2
84 sty$2

aa tax
8a txa
a8 tay
98 tya

29 and#
09 ora#

ee inc$4
e6 inc$2
e8 inx
c8 iny

ce dec$4
c6 dec$2
ca dex
88 dey

0a asl
2a rol

c9 cmp#

4c jmp
20 jsr
60 rts

f0 beq
d0 bne

78 sei
58 cli
18 clc

ea nop

#MOS6510

Basiscode für LiveCoding !mit dem MONITOR des ActionReplay V4.2 pro!
meine vorläufige Startadresse $c000, Rasterzeile $ff, Interruptroutine ab $c100

a9 06 8d 20 d0
78
a9 7f 8d 0d dc 8d 0d dd
ad 11 d0 29 7f 8d 11 d0
a9 ff 8d 12 d0
a9 01 8d 1a d0
a9 00 8d 14 03
a9 c1 8d 15 03
58
60

in der Rasterzeit mit PAL 50 Interrupte/Sekunde
#Opcode #VICII #Rasterinterrupt

DEANJIMMY had a nice day at an event of the #HomecomputerMuseumFrankfurt 🤗
In the video I am the #MOS6510 guy with the huge nerd glasses 😂
https://homecomputer-museum-frankfurt.de/#video
Homecomputer Museum Frankfurt Retro Computer | Bad Homburg

Interaktive Ausstellung & Flohmarkt für Retro Computer Commodore, Atari, Sinclair, Coleco Vision uvm. ♥ Photo Art Exposition | 80's Community inkl. 8 Bit Gaming Arena. Sei dabei und erlebe die Faszination von 8 Bit nochmal ganz neu

Homecomputer Museum Frankfurt - Commodore Amiga C64 VC20 C16 Atari Coleco Vision
Il monitor Woz era lo strumento principale con cui si poteva programmare l'Apple 1, il precursore dell'Apple II. Grazie a questo editor, si potevano inserire i codici esadecimali del linguaggio macchina del processore 6502. Proviamo l'ebbrezza di quei primi programmatori di microcomputer. #apple #retrocomputing #retrocomputer #mos6510 #assembly https://www.youtube.com/watch?v=PofvTs136aw
Programmare l'Apple 1 nel 1976 / Retrocomputing

YouTube
1982 Commodore introduced the computer for the masses not the classes...
“It writes, rates, creates, even telecommunicates. Costs less does more — the #Commodore64

This outstanding #homecomputer came with #8bit #MOS6510 #CPU, 64KB RAM and #BASIC. Initially the #C64 was sold for a little under 600 bucks, but competition was brutal in the #8bit-war. https://youtu.be/E9nDsIvUto4

With prices dropping #Commodore sold two million units annually and had a market share up to 40% in the US until 1986.
At one point, the company was selling as many C64s as the rest of the industry combined.

Even when #IBM #PC 5150 compatible #16bit systems changed that in 1988, the #C=64 became highest-selling computer model of all time.

Our #vector #graphic #retrocomputer #art wasn't realized in old #Adobe #PostScript #vectorgraphics #tech with #Ai #Illustrator, but in #svg #technology with #FreeSoftware #Inkscape
8 Bit Generation: The Commodore Wars

YouTube
Zig64 Commodore 64 Emulator - The Oasis BBS

Discover a cycle-accurate, efficient, and versatile Commodore 64 MOS6510 emulator written in Zig, perfect for debugging, testing, and authentic SID music playback.

The Oasis BBS
Continua il corso di Assembly per il C64. In questo video approfondiamo come eseguire calcoli sul processore 6502 che equipaggia la mitica unità floppy 1541 del C64 evitando che lunghi calcoli la blocchino. Il metodo più semplice consiste nell'adottare la tecnica dei threads preemptive. Scopriamo assieme come si potrebbe fare. #commodore64 #retrocomputing #assemblylanguage #mos6510 https://www.youtube.com/watch?v=NRi-3dsJBbQ
Multithreading con l'unità 1541 / Corso di Assembly #29 bis / Commodore 64

YouTube
Torna il corso di Assembly per il Commodore 64. In questo video scopriremo come eseguire calcoli sul processore 6502 che equipaggia la mitica unità floppy 1541 del C64. #commodore64 #retrocomputing #assemblylanguage #mos6510 https://www.youtube.com/watch?v=o3URLChr4c4
Programmare l'unità 1541 / Corso di Assembly #29 / Commodore 64

YouTube