Atomulator Bugs Thread

discussion of games, software, hardware & emulators relating to the Acorn Atom
User avatar
hoglet
Posts: 7122
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: Atomulator Bugs Thread

Post by hoglet » Sat Jun 27, 2015 3:22 pm

harrowm wrote:I did it .. I think :D
Let me know if you can't see the pull request
Malcolm
Yup:
https://github.com/hoglet67/Atomulator/pull/1/files

I'll try to take a look tomorrow.

There's quite a few changes there. Can I ask what platforms you have tested this on?

Dave

harrowm
Posts: 121
Joined: Sun Nov 30, 2014 11:07 pm
Location: Singapore
Contact:

Re: Atomulator Bugs Thread

Post by harrowm » Sat Jun 27, 2015 3:43 pm

Windows 10 and Linux - Debian 8 32bit.

I ran the Dormann test on Linux as I changed 6502.c
I loaded up some SID files in both Windows and Linux.
Wrote a trivial BASIC program on both platforms.

The Linux-keydefine change is the most number of lines. But all I did was move the structure declaration from outside the function to within the function so that it worked on subsequent calls. Not real pretty but it works.

The other things are pretty trivial (changes I had to make to the code to get a clean compile on OS X).

f_read() and f_write() don't compile on OSX as the compiler thinks there may be a case when the functions don't return a value. The two ifs cover all possibilities so the second if isn't required (as the first if does a return).

I'm not an Atom expert though .. and my c is rusty .. I'm open to all and any feedback. :D

Malcolm

harrowm
Posts: 121
Joined: Sun Nov 30, 2014 11:07 pm
Location: Singapore
Contact:

Re: Atomulator Bugs Thread

Post by harrowm » Sun Jun 28, 2015 2:34 am

Now that I can compile Atomulator from the command line in Linux I though I would try to install an IDE .. eclipse seems popular ..

Code: Select all

sudo apt-get install eclipse-cdt
wait until it asks you to confirm the 236Mb download .. press Y and go and have a cup of tea .. or two :)
Goto the source directory of Atomulator and make sure that the make file is called Makefile .. ie for Linux:

Code: Select all

mv Makefile.linux Makefile
Type "eclipse" from a terminal to start
Select a workspace folder
Start a new project .. File, New, Project .. scroll to "C/C++", expand the selection and choose "Makefile Project with Existing Code"
At some point during this process eclipse will ask whether you wish to change to the "C/C++ Perspective", reply Yes.
Choose the Atomulator "src" directory. Ensure both "C" and "C++" languages are checked, choose the "Linux GCC" tool set.

To build:
Project .. Clean
Project .. Build All

To run:
First set up configuration .. choose Run .. Run Configuration. Browse to the executable; under the arguments tab change the working directory to the same directory where the executable resides (ie one directory up from the src directory).

Further instructions (eg how to set breakpoints, inspect variables etc are here https://www3.ntu.edu.sg/home/ehchua/pro ... HowTo.html. This guide also shows how to set up eclipse on Windows/mingw32 which will be this afternoon's fun ..
Attachments
Capture.PNG

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

Re: Atomulator Bugs Thread

Post by hoglet » Sun Jun 28, 2015 6:37 am

Malcolm,

Excellent work there! Thanks for posting the Eclipse instructions. I use Eclipse for all my Java projects, but haven't tried it with C or C++. I'll add this to my to-do list.

Dave

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

Re: Atomulator Bugs Thread

Post by hoglet » Fri Jul 03, 2015 10:41 am

hoglet wrote:
harrowm wrote:I did it .. I think :D
Let me know if you can't see the pull request
Malcolm
Yup:
https://github.com/hoglet67/Atomulator/pull/1/files

I'll try to take a look tomorrow.
Malcolm, apologies, for not merging this yet. I have been a bit distracted recently with other projects. I'll try to merge it over the weekend.

If I don't feel free to remind me. :D

Dave

harrowm
Posts: 121
Joined: Sun Nov 30, 2014 11:07 pm
Location: Singapore
Contact:

Re: Atomulator Bugs Thread

Post by harrowm » Sun Jul 05, 2015 1:22 pm

No worries .. I've been busy trying to get it to work with Allegro 5. After a lot of man handling .. I'm this far. Linux on the right (Debian running in a VirtualBox), OS X on the right. The colours are off .. I've no idea why, the bit map on scan line 190 looks identical for each in the simple basic program. I've broken sound. Some strange quirks on resizing windows/going fullscreen.

Malcolm
Attachments
Screen Shot 2015-07-05 at 9.14.19 pm.png
Screen Shot 2015-07-05 at 9.11.28 pm.png

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

Re: Atomulator Bugs Thread

Post by hoglet » Sun Jul 05, 2015 2:06 pm

Hi all,

FYI, I've just merged Malcolm's changes:
https://github.com/hoglet67/Atomulator/network

I also updated the current version number to be 1.23 in Windows as well (this had already been updated in Linux)

Dave

harrowm
Posts: 121
Joined: Sun Nov 30, 2014 11:07 pm
Location: Singapore
Contact:

Re: Atomulator Bugs Thread

Post by harrowm » Sun Jul 05, 2015 2:11 pm

Many thanks :)

Malcolm

harrowm
Posts: 121
Joined: Sun Nov 30, 2014 11:07 pm
Location: Singapore
Contact:

Re: Atomulator Bugs Thread

Post by harrowm » Mon Jul 13, 2015 2:28 pm

Slooooow progress. Think I have nailed the Windows Makefile .. finally!

Here's the same code base running on Windows. You can tell its the same code because the colours still don't work #-o #-o #-o

Malcolm
Attachments
Screen Shot 2015-07-13 at 10.31.06 pm.png

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

Re: Atomulator Bugs Thread

Post by oss003 » Mon Jul 13, 2015 3:58 pm

Hi Malcolm,

I think the Red and Blue parameters in the pallet are switched.

Greetings
Kees
Attachments
rgb.PNG

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

Re: Atomulator Bugs Thread

Post by Prime » Mon Jul 13, 2015 5:36 pm

oss003 wrote:Hi Malcolm,

I think the Red and Blue parameters in the pallet are switched.
Yep I'd agree with Kees, I saw colours like that when I managed to switch red & blue on the colour board :(

Cheers.

Phill.

User avatar
jgharston
Posts: 3059
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Atomulator Bugs Thread

Post by jgharston » Mon Jul 13, 2015 7:21 pm

Keyboard: If you look at the schematic for the Atom keyboard you will see that it's arranged very logically, for most of the keys, the keycode *is* the ASCII character minus 32. '0' is keycode 16, add 32 gives 48 = '0'. 'A' is keycode 33, add 32 gives 65 = 'A'. (I'll upload the schematic)

You will see the keys below '0' are special-cased for various editing keys. You will also notice that keycodes 8,9,10,11,12 are missing from the physical keyboard. If you follow the Kernel code through you will find that these keys are treated the same as keycode 13, that is, they return the keycode. That means that if you physically implement keys 8,9,10,11 you get the four cursor keys - with no fiddling about pressing Shift-UpDn/Shift-Left/Rght/etc.

It would be useful if emulated Atoms had the ability to emulate keys 8,9,10,11 being pressed instead of the physical cursor keys emulating Shift/NoShift+UpDn/LftRght.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

harrowm
Posts: 121
Joined: Sun Nov 30, 2014 11:07 pm
Location: Singapore
Contact:

Re: Atomulator Bugs Thread

Post by harrowm » Tue Jul 14, 2015 9:08 am

Ok, let me look at the keyboard.

Kees, Phill, thanks for the hints .. It's given me a new thought as to the solution. Famous last words .. I haven't changed the code, it should work. I have double triple checked. The code is actually from Optima and works fine on my Mac (and on the RaspberryPi) .. However the code does bypass the Allegro API and assumes a SRGB 32 bit map. I wonder if my virtual box video driver has a SBGR screen for some weird reason. I will check ..
Malcolm

