Git Product home page Git Product logo

drastic2melonds's Introduction

Drastic to MelonDS

This script will convert the dsv save from drastic emulator to a melonDS save file.
This also works for desmume to MelonDS save files since desmume also seems to add padding to the end of the file.

Usage

usage: dr2mds.py [-h] [-o OUTPUT] [-f] file

positional arguments:
  file                  The drastic save file

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Specify the output file
  -f, --force           Overwrite the output file if it exists

Install

Add it to a folder in your $PATH

install -Dm755 dr2mds.py ~/.local/bin/dr2mds

For windows users just run the script from the folder

How to use

You need python 3 installed.
Specify the input save file

./dr2mds.py "Pokemon Black.dsv"

This will make a "Pokemon Black.sav" file as output You can also specify the output like

./dr2mds.py "Pokemon Black.dsv" -o "PKMN.sav"

How does this work ?

MelonDS determines the type of save using exact byte count in the save file

Which needs to be a power of 2 as mentioned here.
In Importing a savefile from another emulator part under How to section

This script calculates the closest power of 2 to the save file and removes the padding.

Other ways of doing this

This can be done manually by removing the padding using a hex editor. Or using dd like this (on linux/macos)

dd if=Pokemon.dsv of=Pokemon.sav bs=1 count=524288

This will make a 4KiB EEPROM save from drastic to melonDS save.

How to calculate the save size

Run wc -c file in terminal to count the number of bytes in the file

wc -c Pokemon\ Black.dsv

which will output something like

524410 Pokemon Black.dsv

Now calculate log(524410)/log(2) which equates to 19.000335671081253
Take its floor i.e. 19 and calculate the power of 2 to the number ie 219 which equates to 524288
The resulting number is the number of blocks to put in dd count= if you are manually making the save.

drastic2melonds's People

Contributors

uttarayan21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.