how to make roms out of cas or dsk

By OeiOeiVogeltje

Paragon (1406)

OeiOeiVogeltje's picture

09-09-2012, 11:31

it has been asked many times before i guess but i ask again since i cant find an easy answer

its possible to make roms out of cas files and of DSK files ,numerous examples exist
most of those conversions are done by tools
i find that those tools make the rom bigger than nessesary or not completly to standard.

so im asking if there is a way to load a disk or cas into an emulator and then extraxt it from its "memory" so that no
non-needed stuff is present in the rom
A memory image or something like that ,which is usable as a loadable rom in emulators or real hardware

Login or register to post comments

By AxelF

Champion (395)

AxelF's picture

09-09-2012, 13:57

A quick and simple solution for DSK images is DSK2ROM with the compression opion enabled
to make a 512k rom images. Still very large as you mentioned.

What CAS / DSK games do you want to have as ROM file ?

By NYYRIKKI

Enlighted (5917)

NYYRIKKI's picture

09-09-2012, 14:36

The problem here is similar to real world problem we all know: When you put square box inside round box, you need bigger round box. Same problem other way around: If you put round box in to square box the square box needs to be quite a lot bigger if you don't start to modify the boxes.

Example: If you have 360KB disk then you need 512KB ROM to make it fit inside. If you have 512KB ROM you need 720KB disk to make it fit inside. If you have 720KB disk, then you need 1MB ROM to make it fit inside... Doing packing may help a bit, but anyway more conversion you make -> bigger it gets.

I'm sure you can take an emulator save state and start packing that to ROM-file as well, but it is much easier just to take assembler & the original files and rewrite the loader. This is absolutely the best method and minimizes the overhead caused by using standard containers and heck of a lot of logic glue. Usually the size does not change lot since you replace routines instead of just adding emulation layers. Unfortunately it also requires some manual work. If you want to use the tools then best that you can do is to use fresh DSK-file where you put the files. This will make the DSK-file easier to compress and therefore it may compress more.

By OeiOeiVogeltje

Paragon (1406)

OeiOeiVogeltje's picture

09-09-2012, 18:53

NYYRIKKI wrote:

....t is much easier just to take assembler & the original files and rewrite the loader....

is this an easy thing to do?

is this way documented anywhere?

By NYYRIKKI

Enlighted (5917)

NYYRIKKI's picture

09-09-2012, 22:04

OeiOeiVogeltje wrote:
NYYRIKKI wrote:

....t is much easier just to take assembler & the original files and rewrite the loader....

is this an easy thing to do?

is this way documented anywhere?

It depends... If you take some small cassette game it will be matter of coffee break to make it a ROM-file, but if you take some huge disk game that loads in between you better buy a lot of coffee to home before you even start.

The biggest difference in ROM is that it is all available to use at the very moment you power on your MSX. You don't need to load it or anything like that.

Handling disks is actually quite a complex task. The MSX disk handling takes 13KB even without the low level driver routines! This space is used to initialize RAM variables, handle file system, file names, file control blocks etc. Most of this stuff is completely useless for the games and could be just as well left away if the game would be in ROM. Because the DSK2ROM tries to emulate disk drive all this is included to ROM-file as well. Because there is filesystem the ROM then also contains emulation layer, bootsector, FAT-tables, filenames, directorys, unused disk space etc. totally useless stuff from user/game point of view and this is what causes the size to be such a big.

If you for example want to load stuff to VRAM from disk, you first need to load it to RAM and then copy it to VRAM. When you work with ROM's you can skip the loading and just do the copy operation.

This is a bit hard to explain, but in best case it is just as easy to convert ROM to BIN as it is to convert BIN to ROM. In worst case you may end up writing huge pile of support routines and fixing the way the game works. It depends of how the game is made and there are pretty much endless possibilities to implement things. Some use BASIC-loaders with lot of BLOAD-commands that are pretty easy to replace with bunch of LDIR-commands in ROM. Some use direct sector access and some programs handle files in assembler. Best approach should be considered case by case.

Yet again a real world example:
Q: Is it hard to build a car?
A: If you have all needed LEGO-parts on your desk it should take about 5 minutes. If you need it for transportation, you live in woods 200000BC and you haven't invented a wheel yet, then yes, it is almost impossible... or at least you can expect it to take about 200000 years to solve all the minor details...