News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_francouai

CPR to BIN

Started by francouai, 08:53, 01 May 20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

francouai

Hello!
I have a 6128 plus cartridge with a dead Basic/burning rubber EPROM on it.Instead of bin it and for fun, I plan to remove this dead Eprom, install a socket and program a new 27c1001 eprom with one of the best demos called "CRTC3".The problem is, CRTC3 is .CPR so no straight compatible dur to "headers" on the file.

How to convert CPR to BIN or ROM file directly compatible with Xgpro TL866II Plus?Thanks!
--
francois

francouai

looks like I found it..  :picard:
CPRTools"Convert between CPR and BIN cartridge formats"
http://www.cpcmania.com/cprtools/cprtools.htm
--
francois

Bryce

You can do this manually too by removing the first 80H Bytes with a hex editor and saving it as BIN.

Bryce.

GUNHED

Quote from: Bryce on 09:49, 01 May 20
You can do this manually too by removing the first 80H Bytes with a hex editor and saving it as BIN.

Bryce.


Don't make him burn an EPROM in vain. It's not that easy. Learn here:
http://www.cpcwiki.eu/index.php/Format:CPR_CPC_Plus_cartridge_file_format



http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Bryce

Eh, it is that easy. As all CPC EPROMs are 16K the header section always has the same length. I've often converted CPR files to Bin without ever having an issue and I've never used CPR2BIN. If the ROM pages were of variable size you are correct, but that's not the case with CPRs for the CPC.

If you want to be 100% sure: Cut the header, check that the file length is 16384 bytes and save the file. If the file is bigger or smaller than 16384 you've cut off too much/little.


Bryce.

Duke

#5
You have to skip the first 4 bytes + size of each block that is 16KB (total 8 bytes) AND the CPR header (RIFF, 12 bytes) to convert to a straight binary.
That's what I do in M4 to support CPC plus BIN and CPR images, when programming them into flash.

The 0x80 Bytes is just the AMSDOS header, which would need to be stripped too when programming from a PC.

arkive

How about cpr to dsk? Is it possible? I have a converted GX4000 with a DDI device...

GUNHED

#7
Quote from: Duke on 15:52, 01 May 20
You have to skip the first 4 bytes + size of each block that is 16KB (total 8 bytes) AND the CPR header (RIFF, 12 bytes) to convert to a straight binary.
That's what I do in M4 to support CPC plus BIN and CPR images, when programming them into flash.

The 0x80 Bytes is just the AMSDOS header, which would need to be stripped too when programming from a PC.
Perfectly explained!

Bryce probably mixed up ROM and CPR files.

Quote from: arkive on 09:13, 02 May 20How about cpr to dsk? Is it possible? I have a converted GX4000 with a DDI device...

Yes, use a 80 track, double sided format (like Vortex) to habe about 0,7 MB space on disc. Put the CPR on disc and then convert it. How? Duke explained it and you can look it up also in the wiki, see my previous link.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Bryce

Quote from: GUNHED on 17:26, 04 May 20
Perfectly explained!

Bryce probably mixed up ROM and CPR files.

Yes, use a 80 track, double sided format (like Vortex) to habe about 0,7 MB space on disc. Put the CPR on disc and then convert it. How? Duke explained it and you can look it up also in the wiki, see my previous link.


I'm not mixing up anything, and on top of that a .ROM is just a .BIN with a different extension. Please look at the attachment below. It's Geralds ROMSelect file as CPR. As you can see, the RIFF section that needs to be removed is the first 80H (Highlighted). The actual ROM data starts with the bytes &01 &7F as expected. It is ALWAYS 80H that needs to be removed from a 16K file and CPC ROM/BIN whatever you want to call them are always 16K.

Bryce.




Duke

Quote from: Bryce on 18:52, 04 May 20
It is ALWAYS 80H that needs to be removed from a 16K file and CPC ROM/BIN whatever you want to call them are always 16K.
Well correct only if the CPR image is ONE single rom, but most CPR's are multiple rom's and represent a CPC plus cartridge image. Just chopping of the header and burning it to an EPROM would not work as you would have excessive bytes for EACH 16KB block in the image.

GUNHED

Quote from: Bryce on 18:52, 04 May 20
I'm not mixing up anything, and on top of that a .ROM is just a .BIN with a different extension. ...
Well, a ROM files is more often a BIN file without header. However a CPR is completely different, it contains extra information for every 16 KB block.

The usual CPR in addition is not 16 KB, it 128 KB or 256 KB (or more).
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Bryce

There are of course combined images, but the majority of ROM files are all 16K.
@GUNHED: BIN files don't have a header, they are just the raw data. I know that CPR are completely different and that the RIFF header can vary in length. All I was saying is that you don't need a fancy program to remove this, you can manually remove this and in almost all cases (for the CPC) it will be &80 bytes that need to be removed.


Bryce.

GUNHED

Yes ROM files are 16 KB (or 16,1 KB with header), but CPRs are 128 or longer. So removing just 128 bytes will not work and you burn your EPROM in vain.

BIN files on my CPC always have an 128 byte header, or somebody misnamed an ASCII file.

But to end the discussion just compare some game being on CPR versus on BIN.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod