SpectROM - Speccy emulator for the Pi co-pro

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Sat May 19, 2018 3:06 pm

I've created a new version of SpectROM that fixes a few issues with the keyboard handling (thanks JGH!) and adds support for loading and saving .tap tape files. It also now works under MOS 3.50 on the Master (at least from my DC).

Enjoy!
Attachments
spectrom.zip
Spectrum emulator
(63.72 KiB) Downloaded 44 times

User avatar
marcusjambler
Posts: 647
Joined: Mon May 22, 2017 11:20 am
Location: Bradford
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by marcusjambler » Wed May 23, 2018 5:41 pm

=D>

Confirming that it is running under 3.2 and 3.5 MOS from a folder on BeeSCSI mini ( RPIZero with EggEater rc0 ) .
Also, I used F1 and F3 to find and run SNA files in a sub folder. :D
I'll try TAP files at some point.

Marcus

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Wed May 23, 2018 6:50 pm

Thanks Marcus.

I think the MOS 3.50 issue was that I was using OSARGS to read the command line (from code taken from Sprow's ARMTDMI examples). I've now switched to using OS_GetEnv. I'll put the same fix into my other emulators at some point.

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

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by jgharston » Wed May 23, 2018 7:06 pm

I investigated the command line issue on various ARM platforms and documented them on the WIki.

Code: Select all

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

aotta
Posts: 179
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by aotta » Sun Nov 11, 2018 10:53 pm

i tried to launch zxspec, following instruction displayed with !boot on ssd spectrom, but i get "bad command" error with MOS 3.2 in my Master (@RobC: i take off for the moment one of my 2 videonula from other BBC... but i hope to get my 3rd vnula soon! ;) ).
*zxinit let screen a bit darker, and *zxscreen show some coloured pixel in the top of screen... my doubt is if my videonula is update for speccy emulator, or if i miss something else
Thank you for any help

Edit: solved! Error was invoke arm before loading sprom! 😜
Last edited by aotta on Sun Nov 11, 2018 11:30 pm, edited 1 time in total.

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Mon Nov 12, 2018 10:17 am

aotta wrote:
Sun Nov 11, 2018 10:53 pm
Edit: solved! Error was invoke arm before loading sprom!
Glad you got it working. I'm currently developing an Amstrad CPC emulator - most of it is working but I've got a stubborn scrolling bug to iron out and haven't added sound yet...

aotta
Posts: 179
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by aotta » Mon Nov 12, 2018 10:22 am

Good news! It's incredible what you can squeeze out from a bbc & vnula! Good luck for your debugging!

User avatar
tricky
Posts: 3672
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by tricky » Mon Nov 12, 2018 11:07 am

RobC wrote:
Mon Nov 12, 2018 10:17 am
... I'm currently developing an Amstrad CPC emulator - most of it is working but I've got a stubborn scrolling bug to iron out and haven't added sound yet...
Are you thinking of using the 6845 for Amstrad 6845 stuff, or I guess more likely going with the speccy way for now.
You would also need the NULA scrolling/offset for Edge Grinder, but I guess that isn't your first targeted game :lol:

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Mon Nov 12, 2018 11:49 am

aotta wrote:
Mon Nov 12, 2018 10:22 am
Good news! It's incredible what you can squeeze out from a bbc & vnula! Good luck for your debugging!
Thanks - I'm not sure how far I'll be able to take it but it's fun seeing the Beeb boot up as a CPC :D
tricky wrote:
Mon Nov 12, 2018 11:07 am
RobC wrote:
Mon Nov 12, 2018 10:17 am
... I'm currently developing an Amstrad CPC emulator - most of it is working but I've got a stubborn scrolling bug to iron out and haven't added sound yet...
Are you thinking of using the 6845 for Amstrad 6845 stuff, or I guess more likely going with the speccy way for now.
You would also need the NULA scrolling/offset for Edge Grinder, but I guess that isn't your first targeted game :lol:
I'm converting writes to the CPC's 6845 into writes to the Beeb's R12/R13. This is all working correctly (or seems to be!) but it looks like I've got an error in one of my screen plotting routines. Whole row plotting works fine with scrolling but plotting blocks of pixels sometimes shows corruption :x

I'm still only messing about with the CPC's BASIC so haven't thought about R3 tricks yet! However, it should be possible to replicate them with the NuLA's horizontal scrolling as you suggest...

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Tue Nov 13, 2018 10:11 pm

Finally found the scrolling bug and have now got it loading snapshot files.

