Researching software under win, for conversion from binary format to *.ROM format

By sp4

Master (214)

sp4's picture

26-04-2010, 18:00

Hi, i'm searching whitout success any program under win xp, for translate the binary format
to ROM format.
Is there anybody than can help me please? Question

Login or register to post comments

By NYYRIKKI

Enlighted (5396)

NYYRIKKI's picture

26-04-2010, 20:42

Hmm... I doubt this kind of software exists(?)... At least I've not heard about this kind of software...

How ever here is simple instructions, how to make this happen...

1) Rename your binary program as MY.BIN
2) Open command prompt (Start / Run -> Write CMD + ret)
3) Copy / Paste the crap below to the command window
4) You should now have MY.ROM that you can start on emulator (Works up to ~15.7KB big BIN-files)

debug
n my.bin
f 100 40ff 0
e 100 41 42 10 40 00 00 00 00 00 00 00 00 00 00 00 00
e 110  3A 39 40 FE FE C0 2A 3A 40 E5 ED 4B 3C 40 7C 2F
e 120  67 7D 2F 6F 23 09 E5 C1 D1 2A 3E 40 E5 21 40 40
e 130  ED B0 3E 80 26 40 C3 24 00
l 139
n my.rom
rcx
4000
w 100
q



By cax

Prophet (3722)

cax's picture

26-04-2010, 21:49

NYYRIKKI gives us super cool answers, as usual, while I am still not sure sp4 has any BIN file smaller than 16K.

But I'd like to ask sp4 - what are you going to do with these ROMs ?
Is it for easy running in emulator, or for ROM->WAV conversion, or for flashing into special cartridge ?

By sp4

Master (214)

sp4's picture

26-04-2010, 23:15

Hi cax, i want create ROM game for put them into the rom-cartridge.

By NYYRIKKI

Enlighted (5396)

NYYRIKKI's picture

26-04-2010, 23:35

I know I have a bad habit of giving technically correct answers to questions that might have been wrong in the first place... but you newer know... How ever I also find it a bit odd wanting to convert .BIN-files to .ROM as usually the problem is just other way around.

The absolute maximum size of BIN-file is about 23KB therefore it is very likely to be <16KB. In case it is a bit over 16KB it is most likely a 16KB ROM-file that has a BIN-file loader... In this case doing something like above would end up to ROM-file... that has BIN-file loader... that has ROM-file loader... that has no sense.

In this case I suggest converting it to ROM by removing the BIN-loader... Cutting long story short:

Check 8th & 9th byte of file
If they contain string "AB" then
- remove 7 first bytes ("AB" is now in start of file)
- Remove anything after 16384 bytes.
else
- Count 16384 bytes from end of file and check that you found "AB"
- Remove everything before that.
end if

By NYYRIKKI

Enlighted (5396)

NYYRIKKI's picture

26-04-2010, 23:54

Hi cax, i want create ROM game for put them into the rom-cartridge.
Ah, a real ROM! Very nice... Many times people just use those flash RAM cards forget the good old ways...

You might want to change third line like this:
f 100 40ff ff

...this may speed up ROM burning time as (EP)PROM burner does not have to write "1"-bits.

By enribar

Paladin (1004)

enribar's picture

27-04-2010, 19:07

certo che esiste, noi abbiamo tutto Wink

By Imanok

Paragon (1143)

Imanok's picture

28-04-2010, 19:54

You can put your .BIN and an AUTOEXEC.BAS to load it into a .DSK and then convert the .DSK into a .ROM file with DSK2ROM Wink

By PingPong

Prophet (3459)

PingPong's picture

28-04-2010, 21:47

Hmm... I doubt this kind of software exists(?)... At least I've not heard about this kind of software...

How ever here is simple instructions, how to make this happen...

1) Rename your binary program as MY.BIN
2) Open command prompt (Start / Run -> Write CMD + ret)
3) Copy / Paste the crap below to the command window
4) You should now have MY.ROM that you can start on emulator (Works up to ~15.7KB big BIN-files)

debug
n my.bin
f 100 40ff 0
e 100 41 42 10 40 00 00 00 00 00 00 00 00 00 00 00 00
e 110  3A 39 40 FE FE C0 2A 3A 40 E5 ED 4B 3C 40 7C 2F
e 120  67 7D 2F 6F 23 09 E5 C1 D1 2A 3E 40 E5 21 40 40
e 130  ED B0 3E 80 26 40 C3 24 00
l 139
n my.rom
rcx
4000
w 100
q



Wow! the old MS-DOS debug tool! Nice to see again! What good old memories!

By Eugeny_Brychkov

Paragon (1106)

Eugeny_Brychkov's picture

28-04-2010, 23:55

Hi cax, i want create ROM game for put them into the rom-cartridge.
Well, now there's enough information on the subject...

As I understand you compile and link code and get .bin file, and you use "link" for linking. Most games are running in the window 4000h-BFFFh (/CS1, /CS2 or both /CS12), thus you will need to tell asm that start code is 4000h by stating in your .asm file

org 4000h

db 41h,42h
dw rom_start ; address from where exec starts
db 0,0,0,0,0,0,0,0,0,0,0,0,10h,0,0

rom_start:
<your code>
...
end

However linker will still think that start is 0000h, and for this purpose you give it a command line instruction (you may keep other keys and instructions you use in this command line)

link <out name>=<rel name>[l4000]

where "l" is a lowercase "L" (el).

Then you rename output file to .rom extension and try with emulator. As soon as it will work fine, you can burn ROM and use it in your hardware Smile