Part I - Uploading files
For uploading files from your Dreamcast to the Dreamcast server, you can not use any generic file uploader (no matter if written in PHP or Perl). One reason is, that Dream Key is using a modified Netscape/Mozilla 3.0 version, which does not use the default 'input type="file"' element. Instead it uses 'input type="vmfile"'. Another reason is the structure of downloads for the Dreamcast. Downloads for the Dreamcast are splitted into two different files:
- The first file is the VMI file, which is only some sort of descriptor file.
- The second files is them VMS file, which contains the actual content to download.
Since I am really not a developer, I searched for an alternative to develop an VMU uploader. I found an excellent alternative with NeoDC. NeoDC has the entire code that is needed to upload content from your VMU's and it also creates the VMI and VMS structure. So here is what I did:
- Download NeoDC
- Extract the required code from the NeoDC project into a single neodc.php file
- Create a very simple upload front end, that would use the neodc.php upload functions
# cd /var/www/html
# tar xf dc_up_down.tar.gz
You should have at least the following structure now:
# tree
.
├── dc_up_down.tar.gz
├── download.php
├── neodc.php
├── upload
│ ├── _SILVE_0.VMI
│ ├── _SILVE_0.VMS
│ ├── _SILVE_1.VMI
│ └── _SILVE_1.VMS
└── upload.php
download.php will just list all VMI files inside the upload folder
neodc.php contains the functions to upload content from your VMU
upload.php will offer you to upload a file and then utilize neodc.php to actually upload a file
The files under upload are my save states from the game 'Silver' as an example.
Now you can navigate to your Dreamcast server, load the upload.php and save some game states.
Part II - Downloading files
As I said before, downloading files is also not too easy. Fortunately, way easier than uploading files. If you try to download any VMI file from the Dreamcast server, Dream Key will only display an error meassge with: "This page can not be displayed.". To be able to download files, you have to manipulate the mime.types file for Nginx and add the following two lines:
# vi /etc/nginx/mime.types
...
application/x-dreamcast-vms-info vmi;
application/x-dreamcast-vms vms;
...
And don't forget to restart Nginx again:
# systemctl restart nginx
After that you will be able to download files via the download.php script from above. The (unofficial) VMU FAQ also describes a method by using the .htaccess file, but I haven't tested it.
Links:
The (unofficial) VMU FAQ: https://vmudev.dcemulation.org/faq.html
NeoDC: https://github.com/mrneo240/NeoDC-Icondata-Tool
dc_up_down.tar.gz: https://drive.google.com/open?id=13-bYNo7srDDny-jcxFUHxESc3SHJoi5Y
No comments:
Post a Comment