Page 1 of 1

Happy Birthday Dragon Individual Games

Posted: Mon May 01, 2023 11:48 am
by megagarrym
Hi Everyone
I'm trying to split the Happy Birthday Dragon cassette file in to the 3 individual games so that I can use them with XRoar and Launchbox. I CLOADed Santa Laverna in from the virtual cassette and CSAVEd it out to a new virtual cassette but it won't run when loaded from it. This is because the program tries to CLOADM a machine code routine called m/code at line 55. On the original cassette file I can CLOADM the m/code file although EXECing it doesn't appear to do anything.

I have no idea how to save machine code as I understand that memory addresses and lengths need to be specified in the CSAVEM command and I have no idea how to get hold of those.

Does anyone have the three games(Hoppy/Santa Laverna/Meson Raid-although I have got this working as I'd like) on individual cassette files that they would be willing to share? Failing that, if anyone can let me know how to find the memory addresses for a CSAVEM that would be great too.

Cheers
Garry

Re: Happy Birthday Dragon Individual Games

Posted: Wed May 03, 2023 10:00 am
by sorchard
The start, end and exec addresses for a simple binary file can be found with a few PEEKs after loading:

Code: Select all

CLOADM
ST=PEEK(&H1E7)*256+PEEK(&H1E8)
EN=PEEK(&H7E)*256+PEEK(&H7F)-1
EX=PEEK(&H1E5)*256+PEEK(&H1E6)
CSAVEM"NAME",ST,EN,EX
This won't work with custom formats such as autorun programs, but should be good for most things originally saved with CSAVEM.

One possible snag would be the machine code loading at the top of memory where the stack is, in which case you would need to use an appropriate CLEAR command before CLOADM. I don't think this will be a problem in your particular case.

Re: Happy Birthday Dragon Individual Games

Posted: Wed May 03, 2023 10:03 am
by bluearcus
You should be able to use the tape re-write feature on Xroar to create a file that covers just each individual item.

Set the tape input image as normal.
Also set an output tape file to a new .cas file.
Select the rewrite feature.

Load the game as normal. At the same time as it loads, the new output .cas file specified will be written out. This will also contain the binary file part of the load.

At least, that's how it's supposed to work, give it a try.

Re: Happy Birthday Dragon Individual Games

Posted: Wed May 03, 2023 11:17 am
by robcfg
Here you have!

It was far easier to split them using a hex editor... :mrgreen:

Re: Happy Birthday Dragon Individual Games

Posted: Wed May 03, 2023 11:34 am
by bluearcus
Easy to say when you know the .CAS format inside out :-)

But yes, that's another way!!!

Re: Happy Birthday Dragon Individual Games

Posted: Wed May 03, 2023 12:17 pm
by megagarrym
Rob: Thank you very much for this, exactly what I was after! They're now working in Launchbox.
Bluearcus: That's a feature worth knowing about, I gave it a whirl and to get a copy of Santa Laverna with its machine code file I SKIPFed past the Birthday and Hoppy programs then turned on the rewrite and specified a new cas file. Then I CLOADed the main Laverna file then CLOADMed the machine code and both were written to my new cassette, which now works as I wanted it to. Ultimately made redundant by Rob kindly adding the games but I will probably use this feature again so thank you for letting me know of its existence.

Thanks all,
Garry :D

Re: Happy Birthday Dragon Individual Games

Posted: Wed May 03, 2023 12:42 pm
by robcfg
Not that it is a difficult format...

In case you need to examine cas files and get useful info on load and exec addresses, content, crc checks, cas file comparison, etc, please check this nice tool I made: https://bitbucket.org/robcfg/dgnblock_fltk

Cheers!