XRoar and GMC emulation

Hardware Hacking, Programming and Game Solutions/Cheats
Post Reply
pser1
Posts: 1243
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

XRoar and GMC emulation

Post by pser1 » Sat Feb 23, 2019 10:43 pm

@Ciaran, Stewart Orchard
Hello,
I am trying to make some tests on XRoar using at the same time a DOS cartridge and the Game Master Cartridge.
I am including the MPI as I did for the Orchestra project, but I cannot get it work properly.
The call I am using is this

Code: Select all

xroar -machine dragon64 -machine-cpu 6309 -extbas d64_1.rom -altbas d64_2.rom -machine-cart mpi -mpi-load-cart 3=dosPlus -mpi-load-cart 0=gmc -mpi-slot 3 -force-crc-match -tape-fast -joy-left 0,0:1:0 -kbd-translate -lp-file ..\XRoar\sortida.txt 
It starts the DOS but not properly. When I attach an VDK to drive1 and issue a DIR command, all I get is
? BT ERROR
I cannot see what is wrong here. Without drives it seems to work right, using

Code: Select all

xroar -machine dragon64 -machine-cpu 6309 -extbas d64_1.rom -altbas d64_2.rom -cart gmc -no-cart-autorun -force-crc-match -tape-fast -joy-left 0,0:1:0 -kbd-translate -lp-file ..\XRoar\sortida.txt 
Any hint or advice will be highly welcome
cheers
pere

sorchard
Posts: 395
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: XRoar and GMC emulation

Post by sorchard » Sat Feb 23, 2019 11:36 pm

Hi Pere,

I have had this working in xroar, (gmc and disk in mpi) but I normally use xroar.conf to build a configuration instead of putting everything on the command line. I think I had a definition for a non-autorun gmc in xroar.conf that could be referred to on the command line. I should be able to get some time tomorrow to let you know what worked for me.
Stew

pser1
Posts: 1243
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: XRoar and GMC emulation

Post by pser1 » Sat Feb 23, 2019 11:40 pm

sorchard wrote:Hi Pere,
I have had this working in xroar, (gmc and disk in mpi) but I normally use xroar.conf to build a configuration instead of putting everything on the command line. I think I had a definition for a non-autorun gmc in xroar.conf that could be referred to on the command line. I should be able to get some time tomorrow to let you know what worked for me.
Hi Stew,
thanks a lot. I have ended changing the config file too, adding an entry like this one

Code: Select all

cart gmc
	cart-desc Games Master Cartridge
	cart-type gmc
	no-cart-autorun
And this seems to enable the DOS, so I just need to verify if the GMC can be accessed by a command like POKE&HFF7F,0
Will test it tomorrow!
cheers
pere

sorchard
Posts: 395
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: XRoar and GMC emulation

Post by sorchard » Sun Feb 24, 2019 9:01 am

Hi Pere,

Here's an example that works for me. The following entries are in xroar.conf:

Code: Select all

cart ddos41dir
  cart-desc DragonDOS V4.1 (dir)
  cart-type dragondos
  cart-rom ddos41dir.rom

cart gmc_test
  cart-desc GMC Test
  cart-type gmc
  no-cart-autorun
Then I start xroar with the following command line:

Code: Select all

xroar -machine-cart mpi -mpi-load-cart 3=ddos41dir -mpi-load-cart 0=gmc_test -mpi-slot 3
The dos seems to be working OK and I've also checked that the gmc hardware is working providing the program first writes 0 to $ff7f
Stew

pser1
Posts: 1243
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: XRoar and GMC emulation

Post by pser1 » Sun Feb 24, 2019 10:08 am

Hi Stew,
thanks a lot!
I will try these configs.
Yesterday night I got it working both ways, all alone and inside an MPI with DOS cartridge.
Almost the same way .... but i noticed that the sound is not continous. It has spikes/clicks
almost periodically.
I tested it in Basic while listening/seeing the Mike Rowen videos about GMC use
The program I used was this one

Code: Select all

100 POKE&HFF7F,&H30:'ACCESS GMC
110 POKE&HFF01,52:POKE&HFF03,61:POKE&HFF23,63
120 X=&HFF41:POKEX,159:POKEX,191:POKEX,223:POKEX,255:'0 VOLUME
130 POKEX,142:POKEX,56:'SET FREQUENCY
140 POKEX,145:GOSUB180:'SET VOLUME
150 POKEX,159:'END SOUND
160 POKE&HFF7F,255:'ACESS DISK
170 END
180 IFINKEY$=""THEN180ELSERETURN

Do you think there is something wrong here as to create sound spikes?
Might the interrupts affect here?
By the way, you will have seen that I use POKE&HFF7F,&H30 because selecting both signals to slot 0 (GMC) doesn't work ...
I don't know why it doesn't as on the Dragon we need to switch both /SCS and /CTS IIRC
cheers
pere

pser1
Posts: 1243
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: XRoar and GMC emulation

Post by pser1 » Sun Feb 24, 2019 11:14 am

Hi Stew,
to verify if it was caused by the keyboard detection, I have substituted that with a long delay but it keeps
making interrupted sound. I don't know if this could be related to the XRoar version I am using.
It is the XRoar w64 v0.35.2
cheers
pere

Ps I will try it on real hardware when I have the time.

sorchard
Posts: 395
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: XRoar and GMC emulation

Post by sorchard » Sun Feb 24, 2019 11:42 am

Hi Pere,

Your program gives a clean sound when I try it, even if I run it directly from disk.

The problem with writing $00 to $ff7f from basic is that the dos rom disappears leaving the interrupt vectors hanging. Writing $30 to $ff7f gives you a dos rom accessing the gmc hardware via scs. That's OK if the dos is inactive, but if it's still doing something via an interrupt then bad things may happen.

The safest thing to do would be to turn the disk motor off and then disable or revector the interrupts before switching out the dos rom/hardware. Not so convenient from basic, but easy in m/c.

I'm running xroar under 32 bit linux on an old laptop, so system performance shouldn't be an issue. It might be worth playing with audio settings or trying some earlier snapshots to see if it makes any difference.
Stew

pser1
Posts: 1243
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: XRoar and GMC emulation

Post by pser1 » Sun Feb 24, 2019 1:31 pm

Thanks a lot, Stew
I am sure it has to be something related to the DOS because I don't disable it, right!
Anyway this was just a test. I want to use assembler to program whatever I'll do,
so disabling interrupts is very easy there.
I am sure that on the real harwdware it will work well because POKE&HFF7F,0 is
going to be accepted ... I hope that even from Basic.
cheers
pere

pser1
Posts: 1243
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

Re: XRoar and GMC emulation

Post by pser1 » Sun Feb 24, 2019 2:00 pm

Hi Stew,
right now I have the mini-MPI with CoCo-SDC on slot2 assigned to slot4 and the GMC on slot1
I have loaded from SDC the basic program I was using on XRoar and run it without any change.
I works flawlessly. No sound spikes nor interruptions at all. Great!
If I try to POKE&HFF7F,0 the machine hangs because the already set interrupt vectors are no more accesible
That means, as you hinted, that these DOS vectors should be patched with RTS ($39) and then the 0 POKE
should work well, but I don't mind. The important question was to know if it would work on hardware
The only question now is why doesn't XRoar work the same way as the actual hardware?
Might be a sound configuration most probably but I don't know what could be changed on the command line ...
Thanks a lot for your help!
cheers
pere

Post Reply