It is currently Sun Jun 25, 2017 3:17 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Nov 17, 2015 4:41 pm 
Offline

Joined: Tue Nov 17, 2015 4:38 pm
Posts: 3
Hello folks, I am really newbie to Gameboy development so probably stupid questions.

Trying to compile example1.asm from Carillon Editor to play tune on gb. I setted up RGBDS on osx and after adding missing EQU's to source it compiles just fine. But no sound from rom file it produces.

I compile/link/fix with following:
rgbasm -o example1.o example1.asm
rgblink -o baz.gb example1.o
rgbfix -v baz.gb

As test tune i used fruitless from Carillon package, which i first splitted with carillon.exe tool. Any obvious mistakes i am making here?
If i export same tune as .gb from carillon.exe tool it works.

Code:
http://pastebin.com/qww9mzrq


Top
 Profile  
 
PostPosted: Fri Nov 20, 2015 6:36 pm 
Offline

Joined: Fri Nov 20, 2015 6:18 pm
Posts: 1
Here's what you need to import just the song and player from the .gb file - you chop off the first 0x4000 (16K or 16384) bytes. If you're on OSX or a *nix system, you can use dd to do this like so:

Code:
dd if=fruitless.gb of=fruitless.bin bs=1k skip=16


That will take the source ("if") file and copy its contents into the destination ("of") file, using blocks of 1KB, but skip the first 16 blocks.

If you INCBIN that .bin file, it should hopefully work. 8-)

You can also just INCBIN the .sav, as they helpfully do the chopping for you - you may want to just copy the first 16KB though, which you can do like this:

Code:
dd if=fruitless.sav of=fruitless.bin bs=1k count=16


Top
 Profile  
 
PostPosted: Sat Nov 21, 2015 4:14 am 
Offline

Joined: Tue Nov 17, 2015 4:38 pm
Posts: 3
Thanks for your reply! Tried both suggestions, but still no luck.
Makes me think that there is something wrong with either the code or compiling and making the actual rom file.

Made package that has compiled .gb file that has tune extracted from .gb file as you suggested and example1.s player compiled together. Is there a way to check if ROM is valid and runnable? As Nintendo logo appears, but that's it.

http://paradise.untergrund.net/tmp/roinat/g-boi.zip


Top
 Profile  
 
PostPosted: Sat Nov 21, 2015 7:37 am 
Offline

Joined: Tue Nov 17, 2015 4:38 pm
Posts: 3
Found the reason it did not work. If i run rgbfix -v it makes rom that does not work. If i run the rom after linker it works fine.
Have to test on real machine too. But anyway, thanks a ton for your tips crazyjoe.

edit:
Cannot make it work on real thing, it works on emulator if i don't do rgbfix. But does not work if i do, neither emulator or real thing.

edit edit:
Diffed working rom from carillon.exe tool and mine together and it is missing this:
0100-0103 - Entry Point
After displaying the Nintendo Logo, the built-in boot procedure jumps to this address (100h), which should then jump to the actual main program in the cartridge. Usually this 4 byte area contains a NOP instruction, followed by a JP 0150h instruction. But not always.

So copied bytes from working rom and pasted to non working one and voila, it works on emulator and on real thing!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group