Banks 00 and 01 are understood to be the 32k fixed memory portion of the executable. 8k ram sits at 0xc000. Other banks are 16k and can be mapped in the 0x8000-0xbffff range. I've named the banks "BANK_02" through "BANK_01F" in hex. If files of the name "foo_BANK_xx.bin" are found in the output directory, these are assumed to be extra 16k banks that should be added to the output binary. Any kind of padding caused by missing banks or banks not filling the full 16k is automatically added.
I've also added pragmas to customize sms header information. A simple example that shows all the customizable header elements follows.
Reference for the header info can be found here:
http://www.smspower.org/Development/ROMHeader
http://www.smspower.org/Development/SDSCHeader
Code: Select all
#pragma output SMS_HDR_PRODUCT_CODE = 107026
#pragma output SMS_HDR_VERSION = 1
#pragma output SMS_HDR_REGION = 0x3
#pragma output SMS_HDR_ROM_SIZE = 0x1
#pragma output SDSC_HDR_VERSION = 1046
#pragma output SDSC_HDR_DATE = 20160131
#pragma redirect SDSC_HDR_AUTHOR = _author
#pragma redirect SDSC_HDR_NAME = _name
#pragma redirect SDSC_HDR_DESCRIPTION = _description
#include <stdio.h>
const char author[] = "z88dk";
const char name[] = "Awesome Game";
const char description[] = "A game of awesomeness.";
char buf[100];
void main(void)
{
sprintf(buf, "Hello World\n");
}
The SDSC header is a recent addition by the hobbyist scene. If none of the SDSC pragmas are defined, the SDSC header is not inserted. All header elements have default values and the default value for the date is the date of the compile.
The new c lib's sms target is based on the embedded target (info at http://www.z88dk.org/wiki/doku.php?id=l ... t_embedded ), as are all new c lib targets. Sms programs need control of interrupt routines and restarts and the mechanism defined for the embedded target will work for sms programs. I have not defined any defaults in the new c lib because these seem to vary from program to program. The classic c lib is using someone's sms library to define those things for all compiles. I'm using devkitSMS as a contrasting example.
If anyone has example code for the sms written using the classic c lib, could you check that create-app still produces running code for it?
------------------------------------------------------------------------------