Acorn Atom Emulator

discussion of games, software, hardware & emulators relating to the Acorn Atom
User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Acorn Atom Emulator

Postby oss003 » Tue Jan 31, 2017 12:14 pm

Hi guys,

just noticed another Atom emulator with some interesting features at: http://floooh.github.io/virtualkc/
Press 'UI' and then select Acorn Atom.

Greetings
Kees
Attachments
Atom Emulator.png

User avatar
BigEd
Posts: 1499
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Acorn Atom Emulator

Postby BigEd » Tue Jan 31, 2017 3:02 pm

Oh, well spotted! I was aware of this emulator, very vaguely, but I think it's only recently got the Atom capability.

User avatar
hoglet
Posts: 6629
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Acorn Atom Emulator

Postby hoglet » Tue Jan 31, 2017 3:17 pm

Very interesting and cool!

This is the source for the Atom emulation:
https://github.com/floooh/yakc/blob/mas ... ms/atom.cc

It seems he uses emscripten to compile C/C++ to very efficient Javascript.

Dave

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Tue Jan 31, 2017 4:44 pm

It also has some nice debugging features ..

Greetings
Kees

User avatar
hoglet
Posts: 6629
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Acorn Atom Emulator

Postby hoglet » Tue Jan 31, 2017 5:22 pm

oss003 wrote:It also has some nice debugging features ..

Yes, very nice...

How did you come across this, given it's literally only been written in the last few days? Do you know the author?

It would be great to have a way of loading the Atom Software Archive.

Dave

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Tue Jan 31, 2017 6:19 pm

Well normally I do a search for "Acorn Atom" once every day for the last 24h to see if there's any news ...... :)

Today there was a post on Matt Godbolt's Twitter: https://twitter.com/mattgodbolt
I think the author is Andre Weissflog: https://twitter.com/FlohOfWoe

I send him a Facebook message because I have no Twitter account.

Greetings
Kees

User avatar
flohofwoe
Posts: 11
Joined: Wed Feb 01, 2017 4:30 pm
Location: Berlin
Contact:

Re: Acorn Atom Emulator

Postby flohofwoe » Wed Feb 01, 2017 6:37 pm

Hi, I'm the author of that emulator, Kees contacted me and pointed me to this forum, and I'm glad he did because I have a lot of questions about the Atom :)

I stumbled over the Atom a bit by accident, but the more I learn about it, the more I like it. Growing up in East-Germany in the 80's, the Acorn 8-bit line was completely unknown to me, I only learned later about the Acorn Archimedes, but this must already have been in the early 90's (after the wall came down first thing I got was an Amiga500 though :)

Anyway... I found the Atom because I was looking for a not-too-complex first system for my new 6502 CPU emulator. At first I thought that the BBC Micro would be that simple system, but boy was I wrong :D So I went back in history to the Atom, which apart from the MC6847 display chip has a fairly simple architecture, but at the same time implements some really clever ideas (like the upper 2 bits of the data bus directly wired to mode-select pins of the MC6847).

The emulator is really early though. At the moment it's just the CPU, about half of the PPI functionality (sound, cassette I/O and 2400Hz timer is missing), and there's no VIA6522 at all yet. Having never seen a real Atom also makes things a bit complicated ;)

I started to implement TAP file loading just now (not sure if that the right name, the file format where the first 16 bytes are the name, and then 2 bytes each for start addr, exec addr and length), but it looks like just dumping the data into memory and jumping to the start address isn't enough :) Once it works you'll be able to drag-and-drop files onto the emulator, hopefully I can also include a few games directly.

I'll have some questions about the correct colors and behaviour of a real Atom, but I'll open a separate thread(s) for that.

Cheers!
-Floh.

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Wed Feb 01, 2017 10:05 pm

Hi Floh,

welcome on the forum.

Normally used Atom tape formats are ATM, TAP, CSW, UEF or WAV.

ATM, is an Atomfile with 22 bytes header containing the filename and legth, load- and execute addresses.

TAP = a sequential file with ATM programs and is used with Wouter Ras DOS Atom Emulator.
The ATM and TAP formats were introduced by Wouter Ras.

CSW = Compressed Square Wave introduced by a ZX Spectrum Group and is a compressed format used to preserve tapes.
You can use the CSW Viewer to convert a WAV file to CSW file.
http://ramsoft.bbk.org.omegahg.com/csw.html

UEF = United Emulator Format introduced by Thomas Hart and is also a compressed format used to preserve tapes.
Thomas Hart has written MakeUEF to convert a CSW file to an UEF file and Fraser Ross has expanded the tool.
https://en.wikipedia.org/wiki/Unified_Emulator_Format
http://electrem.emuunlim.com/UEFSpecs.htm

