mkit: as: fix signedness issue when loading map files

Adding signed header bytes to calculate sizes fails for values > 127.
Reported by ArtemioUrbina. Fixes issue #1, part 1.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
mkit: as: fix loading of maps in which the BODY chunk is last

Reported and fixed by ArtemioUrbina. Fixes issue #1, part 2.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
samples: add sample game

Derived from the tutorial at http://obeybrew.com/tutorials.html

If you can contribute more appropriate graphics and (especially) sound
effects, please do so.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: main.c: include startup/globals at the appropriate time

Before this commit, startup.asm and globals.h were included at a time when
parsing of the first .c file had already started. This worked with the
assembly file because it does not depend on the C parser, but broke
horribly when there was a globals.h file.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: main.c: use assembler specified in environment variable PCE_PCEAS

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
test: mk: use PCE_PCEAS to allow tests to run without installing first

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: accept C files with a capital C

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: io.c: print error message on invalid file type

Exiting silently is less than helpful...

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: setvdc(), scroll(): fix stack pointer arithmetic with -msmall

Small stack code assumes the high byte of the stack pointer is fixed at
0x3f. These functions incorrectly used 16-bit arithmetic to clean their
arguments from the stack, causing the high byte to increment to 0x40 if
the stack is empty afterwards.

Fixes issue #3.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
samples: added scroll sample

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
malloc.c: add init function __malloc_init2 with fewer parameters

This simpler interface saves bytes in the initialization code.

Part of fix for issue #2.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: save bytes in ovlentry, load_cd_ovl

To make overlay entry and CD error handler fit in the space before the
boot code even with data and heap initialization.

Part of fix for issue #2.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: startup.asm: pad initialization code to avoid irq handler shift

The overlay entry code does not re-initialize the interrupt handlers,
making it necessary to have them all in one place and thus to pad the
code if there is no data or heap initialization.

Final part of fix for issue #2.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
isolink: Makefile: add dependency on overlay.h

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
test: added non-automated overlay test

Test suite emulator TGEmu does not support CDs...

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
SGX/AC: common code changes

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: import Arcade Card library

This needed a few touch-ups. Most importantly, all code has been moved
from LIB2_BANK to LIB3_BANK.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: provide LIB3_BANK for both SGX and ACD

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: import SuperGrafx library

This is difficult to move out of LIB2_BANK because it has dependencies.

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>
huc: macro.inc: clean up new maplibfunc* macros

- rename maplibfunc2 -> maplibfunc_y, explain
- save two bytes in maplibfunc_y
- remove maplibfunc3 (unused)

Signed-off-by: Ulrich Hecht <ulrich.hecht@gmail.com>