Acorn Atom emulator on an ESP32VGA

emulators, hardware and classic software for atom + system machines
Post Reply
leendert
Posts: 30
Joined: Thu Mar 05, 2015 12:55 pm
Location: Harderwijk, the Netherlands
Contact:

Acorn Atom emulator on an ESP32VGA

Post by leendert »

ESP32ATOM
Recently I have been working migrating full Atom functionality in an ESP32 microcontroller. This controller is a very powerful and includes 2 cores.
I use a TTVGA PCB that is available for a very friendly price. This has a standard VGA connection, in addition to a PS / 2 keyboard and mouse connection. You can also connect a standard microSD card with version 1.4 and higher of that print.
image0.jpeg
2 cores
I've chosen to run the entire VGA control in 1 core and a full Atom kernel in the other core. Both follow their own track: one reads memory and translates it into a VGA image, the other 'only' writes to video memory, without having to worry about the consequences.
image1.jpeg
re use
I didn't invent or develop very much myself. For the VGA there is a standard library and for the ATOM functionality, I reused the Atomulator. The work is mainly in adapting it so that it works in a microcontroller. Serial.print is my best friend.
image2.jpeg
filesystem
An ESP32, like a ESP8266, can host a filesystem (SPIFFS) by default. That behaves as if there is a filesystem available for the programmer. However, its size is limited, due to the actual 4MB size of the ESP32, so it will be replaced later by a library that supports an external SD card. I am using the MMC routines. I installed the Atom Archive on an 8Gb micro SD and it works great.
image3.jpeg
Graphic screen
All graphics modes are supported, including full color support. This emulator is also equipped with scaling routines, so that the full width of the connected screen is used. In order to maintain sufficient speed for the Atom core, a shadow memory is used and it checks whether something has been changed in the relevant video byte. If not, nothing will be recalculated or drawn. Using this approach, even the fastest games can also be played smoothly. Text mode is of course supported and the standard Atom font is re-used to have that great 32x16 capital character screen.
image4.jpeg
keyboard
The signals from the PS/2 keyboard are translated into values ​​that correspond to the B000/B001 keyboard matrix to be read. For example, it seems to the Atom as if it has a real Atom keyboard. This way there are some handy tricks possible: on the PS/2 keyboard there are four cursor control keys, on the Atom only 2, where you have to press the shift key for the 2 other movements. The scan code of the PS/2 keyboard is translated into a 'shift' and an 'arrow', so that the ATOM really thinks that these two keys have been pressed. Implementing this routine (which has to be written) was a nice thing: works with an IRQ routine to the ESP32 and had to be '2 cores proof'. Especially vital when writing to the file system. Leared by experience that if the IRQ is not handled ok, the content of the whole file system is lost in space.

Whats next
On one of the next upcoming Atom days in the Netherlands in the post-corona era, I would like to officially hand over a copy to Roland, who is the great inspirator for me and is the leader in the Netherlands to keep the Atom alive.
Not everything is implemented in the Atomulator is also in the ESP32ATOM. For example, I do not a SID or the emulation of image noise or engine sounds lover. So those routines are not implemented. likewise for the BBC roms: I have not implemented the entire BBC basic part.
The source code is of course freely available for those who want it.
Some of you may be are familiar with my FPAtom ROM. That is an upgraded floating point rom which was developed for the ATOMinPC card. In that ROM the floating point arguments were handed over to the Intel x87 core, which has a very fast native instruction set for eg. SQR and SIN. The outcome was redirected to the ATOM and the results were stunning.
On my bucket list is to migrate this functionality to the ESP32 (and the Atomulator), not by native x87, but using standard C fp libraries. Now days these libraries are very efficient, and combining ASM and C is a pain in the neck when it comes to cross platform (as I learned by experience...)
My ultimate goal is to implement these routines in an FPG solution, but that's beyond the scope of this topic..

Leendert
Last edited by leendert on Thu Jun 03, 2021 2:46 pm, edited 1 time in total.
Atom 6502 rocks.

'If everything is transparent, you would see nothing'
User avatar
roland
Posts: 5148
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by roland »

Good to see you back on this forum. And how =D> Again a very nice Atom project. I am looking forward to see this in real life and hear and see all the technical details :lol:

Maybe we can arrange a meeting shortly after the summer holidays, by the end of August or start of September.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by oss003 »

Nice job Leendert ......... =D>

Greetings
Kees
User avatar
hoglet
Posts: 12667
Joined: Sat Oct 13, 2012 7:21 pm
Location: Bristol
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by hoglet »

This looks very nice indeed.

Do you have a link to the "TTVGA" board that you are using?

I searched the internet for TTVGA and found nothing that looked relevant.

Dave
leendert
Posts: 30
Joined: Thu Mar 05, 2015 12:55 pm
Location: Harderwijk, the Netherlands
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by leendert »

You can find the item on:
https://nl.aliexpress.com/item/33014937 ... web201603_

Go for the 1.4 version, that's the one with the micro SD support.

Regards,
Leendert
Atom 6502 rocks.

'If everything is transparent, you would see nothing'
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by oss003 »

Hi Leendert, is the Wifi also working?
Roland wrote some code for the ESP8266 to communicate with the Atom.
So if there is some free space ........ ;)

viewtopic.php?f=44&t=19056