WAV = Wave and is an uncompressed recorded file.

For diskusages, DSK files are used.
A DSK file is an image of a ssd (100kb) or dsd (200kb) floppy.

Greetings
Kees

User avatar
flohofwoe
Posts: 11
Joined: Wed Feb 01, 2017 4:30 pm
Location: Berlin
Contact:

Re: Acorn Atom Emulator

Postby flohofwoe » Wed Feb 08, 2017 7:45 pm

Thanks for the info Kees! I have started to add TAP loading to the emulator, currently by trapping the OSLOAD function. It kinda works, but the games I tested so far uncover several bugs in the emulator. Also I'm not sure if OSLOAD is a good function to trap, or whether it makes more sense to go down to the block loading function (that's what I'm doing on the CPC for instance). I rewrote the entire data loading code in order to support this type of tape loading (before that I only supported simple snapshot files on all systems).

You can try out what's there at the moment, but the only game that somewhat works at the moment is Jet Set Willy :D And better turn down the sound volume, some of the other games have sound bugs ;)

Here's how it works:

On the Atom system, open the new "Tape Deck" window, insert a game by clicking on the button at the bottom, and then simply type *LOAD[Enter] (the tape doesn't need to run).

I'll try to hammer out the remaining bugs (it's my first 6502 system, so these are quite expected), and play around with different types of file loading, but this will take little bit of time.

In the end I also want to support loading without having to trap operating system functions (so basically toggling the cassette input bit in PPI port C).

Oh, and joystick support is also kinda important for games, since my keyboard input code doesn't support multiple keys pressed at the same time.

Cheers!
-Floh
Attachments
Screen Shot 2017-02-08 at 20.37.11.png

User avatar
hoglet
Posts: 6629
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Acorn Atom Emulator

Postby hoglet » Wed Feb 08, 2017 7:53 pm

If you haven't already done so, it's definitely work running the DORMANN 6502 test suite to validate the 6502.

There is an Atom version with the ATM Header in the Atom Software Archive:
https://github.com/hoglet67/AtomSoftwar ... TEST/D6502

Dave

User avatar
flohofwoe
Posts: 11
Joined: Wed Feb 01, 2017 4:30 pm
Location: Berlin
Contact:

Re: Acorn Atom Emulator

Postby flohofwoe » Wed Feb 08, 2017 7:53 pm

Oh, and I added a few nice debugger features, the CPU debugger now shows the cycle count of the recently executed instructions, and you can inspect the 8255 and 6847 state, both also update during debug-stepping:
Attachments
Screen Shot 2017-02-08 at 20.50.30.png

User avatar
flohofwoe
Posts: 11
Joined: Wed Feb 01, 2017 4:30 pm
Location: Berlin
Contact:

Re: Acorn Atom Emulator

Postby flohofwoe » Wed Feb 08, 2017 7:55 pm

Thanks for pointing me to the test suite Dave, I'm currently only running the nestest, which might be a bit too relaxed.

-Floh.

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Wed Feb 08, 2017 8:42 pm

Hi Floh,

most of the RS games need 32kB RAM from #0000-#7FFF and I think this is not implemented yet.
Chuckie Egg also needs a timer of the 6522 and some games need an IRQ generated by the 6522.

To test a standard 12k+12k Atom, use the commercial games.
Dave has a good point by running the Dormann test because that's a very good program to test the 6502 opcodes.

The Atom has 2 types of joysticks, a keyboard joystick and an AtoMMC joystick.
The keyboard joystick is parallel connected to the first row of the keyboard matrix.
The AtoMMC joystick uses PORTB of the AtoMMC interface to read a digital joystick and can be accessed by the addresses #B400/#B401.

Greetings
Kees
Last edited by oss003 on Thu Feb 09, 2017 7:37 pm, edited 1 time in total.

User avatar
hoglet
Posts: 6629
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Acorn Atom Emulator

Postby hoglet » Wed Feb 08, 2017 8:59 pm

oss003 wrote: most of the RS games need 32kB RAM from #0000-#7FFF and I think this is not implemented yet.
...
Dave has a good point by running the Dormann test because that's a very good program to test the 6502 opcodes.

The Dormann tests also need 32K of RAM.

Dave

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Thu Feb 09, 2017 11:42 am

Hi Floh,

here is a program to quickly test the RAM/ROM configuration in your Atom:

Code: Select all

   10 @=4;P.$12"ATOMIC MEMORY CHECKER"''
   20 P."     0000 0400 0800 0C00"'
   30 F.I=0TO#9FFFS.#1000;P.&I';N.
   40 F.Y=0TO9
   50  F.X=0TO3
   60   Z=Y*#1000+X*#400+9
   70   B=#8065+X*5+Y*#20
   80   A=!Z
   90   !Z=0;IF !Z<>0;!B=#8D8F9220;G.130
  100   !Z=-1;IF !Z<>-1;!B=#8D8F9220;G.130
  110   !B=#0D011220
  120   !Z=A
  130  N.
  140 N.
  150 END

