Problems with running a .bin with MESS

Ask anything your want about Mega/SegaCD programming.

Moderator: Mask of Destiny

Post Reply
MihajelPetrovic
Newbie
Posts: 5
Joined: Sun Sep 01, 2013 2:35 pm

Problems with running a .bin with MESS

Post by MihajelPetrovic » Sun Sep 01, 2013 2:57 pm

Hello everyone,
I am new here and recently I decided to start learning Sega Genesis programming as a hobby since it's my favorite console since childhood. I study programming and I use C and Java, we did some asm but we never really got that into it.

I've been following the guides from this blog: http://bigevilcorp.wordpress.com and I downloaded the files of part 5 but I can't get it to run on an emulator.

The assembler I got is SN 68k version 2.53 and I am running Windows 7, 64 bit. When I download and extract MD_TextTest.zip from http://bigevilcorp.wordpress.com/2012/04/ there's 6 .asm files and 1 folder that has one of the .asm's, I place them all in a folder where's asm68k.exe and run the .exe. Of those 6 .asm files, the one named "hello.asm" has the following lines on top:

Code: Select all

include 'init.asm'
include 'globals.asm'
include 'text.asm'
So I expect that after I run in cmd: >asm68k.exe hello.asm,hello.bin to all of the rest of the .asm's that it needs, as the hello.bin will be the rom that should be played by an emulator, right? It's kinda new to me so it confuses me. It does says: Assembly completed. 1021 lines, which is more than what hello.asm alone has.

When I try to run that .bin with MESS, I get:
Image

What am I doing wrong here?

notaz
Very interested
Posts: 193
Joined: Mon Feb 04, 2008 11:58 pm
Location: Lithuania

Post by notaz » Sun Sep 01, 2013 9:03 pm

Looks like a MESS bug to me, have you tried a different emulator?

MihajelPetrovic
Newbie
Posts: 5
Joined: Sun Sep 01, 2013 2:35 pm

Post by MihajelPetrovic » Sun Sep 01, 2013 11:55 pm

Yes, I tried Fusion but it says "Genesis Shutdown. Warning: Checksum incorrect!"

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Sun Sep 01, 2013 11:58 pm

By default, ASM68K tacks on a small header that throws everything out of whack.

Try this instead:

Code: Select all

asm68k.exe /p hello.asm,hello.bin

MihajelPetrovic
Newbie
Posts: 5
Joined: Sun Sep 01, 2013 2:35 pm

Post by MihajelPetrovic » Mon Sep 02, 2013 12:30 am

Just tried it and it gives same result.
Can somebody try to compile and run the file please?

I am also interested in what the include instruction does. If you put 'include abc.asm' on top of some .asm, will the content of abc.asm be the one that is first executed when you compile and run .bin?

Edit: I just ran it through Fusion and it worked. It gives the same error though, but it may be the thing with initialization.
Image
Thank you.

frederic
Interested
Posts: 23
Joined: Tue May 28, 2013 7:32 pm
Location: France

Post by frederic » Mon Sep 02, 2013 2:01 am

MihajelPetrovic wrote:I am also interested in what the include instruction does. If you put 'include abc.asm' on top of some .asm, will the content of abc.asm be the one that is first executed when you compile and run .bin?
"include" is a directive that is interpreted by the assembler (ie by asm68k), not by the Megadrive. It's not an instruction that is part of the 68000's instruction set. You can replace 'include abc.asm' by the lines contained in the abc.asm file, and you will end up with the exact same binary code (ie the .bin file that will be executed by the Megadrive). A basic assembler may not provide such a directive, though most (if not all) do provide it. It's there to make the job of the programmer easier. This directive is described in the documentation of asm68k, see http://birg.cs.wright.edu/ceg320/simula ... page.shtml. See also http://en.wikipedia.org/wiki/Assembly_l ... directives about assembly directives in general.

The process of transforming assembly code into binary code is rather called "assembling" than "compiling", even though it is common to use the term "compiling".
MihajelPetrovic wrote:Edit: I just ran it through Fusion and it worked. It gives the same error though, but it may be the thing with initialization.
That's just Fusion warning you that the checksum of your ROM is not correct. See http://en.wikibooks.org/wiki/Genesis_Pr ... g#Checksum. You can ignore this warning.

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Mon Sep 02, 2013 2:32 am

Looks like something got changed in MESS v0.149. It works fine in v0.148u1, but the new version expects the ROM to be at least 8KB. Just pad it out with zeroes and it'll work fine.

MihajelPetrovic
Newbie
Posts: 5
Joined: Sun Sep 01, 2013 2:35 pm

Post by MihajelPetrovic » Mon Sep 02, 2013 5:27 am

Thanks for all of the info guys.

Post Reply