HELP NEEDED! With loading file based game from HDD.

By max_iwamoto

Hero (627)

max_iwamoto's picture

12-10-2022, 02:07

Hello.

We are finishing a few translations of multi-disk games. And we would like to make them able to load from HDD.

I tried to do it on SUNRISE IDE controller with MSX DOS 2. I created a new partition, copied files, and tried to execute. As expected there was not enough RAM. If I rename 1st file from the game as MSXDOS.SYS and restart, the game would start, but after loading the next file it doesn't want to load more files from the HDD.

So my question is: what is the correct way to make a disk-based game run from HDD with MSX-DOS 2?

Would be great if somebody could point me in the right direction. I am not afraid of patching the game and add some code if required. But from what I understand to properly run a game in MSX-DOS 2 it must be prepared to do so from the beginning. Because rewriting the whole game is not an option, what would be the easiest route with minimal patching to make it run from HDD?

And is there any tool that lets you add/remove files from HDD image under Windows? I tried DISK-Manager but it gives me an error about "wrong HDD partition".

Thanks,
Max

Login or register to post comments

By Manuel

Ascended (19220)

Manuel's picture

12-10-2022, 07:44

For Sunrise IDE disks you can use the built in diskmanipulator in openMSX.

By ro

Scribe (4865)

ro's picture

12-10-2022, 08:15

You're talking "not enough memory"

When booting in DOS2, you will have 2 mapper segments in use for dos2. Usually the most upper two. Unless you are booting on turbo R, then you will loose another 4 mappers. Dos2 reserves these for DRAM mode (even if it is not active). That is, if you are using the DOS2 mapper management functions.

If you are not using memory mapper and/or dos2 functions like directories, you can easily just go basic/dos mode and save some memory. Running that from HDD in DOS2 mode will perhaps kill a proper return to DOS2, if you have that option.

By SjaaQ

Champion (370)

SjaaQ's picture

12-10-2022, 11:27

I always use https://hp.vector.co.jp/authors/VA013937/editdisk/index_e.html for HDD image editing. If the "plain image" option does not work, "vmware plain disk" does.

By NYYRIKKI

Enlighted (6011)

NYYRIKKI's picture

12-10-2022, 12:29

The most popular reason why games don't work under MSX-DOS2 is the direct usage of memory mapper. This is a big "no no" under DOS2. The problem comes from the fact that when game changes mapper page and then loads something from the disk/HDD the disk routines automatically change the mapper page back to what DOS2 thinks should be there.

If the mapper on your machine happens to support mapper page read back (input from ports #FC-#FF) correctly then you can get around the problem by executing "MAP2.COM" tool first before loading the game. If this approach is not available then there is very little that can be done except to start patching the mapper OUT-command to MSX-DOS2 calls instead.

It is true also that MSX-DOS2 always uses some of the last mapper pages for it self while MSX-DOS1 does not even know that mapper exists. This some is minumum of 2, but ie tR with modern command interpreter can easily take 7 even if you have not loaded anything yet in autoexec.bat ... This is anyway usually very straight forward to solve: Get bigger memory mapper.

If you have trouble with TPA-memory, try MSXDOS2.SYS 2.40... It has quite a bit smaller footprint on RAM compared to earlier versions.

By max_iwamoto

Hero (627)

max_iwamoto's picture

12-10-2022, 17:45

Manuel wrote:

For Sunrise IDE disks you can use the built-in diskmanipulator in openMSX.

where is it located?

By max_iwamoto

Hero (627)

max_iwamoto's picture

12-10-2022, 17:51

Thank you, Everybody, for your fast response. I made some progress. The issue with "not enough memory" was happening because the game was assuming ROM is still located at 4000h (like when you boot from a floppy). So it starts now. But there is an issue with resource file data that is stored in VRAM and disappear after loading 1st file segment. I have to debug that.

One more question is the game searching for the file using DOS function 11h with "?" instead of file number. It does find it if you start from a floppy and cannot find it if you run from HDD. Why would that happen?

I avoid using 11h by manually entering the correct file name but still would like to know why it cannot find the file...

By NYYRIKKI

Enlighted (6011)

NYYRIKKI's picture

12-10-2022, 19:11

max_iwamoto wrote:
Manuel wrote:

For Sunrise IDE disks you can use the built-in diskmanipulator in openMSX.

where is it located?

It is hidden behind F10-key in most systems... How ever as it is a bit tricky to use, I suggest you to RTFM anyway... or go with the SjaaQ tip.

max_iwamoto wrote:

One more question is the game searching for the file using DOS function 11h with "?" instead of file number. It does find it if you start from a floppy and cannot find it if you run from HDD. Why would that happen?

What can I say... It should definitely work. Maybe hard coded drive letter or something?

By max_iwamoto

Hero (627)

max_iwamoto's picture

13-10-2022, 03:15

NYYRIKKI wrote:
max_iwamoto wrote:
Manuel wrote:

For Sunrise IDE disks you can use the built-in diskmanipulator in openMSX.

where is it located?

It is hidden behind F10-key in most systems... How ever as it is a bit tricky to use, I suggest you to RTFM anyway... or go with the SjaaQ tip.

I tried SjaaQ tool with BlueMSX and openMSX HDD partition and both couldn't work in it.

I do like diskmanipulator. But is there any way to use it in a "bat" file? So I can automatically update the image after recompiling my files.

For now, I added Windows "directory as floppy" and copying file from there via MSX-DOS command line.

NYYRIKKI wrote:
max_iwamoto wrote:

One more question is the game searching for the file using DOS function 11h with "?" instead of file number. It does find it if you start from a floppy and cannot find it if you run from HDD. Why would that happen?

What can I say... It should definitely work. Maybe hard coded drive letter or something?

It wasn't hard coded, FCB starts with "0". I changed MSXDOS 2.0 to 1.0 and it's working. Probably some incompatibility in MSXDOS2 syntax.

---

Now I have a new issue. The file is loading, but when the game executing a VDP command, it not working properly. Like, for example, a simple clear screen will leave extra garbage.

Is there any difference when you boot from HDD that can cause that? I've been debugging for hours without much success... The code is exactly the same as when you start from a floppy.

By Manuel

Ascended (19220)

Manuel's picture

13-10-2022, 07:46

Some games run a VDP command and load something from disk at the same time. When the loading is done they assume the VDP command is also done. But on HDD the loading is much faster and the assumption breaks. E.g. Xak 2 does this, iirc.

By max_iwamoto

Hero (627)

max_iwamoto's picture

13-10-2022, 14:35

Manuel wrote:

Some games run a VDP command and load something from disk at the same time. When the loading is done they assume the VDP command is also done. But on HDD the loading is much faster and the assumption breaks. E.g. Xak 2 does this, iirc.

Thank you, Manuel. I will check that.

---

EDIT: You were right! It was missing VDP WAIT COMMAND before loading file data from VRAM with INIR (but they did have "wait VDP" when executing regular VDP commands). And the data was damaged as well because clear screen command was slow and wiped (damaged) the data during upload to VRAM.

The HDD load works now!