Greetings
Kees

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Thu Feb 09, 2017 11:49 am

And here is a program to test the keyboard joystick (upper keyrow in the keyboardmatrix):

Code: Select all

 10 P.$12;?#E1=0
 20 P."KEYBOARD JOYSTICK TEST"''"aldru"'
 30 $#2800="00000"
 40 A=1
 50 F.I=0TO4
 60  ?#B000=0
 70  I?#2800=48+(?#B001&A=0)
 80  A=A*2
 90 N.
100 P.$#2800$13
110 G.40

Greetings
Kees
Last edited by oss003 on Thu Feb 09, 2017 6:27 pm, edited 1 time in total.

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Thu Feb 09, 2017 6:18 pm

This program is to test the Atommc joystick (PORTB of the AtoMMC interface):

Code: Select all

 10 P.$12;?#E1=0
 20 P."ATOMMC JOYSTICK TEST"''"rldua"'
 30 $#2800="00000"
 40
 50 ?#B401=#FF;?#B400=#A1
 60 A=1
 70 ?#B400=#A2;D=?#B400
 80 F.I=0TO4
 90  I?#2800=48+(D&A=0)
100  A=A*2
110 N.
120 P.$#2800$13
130 G.60

Greetings
Kees

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Thu Feb 09, 2017 7:39 pm

Maybe you can add these test progams to the quickload feature.

Greetings
Kees

User avatar
flohofwoe
Posts: 11
Joined: Wed Feb 01, 2017 4:30 pm
Location: Berlin
Contact:

Re: Acorn Atom Emulator

Postby flohofwoe » Thu Feb 09, 2017 8:11 pm

Thanks! Will do!

Btw, I've put the full 32 KByte RAM into the emulator and this indeed fixed most of the immediate game crashes. Next I noticed some games poll the address $B809 (which seems to a VIA 6522 timer), so adding a proper 6522 emulation is also on my list.

But first I'll finally fix the colors, add the dormann CPU test, and joystick support. Phew... ;)

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Thu Feb 09, 2017 8:22 pm

The timers in the 6522 and the IRQ generation are mostly used.

Code: Select all

        Register:                   Address:  Name:
      Data Register B                #B800      DB
      Data Register A                #B801      DA
      Data Direction Register B      #B802      DDRB
      Data Direction Register A      #B803      DDRA
      Timer 1 low counter, latch     #B804      T1CL
      Timer 1 high counter           #B805      T1CH
      Timer 1 low latch              #B806      T1LL
      Timer 1 high latch             #B807      TlLH
      Timer 2 low counter, latch     #B808      T2CL
      Timer 2 high counter           #B809      T2CH
      Shift Register                 #B80A      SR
      Auxiliary Control Register     #B80B      ACR
      Peripheral Control Register    #B80C      PCR
      Interrupt Flag Register        #B80D      IFR
      Interrupt Enable Register      #B80E      IER
      Data Register A                #B80F      DA

Greetings
Kees

Prime
Posts: 2347
Joined: Sun May 31, 2009 11:52 pm

Re: Acorn Atom Emulator

Postby Prime » Thu Feb 09, 2017 8:29 pm

Also Feel free to take the implementation details for the RamRom, Gdos2015 from Atomulator.

You'll have to ask sirmorris about the AtoMMC code, but he didn't have any objection to me building it into Atomulator, but you should probably check with him just to be on the safe side.

Cheers.

Phill.

User avatar
flohofwoe
Posts: 11
Joined: Wed Feb 01, 2017 4:30 pm
Location: Berlin
Contact:

Re: Acorn Atom Emulator

Postby flohofwoe » Thu Feb 09, 2017 9:07 pm

Thanks for all the advice!

I've updated the emulator with the color correction (not sure if the text mode green is now a bit too dull, but the graphics test looks nice now IMHO), added Kees' BASIC test snippets (even though no joystick support has been implemented yet), and added the dormann test as tape. This is what I get when running it twice, I guess/hope that means it has passed without errors \o/
Attachments
atom_dormann.png

User avatar
bakoulis
Posts: 249
Joined: Wed Feb 08, 2012 9:45 pm
Location: Athens, Greece

Re: Acorn Atom Emulator

Postby bakoulis » Fri Feb 10, 2017 12:11 am

I tried unsuccessfully to build the emulator for Linux Mint 17 32bit.
Is anybody who have build this on Linux Mint 17?
I need little help.
:?
2xElectron, 3xBBC B, BBC Master.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.