It plays Bomb Jack really well :D
IMG_20181113_220334[1].jpg
CPC Bomb Jack intro screen
IMG_20181113_220351[1].jpg
CPC Bomb Jack Level 1
I also tried Pacland and it plays fine but it's doing a palette switch mid-frame which I've not implemented yet so there's an annoying colour flicker on the sky :(

VectorEyes
Posts: 245
Joined: Fri Apr 13, 2018 1:48 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by VectorEyes » Tue Nov 13, 2018 10:30 pm

My God... If ever there was an excuse to get a Pi CoPro, I think this was it!

aotta
Posts: 179
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by aotta » Tue Nov 13, 2018 10:33 pm

VectorEyes wrote:
Tue Nov 13, 2018 10:30 pm
My God... If ever there was an excuse to get a Pi CoPro, I think this was it!
..and to get a Videonula! =D>

User avatar
marcusjambler
Posts: 647
Joined: Mon May 22, 2017 11:20 am
Location: Bradford
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by marcusjambler » Tue Nov 13, 2018 10:45 pm

=D> =D> =D> =D> =D>

Rob this is another outstanding project... wow


aotta
Posts: 179
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by aotta » Wed Nov 14, 2018 4:10 pm

Rob, can you confirm the emu you are working on doesn't need update to vnula's board, since cpc colors are the same vnula already supports?
We are all waiting for your release... :D

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Wed Nov 14, 2018 4:29 pm

aotta wrote:
Wed Nov 14, 2018 4:10 pm
Rob, can you confirm the emu you are working on doesn't need update to vnula's board, since cpc colors are the same vnula already supports?
We are all waiting for your release... :D
Yes - no update required as VideoNuLA already supports the CPC's colours as you suggested.

Just to set expectations, there's still quite a lot of work to do on this and I'm a bit short of time at the moment as my mother has been quite seriously ill and so I'm currently doing a lot of visiting etc. I've also been working on something else NuLA-related so am dividing my time between the two projects.

aotta
Posts: 179
Joined: Fri May 26, 2017 8:57 am
Location: Italy
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by aotta » Thu Nov 15, 2018 6:14 am

Best wishes to your mother, and happy you are getting something new about vnula from your magic hat!

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Thu Nov 15, 2018 9:15 am

aotta wrote:
Thu Nov 15, 2018 6:14 am
Best wishes to your mother, and happy you are getting something new about vnula from your magic hat!
Many thanks. She had a heart attack last week but is now home and hopefully over the worst.

User avatar
vanpeebles
Posts: 584
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by vanpeebles » Thu Nov 15, 2018 10:50 am

RobC wrote:
Thu Nov 15, 2018 9:15 am
aotta wrote:
Thu Nov 15, 2018 6:14 am
Best wishes to your mother, and happy you are getting something new about vnula from your magic hat!
Many thanks. She had a heart attack last week but is now home and hopefully over the worst.
Heartfelt best wishes to you!

User avatar
tricky
Posts: 3672
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by tricky » Thu Nov 15, 2018 11:59 am

Best wishes rob, my dad had one 20 years ago and had to be jump started, he has had two since, one with 45minutes CPR at the roadside from a nurse on her way home; that needed a jump too. He now has a pacemaker with built in defib' but fortunately hasn't needed the extra functionality.
I eagerly await your new announcement.

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Thu Nov 15, 2018 1:39 pm

Thanks so much guys - I really appreciate it.

I managed to sort out the rest of the CRTC registers (apart from R3) this morning so it can now handle non-standard screen sizes. I hadn't realised that the CPC's CRTC uses horizontal units that are double those of the Beeb's :oops:

Anyway, it'll now play Rainbow Islands and Commando:
IMG_20181115_132741.jpg
Rainbow Islands on a Beeb!
IMG_20181115_132836.jpg
Commando
Last edited by RobC on Thu Nov 15, 2018 1:47 pm, edited 2 times in total.

User avatar
trixster
Posts: 891
Joined: Wed May 06, 2015 11:45 am
Location: York
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by trixster » Thu Nov 15, 2018 2:54 pm

This is bonkers! :o
A3020 | A3000 | A420/1 | BBC B | Master Turbo | ZX48K | NeoGeo
Atom | Amiga A4000 | A3000 | A1200 | A500 | PC Engine | Enterprise
Falcon | Saturn | PS1 | SNES | CPC6128 | C64 | 3DO | MD | Jaguar | X68000 | CD32

VectorEyes
Posts: 245
Joined: Fri Apr 13, 2018 1:48 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by VectorEyes » Thu Nov 15, 2018 3:31 pm

