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
Carillon player example not working
Re: Carillon player example not working
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:
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.
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: Select all
dd if=fruitless.gb of=fruitless.bin bs=1k skip=16
If you INCBIN that .bin file, it should hopefully work.
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: Select all
dd if=fruitless.sav of=fruitless.bin bs=1k count=16
Re: Carillon player example not working
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
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
Re: Carillon player example not working
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!
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!