Romdisk

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Romdisk

Post by RyoDC »

What it is and why it's used?
How do I try to build a Dreamcast toolchain:
Image
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Re: Romdisk

Post by BlackAura »

Basically, it's for embedding files inside your program, so you don't have to read them off a CD.

You have a bunch of files, and the build process generates a romdisk image out of them, and embeds it in the program. KOS picks that up, and makes the files accessible from /rd. You can then read them the same way you'd read files off a CD (fopen / fread, or fs_open / fs_read), or you can get a pointer directly to the file data using fs_mmap (I think).

As to why...

You could use it if you want to distribute your program as one file. Makes it a lot easier to burn to a CD that way. You could put some files in the romdisk that you need at startup, or are actually required for anything to work at all (fonts, for example), and load everything else off the CD.

Feet of Fury uses them to improve loading times. You can actually read additional romdisk images and mount those. Reading the romdisk in a single chunk is much faster than reading all the individual files, because you don't have to seek (and seeking is very slow on the DC's CD drive).

For development, it's much easier (and faster, generally) to just shove files in a romdisk than it is to read them using dcload's /pc filesystem. Especially if you're using a serial cable instead of a network adapter.
User avatar
RyoDC
Mental DCEmu
Mental DCEmu
Posts: 366
Joined: Wed Mar 30, 2011 12:13 pm
Has thanked: 2 times
Been thanked: 0

Re: Romdisk

Post by RyoDC »

Thank you very much for your response!


Well, basically my dream is to write a good 2d-game on Dreamcast or just some simple 3D representation (some cubes or really simple geometric forms, like primitives, etc.) I've ideas but don't have any clue how to realize all this. Now I'm working on the C++ function that could copy one rectangular area from one point of the memory to the another point of other memory (like video mem), though, don't know how to update the screen (call the interrupt) and how to interact with the user and make it all succesful compile on GCC with KOS...
How do I try to build a Dreamcast toolchain:
Image
Post Reply