DC-SWAT Forum

Полная версия: vmu read and write
Вы просматриваете yпpощеннyю веpсию форума. Пеpейти к полной веpсии.
Hello everyoneBlush

I want to learn how to read and write vmu.

I read some information from http://mc.pp.se/dc/vms/flashmem.html,

may I ask where there are some practical examples for reference What?

Thanks ReplyBig Grin
You mean low-level?
I mean ordinary, basic. Recently, in the game conversion of atomiswave, we found that although the archive is very large, we can simply compress it with DC's SH4 CPU before storing it in VMU. After compression, we can reduce the space by about 70%, so that we don't need too much space to archive it in VMU. But I'm not familiar with VMU. I haven't touched it before, so I'm not familiar with reading and writing VMU archives. So I want to ask if there are any materials and examples for reference.
Maple Bus simple code:
https://github.com/DC-SWAT/DreamShell/bl...rc/maple.c

VMU block r/w simple code:
https://github.com/DC-SWAT/DreamShell/bl.../src/vmu.c

VMU FAT filesystem code:
https://github.com/KallistiOS/KallistiOS...fs/vmufs.c


But it's not easy way. Better find in-game functions from KATANA SDK and use it.
Thank you for providing information. I have watched some games these days. KATANA is a lot more complicated. I found some related function sections. However, the method of reading and writing is more complicated. It is probably achieved by switching access permissions? (0x8c switches to 0xac and 0x0c)
Maple bus data is transfering by DMA to/from maple controller with some frequency.
Different areas of RAM used by some reasons. For example at 0xac area disabled CPU cache, or 0x0c it's a physical address uses for DMA transfers and 0x8c used as default work area.
(21.01.2021 10:45)SWAT писал(а): [ -> ]Maple bus data is transfering by DMA to/from maple controller with some frequency.
Different areas of RAM used by some reasons. For example at 0xac area disabled CPU cache, or 0x0c it's a physical address uses for DMA transfers and 0x8c used as default work area.

Thank you swatSmile

at 0xac area disabled CPU cache, or 0x0c it's a physical address uses for DMA transfers and 0x8c used as default work area.

Can you elaborate on this?
I have been troubled by this. Is the address starting with 0xac and the memory address starting with 0x8c the same? Is there just a difference in caching?
such asHuh

0xac010000
0x8c010000
0x0c010000
Are these 3 addresses one? Is there a difference between caching


I found several KATANA games and put them together with other functions, and the assembly seems particularly difficult.

Can you recommend a KATANA game or app about the use of these functions?
0xac and 0x8c is the mirror of 0x0c. So yes, it is the same memory.
Thank you for your help. At present, the file reading function of the katana game has been found. After reading a few games, it seems to be similar. It seems to be the function library of katana.

The current result is that the game archive can be encrypted, decrypted or compressed (many games have a separate set in addition to the CRC set with the system, and some games have too large archives, such as Advanced Daisenryaku 2001, which actually requires 194 frames. The memory card space, if we simply compress it, theoretically it can be reduced by half)

But if I want to copy the archive reading function and use it alone, it's too difficult. Give up temporarily...
After all this time, I can finally make some sense of it

What I want to ask is, does it have any effect to cancel this sentence when writing the archive data to the memory card?

/* Gotta wait a bit to let the flash catch up */
sleep(20);


Maybe I can do a test with this game

https://www.bilibili.com/video/bv1qF411b778
I'm not sure, but I think you should wait some milliseconds for writing data by maple bus controller and/or VMU.
(26.11.2021 14:03)SWAT писал(а): [ -> ]I'm not sure, but I think you should wait some milliseconds for writing data by maple bus controller and/or VMU.

Thanks for the answer, I've seen the code for the KATANA game about this and most of the games have the same loop code here
To be honest, the loops in there are a bit confusing to me


Ok, looks like I found them from your github....

timer_init ();
timer_prime();
timer_start ();
timer_spin_sleep_bios(20);

Ok, looks like I found them from your github

I think there are no more errors, thanks again
URL ссылки