Question About Loading Files (CD and 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
KingCrazy
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 33
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sat Aug 04, 2018 11:36 am
Has thanked: 2 times
Been thanked: 7 times

Question About Loading Files (CD and Romdisk)

Post by KingCrazy »

Hello again!

Sorry to be buggin' you all with my questions, but I haven't found many good answers on this subject.

I've been tinkering around with KOS a bit. I've gotten some 3D objects to draw on the screen with all of the vertices defined in the source code. Next, I wanted to try loading the objects in from a file. Doing some research, I noticed a lot of people pack their files into romdisk folders and load them in. There's plenty of information regarding romdisks, but I still had a few questions!

It seems (from what I've been reading) that the biggest drawback to romdisks is that they end up in RAM once mounted -- meaning a romdisk can't be more than a certain size otherwise you'll run into problems. That made me wonder: what files should I be storing on the romdisk? How should it be best utilized?

I noticed that there's a tutorial on romdisk swapping, so would proper usage be to pack all of my assets per-level into romdisks and swap the romdisks when loading levels? If that's the case, would that mean that if I had an enemy that were to appear in 2 different levels, I'd have to waste space including that file in 2 separate folders, or am I able to pick and choose what files out of what romdisks I'd like to load in?

I'm aware, thanks to BlackAura's post in this topic awhile ago, that the virtual filesystem is broken up into a few mount points. One of those mount points is /cd/, this being all the data on the CD. I'm assuming that /cd/ can hold more data, but is slower to access than a romdisk (gotta love optical drive speeds).

That leads me to my main question:
What kind of files would I want to store on the romdisk, and what (if anything) would I want to store on the cd?

Would it basically just boil down to frequency of use (if the assumption that loading from /cd/ is slower than loading from a romdisk is correct) and file size?

My second question is: What gets packed up into /cd/ when I compile? Is it anything in the folder I'm running my Makefile from? Or do I have to make a separate folder for it?

There's very little talk about using the CD itself, so I was very curious about all of this! I'm also not very familiar with the process of loading and unloading files for games on consoles, so I apologize for all of the questions!

Thanks so much!
User avatar
lerabot
Insane DCEmu
Insane DCEmu
Posts: 134
Joined: Sun Nov 01, 2015 8:25 pm
Has thanked: 2 times
Been thanked: 19 times

Re: Question About Loading Files (CD and Romdisk)

Post by lerabot »

It seems to me that you have a good grasp on the pros and cons of romdisk vs CD.

Something I might add is that you can compress (.gz) the romdisk to save space aswell on you CD. Also, if you load a romdisk, you basically only load 1 compressed file from the CD drive which sometime reduce the wierd noise it makes. Once it's loaded into ram, you could send your textures to the PVR, your various geometry in some strucs, and then unload the romdisk. You could then load a second romdisk right away if you wanted to.

I personally have my textures (.png), maps (.svg) and dialogs (.json) for each area in different romdisk. You could also put music in, but this usually takes a bit too much space if you use a somewhat long loop. CD is good for music, rom for SFX.

But, when I load big texture (full screen character portrait), I load it off the CD because it doesn't mean that the player will speak to all NPC, and multiple NPC + various different portrait per NPC fill the romdisk pretty quickly.

As for the CD, you got that right, you can access something that would be in your /music folder using /cd/music/*****.ogg

Let me know if you have any other question :)
KingCrazy
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 33
Joined: Sat Aug 04, 2018 11:36 am
Has thanked: 2 times
Been thanked: 7 times

Re: Question About Loading Files (CD and Romdisk)

Post by KingCrazy »

lerabot wrote: Wed Aug 08, 2018 3:27 pm It seems to me that you have a good grasp on the pros and cons of romdisk vs CD.
...
Thank you so much! That clears up a lot of my questions!
The only question I have left is: How would I go about storing something directly onto the CD? Is there a specific folder I'd need to place it in when compiling? Or is there something I need to add into the makefile to get it to pack those things onto the CD?

Edit: Nevermind! Solved my own question by viewing the files in /cd/ -- it seems like anything in the folder is put in /cd/, for anyone who may also have this question.
Post Reply