Greetings
Kees
leendert
Posts: 30
Joined: Thu Mar 05, 2015 12:55 pm
Location: Harderwijk, the Netherlands
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by leendert »

Hi Kees,
In this version my ambition was to get the atom in a working version. Thanks to you’re great work on the Atomulator, things went pretty smooth.
I’ve read the experiments Roland is doing with the WiFi and the Electron. I’ve a lot of reusable code for doing similar things on the Atom, but to be honest, that’s just a fancy replacement for the mmc system. And a browser in 192x256 monochrome.. hm...
In an earlier version I emulated the atom with 2 x esp8266, where one generated a composite video signal, and the other run the Atom. The video memory was send via espnow. Did work quite well, but composite video.. do I need to say more :D

Next on my list is the floating point upgrade. That will be my give back to the Atomulator as a ‘thank you’ for all those who did a great job on the code.

Regards, Leendert
Atom 6502 rocks.

'If everything is transparent, you would see nothing'
User avatar
roland
Posts: 5148
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by roland »

leendert wrote: Thu Jun 03, 2021 8:04 pm And a browser in 192x256 monochrome.. hm...
That would be the ultimate Atom killer application :lol:
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by oss003 »

Adam Dunkels did write a web browser in CC65 for his Contiki project .....
He even wrote a web client.
It could be compiled for the C64, Apple or Atari to run with 6502 code.

https://github.com/contiki-os/contiki

And here is a TCP/IP stack for 6502 machines: https://github.com/cc65/ip65

Greetings
Kees
Jansenarruda
Posts: 14
Joined: Tue Jan 11, 2022 10:59 pm
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by Jansenarruda »

Hello Leendert! Amazing work!!!! My name is Jansen and I from Brazil. Here Acorn machines are nearly unknown. I recently buy a ttgo vga (awaiting receive...). Looking for emulators to play with it I found your work. I'd like to know if you can send me the sources, to play around and if possible learn with it. I'm very new to esp32/emulators and I really love Acorn machines.

Best regards

Jansen
Jansenarruda
Posts: 14
Joined: Tue Jan 11, 2022 10:59 pm
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by Jansenarruda »

Jansenarruda wrote: Sat Jan 15, 2022 3:55 pm Hello Leendert! Amazing work!!!! My name is Jansen and I from Brazil. Here Acorn machines are nearly unknown. I recently buy a ttgo vga (awaiting receive...). Looking for emulators to play with it I found your work. I'd like to know if you can send me the sources, to play around and if possible learn with it. I'm very new to esp32/emulators and I really love Acorn machines.

Best regards

Jansen
Hello @leendert, how are you? Can you send me the sources of Atom emulator in ESP32? Thank you!!!
azesmbog
Posts: 6
Joined: Mon Jan 16, 2023 5:41 pm
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by azesmbog »

Hello @leendert, how are you? Can you send me the sources of Atom emulator in ESP32? Thank you!!!
gob33
Posts: 130
Joined: Thu Jun 02, 2016 11:15 am
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by gob33 »

Why not implementing the emulator directly inside the FabGL library for ESP32 ?
There is already a VIC20 emu inside FabGL, Atom should be possible.
nicolagiacobbe
Posts: 215
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by nicolagiacobbe »

Really nice and wonderful example of load balancing. How much processing time uses the VGA core?
azesmbog
Posts: 6
Joined: Mon Jan 16, 2023 5:41 pm
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by azesmbog »

There are other implementations.
Electron for example, but I would like to see the subject

https://github.com/rpsubc8/ESP32TinyElkulator
leendert
Posts: 30
Joined: Thu Mar 05, 2015 12:55 pm
Location: Harderwijk, the Netherlands
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by leendert »

Jansenarruda wrote: Thu Mar 24, 2022 11:16 am Hello @leendert, how are you? Can you send me the sources of Atom emulator in ESP32? Thank you!!!
Sorry for late response. Next couple of days I will add the stuff to the Github, but meanwhile, here the BIN you can already load.
My board has an issue with the SD card, so I disabled the code for that. But if you start up and give 'old', you see a nice example..
The implemenation is done based on the Atomulator source, excluding BBC support, SSID and SDDOS.

The file is called firmware.rom, because firmware.bin is not loved by the naming restrictions of this site. You can upload them with any ESP32 loader.

Leendert
Attachments
firmware.rom
(487.94 KiB) Downloaded 35 times
Atom 6502 rocks.

'If everything is transparent, you would see nothing'
gob33
Posts: 130
Joined: Thu Jun 02, 2016 11:15 am
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by gob33 »

Could you move your work on OLIMEX's ESP32-SBC-FabGL board ?
User avatar
2114Invader
Posts: 9
Joined: Wed Apr 27, 2022 11:36 am
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by 2114Invader »

:D
hi Leendert,
i was very happy to discover your last post including the bin file.
as soon as i red it i tried to flash my tiny board
unfortunately i guess by lack of knowledge i failed to get it running.
i used the official flashtool but it ask to set some parameters and particulary the starting adress
it flashes the whoole file but i think at the wrong place..

thank you for all your work
to keep atom alive

cheers
marc
azesmbog
Posts: 6
Joined: Mon Jan 16, 2023 5:41 pm
Contact:

Re: Acorn Atom emulator on an ESP32VGA

Post by azesmbog »

acorn_esp32.jpg
Post Reply

Return to “acorn atom and acorn system series”