User avatar
jgharston
Posts: 3059
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Atomulator Bugs Thread

Post by jgharston » Tue Jul 14, 2015 6:14 pm

harrowm wrote:Ok, let me look at the keyboard.
Circuit diagram here, and it's clear from the keyboard matrix that the missing five keys generate CHR$8,9,10,11,12.

I can't remember where I got the schematic from, it was originally in two parts that I've stitched together. I think it was on our Dutch friend's website.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

harrowm
Posts: 121
Joined: Sun Nov 30, 2014 11:07 pm
Location: Singapore
Contact:

Re: Atomulator Bugs Thread

Post by harrowm » Sat Jul 18, 2015 7:48 am

I'm getting a little (but not completely) bored of compiling the same code on three platforms and testing it. Does anyone have objections if I automate the builds using cmake ? Cmake also has the ability to package and automate some testing .. It would be great if I could automate say starting Atomulator, running a series of tests and then automatically detecting if they passed or failed. How could I do this .. Write out a file to the Mmc directory and look at the contents ? Anyone with more Atom experience got any great ideas on this ?
Malcolm

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

Re: Atomulator Bugs Thread

Post by hoglet » Tue Aug 25, 2015 3:41 pm

At the ABUG event, Kees was demonstrating his Manic Miner Intro program that uses Palette Switching to get 8 colours on the screen. This worked perfectly in Atomulator 1.22, but didn't work on a real Atom. Which meant the Frame Sync (FS) signal is not being accurately emulated in Atomulator.

I've just looked at how Atomulator generates FS (called vbl in Atomulator and active high), and discovered the following in video.c:

Code: Select all

	if (line == 200)
		vbl = 1;
	if (line == 261)
		vbl = 0;
The value of line depends on the Colour Board setting, and is either 0..261 or 0..311. Lines 0..191 are the active region on the display.

I think there are two separate issues here:

1. On a real Atom, FS is asserted low for 32 lines, starting at the end of the active region of the display. So, the above code should switch vbl at lines 192 and 224.

2. When you enable the Colour Board option, Atomulator emulates an original Acorn ColourBoard which runs at 50Hz. Modern Colour solutions, like Phill's or the like the GODIL, run at 60Hz as it's just simpler and more compatible. I think it's worth having separate config options in Atomulator for PAL (50Hz)/NTSC (60Hz) and Mono/Colour.

I've just implemented the above, plus fixed some small debugger issues (mentioned earlier in this thread) and pushed a version 1.24 into github:
https://github.com/hoglet67/Atomulator/ ... ulator.exe

I've tested this with the code we wrote at ABUG, and this gives identical results on Atomulator, an original Atom, and an Atom with the latest GODIL code (about to be pushed...)

Kees, your MMINTRO.ATM now fails in Atomulator in the same way it fails on a real Atom. You should be able to debug this more easily now.

For further testing, I'll try to write a program to accurately time FS using the 6522. I'm interested in whether there is much variability on real Atoms.

Dave

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

Re: Atomulator Bugs Thread

Post by oss003 » Tue Aug 25, 2015 4:38 pm

Great that my demo doesn't work any more ..... :lol: :lol:

I'll give it a try this evening with the new Atomulator version.

Greetings
Kees

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

Re: Atomulator Bugs Thread

Post by Prime » Thu Dec 03, 2015 4:01 pm

Ok chaps,

What version of Allegro is required for the current build under Linux, are we still using 4.x or has it been ported to 5.x?

Cheers.

Phill.

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

Re: Atomulator Bugs Thread

Post by hoglet » Thu Dec 03, 2015 4:59 pm

Prime wrote: What version of Allegro is required for the current build under Linux, are we still using 4.x or has it been ported to 5.x?
4.x

It's only the Raspberry Pi and OS X versions that were using 5.x, and the code for those is forked and in a different repository.

Dave

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

Re: Atomulator Bugs Thread

Post by Prime » Tue Dec 08, 2015 10:10 am

OK....

Here's my latest version, I sent it to Kees but I don't think he's had time to merge into the source archive yet.