User avatar
hoglet
Posts: 6629
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Acorn Atom Emulator

Postby hoglet » Fri Feb 10, 2017 8:11 am

bakoulis wrote:I tried unsuccessfully to build the emulator for Linux Mint 17 32bit.
Is anybody who have build this on Linux Mint 17?
I need little help.
:?

Just checking you mean Atomulator....

What libraries have you installed?

From memory you need the following libraries (and their dev packages): allegro4, openal, alut and zlib .

What error are you getting?

Dave

User avatar
bakoulis
Posts: 249
Joined: Wed Feb 08, 2012 9:45 pm
Location: Athens, Greece

Re: Acorn Atom Emulator

Postby bakoulis » Fri Feb 10, 2017 12:15 pm

No I don't mean Atomulator. I have it already installed.
I mean yakc "Yet another KC emulator"!
The source is here: https://github.com/floooh/yakc
Help please if you can.
:(
2xElectron, 3xBBC B, BBC Master.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.

User avatar
flohofwoe
Posts: 11
Joined: Wed Feb 01, 2017 4:30 pm
Location: Berlin
Contact:

Re: Acorn Atom Emulator

Postby flohofwoe » Fri Feb 10, 2017 8:32 pm

Hi, I just fixed 2 compile errors on GCC (it's a bit pickier than clang or VS), and now it's running on Linux again (I'm on a fairly recent Ubuntu).

Problem is, I'm only supporting 64-bit Linux, I didn't expect anybody is still running a 32-bit Linux ;)

You can create an issue here with the errors you're getting (https://github.com/floooh/yakc/issues) and I'll see what I can do. I can't promise to make 32-bit work though, since this would require quite a few changes from the build system to external dependencies.

Cheers,
-Floh.

User avatar
bakoulis
Posts: 249
Joined: Wed Feb 08, 2012 9:45 pm
Location: Athens, Greece

Re: Acorn Atom Emulator

Postby bakoulis » Fri Feb 10, 2017 11:59 pm

This time the gen command work well.
ᐅ ./fips gen
But then, the next command give 2 errors.
ᐅ ./fips make yakcapp

I have left an issue at github and I hope it isn't so hard to fixed.
:roll:
2xElectron, 3xBBC B, BBC Master.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.

User avatar
flohofwoe
Posts: 11
Joined: Wed Feb 01, 2017 4:30 pm
Location: Berlin
Contact:

Re: Acorn Atom Emulator

Postby flohofwoe » Sun Feb 12, 2017 4:58 pm

Ok, I've got an initial VIA and AtoMMC joystick emulation up and it's now possible to play Atomic Chuckie Egg :)

https://www.youtube.com/watch?v=FWPMsvOnYuI

But I have a question regarding the AtoMMC joystick code in Jet Set Willy:

Right now I'm just checking whether the command $A2 is written to $B400, and in the next read from $B401 I'm returning the joystick mask. However in Jet Set Willy, when the AtoMMC joystick mode is selected, and after pressing fire, it hangs on *reading* from $B400, the code is:

7EE1: LDA $B400
7EE4: BMI $#FB

What is the purpose of this loop? Isn't $B400 the command register? Unfortunately I haven't found a lot of info on the AtoMMC IO interface, is the MMC memory map and behaviour described somewhere in detail?

Thanks a lot :)
-Floh.

User avatar
hoglet
Posts: 6629
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol

Re: Acorn Atom Emulator

Postby hoglet » Sun Feb 12, 2017 5:25 pm

flohofwoe wrote:However in Jet Set Willy, when the AtoMMC joystick mode is selected, and after pressing fire, it hangs on *reading* from $B400, the code is:

7EE1: LDA $B400
7EE4: BMI $#FB

What is the purpose of this loop? Isn't $B400 the command register? Unfortunately I haven't found a lot of info on the AtoMMC IO interface, is the MMC memory map and behaviour described somewhere in detail?


Here's the latest protocol spec I have for the AtoMMC interface:
AtoMMC firmware v2.9.doc
(42.5 KiB) Downloaded 16 times

Reading B400 after issuing a command reads the status register, and bit 7 being set indicates the PIC is still busy with the command.

Dave

User avatar
oss003
Posts: 2550
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: Acorn Atom Emulator

Postby oss003 » Sun Feb 12, 2017 6:06 pm

You're right, it's a bit confusing because I didn't implement this in the Basic AtoMMC joysticktest.
The reason is that assembler is to fast and there could be problems if you don't wait until the AtoMMC interface is ready.
Basic is a lot slower and therefore the statusbit check isn't necesarry so I left it out.

Greetings
Kees


Return to “acorn atom”

Who is online

Users browsing this forum: No registered users and 2 guests