Totally agree that this is amazing! I find myself wondering what the limits are. Can it can handle the more extreme abuses of the CPC hardware, e.g. recent demos such as still rising (https://youtu.be/dDVAzMjA7bM) or phX (https://youtu.be/6wBwbRYL-F4)

[And by the way, I know it's unrealistic (possibly: literally impossible) to expect them to work. Just curious how far you can push a system like this before it hits fundamental limits! But that's for later. Hope your Mum continues to get better!]
Last edited by VectorEyes on Thu Nov 15, 2018 3:33 pm, edited 1 time in total.

User avatar
trixster
Posts: 891
Joined: Wed May 06, 2015 11:45 am
Location: York
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by trixster » Thu Nov 15, 2018 4:40 pm

Good question. That CPC Batman demo is incredible, as is the Pinball Dreams work in progress; if either of those work on this WITCHCRAFT then I’ll eat my beanie! It’s an incredible accomplishment already without further wizardry!
Last edited by trixster on Thu Nov 15, 2018 5:45 pm, edited 1 time in total.
A3020 | A3000 | A420/1 | BBC B | Master Turbo | ZX48K | NeoGeo
Atom | Amiga A4000 | A3000 | A1200 | A500 | PC Engine | Enterprise
Falcon | Saturn | PS1 | SNES | CPC6128 | C64 | 3DO | MD | Jaguar | X68000 | CD32

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Thu Nov 15, 2018 5:26 pm

Those demos are amazing but anything that uses interrupts to do clever tricks won't work at the moment. Pacland doesn't work properly yet because it seems to be doing a palette switch mid-frame and I think Paperboy is doing a mode change mid-frame which is messing up the display.

I'm hoping I can sort out some of this by generating a 300Hz interrupt on the Beeb - I did something similar on the Spectrum emulator to ensure border colour changes happened at roughly the right time. However, anything that uses very precise timing is very unlikely to work properly.

My aims in doing these emulators are two-fold: a) to learn more about other 8-bit machines & b) to play games that didn't get released on the Beeb but I don't really have the skills to write something that pushes the concept to its limit...

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Fri Nov 16, 2018 6:14 pm

Not much progress today as I've been trying to track down an annoying bug which caused the screen mode to change at random. Finally tracked it down to the Beeb's OS coming in and setting the ULA thinking it needed to update the flashing colours. Thought I'd stopped this by using my own vsync interrupt routine but evidently not :(

Anyway, I did manage to get Ghosts 'n' Goblins running:
IMG_20181116_175802.jpg
IMG_20181116_175716.jpg
Zombie slaying on the Beeb!
I played this loads in the arcades but was always terrible at it!

User avatar
tricky
Posts: 3672
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by tricky » Fri Nov 16, 2018 9:37 pm

I thought that flashing was on the 100hZ interrupt , but now I'm not sure :lol:

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Fri Nov 16, 2018 10:09 pm

tricky wrote:
Fri Nov 16, 2018 9:37 pm
I thought that flashing was on the 100hZ interrupt , but now I'm not sure :lol:
Looking at the OS 1.2 disassembly at &DD15 onwards, it seems that it's done when looking for the vsync (CA1) interrupt.

However, I guess this explains why I was seeing this sort of very occasional behaviour. I'd enabled the ADC and T1 interrupts (for joystick and keyboard) and was letting the OS deal with them. If vsync went off just as the OS was going through this code, it would deal with it before reaching my vsync code.

I'll probably move to handling all of the interrupts in my code so that the OS doesn't get a look in.

dominicbeesley
Posts: 826
Joined: Tue Apr 30, 2013 11:16 am
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by dominicbeesley » Fri Nov 16, 2018 10:26 pm

Hi Rob,

I've had this problem myself, it doesn't matter which vector you hang off i.e. IRQ1V is called before the mos routines there's always the chance that the relevant bit in the interrupt flags register could get set between your routine and the mos one and then the mos code would handle it.

However, in this case I think you just want the mos to not do the flash handling, in which case setting the flash period to 0 should do the trick?

D

RobC
Posts: 2666
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: SpectROM - Speccy emulator for the Pi co-pro

Post by RobC » Fri Nov 16, 2018 10:31 pm

dominicbeesley wrote:
Fri Nov 16, 2018 10:26 pm
However, in this case I think you just want the mos to not do the flash handling, in which case setting the flash period to 0 should do the trick?
Yes - that what I did by setting the flash counter at &251 to zero. However, I'd like to make sure I catch every vsync so I'll look at doing everything in my code and shutting out the MOS.

Post Reply