Giter Site home page Giter Site logo

Comments (2)

aralbrec avatar aralbrec commented on May 18, 2024

I've finished incorporating the kit into z88dk but it still needs testing. I have not done anything about GG or SC1000 targeting because I'm not sure yet if these machine variations are better served by an independent target.

The kit is configured by editing z88dk/libsrc/_DEVELOPMENT/target/sms/config_devkitSMS.m4 and then re-building the sms library by running "Winmake sms" or "make TARGET=sms" from z88dk/libsrc/_DEVELOPMENT

The kit is compatible with any crt but there is a special one selectable from the compile line with "startup=8" that places the kit's two restarts at 0x08 and 0x18. If this crt is used, the config variables "__SMSLIB_ISRST_SMSCRT0RST08" and "__SMSLIB_ISRST_SMSCRT0RST18" should be set non-zero so that C calls will be routed through the restarts. Other crts must have these set to zero so that calls are made instead of rst.

Differences from devkitSMS itself:

  • all functions are written in assembly language
  • functions are partitioned into individual source files so that they can be linked individually
  • the macros used to specify the binary headers are made inert as z88dk specifies header data via pragmas
  • the devkitSMS tools number memory banks in decimal; at this time z88dk is following sega's tech doc and is numbering banks in hexadecimal.

devkitSMS also has a few tools associated with it to help create .sms files from sdcc's minimal output. z88dk is able to create sms files directly from the compile line so these are not necessary. One tool that might nevertheless be useful is "assets2banks" that will try to distribute data to different memory banks compactly. In z88dk it's very easy to manually assign code and data to banks but there is no automatic assignment like this tool performs.

I will be committing some examples in the course of testing.

Typical compile lines:

sccz80:
zcc +sms -vn -startup=8 -clib=new -O3 test.c -o test -create-app -pragma-include:zpragma.inc

sdcc:
zcc +sms -vn -startup=8 -clib=sdcc_iy -SO3 --max-allocs-per-node200000 test.c -o test -create-app -pragma-include:zpragma.inc

where zpragma.inc contains pragmas defining various options. An example here:

// Standard SMS Header

#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              // ignored; rom size is always set to 32k

// SDSC Header - not generated if no SDSC pragmas are present

#pragma output   SDSC_HDR_VERSION     = 1046
#pragma output   SDSC_HDR_DATE        = 20160131         // if omitted current date is used
#pragma redirect SDSC_HDR_AUTHOR      = _author
#pragma redirect SDSC_HDR_NAME        = _name
#pragma redirect SDSC_HDR_DESCRIPTION = _description

// Change ORG Address of Banks - the default for all banks is 0x8000
// You would not normally change anything; this is an example only

#pragma output   CRT_ORG_BANK_05      = 0x4000           // BANKS are defined from 02 through 1F in hex

In the SDSC header above, "author", "name" and "description" must be const character strings defined in the program.

from z88dk.

aralbrec avatar aralbrec commented on May 18, 2024

Move the bugfixing activity to #145

from z88dk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.