Download a Nightly Build: http://nightly.z88dk.org/
Latest Successful Build: http://www.z88dk.org/forum/viewforum.php?id=19
Starting with the August 31 build, the Sega Master System is a supported target using +sms on the compile line.
The target defines a main rom executable up to 48k in size located from address 0x0000 through 0xbffff. 8k ram is available from 0xc000 through 0xdffff. By default the stack is correctly placed at the top of this ram area leaving space for the memory mapped paging registers. The z80's page 0 is filled with standard crt code implementing the restarts and im1/nmi interrupt routines. By default these entry points act like nops but can be customized for each compile (see the embedded target description for details: http://www.z88dk.org/wiki/doku.php?id=l ... embedded). All new c lib targets are based on the embedded target so information from this link will be useful until an sms-specific page is written.
In addition to the main 48k rom occupying banks 0,1 (normally the main rom will not exceed 32k but it is allowed to extend up to 48k into bank 2 with warnings), the target defines 16k sections BANK_02 through BANK_1F in uppercase hex. Code and data can be placed in those banks through appropriate assignment to those sections. This means the target is capable of creating up to 512k cartridges.
-create-app has been implemented to automatically compile an sms project into a rom .sms file up to 512k in size. -create-app will optionally insert sega and sdsc header information into the rom when the .sms file is built. The header information is given through pragmas. -create-app will also report free ram and rom space in each bank.
A small example project can be seen here detailing how an sms program might be built:
https://drive.google.com/open?id=0B6XhJ ... 0YxZ2dHd2M
The project has a pragma file "pragma.inc" which contains all the compile-time options and the header information pragmas. All possible header pragmas are shown in this example but any can be omitted. The project list files list what needs to be compiled by zcc. "proj.lst" is the main list file used to generate the final binary. "proj-05.lst" lists c code that will be assigned to bank 5. How these are used to produce the final .sms file can be seen at the top of "test.c". The c files listed in "proj-05.lst" are first compiled to an object file using a modified code segment (BANK_05). Then the object file(s) generated are listed in the main project "proj.lst" to make them part of the output binary.
The September 2 build of z88dk will contains important changes to zcc that will make it easy to compile many files to .o or .asm files in a single zcc invocation, which will be very helpful for the sms target.
What is missing:
(1) an "arch/sms.h" include that defines hardware port address and memory mapped registers.
(2) sms-specific documentation
(3) a decision on how to handle stdin and stdout
(1) will come soon, (2) a little later.
The classic c lib already supports the sms target. I am not sure how solid it is as it was made before z88dk could properly generate rom files. However it does support printf by writing tiles representing letters to screen. The new c lib could do this as well but it is also capable of windows; in a game environment it may be useful to be able to customize the window size in order to print messages in speech bubbles. stdin is a problem for a games console without keyboard. An uncommon keyboard peripheral was made but for a standard sms it may still be possible to enter text in a way similar to how arcades enter initials but possibly with selection of words instead. So these elements are still undecided as there are no prior examples in the sms community.
To allow text printing, the classic c lib actually implements someone's sms game library. The new c lib has left game-engine specific code out so that the programmer can provide his own code. This may include 3rd party supplied library code like what is in the classic c lib or devkitSMS, a more recent development.
Try the SMS target. If it gets attention we'll try to develop it further.
New features and project activity between releases
1 post • Page 1 of 1