Skip to content

Commit

Permalink
New tool: romfix
Browse files Browse the repository at this point in the history
  • Loading branch information
sikthehedgehog committed Nov 7, 2018
1 parent 17e3cd4 commit 293e585
Show file tree
Hide file tree
Showing 6 changed files with 695 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README
Expand Up @@ -14,26 +14,29 @@ build better quality homebrew as well as to provide a standard set of tools.

Tools currently available:

* Programming tools
- headgen (generates Mega Drive headers)

* Graphics tools
- mdtiler (converts PNG files into Mega Drive tiles)

* Sound tools
- midi2esf (converts MIDI files into Echo streams - PRELIMINAR)
- mml2esf (converts MML files into Echo streams)
- tfi2eif (converts TFM Maker instruments into Echo FM instruments)
- vgi2eif (converts VGM Maker instruments into Echo FM instruments)
- eif2tfi (converts Echo FM instruments into TFM Maker instruments)
- pcm2ewf (converts raw PCM data into Echo PCM instruments)

* Compression
- slz (general purpose compression)
- uftc (fast graphics compression)

* Miscellaneous tools
- headgen (generates Mega Drive headers)
- romfix (post-build ROM fixups)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Some other places you may want to check:

- http://echo.mdscene.net/ (Echo sound engine)
- https://github.com/sikthehedgehog/echo (Echo sound engine)

-----------------------------------------------------------------------------
17 changes: 17 additions & 0 deletions romfix/LICENSE
@@ -0,0 +1,17 @@
© 2018 Javier Degirolmo

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
18 changes: 18 additions & 0 deletions romfix/Makefile
@@ -0,0 +1,18 @@
CFLAGS=-Wall -O3 -s -std=c99

.PHONY: all
all: romfix

romfix: main.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

main.o: main.c main.h

.PHONY: clean
clean:
-rm -rf romfix
-rm -rf *.o

.PHONY: love
love:
@echo not war?
74 changes: 74 additions & 0 deletions romfix/README
@@ -0,0 +1,74 @@
___ ___ _____ ____ _ _ _
| | | | __| | | |
| | | | | | | | |_ | | | |
| <| | | | | | _|| |> <
| | | | | | | | | | | | |
|_|_|___|_|_|_|_| |_|_|_|

Mega Drive ROM fixer utility
© 2018 Javier Degirolmo
Version 1.0

This program is meant to be run after an assembler or compiler generates
the ROM file. It does some additional maintenance job like padding the ROM
or fixing some information in the ROM header. It's an useful addition to
complement your current tools.

This utility is released under the zlib license.

;----------------------------------------------------------------------------

The program is run as follows:

romfix «options» «filename.bin»

Running the program as-is (even without options) will do the following:

* The checksum is calculated and fixed in the ROM header.

* The ROM will be padded to the next size deemed "safe". This is useful
to avoid issues with some old emulators or flashcarts that could mistake
it for a .smd file in edge cases, or in case your assembler doesn't
align the ROM to a word size for whatever reason.

;----------------------------------------------------------------------------

On top of that, passing arguments to the command line (see «options») lets
you do some additional operations on the ROM:

-t "GAME TITLE GOES HERE"

Changes the game title in the ROM header (both domestic and overseas
fields). Title must be up to 48 characters long, will be padded with
spaces if it's shorter.

-c "XYZW"

Changes the four-letter copyright code in the ROM header. If the code
is shorter than four characters, it'll be padded with spaces.

-d

Changes the date in the copyright field to today.

-s "BLAHBLAH"

Changes the serial number. It must be up to 8 characters long, it will
be padded with spaces if shorter. Try to pick an unlikely serial number
(e.g. maybe your copyright code + a suffix? whatever works)

-r 00

Changes the revision number. It must be between 00 and 99. It
*must* be two digits (e.g. you can't do -r 1, instead do -r 01)

-z

Reports the size of the ROM before and after padding (to stderr).

;----------------------------------------------------------------------------

Also (without passing a ROM file):

romfix -h ... show usage
romfix -v ... show version

0 comments on commit 293e585

Please sign in to comment.