Author |
Message |
- Joined: 28 May 2015
- Posts: 118
|
devkitSMS header not found.
Posted: Mon Dec 05, 2016 8:12 am
|
I'm having an issue building my project, with a header.
As seen in the attached picture, i am not sure why it says this message, when it's right there at the bottom. It still builds though.
Thanks.
|
|
|
- Joined: 05 Sep 2013
- Posts: 3827
- Location: Stockholm, Sweden
|
Posted: Mon Dec 05, 2016 12:39 pm
|
It's a warning, it's saying that if you put your ROM into a physical cartridge then it won't boot on an western SMS (no problems on a Japanese one).
To avoid that warning, use the lowwing macro:
SMS_EMBED_SEGA_ROM_HEADER(productCode,revision); /* macro - embed SEGA header into ROM */
usually I put 9999 as productCode (it's an officially invalid product code, thus it may be used for homebrew) and whatever revision value you like, from 0 to 15.
|
|
|
- Joined: 28 May 2015
- Posts: 118
|
Posted: Mon Dec 05, 2016 6:40 pm
|
sverx wrote It's a warning, it's saying that if you put your ROM into a physical cartridge then it won't boot on an western SMS (no problems on a Japanese one).
To avoid that warning, use the lowwing macro:
SMS_EMBED_SEGA_ROM_HEADER(productCode,revision); /* macro - embed SEGA header into ROM */
usually I put 9999 as productCode (it's an officially invalid product code, thus it may be used for homebrew) and whatever revision value you like, from 0 to 15.
I seem to still get the same warning. Look at attached picture.
|
|
|
- Joined: 05 Sep 2013
- Posts: 3827
- Location: Stockholm, Sweden
|
Posted: Tue Dec 06, 2016 9:02 am
|
I suspect it's the effect of a known nasty SDCC problem with absolute positioning in ROM - the SEGA ROM header gets overwritten by your assets in slot 1.
To avoid this, you should make sure that there's enough space left for the header to fit nicely, for instance leaving some more space in slot 1 (I see you're using a lot of it) - 16 bytes are enough.
|
|
|
- Joined: 28 May 2015
- Posts: 118
|
Posted: Tue Dec 06, 2016 5:28 pm
|
sverx wrote I suspect it's the effect of a known nasty SDCC problem with absolute positioning in ROM - the SEGA ROM header gets overwritten by your assets in slot 1.
To avoid this, you should make sure that there's enough space left for the header to fit nicely, for instance leaving some more space in slot 1 (I see you're using a lot of it) - 16 bytes are enough.
This is my current bat file.
@echo off
set PATH="C:\Program Files\SDCC\bin";%PATH%
echo Build assets
assets2banks assets --bank1size=24972
@if %errorlevel% NEQ 0 goto :EOF
sdcc -c -mz80 bank1.c
@if %errorlevel% NEQ 0 goto :EOF
sdcc -c -mz80 bank2.c
@if %errorlevel% NEQ 0 goto :EOF
echo Build Main
sdcc -c -mz80 main.c
@if %errorlevel% NEQ 0 goto :EOF
echo Linking
sdcc -o output.ihx -mz80 --data-loc 0xC000 --no-std-crt0 crt0_sms.rel main.rel SMSlib.lib bank1.rel bank2.rel
@if %errorlevel% NEQ 0 goto :EOF
ihx2sms output.ihx output.sms
|
|
|
- Joined: 05 Sep 2013
- Posts: 3827
- Location: Stockholm, Sweden
|
Posted: Tue Dec 06, 2016 7:12 pm
|
4th line:
assets2banks assets --bank1size=24972
try reducing that bank1size value - or avoid using bank1 altogether.
edit: in the linking you also forgot to add a location for your bank2 data:
-Wl-b_BANK2=0x8000
and that might be another reason for your header not appearing.
|
|
|
- Joined: 28 May 2015
- Posts: 118
|
Posted: Tue Dec 06, 2016 7:38 pm
|
sverx wrote 4th line:
assets2banks assets --bank1size=24972
try reducing that bank1size value - or avoid using bank1 altogether.
edit: in the linking you also forgot to add a location for your bank2 data:
-Wl-b_BANK2=0x8000
and that might be another reason for your header not appearing.
I did, but it's required me to use 24972, do to it being too small to fit the tilemap.
If i add the ""-Wl-b_BANK2=0x8000" into the build, i get this error.
Linking
ASlink-Warning-No definition of area _BANK2
|
|
|
- Joined: 28 May 2015
- Posts: 118
|
Posted: Tue Dec 06, 2016 8:22 pm
|
I fixed it. This is the bat now.
set PATH="C:\Program Files\SDCC\bin";%PATH%
echo Build assets
assets2banks assets --bank1size=24972
@if %errorlevel% NEQ 0 goto :EOF
sdcc -c -mz80 --constseg BANK2 bank2.c
@if %errorlevel% NEQ 0 goto :EOF
echo Build Main
sdcc -c -mz80 main.c
@if %errorlevel% NEQ 0 goto :EOF
echo Linking
sdcc -o output.ihx -mz80 --data-loc 0xC000 -Wl-b_BANK2=0x8000 --no-std-crt0 crt0_sms.rel main.rel SMSlib.lib bank1.rel bank2.rel
@if %errorlevel% NEQ 0 goto :EOF
ihx2sms output.ihx output.sms
|
|
|