CPCWiki forum

General Category => Programming => Topic started by: kolleykibber on 16:49, 19 April 21

Title: ROM to DSK
Post by: kolleykibber on 16:49, 19 April 21
I was wondering if there's anything out there that will take a rom and convert it so it loads from disk? Can't find anything out there. Or is the only way via a disassembler and time?

Title: Re: ROM to DSK
Post by: ComSoft6128 on 18:02, 19 April 21
The program below will dump a ROM image to disc, normally then for the image to be blown onto another ROM or examined , but as for Running the image from disc I don't think that's possible.


https://www.cpc-power.com/index.php?page=detail&num=12575 (https://www.cpc-power.com/index.php?page=detail&num=12575)
Title: Re: ROM to DSK
Post by: GeoffB17 on 20:39, 19 April 21
Well, the original question said 'loads from disk'.

You would need a block of memory, specifically RAM, that had the same addresses as the original ROM would have had.  You would need software that would read the file of the ROM data from the disk, and write it to the new RAM, so that everything was at the same address that it would have been at on the ROM.  Then execute the prog starting at the original start address, which might not be the start address of the memory block.

Otherwise, you might try to create a program that 'emulated' the original machine and stepped through the ROM data directly from the disk file, making any jumps as required.  Possible, as it may not be too far from what emulators do anyway, but complicated.

Geoff
Title: Re: ROM to DSK
Post by: Animalgril987 on 23:35, 19 April 21
Not just jumps, but calls and instructions of the form:


  LD register, ( address in ROM address range)
Title: Re: ROM to DSK
Post by: kolleykibber on 03:15, 20 April 21
Thanks for the replies!


So if you were to disassemble a Rom file from &c000 and then move it to &4000 by changing all calls within the address range of the rom so they are relative to &4000.
Covering all things like far_calls. Would you be able to call &4000? Would you need to remove the ROM header?











Title: Re: ROM to DSK
Post by: GUNHED on 16:36, 20 April 21
No, ROMs usually have a special header. Most ROM software has their DISC software pendandant, just use the disc version.