New in this version :
1) Support for the new GDOS-2015 floppy controller together with 16 banks of ROM at E000.
2) Configurable RAM setup when **NOT** using the RAMROM.

I've updaterd the gui for bothe the Windows and Linux versions to support this.
Atomulator-master-2015-12-08.zip
(2.58 MiB) Downloaded 22 times
Cheers.

Phill.

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

Re: Atomulator Bugs Thread

Post by hoglet » Tue Dec 08, 2015 10:57 am

Phill,

Nice job there - this looks like it should merge back in pretty painlessly.

Dave

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

Re: Atomulator Bugs Thread

Post by Prime » Tue Dec 08, 2015 1:39 pm

hoglet wrote:Phill,

Nice job there - this looks like it should merge back in pretty painlessly.
Excellent, I downloaerd a copy of the latest sources last week and merged my sources into those, even kept a copy of the downloaded sources unmodified incase you wanted diffs :)

Cheers.

Phill.

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

Re: Atomulator Bugs Thread

Post by oss003 » Tue Dec 08, 2015 1:44 pm

Hi Phill,

Looks like the only thing to do is increment the version number to v1.26 in win.c
I'll upload the files this evening.

Greetings
Kees

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

Re: Atomulator Bugs Thread

Post by Prime » Tue Dec 08, 2015 1:58 pm

oss003 wrote:Hi Phill,

Looks like the only thing to do is increment the version number to v1.26 in win.c
I'll upload the files this evening.
atom.c and linux-gui.c too please..... :)

Perhaps we need a #define for this somewhere......

Cheers, only reason I posted it here was so other people could get it if they wanted before it's merged in :)

Phill.

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

Re: Atomulator Bugs Thread

Post by oss003 » Tue Dec 08, 2015 8:18 pm

HELP..... Dave can you upload Phill's update to Github?
I'm getting all kind of errors if I want to clone Atomulator ...... :?

Github is still one magic black box for me ...... :(

Greetings
Kees

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

Re: Atomulator Bugs Thread

Post by hoglet » Tue Dec 08, 2015 8:50 pm

OK....

I've just checked in the updated source files.

But was having some problem now running the AtoMMC menu system. :(

It seems the RAM defaulted to 1K Video RAM, even though I had the RAM ROM board enabled.

I wonder if we need better defaults, or else people will get confused (I was for a while....)

Dave

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

Re: Atomulator Bugs Thread

Post by hoglet » Tue Dec 08, 2015 8:58 pm

Oh, I haven't updated the Atomulator.exe with version 1.26 yet, in case there are any last minute changes to the defaults.

Dave

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

Re: Atomulator Bugs Thread

Post by Prime » Tue Dec 08, 2015 10:29 pm

hoglet wrote:Oh, I haven't updated the Atomulator.exe with version 1.26 yet, in case there are any last minute changes to the defaults.
I'll have a look tomorrow.....

Cheers.

Phill.

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

Re: Atomulator Bugs Thread

Post by oss003 » Wed Dec 09, 2015 7:14 am

Isn't that only with the first time you start the new Atomulator?
The settings are written in the atom.cfg file so the next time these settings will be read from the atom.cfg file.

Greetings
Kees

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

Re: Atomulator Bugs Thread

Post by hoglet » Wed Dec 09, 2015 7:49 am

oss003 wrote:Isn't that only with the first time you start the new Atomulator?
The settings are written in the atom.cfg file so the next time these settings will be read from the atom.cfg file.
Yes, it is only the first time.

But surely it's better for this first time configuration to be something other than the 1K + 1K Atom.

It may be that some other setting I previously has were confusing matters - I'm not sure what state my RAMROM board settings were in.

I'd say that starting with no config file should result in a config that will allow AtoMMC to boot the archive successfully.

Edit: It doesn't. I need to manually:
- Set RAMROM Disk ROM to Enabled
- Set RAM/Main RAM to the max (or at least 12K)
- Set RAM/Video RAM to the max (or at least 6K)

The default seems to be 1K + 1K with no AtoMMC.

Dave

Post Reply