Compare commits

...

25 commits

Author SHA1 Message Date
Michael Hope 50a602383a Pull the version directly from git. 2015-01-10 21:49:00 +01:00
Michael Hope 51613ec605 Bump the version. 2015-01-10 21:36:06 +01:00
Michael Hope 1ec424f4e2 Added a travis-ci.org build config. 2015-01-10 21:32:20 +01:00
Michael Hope 0196eac7dc Added a Docker script to build in a clean VM. 2015-01-10 21:26:25 +01:00
Michael Hope 684a30b299 Added a build-dep rule for Debian machines. 2015-01-10 21:16:48 +01:00
Michael Hope ff61cf5601 Modernise the binary tarball command. 2015-01-10 20:54:56 +01:00
Michael Hope 637da8d677 Pulled maccer into the top level build. 2015-01-10 20:48:29 +01:00
Michael Hope 947e10906d Make the install prefix overridable. 2015-01-10 20:45:13 +01:00
Michael Hope bf945bdc26 Renamed getline() to getline_() so it doesn't collide with libc. 2015-01-10 20:21:18 +01:00
Michael Hope 584c3e5ef5 Fixed the build by moving -lm to the end of the ld command.
Don't generate the API documentation by default.
2015-01-10 20:06:03 +01:00
Michael Hope 2c782e0b62 Imported maccer 0.25. 2015-01-10 20:04:02 +01:00
Michael Hope 105215819f Removed an auto-generated file. 2015-01-10 19:28:17 +01:00
Michael Hope 105a361908 Ensure we have a bin/ directory. 2015-01-10 19:25:28 +01:00
Michael Hope af8c3fd0b7 Renamed getline() to getline_() to remove the conflict with the builtin getline(). 2015-01-10 18:59:29 +01:00
Michael Hope 87e88b6377 Rename getline() to getline_() so we don't conflict with the builtin getline(). 2015-01-10 18:57:12 +01:00
Michael Hope 83ff071c62 Fix the copy command by removing the explicit $MANUAL path. 2015-01-10 18:55:39 +01:00
Michael Hope f4ce5ce439 Removed generated files. 2015-01-10 18:01:58 +01:00
Michael Hope 01da2d884e Added a .gitignore. 2015-01-10 17:13:19 +01:00
Michael Hope 6a90b129b7 Update the YACC script to work with bison 3.0. 2015-01-10 17:09:22 +01:00
Michael Hope bf5cebfdd7 Update the lexer to match flex 2.5. 2015-01-10 17:08:13 +01:00
Michael Hope 64db604da9 Remove the generated lexer and yaccer from the tree. 2015-01-10 16:58:05 +01:00
Michael Hope f551cdb3c0 Pull the host architecture from the dpkg.
Default the build architecture to the host architecture.
2015-01-10 16:57:08 +01:00
Michael Hope 09a290dd78 Imported gbdk-2.96a. 2015-01-10 16:25:09 +01:00
Michael Hope 7ee938a8ae Imported gbdk-2.95-2. 2015-01-10 16:25:09 +01:00
Michael Hope 42b070e5e9 Imported gbdk-2.95. 2015-01-10 16:25:08 +01:00
1957 changed files with 195302 additions and 185405 deletions

5
.travis.yml Normal file
View file

@ -0,0 +1,5 @@
language: c
install:
- sudo apt-get update -qq
- sudo make build-dep
script: make

192
Makefile Normal file
View file

@ -0,0 +1,192 @@
# Top level Makefile for GBDK that combines the builds for sdcc,
# gbdk-lib, and gbdk-support
#
# 2001 Michael Hope <michaelh@juju.net.nz>
# $Id: Makefile,v 1.4 2001/11/04 18:43:51 michaelh Exp $
#
TOPDIR = $(shell pwd)
# Package name, used for tarballs and cvs
PKG = gbdk
# Version, used for tarballs
VER ?= $(shell git describe --tags --always | sed "s/^$(PKG)-//")
# Prefix to add to the standard tools. Usefull for a standard gcc
# cross-compile.
TOOLSPREFIX =
TARGETCC = $(TOOLSPREFIX)gcc
TARGETRANLIB = $(TOOLSPREFIX)ranlib
TARGETAR = $(TOOLSPREFIX)ar
TARGETCXX = $(TOOLSPREFIX)g++
TARGETSTRIP = $(TOOLSPREFIX)strip
# Add extra flags here. g++ 2.95.4 requires -fdollars-in-identifiers
TARGETCXXFLAGS =
# Directory containing the source to sdcc
SDCCDIR = $(TOPDIR)/sdcc
# Directory containing the source to gbdk-lib
GBDKLIBDIR = $(TOPDIR)/gbdk-lib
# Directory containing the source to gbdk-support
GBDKSUPPORTDIR = $(TOPDIR)/gbdk-support
# Directory containing the source to maccer
MACCERDIR = $(TOPDIR)/maccer
# Base setup
# Extension to add to executables
EXEEXTENSION =
# Host operating system identifier. The one below should work for
# most systems.
HOSTOS := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
# Target operating system identifier. Used in the output zip name.
TARGETOS = $(HOSTOS)
# Directory that gbdk should finally end up in
TARGETDIR = /opt/gbdk
# Directory that gbdk for this target is built into.
BUILDDIR = $(TOPDIR)/build/$(TARGETOS)/gbdk
# Intermediates directory
INTDIR = $(TOPDIR)/tmp
NOISELOG = $(TOPDIR)/noise.log
all: native-build
clean: sdcc-clean gbdk-support-clean gbdk-lib-clean maccer-clean
distclean: clean build-dir-clean
# Cross-compilation targets
FIXUPMASKS = *.c *.h .bat *.s ChangeLog README
build-dep:
sudo apt-get install -y build-essential bison flex
native-build: gbdk-build gbdk-install
cross-clean: sdcc-clean gbdk-support-clean
cross-build: gbdk-build gbdk-install cross-cleanup
cross-cleanup:
ifdef MSDOSLINEENDS
for i in $(FIXUPMASKS); do \
find $(BUILDDIR) -name $$i -exec unix2dos {} \; ; \
done
endif
cross-linux-mingw32-build:
$(MAKE) TARGETOS=i586-mingw32msvc \
TOOLSPREFIX=i586-mingw32msvc- \
EXEEXTENSION=.exe \
CROSSCOMPILING=1 \
MSDOSLINEENDS=1 \
TARGETDIR=/sdcc \
ARCHIVETYPE=zip \
cross-build gbdk-lib-examples-makefile binary
# Source code drop
src: clean
rm -rf gbdk
mkdir -p gbdk
cp -r Makefile sdcc gbdk-lib gbdk-support gbdk
rm -rf `find gbdk -name CVS`
tar czf gbdk-$(VER).tar.gz gbdk
# Base rules
gbdk-build: sdcc-build gbdk-support-build gbdk-lib-build
gbdk-install: sdcc-install gbdk-support-install gbdk-lib-install
# Directories
build-bin-dir:
mkdir -p $(BUILDDIR)/bin
build-dir-clean:
rm -r $(BUILDDIR)
# Rules for sdcc
SDCCCONFIGUREFLAGS = \
--disable-mcs51-port \
--disable-avr-port \
--disable-ds390-port \
--disable-pic-port \
--disable-i186-port \
--disable-tlcs900h-port \
--disable-ucsim \
--disable-device-lib-build \
--disable-packihx
SDCCCONFIGUREFLAGS += \
--prefix=$(TARGETDIR) \
--program-suffix=$(EXEEXTENSION)
sdcc-build: $(SDCCDIR)/sdccconf.h
$(MAKE) -C $(SDCCDIR) SDCC_SUB_VERSION=$(PKG)-$(VER)
$(SDCCDIR)/sdccconf.h:
cd $(SDCCDIR); CC=$(TARGETCC) CXX=$(TARGETCXX) STRIP=$(TARGETSTRIP) RANLIB=$(TARGETRANLIB) CXXFLAGS=$(TARGETCXXFLAGS) ./configure $(SDCCCONFIGUREFLAGS) --host=$(HOSTOS)
sdcc-install: sdcc-build build-bin-dir
rm -rf $(INTDIR)/sdcc
$(MAKE) -C $(SDCCDIR) install prefix=$(INTDIR)/sdcc
cp $(INTDIR)/sdcc/bin/sdcc* $(INTDIR)/sdcc/bin/sdcpp* $(INTDIR)/sdcc/bin/link-* $(INTDIR)/sdcc/bin/as-* $(BUILDDIR)/bin
# PENDING: Hack below
sdcc-clean:
-$(MAKE) -C $(SDCCDIR) distclean
touch $(SDCCDIR)/doc/holder.pdf
# Rules for gbdk-support
gbdk-support-build:
$(MAKE) -C $(GBDKSUPPORTDIR)/lcc TOOLSPREFIX=$(TOOLSPREFIX) TARGETDIR=$(TARGETDIR)/
gbdk-support-install: gbdk-support-build build-bin-dir
cp $(GBDKSUPPORTDIR)/lcc/lcc $(BUILDDIR)/bin/lcc$(EXEEXTENSION)
$(TARGETSTRIP) $(BUILDDIR)/bin/lcc*
cp $(GBDKSUPPORTDIR)/README $(GBDKSUPPORTDIR)/ChangeLog $(BUILDDIR)
gbdk-support-clean:
$(MAKE) -C $(GBDKSUPPORTDIR)/lcc clean
# Rules for gbdk-lib
gbdk-lib-build: maccer-build
ifndef CROSSCOMPILING
PATH=$(PATH):$(INTDIR)/host $(MAKE) -C $(GBDKLIBDIR)/libc PORTS=gbz80 PLATFORMS=gb SDCCLIB=$(SDCCDIR)
endif
gbdk-lib-install: gbdk-lib-build
cp -r $(GBDKLIBDIR)/libc $(GBDKLIBDIR)/include $(GBDKLIBDIR)/examples $(GBDKLIBDIR)/tools $(BUILDDIR)
rm -rf $(BUILDDIR)/lib
cp -r $(GBDKLIBDIR)/build $(BUILDDIR)/lib
gbdk-lib-clean:
$(MAKE) -C $(GBDKLIBDIR) clean
gbdk-lib-examples-makefile:
$(MAKE) -C $(BUILDDIR)/examples/gb make.bat
unix2dos $(BUILDDIR)/examples/gb/make.bat
maccer-build:
$(MAKE) -C $(MACCERDIR) install PREFIX=$(INTDIR)/host
maccer-clean:
$(MAKE) -C $(MACCERDIR) clean
# Final binary
binary: binary-tidyup
ifeq ($(ARCHIVETYPE),zip)
rm -f $(TOPDIR)/gbdk-$(VER)-$(TARGETOS).zip
cd $(BUILDDIR)/..; zip -9Xrq $(TOPDIR)/gbdk-$(VER)-$(TARGETOS).zip gbdk
else
rm -f gbdk-$(VER)-$(TARGETOS).tar.xz
tar caf gbdk-$(VER)-$(TARGETOS).tar.xz -C $(BUILDDIR)/.. gbdk
endif
binary-tidyup:
rm -rf `find $(BUILDDIR) -name CVS`
# Install
install: native-build
mkdir -p $(TARGETDIR)
cp -r $(BUILDDIR)/* $(TARGETDIR)

View file

@ -1,5 +0,0 @@
/Makefile/1.1/Mon Feb 21 02:04:36 2000//Tgbdk-294
/Makefile.common/1.7/Sun Mar 5 22:11:32 2000//Tgbdk-294
D/examples////
D/include////
D/libc////

View file

@ -1 +0,0 @@
gbdk-lib

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

6
gbdk-lib/ChangeLog Normal file
View file

@ -0,0 +1,6 @@
2001-11-03 Michael Hope <michaelh@juju.net.nz>
* examples/gb/gb-dtmf/gb-dtmf.c (main): Changed printf to %u as the arg was a int.
* examples/gb/ram_fn.c (print_counter): Made ANSI compliant.

View file

@ -1,4 +1,11 @@
# Common settings
ifndef ASM
ASM = asxxxx
endif
ifndef MODEL
MODEL = small
endif
ifndef PORTS
PORTS = gbz80 z80
@ -11,14 +18,22 @@ ifndef SDCCLIB
SDCCLIB = /home/michaelh/projects/sdcc
endif
SCC = $(SDCCLIB)/bin/sdcc
GBCC = $(SDCCLIB)/bin/lcc
SCC = $(SDCCLIB)/bin/sdcc
GBCC = $(SDCCLIB)/bin/lcc
AS_Z80 = $(SDCCLIB)/bin/as-z80
ifeq ($(RGBDS),1)
AS_GBZ80 = rgbasm
else
AS_GBZ80 = $(SDCCLIB)/bin/as-gbz80
endif
CLEANSPEC = *.o *.asm *.cdb *.sym *.lst *~
CLEANSPEC = *.o *.cdb *.sym *.lst *~ *.asm
# Maccer rule
%.s: %.ms
maccer -o $@ $<
CFLAGS = -I$(TOPDIR)/include --model-$(MODEL)
CFLAGS += -m$(PORT) -DGBDK=1
CC = $(SCC)
BUILD = $(TOPDIR)/build/$(MODEL)/$(ASM)/$(THIS)
LIB = $(BUILD)/$(THIS).lib
OBJ = $(CSRC:%.c=$(BUILD)/%.o) $(ASSRC:%.s=$(BUILD)/%.o)

View file

@ -1 +0,0 @@
D/gb////

View file

@ -1 +0,0 @@
gbdk-lib/examples

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,23 +0,0 @@
/Makefile/1.11/Wed Apr 19 02:56:04 2000//Tgbdk-294
/bank_0.c/1.2/Thu Apr 6 04:13:52 2000//Tgbdk-294
/bank_1.c/1.2/Thu Apr 6 04:13:52 2000//Tgbdk-294
/bank_2.c/1.2/Thu Apr 6 04:13:52 2000//Tgbdk-294
/bank_3.c/1.2/Thu Apr 6 04:13:52 2000//Tgbdk-294
/banks.c/1.2/Thu Apr 6 04:13:52 2000//Tgbdk-294
/comm.c/1.1/Wed Feb 23 02:49:17 2000//Tgbdk-294
/filltest.c/1.1/Wed Feb 23 02:49:17 2000//Tgbdk-294
/fonts.c/1.1/Wed Feb 23 02:49:17 2000//Tgbdk-294
/fprpn.c/1.1/Wed Feb 23 02:49:17 2000//Tgbdk-294
/galaxy.c/1.4/Sun Mar 5 22:11:32 2000//Tgbdk-294
/irq.c/1.1/Wed Feb 23 02:49:17 2000//Tgbdk-294
/paint.c/1.3/Sun Feb 27 22:54:33 2000//Tgbdk-294
/ram_fn.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/rand.c/1.3/Wed Apr 19 02:56:04 2000//Tgbdk-294
/rpn.c/1.1/Wed Feb 23 02:49:17 2000//Tgbdk-294
/samptest.c/1.1/Wed Feb 23 02:49:17 2000//Tgbdk-294
/sound.c/1.1/Wed Feb 23 02:49:17 2000//Tgbdk-294
/space.s/1.1/Wed Feb 23 02:49:17 2000//Tgbdk-294
D/colorbar////
D/dscan////
D/gb-dtmf////
D/tests////

View file

@ -1 +0,0 @@
gbdk-lib/examples/gb

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,4 +1,4 @@
CC = ../../bin/lcc -Wa-l -Wl-m -Wl-j -DUSE_SFR_FOR_REG
CC = ../../bin/lcc -Wa-l -Wl-m -Wl-j
BINS = galaxy.gb \
space.gb \
@ -19,7 +19,8 @@ OTHER = sound.gb \
all: $(BINS)
make.bat: Makefile
make -sn | sed y/\\//\\\\/ | grep -v make > make.bat
echo "REM Automatically generated from Makefile" > make.bat
make -sn | sed y/\\//\\\\/ | grep -v make >> make.bat
%.o: %.c
$(CC) -c -o $@ $<

View file

@ -0,0 +1,92 @@
TOPDIR= ../..
CC= $(TOPDIR)/bin/sdcc -mgbz80 --asm=rgbds -I$(TOPDIR)/include -v
GBLIB = $(TOPDIR)/lib/rgbds
LIB = $(GBLIB)/gbz80/gbz80.lib $(GBLIB)/gb/gb.lib
CRT0 = $(GBLIB)/gb/crt0.o
BINS = \
galaxy.gb \
paint.gb \
rpn.gb \
rand.gb \
comm.gb \
irq.gb \
filltest.gb \
fonts.gb \
samptest.gb
# sound.gb: Cant do bitfields
OTHER = sound.gb \
banks.gb \
ram_fn.gb
all: $(BINS)
make.bat: Makefile
make -sn | sed y/\\//\\\\/ | grep -v make > make.bat
%.o: %.s
%.asm: %.s
astorgb.pl $< > $@
%.o: %.c
$(CC) -c $<
%.s: %.c
$(CC) -S $<
%.o: %.asm
rgbasm -o$@ $<
%.gb: %.o
$(CC) $(CRT0) $< $(LIB)
cp a.gb $@
rgbfix -p -v $@
clean:
rm -f *.o *.lst *.map *.gb *~ *.rel *.cdb *.ihx *.lnk *.sym *.asm
############################################################
# Multiple bank example
# Compile bank 0 (no ROM)
# RAM bank 0 : -Wf-ba0
#
bank_0.o: bank_0.c
$(CC) -Wf-ba0 -c -o $@ $<
# Compile bank 1 (ROM+RAM)
# ROM bank 1 : -Wf-bo1
# RAM bank 1 : -Wf-ba1
#
bank_1.o: bank_1.c
$(CC) -Wf-bo1 -Wf-ba1 -c -o $@ $<
# Compile bank 2 (ROM+RAM)
# ROM bank 2 : -Wf-bo2
# RAM bank 2 : -Wf-ba2
#
bank_2.o: bank_2.c
$(CC) -Wf-bo2 -Wf-ba2 -c -o $@ $<
# Compile bank 3 (ROM+RAM)
# ROM bank 3 : -Wf-bo3
# RAM bank 3 : -Wf-ba3
#
bank_3.o: bank_3.c
$(CC) -Wf-bo3 -Wf-ba3 -c -o $@ $<
# Link banks
# ROM+MBC1+RAM : -Wl-yt2
# 4 ROM banks : -Wl-yo4
# 4 RAM banks : -Wl-ya4
#
banks.gb: banks.o bank_0.o bank_1.o bank_2.o bank_3.o
$(CC) -Wl-yt2 -Wl-yo4 -Wl-ya4 -o $@ banks.o bank_0.o bank_1.o bank_2.o bank_3.o
############################################################
# RAM function example
ram_fn.gb: ram_fn.o
$(CC) -Wl-g_inc_ram=0xD000 -Wl-g_inc_hiram=0xFFA0 -o $@ ram_fn.o

View file

@ -3,7 +3,7 @@
int var_1; /* In external RAM bank 1 */
void bank_1() /* In ROM bank 1 */
void bank_1() NONBANKED /* In ROM bank 1 */
{
puts("I'm in ROM bank 1");
}

View file

@ -3,7 +3,7 @@
int var_2; /* In external RAM bank 2 */
void bank_2() /* In ROM bank 2 */
void bank_2() NONBANKED /* In ROM bank 2 */
{
puts("I'm in ROM bank 2");
}

View file

@ -3,7 +3,7 @@
int var_3; /* In external RAM bank 3 */
void bank_3() /* In ROM bank 3 */
void bank_3() NONBANKED /* In ROM bank 3 */
{
puts("I'm in ROM bank 3");
}

View file

@ -0,0 +1,38 @@
SRC = main.c bank2.c bank3.c
BIN = banked.gb
TOPDIR = ../../..
GBLIB = $(TOPDIR)/lib/medium/rgbds
LIB = $(GBLIB)/gbz80/gbz80.lib $(GBLIB)/gb/gb.lib
CRT0 = $(GBLIB)/gb/crt0.o
OBJ = $(SRC:.c=.o)
CC = $(TOPDIR)/bin/sdcc -mgbz80 --asm=rgbds -I $(TOPDIR)/include
all: $(BIN)
clean:
rm $(OBJ)
%.o: %.s
$(BIN): $(OBJ)
$(CC) -v $(CRT0) $(OBJ) $(LIB)
rgbfix -p -v a.gb
$(LIB): $(LIBOBJ)
xlib $@ a $(LIBOBJ)
%.o: %.c
$(CC) -c $<
%.asm: %.s
astorgb.pl $< > $@
%.o: %.asm
rgbasm -o$@ $<
%.s: %.ms
maccer -o $@ $<

View file

@ -0,0 +1,9 @@
#ifndef BANK_INCLUDE
#define BANK_INCLUDE
#include <stdio.h>
int bank2(int i) BANKED;
void bank3(void) BANKED;
#endif

View file

@ -0,0 +1,13 @@
#include "bank.h"
#pragma bank=2
int bank2(int i) BANKED
{
int j;
puts(" In bank 2");
for (j=0; j<i; j++) {
bank3();
}
return 2;
}

View file

@ -0,0 +1,8 @@
#include "bank.h"
#pragma bank=3
void bank3(void) BANKED
{
puts(" In bank 3!");
}

View file

@ -0,0 +1,10 @@
#include "bank.h"
int main(void)
{
puts("Testing 1,2,3...");
puts("Calling bank2()");
bank2(3);
puts("Back to main()");
return 0;
}

View file

@ -1,3 +1,6 @@
/** Note that this example is a bit old. Try BANKED and NONBANKED
as in banked/
*/
#include <gb/gb.h>
#include <stdio.h>
@ -7,11 +10,11 @@ extern int var_1; /* In external RAM bank 1 */
extern int var_2; /* In external RAM bank 2 */
extern int var_3; /* In external RAM bank 3 */
void bank_1();
void bank_2();
void bank_3();
void bank_1() NONBANKED;
void bank_2() NONBANKED;
void bank_3() NONBANKED;
void bank_fixed()
void bank_fixed(void) NONBANKED
{
puts("I'm in fixed ROM");
}
@ -22,11 +25,13 @@ void print_var(UBYTE bank)
printf("Var_%u is %u\n");
}
void main()
void main(void)
{
puts("Program Start...");
ENABLE_RAM_MBC1;
SWITCH_4_32_MODE_MBC1;
var_internal = 1;
SWITCH_RAM_MBC1(0);
var_0 = 2;

View file

@ -1,10 +0,0 @@
/Makefile/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/bar_c.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/bar_c.gbr/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/bar_c.h/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/bar_m.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/bar_m.gbm/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/bar_m.h/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/colorbar.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/make.bat/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
D

View file

@ -1 +0,0 @@
gbdk-lib/examples/gb/colorbar

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,4 +1,4 @@
CC = ../../../bin/lcc -Wa-l -Wl-m -v
CC = ../../../bin/lcc -Wa-l -Wl-m
CFLAGS = -DGBDK_2_COMPAT

View file

@ -1,12 +1,12 @@
#include <gb/gb.h>
#include <stdio.h>
char *str = "Hello World!";
const char * str = "Hello World!";
char buffer[32];
void main()
void main(void)
{
UBYTE i, j, n = 0;
UBYTE i, n = 0;
char *s;
puts("Byte");

View file

@ -1,14 +0,0 @@
/Makefile/1.4/Wed Apr 19 02:56:04 2000//Tgbdk-294
/bkg.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/bkg.gbr/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/bkg.h/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/bkg_c.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/bkg_c.gbm/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/bkg_m.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/bkg_m.gbm/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/dscan.c/1.3/Wed Apr 5 03:45:18 2000//Tgbdk-294
/fore.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/fore.gbr/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/fore.h/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/make.bat/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
D

View file

@ -1 +0,0 @@
gbdk-lib/examples/gb/dscan

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,4 +1,4 @@
CC = ../../../bin/lcc -Wa-l -Wl-m -DUSE_SFR_FOR_REG
CC = ../../../bin/lcc -Wa-l -Wl-m
BINS = dscan.gb

View file

@ -430,7 +430,7 @@ void player()
/* bombs */
void bombs()
{
volatile UBYTE i;
UBYTE i;
for( i=0; i<MAX_TT; i++ ) {
if( tf[i] != 0 ) {

View file

@ -4,7 +4,7 @@
#include <gb/gb.h>
#include <gb/drawing.h>
void main()
void main(void)
{
UBYTE a,b,c,d,e;
c=0;

View file

@ -322,7 +322,7 @@ const unsigned char door4_tiles[] = {
};
/* Should really be const, but sdcc doesnt yet support it. */
const unsigned char *film[] = {
const unsigned char * const film[] = {
&door1_tiles[0x0C*0],
&door2_tiles[0x0C*0],
&door3_tiles[0x0C*0],
@ -366,10 +366,10 @@ const unsigned char *film[] = {
#define OPENED 0x02
#define CLOSING 0x03
UBYTE time; /* Global "time" value (counter) */
static UBYTE time; /* Global "time" value (counter) */
UBYTE doorstate; /* State of the door (OPENED, CLOSED...) */
UBYTE doorpos; /* Current position in the door animation */
UBYTE color; /* Current color for fading effect */
static UBYTE color; /* Current color for fading effect */
UBYTE sframe; /* Current frame of the sprite */
fixed bposx, bposy; /* Background position (fixed point) */
fixed bspx, bspy; /* Background speed (fixed point) */
@ -536,8 +536,8 @@ void main()
SCX_REG = 0;
bposy.w = 0;
SCY_REG = 0;
bspx.w = 0xFF00UL;
bspy.w = 0x0080UL;
bspx.w = 0xFF00;
bspy.w = 0x0080;
/* Initialize the window */
set_win_data(0x80, 0x21, frame_data);
@ -561,18 +561,18 @@ void main()
wposy.b.h = MAXWNDPOSY;
wposy.b.l = 0;
WY_REG = MAXWNDPOSY;
wspx.w = 0xFF80UL;
wspy.w = 0xFFC0UL;
wspx.w = 0xFF80;
wspy.w = 0xFFC0;
/* Initialize the sprite */
set_sprite_data(0x00, 0x1C, earth_data);
set_sprite_prop(0, 0x00);
set_sprite_prop(1, 0x00);
sframe = 0;
sposx.w = 0x1000U;
sposy.w = 0x1000U;
sspx.w = 0x0040UL;
sspy.w = 0x0040UL;
sposx.w = 0x1000;
sposy.w = 0x1000;
sspx.w = 0x0040;
sspy.w = 0x0040;
tile_sprite();
place_sprite();
@ -591,22 +591,22 @@ void main()
i = joypad();
if(i & J_B) {
if(i & J_UP)
bspy.w -= 0x0010UL;
bspy.w -= 0x0010;
if(i & J_DOWN)
bspy.w += 0x0010UL;
bspy.w += 0x0010;
if(i & J_LEFT)
bspx.w -= 0x0010UL;
bspx.w -= 0x0010;
if(i & J_RIGHT)
bspx.w += 0x0010UL;
bspx.w += 0x0010;
} else if(i & J_A) {
if(i & J_UP)
wspy.w -= 0x0010UL;
wspy.w -= 0x0010;
if(i & J_DOWN)
wspy.w += 0x0010UL;
wspy.w += 0x0010;
if(i & J_LEFT)
wspx.w -= 0x0010UL;
wspx.w -= 0x0010;
if(i & J_RIGHT)
wspx.w += 0x0010UL;
wspx.w += 0x0010;
} else {
if(i & J_SELECT)
color = STARTFADE;
@ -619,13 +619,13 @@ void main()
doorpos = NBDFRAMES;
}
if(i & J_UP)
sspy.w -= 0x0010UL;
sspy.w -= 0x0010;
if(i & J_DOWN)
sspy.w += 0x0010UL;
sspy.w += 0x0010;
if(i & J_LEFT)
sspx.w -= 0x0010UL;
sspx.w -= 0x0010;
if(i & J_RIGHT)
sspx.w += 0x0010UL;
sspx.w += 0x0010;
}
}
}

View file

@ -1,16 +0,0 @@
/Makefile/1.3/Thu Mar 9 04:49:04 2000//Tgbdk-294
/brk_btn.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/brk_btn.gbr/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/cursor.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/cursor.gbr/1.1/Wed Feb 23 02:50:14 2000//Tgbdk-294
/dtmf_lcd.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/dtmf_lcd.gbr/1.1/Wed Feb 23 02:50:15 2000//Tgbdk-294
/frm_lcd.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/frm_lcd.gbr/1.1/Wed Feb 23 02:50:15 2000//Tgbdk-294
/gb-dtmf.c/1.3/Thu Mar 9 04:49:04 2000//Tgbdk-294
/key_num.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/key_num.gbr/1.1/Wed Feb 23 02:50:15 2000//Tgbdk-294
/make.bat/1.1/Wed Feb 23 02:50:15 2000//Tgbdk-294
/prs_btn.c/1.2/Sun Mar 5 22:11:32 2000//Tgbdk-294
/prs_btn.gbr/1.1/Wed Feb 23 02:50:15 2000//Tgbdk-294
D

View file

@ -1 +0,0 @@
gbdk-lib/examples/gb/gb-dtmf

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -374,7 +374,7 @@ void clr_disp()
/*
CAUTION: Don't display the NULL code
*/
void disp(char str[MAX_DTMF])
void disp(const char *str)
{
UBYTE no, left_pos;
UBYTE i, start_ch, end_ch;
@ -543,7 +543,7 @@ void main()
char str_ms[10];
/* PENDING: sdcc is broken and needs this to be initalised. */
key2 = 1;
key2 = 0;
/* default dialling time setting */
on_time = DTMF_ON;
@ -607,7 +607,7 @@ void main()
/* decremental button */
/* appear the delay during press A button */
if(i == 5 && (j == 1 || j == 2) && !non_flick){
sprintf(str_ms, "%lu MS", on_time);
sprintf(str_ms, "%u MS", on_time);
disp(str_ms);
non_flick = ON;
}

View file

@ -26,7 +26,7 @@ void print_counter()
cnt = tim_cnt;
enable_interrupts();
printf(" TIM %u", cnt);
printf(" TIM %u", (unsigned int)cnt);
gotoxy(9, posy());
/* Ensure mutual exclusion (not really necessary in this example)... */
@ -34,7 +34,7 @@ void print_counter()
cnt = vbl_cnt;
enable_interrupts();
printf("- VBL %u\n", cnt);
printf("- VBL %u\n", (unsigned int)cnt);
}
void main()

View file

@ -4,25 +4,30 @@
UWORD counter;
void inc()
void inc(void)
{
counter++;
}
void print_counter()
void print_counter(void)
{
printf(" Counter is %u\n", counter);
}
void main()
typedef void (*FUNPTR)(void);
void main(void)
{
extern UBYTE __inc_end, __inc_start;
/* Declare extern functions */
void inc_ram();
void inc_hiram();
void inc_ram() NONBANKED;
void inc_hiram() NONBANKED;
/* Declare pointer-to-function variables */
void (*inc_ram_var)(void) = 0xD000;
void (*inc_hiram_var)(void) = 0xFFA0;
/* With sdcc 2.3.1, you cannot cast a constant to a function pointer
without going through a typedef.
*/
FUNPTR inc_ram_var = (FUNPTR)0xD000;
FUNPTR inc_hiram_var = (FUNPTR)0xFFA0;
puts("Program Start...");
counter = 0;

View file

@ -18,16 +18,10 @@
UBYTE accu[80];
UBYTE accua[80];
UWORD seed;
void main(void)
{
UBYTE r, s, t, u;
for(r = 0; r != 80; r++) {
accu[r] = 0;
accua[r] = 0;
}
UBYTE r, s, t = 0, u = 0;
UWORD seed;
/* We use the DIV register to get a random initial seed */
puts("Getting seed");

View file

@ -20,7 +20,7 @@ void push(WORD l)
puts("Stack full");
}
WORD pop()
WORD pop(void)
{
if(sp > 0)
return stack[--sp];
@ -29,7 +29,7 @@ WORD pop()
return 0;
}
WORD top()
WORD top(void)
{
if(sp > 0)
return stack[sp-1];
@ -38,7 +38,7 @@ WORD top()
return 0;
}
BYTE read_op()
BYTE read_op(void)
{
if(pos == 0) {
gets(s);
@ -62,7 +62,7 @@ BYTE read_op()
return NUMBER;
}
void main()
void main(void)
{
BYTE type;
WORD op2;
@ -71,7 +71,7 @@ void main()
sp = 0;
pos = 0;
while((type = read_op(s)) != 0) {
while((type = read_op()) != 0) {
switch(type) {
case NUMBER:
push(n);

View file

@ -1,3 +0,0 @@
/stress.c/1.1/Wed Feb 23 02:50:15 2000//Tgbdk-294
/test-memset.c/1.1/Wed Feb 23 02:50:15 2000//Tgbdk-294
D

View file

@ -1 +0,0 @@
gbdk-lib/examples/gb/tests

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,14 +0,0 @@
/Makefile/1.1/Mon May 8 03:13:10 2000//Tgbdk-294
/ctype.h/1.3/Sun May 7 19:32:58 2000//Tgbdk-294
/gbdk-lib.h/1.2/Sun May 7 19:32:59 2000//Tgbdk-294
/libc.dox/1.1/Sun May 7 19:32:59 2000//Tgbdk-294
/rand.h/1.3/Sun May 7 19:32:59 2000//Tgbdk-294
/stdarg.h/1.1/Mon Feb 21 02:04:36 2000//Tgbdk-294
/stdio.h/1.5/Wed Apr 5 03:45:18 2000//Tgbdk-294
/stdlib.h/1.2/Sat Apr 8 01:12:46 2000//Tgbdk-294
/string.h/1.4/Wed Apr 5 03:45:18 2000//Tgbdk-294
/time.h/1.4/Thu Mar 30 05:54:39 2000//Tgbdk-294
/types.h/1.5/Sun May 7 19:32:59 2000//Tgbdk-294
D/asm////
D/consolez80////
D/gb////

View file

@ -1 +0,0 @@
gbdk-lib/include

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,3 +0,0 @@
/types.h/1.5/Sun May 7 19:32:59 2000//Tgbdk-294
D/gbz80////
D/z80////

View file

@ -1 +0,0 @@
gbdk-lib/include/asm

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,4 +0,0 @@
/provides.h/1.1/Mon Feb 21 02:04:36 2000//Tgbdk-294
/stdarg.h/1.4/Wed Apr 5 03:45:18 2000//Tgbdk-294
/types.h/1.4/Sun May 7 19:32:59 2000//Tgbdk-294
D

View file

@ -1 +0,0 @@
gbdk-lib/include/asm/gbz80

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,3 +1,4 @@
#undef USE_C_MEMCPY
#undef USE_C_STRCPY
#undef USE_C_STRCMP
#define USE_C_MEMCPY 1
#define USE_C_STRCPY 1
#define USE_C_STRCMP 1

View file

@ -9,8 +9,8 @@
the correct order.
*/
typedef char * va_list;
#define va_start(list, last) list = (char *)&last + sizeof(last)
typedef unsigned char * va_list;
#define va_start(list, last) list = (unsigned char *)&last + sizeof(last)
#define va_arg(list, type) *((type *)((list += sizeof(type)) - sizeof(type)))
#define va_end(list)

View file

@ -8,6 +8,9 @@
#error gbz80 only.
#endif
#define NONBANKED nonbanked
#define BANKED banked
/** Signed eight bit.
*/
typedef char INT8;

View file

@ -12,6 +12,14 @@
#error Unrecognised port
#endif
#ifndef NONBANKED
#define NONBANKED
#endif
#ifndef BANKED
#define BANKED
#endif
/** TRUE or FALSE.
*/
typedef INT8 BOOLEAN;

View file

@ -1,4 +0,0 @@
/provides.h/1.1/Mon Feb 21 02:04:36 2000//Tgbdk-294
/stdarg.h/1.2/Wed Feb 23 02:45:18 2000//Tgbdk-294
/types.h/1.3/Mon Feb 21 19:12:00 2000//Tgbdk-294
D

View file

@ -1 +0,0 @@
gbdk-lib/include/asm/z80

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,2 +0,0 @@
/README/1.1.1.1/Mon Feb 21 00:46:01 2000//Tgbdk-294
D

View file

@ -1 +0,0 @@
gbdk-lib/include/consolez80

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,11 +0,0 @@
/cgb.h/1.4/Sun May 7 19:33:46 2000//Tgbdk-294
/console.h/1.3/Fri Apr 28 04:47:42 2000//Tgbdk-294
/drawing.h/1.3/Fri Apr 28 04:47:42 2000//Tgbdk-294
/font.h/1.4/Fri Apr 28 04:47:42 2000//Tgbdk-294
/gb.dox/1.1/Fri Apr 28 04:47:42 2000//Tgbdk-294
/gb.h/1.6/Sun May 7 19:33:46 2000//Tgbdk-294
/hardware.h/1.4/Fri Apr 28 04:47:42 2000//Tgbdk-294
/malloc.h/1.2/Fri Apr 28 04:47:42 2000//Tgbdk-294
/sample.h/1.3/Fri Apr 28 04:47:42 2000//Tgbdk-294
/sgb.h/1.3/Fri Apr 28 04:47:42 2000//Tgbdk-294
D

View file

@ -1 +0,0 @@
gbdk-lib/include/gb

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -34,20 +34,19 @@
#define RGB_ORANGE RGB(30, 20, 0)
#define RGB_TEAL RGB(15, 15, 0)
/** Set bkg palette(s).
*/
void
set_bkg_palette(UINT8 first_palette,
UINT8 nb_palettes,
UINT16 *rgb_data);
UINT16 *rgb_data) NONBANKED;
/** Set sprite palette(s).
*/
void
set_sprite_palette(UINT8 first_palette,
UINT8 nb_palettes,
UINT16 *rgb_data);
UINT16 *rgb_data) NONBANKED;
/** Set a bkg palette entry.
*/
@ -77,7 +76,6 @@ void cpu_slow(void);
*/
void cpu_fast(void);
/** Set defaults compatible with normal GameBoy.
*/
void cgb_compatibility(void);

View file

@ -46,7 +46,7 @@
/** Print the string 'str' with no interpretation */
void
gprint(char *str);
gprint(char *str) NONBANKED;
/** Print the long number 'number' in radix 'radix'. signed_value should
be set to SIGNED or UNSIGNED depending on whether the number is signed
@ -60,7 +60,7 @@ void
/** Print the formatted string 'fmt' with arguments '...' */
INT8
gprintf(char *fmt,...);
gprintf(char *fmt,...) NONBANKED;
/** Old style plot - try plot_point() */
void
@ -72,11 +72,11 @@ void
/** I (MLH) have no idea what switch_data does... */
void
switch_data(UINT8 x, UINT8 y, unsigned char *src, unsigned char *dst);
switch_data(UINT8 x, UINT8 y, unsigned char *src, unsigned char *dst) NONBANKED;
/** Ditto */
void
draw_image(unsigned char *data);
draw_image(unsigned char *data) NONBANKED;
/** Draw a line in the current drawing mode and colour from (x1,y1) to (x2,y2) */
void

View file

@ -30,21 +30,18 @@ extern UINT8 font_ibm_fixed[];
/** Init the font system.
Should be called first.
*/
void font_init(void);
void font_init(void) NONBANKED;
/** Load the font 'font'.
Sets the current font to the newly loaded font.
*/
font_t font_load( void *font );
font_t font_load( void *font ) NONBANKED;
/** Set the current font to 'font_handle', which was returned
from an earlier font_load().
@return The previously used font handle.
*/
font_t font_set( font_t font_handle );
/** Print the same character 'show' 'num' times */
void print_repeat(char show, UINT8 num);
font_t font_set( font_t font_handle ) NONBANKED;
/* Use mode() and color() to set the font modes and colours */
@ -57,5 +54,5 @@ struct sfont_handle {
UINT8 first_tile; /* First tile used */
void *font; /* Pointer to the base of the font */
};
#endif /* __FONT_H */

View file

@ -94,26 +94,26 @@
/** Interrupt handlers
*/
typedef void (*int_handler)(void);
typedef void (*int_handler)(void) NONBANKED;
/** The remove functions will remove any interrupt
handler. A handler of NULL will cause bad things
to happen.
*/
void
remove_VBL(int_handler h);
remove_VBL(int_handler h) NONBANKED;
void
remove_LCD(int_handler h);
remove_LCD(int_handler h) NONBANKED;
void
remove_TIM(int_handler h);
remove_TIM(int_handler h) NONBANKED;
void
remove_SIO(int_handler h);
remove_SIO(int_handler h) NONBANKED;
void
remove_JOY(int_handler h);
remove_JOY(int_handler h) NONBANKED;
/** Adds a V-blank interrupt handler.
The handler 'h' will be called whenever a V-blank
@ -123,7 +123,7 @@ remove_JOY(int_handler h);
@see remove_VBL
*/
void
add_VBL(int_handler h);
add_VBL(int_handler h) NONBANKED;
/** Adds a LCD interrupt handler.
Called when the LCD interrupt occurs, which is normally
@ -141,7 +141,7 @@ add_VBL(int_handler h);
@see add_VBL
*/
void
add_LCD(int_handler h);
add_LCD(int_handler h) NONBANKED;
/** Adds a timer interrupt handler.
@ -152,7 +152,7 @@ add_LCD(int_handler h);
@see add_VBL
*/
void
add_TIM(int_handler h);
add_TIM(int_handler h) NONBANKED;
/** Adds a serial transmit complete interrupt handler.
@ -161,8 +161,9 @@ add_TIM(int_handler h);
completed on the game link port.
@see send_byte, receive_byte, add_VBL
*/
void
add_SIO(int_handler h);
add_SIO(int_handler h) NONBANKED;
/** Adds a pad tranisition interrupt handler.
@ -175,18 +176,19 @@ add_SIO(int_handler h);
times for every button release.
@see joypad
*/
void
add_JOY(int_handler h);
add_JOY(int_handler h) NONBANKED;
/* ************************************************************ */
/** Set the current mode - one of M_* defined above */
void
mode(UINT8 m);
mode(UINT8 m) NONBANKED;
/** Returns the current mode */
UINT8
get_mode(void);
get_mode(void) NONBANKED;
/** GB type (GB, PGB, CGB) */
extern UINT8 _cpu;
@ -256,6 +258,12 @@ extern UINT8 _io_out;
#define DISABLE_RAM_MBC1 \
*(unsigned char *)0x0000 = 0x00
#define SWITCH_16_8_MODE_MBC1 \
*(unsigned char *)0x6000 = 0x00
#define SWITCH_4_32_MODE_MBC1 \
*(unsigned char *)0x6000 = 0x01
/* Note the order used here. Writing the other way around
* on a MBC1 always selects bank 0 (d'oh)
*/
@ -280,7 +288,7 @@ extern UINT8 _io_out;
interrupts disabled (why nobody knows :)
*/
void
delay(UINT16 d);
delay(UINT16 d) NONBANKED;
/* ************************************************************ */
@ -290,7 +298,7 @@ delay(UINT16 d);
@see J_START
*/
UINT8
joypad(void);
joypad(void) NONBANKED;
/** Waits until all the keys given in mask are pressed.
Normally only used for checking one key, but it will
@ -298,12 +306,12 @@ joypad(void);
@see joypad, J_START
*/
UINT8
waitpad(UINT8 mask);
waitpad(UINT8 mask) NONBANKED;
/** Waits for the pad and all buttons to be released.
*/
void
waitpadup(void);
waitpadup(void) NONBANKED;
/* ************************************************************ */
@ -311,7 +319,7 @@ waitpadup(void);
@see disable_interrupts
*/
void
enable_interrupts(void);
enable_interrupts(void) NONBANKED;
/** Disables interrupts.
This function may be called as many times as you like;
@ -320,7 +328,7 @@ enable_interrupts(void);
@see enable_interrupts
*/
void
disable_interrupts(void);
disable_interrupts(void) NONBANKED;
/** Clears any pending interrupts and sets the interrupt mask
register IO to flags.
@ -328,13 +336,13 @@ disable_interrupts(void);
@param flags A logical OR of *_IFLAGS
*/
void
set_interrupts(UINT8 flags);
set_interrupts(UINT8 flags) NONBANKED;
/** Performs a warm reset by reloading the CPU value
then jumping to the start of crt0 (0x0150)
*/
void
reset(void);
reset(void) NONBANKED;
/** Waits for the vertical blank interrupt (VBL) to finish.
This can be used to sync animation with the screen
@ -343,7 +351,7 @@ reset(void);
immediatly.
*/
void
wait_vbl_done(void);
wait_vbl_done(void) NONBANKED;
/** Turns the display off.
Waits until the VBL interrupt before turning the display
@ -351,7 +359,7 @@ wait_vbl_done(void);
@see DISPLAY_ON
*/
void
display_off(void);
display_off(void) NONBANKED;
/* ************************************************************ */
@ -365,7 +373,7 @@ display_off(void);
void
hiramcpy(UINT8 dst,
const void *src,
UINT8 n);
UINT8 n) NONBANKED;
/* ************************************************************ */
@ -447,7 +455,7 @@ hiramcpy(UINT8 dst,
void
set_bkg_data(UINT8 first_tile,
UINT8 nb_tiles,
unsigned char *data);
unsigned char *data) NONBANKED;
/** Sets the tiles in the background tile table.
Starting at position x,y in tiles and writing across for w tiles
@ -468,14 +476,14 @@ set_bkg_tiles(UINT8 x,
UINT8 y,
UINT8 w,
UINT8 h,
unsigned char *tiles);
unsigned char *tiles) NONBANKED;
void
get_bkg_tiles(UINT8 x,
UINT8 y,
UINT8 w,
UINT8 h,
unsigned char *tiles);
unsigned char *tiles) NONBANKED;
/** Moves the background layer to the position specified in x and y in pixels.
Where 0,0 is the top left corner of the GB screen. You'll notice the screen
@ -483,7 +491,7 @@ get_bkg_tiles(UINT8 x,
*/
void
move_bkg(UINT8 x,
UINT8 y);
UINT8 y) NONBANKED;
/** Moves the background relative to it's current position.
@ -491,7 +499,7 @@ move_bkg(UINT8 x,
*/
void
scroll_bkg(INT8 x,
INT8 y);
INT8 y) NONBANKED;
/* ************************************************************ */
@ -503,7 +511,7 @@ scroll_bkg(INT8 x,
void
set_win_data(UINT8 first_tile,
UINT8 nb_tiles,
unsigned char *data);
unsigned char *data) NONBANKED;
/** Sets the tiles in the win tile table.
Starting at position x,y in
@ -540,14 +548,14 @@ set_win_tiles(UINT8 x,
UINT8 y,
UINT8 w,
UINT8 h,
unsigned char *tiles);
unsigned char *tiles) NONBANKED;
void
get_win_tiles(UINT8 x,
UINT8 y,
UINT8 w,
UINT8 h,
unsigned char *tiles);
unsigned char *tiles) NONBANKED;
/** Moves the window layer to the position specified in x and y in pixels.
Where 7,0 is the top left corner of the GB screen. The window is locked to
@ -556,14 +564,14 @@ get_win_tiles(UINT8 x,
*/
void
move_win(UINT8 x,
UINT8 y);
UINT8 y) NONBANKED;
/** Move the window relative to its current position.
@see move_win
*/
void
scroll_win(INT8 x,
INT8 y);
INT8 y) NONBANKED;
/* ************************************************************ */
@ -581,12 +589,12 @@ scroll_win(INT8 x,
void
set_sprite_data(UINT8 first_tile,
UINT8 nb_tiles,
unsigned char *data);
unsigned char *data) NONBANKED;
void
get_sprite_data(UINT8 first_tile,
UINT8 nb_tiles,
unsigned char *data);
unsigned char *data) NONBANKED;
/** Sets sprite n to display tile number t, from the sprite tile data.
If the GB is in 8x16 sprite mode then it will display the next
@ -595,10 +603,10 @@ get_sprite_data(UINT8 first_tile,
*/
void
set_sprite_tile(UINT8 nb,
UINT8 tile);
UINT8 tile) NONBANKED;
UINT8
get_sprite_tile(UINT8 nb);
get_sprite_tile(UINT8 nb) NONBANKED;
/** Sets the property of sprite n to those defined in p.
Where the bits in p represent:
@ -621,10 +629,10 @@ get_sprite_tile(UINT8 nb);
*/
void
set_sprite_prop(UINT8 nb,
UINT8 prop);
UINT8 prop) NONBANKED;
UINT8
get_sprite_prop(UINT8 nb);
get_sprite_prop(UINT8 nb) NONBANKED;
/** Moves the given sprite to the given position on the
screen.
@ -635,26 +643,26 @@ get_sprite_prop(UINT8 nb);
void
move_sprite(UINT8 nb,
UINT8 x,
UINT8 y);
UINT8 y) NONBANKED;
/** Moves the given sprite relative to its current position.
*/
void
scroll_sprite(INT8 nb,
INT8 x,
INT8 y);
INT8 y) NONBANKED;
/* ************************************************************ */
void
set_data(unsigned char *vram_addr,
unsigned char *data,
UINT16 len);
UINT16 len) NONBANKED;
void
get_data(unsigned char *data,
unsigned char *vram_addr,
UINT16 len);
UINT16 len) NONBANKED;
void
set_tiles(UINT8 x,
@ -662,7 +670,7 @@ set_tiles(UINT8 x,
UINT8 w,
UINT8 h,
unsigned char *vram_addr,
unsigned char *tiles);
unsigned char *tiles) NONBANKED;
void
get_tiles(UINT8 x,
@ -670,6 +678,6 @@ get_tiles(UINT8 x,
UINT8 w,
UINT8 h,
unsigned char *tiles,
unsigned char *vram_addr);
unsigned char *vram_addr) NONBANKED;
#endif /* _GB_H */

View file

@ -8,6 +8,7 @@
#include <types.h>
#if USE_SFR_FOR_REG
#error SFR is unteseted and disabled in 2.96
#define __REG extern volatile sfr UINT8

View file

@ -37,8 +37,8 @@ extern UBYTE malloc_heap_start;
extern pmmalloc_hunk malloc_first;
/** Garbage collect (join free hunks) */
void malloc_gc(void);
void malloc_gc(void) NONBANKED;
/** debug message logger */
void debug( char *routine, char *msg );
void debug( char *routine, char *msg ) NONBANKED;
#endif /* __SYS_MALLOC_H */

View file

@ -13,6 +13,6 @@
/** Play the given, appropriatly formatted sample.
*/
void
play_sample(UINT8 *start, UINT16 len);
play_sample(UINT8 *start, UINT16 len) NONBANKED;
#endif /* _SAMPLE_H */

View file

@ -1,4 +1,5 @@
PROJECT_NAME = "gbdk-lib"
OUTPUT_DIRECTORY = "../doc/libc"
RECURSIVE = yes
INPUT = .
INPUT = .
PREDEFINED = "NONBANKED= BANKED="

View file

@ -10,10 +10,10 @@
/** Initalise the random number generator.
seed needs to be different each time, else the same sequence will be
generated. A good source is the DVI register.
generated. A good source is the DIV register.
*/
void
initrand(UINT16 seed);
initrand(UINT16 seed) NONBANKED; /* Non-banked as called from asm in arand.s */
/** Returns a random value.
*/

View file

@ -18,7 +18,7 @@ void putchar(char c);
\%d (signed int), \%x (unsigned int as hex), and \%s (string).
Does not return the number of characters printed.
*/
void printf(const char *format, ...);
void printf(const char *format, ...) NONBANKED;
/** Print the string and arguments given by format to a buffer.
Currently supported: \%c (character), \%u (unsigned int),
@ -28,12 +28,12 @@ void printf(const char *format, ...);
@param str The buffer to print into.
@param format The format string as per printf.
*/
void sprintf(char *str, const char *format, ...);
void sprintf(char *str, const char *format, ...) NONBANKED;
/** puts() writes the string s and a trailing newline to std­
out.
*/
void puts(const char *s);
void puts(const char *s) NONBANKED;
/** gets() reads a line from stdin into the buffer pointed to by s until
either a terminating newline or EOF, which it replaces with '\0'. No
@ -41,4 +41,8 @@ void puts(const char *s);
*/
char *gets(char *s);
/** getchar() gets a single character from stdin.
*/
char getchar(void);
#endif

View file

@ -4,24 +4,41 @@
#ifndef STDLIB_INCLUDE
#define STDLIB_INCLUDE
#include <types.h>
/** Causes normal program termination and the value of status is
returned to the parent.
All open streams are flushed and closed.
*/
void exit(int status);
void exit(int status) NONBANKED;
#if 0
/** Compatibility function. Not implemented.
*/
int getkey(void);
#endif
/** Returns the absolute value of a int.
If i is negative, returns -i; else returns i.
*/
int abs(int i);
int atoi(const char *s);
long atol(const char *s);
char *itoa(int n, char *s);
/** Returns the absolute value of a long.
*/
long labs(long num);
/** Converts an ASCII string to an int.
The string may be of the format [\s]*[+-][\d]+[\D]* i.e. any number
of spaces, an optional + or -, then an arbitrary number of digits.
The result is undefined if the number doesnt fit in an int.
*/
int atoi(const char *s);
/** Converts an ASCII string to a long.
*/
long atol(const char *s);
/** Converts an int into a base 10 ASCII string.
*/
char *itoa(int n, char *s);
/** Converts a long into a base 10 ASCII string.
*/
char *ltoa(long n, char *s);
#endif
#endif

View file

@ -15,14 +15,14 @@
@param src Array to copy from.
@return A pointer to dest.
*/
char *strcpy(char *dest, const char *src);
char *strcpy(char *dest, const char *src) NONBANKED;
/** Compares the two strings s1 and s2.
It returns an integer less than, equal to, or greater than zero if
s1 is found, respectively, to be less than, to match, or be
greater than s2.
*/
int strcmp(const char *s1, const char *s2);
int strcmp(const char *s1, const char *s2) NONBANKED;
/** Copies n bytes from memory area src to memory area dest.
The memory areas may not overlap.
@ -32,18 +32,37 @@ int strcmp(const char *s1, const char *s2);
@param len The length in bytes of src.
@return A pointer to dest.
*/
void *memcpy(void *dest, const void *src, size_t len);
void *memcpy(void *dest, const void *src, size_t len) NONBANKED;
/** Reverses the characters in the string.
For example 'abcdefg' will become 'gfedcba'. Banked as the string
must be modifiable.
*/
char *reverse(char *s);
char *strcat(char *s1, const char *s2);
char *strcat(char *s1, const char *s2) NONBANKED;
int strlen(const char *s);
/** Calculates the length of the string, not including the terminating
`\0' character.
*/
int strlen(const char *s) NONBANKED;
char *strncat(char *s1, const char *s2, int n);
/**Concatenate s2 on the end of s1.
s1 must be large enough. At most n characters are moved.
*/
char *strncat(char *s1, const char *s2, int n) NONBANKED;
int strncmp(const char *s1, const char *s2, int n);
/** Compare strings (at most n bytes):
s1>s2: >0
s1==s2: 0
s1<s2: <0
*/
int strncmp(const char *s1, const char *s2, int n) NONBANKED;
char *strncpy(char *s1, const char *s2, int n);
/** Copy s2 to s1, truncating or null-padding to always copy n bytes.
If there is no \0 in the first n bytes of s2 then s1 will not be
null terminated.
*/
char *strncpy(char *s1, const char *s2, int n) NONBANKED;
#endif

View file

@ -21,7 +21,7 @@ typedef UINT16 time_t;
as a clock_t; to get the number of seconds used, divide by
CLOCKS_PER_SEC.
*/
clock_t clock(void);
clock_t clock(void) NONBANKED;
time_t time(time_t *t);

View file

@ -1,34 +0,0 @@
/Makefile/1.7/Wed Apr 5 03:45:18 2000//Tgbdk-294
/Makefile.platform/1.2/Tue Feb 22 04:05:50 2000//Tgbdk-294
/abs.c/1.1/Thu Mar 30 05:56:06 2000//Tgbdk-294
/atoi.c/1.1/Thu Mar 30 05:56:06 2000//Tgbdk-294
/atol.c/1.1/Thu Mar 30 05:56:06 2000//Tgbdk-294
/calloc.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/free.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/isalpha.c/1.2/Sat Mar 25 04:02:45 2000//Tgbdk-294
/isdigit.c/1.2/Sat Mar 25 04:02:45 2000//Tgbdk-294
/islower.c/1.2/Sat Mar 25 04:02:45 2000//Tgbdk-294
/isspace.c/1.2/Sat Mar 25 04:02:45 2000//Tgbdk-294
/isupper.c/1.2/Sat Mar 25 04:02:45 2000//Tgbdk-294
/itoa.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/labs.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/ltoa.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/malloc.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/printf.c/1.2/Wed Feb 23 02:45:18 2000//Tgbdk-294
/puts.c/1.1/Tue Feb 22 04:12:15 2000//Tgbdk-294
/realloc.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/reverse.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/scanf.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/strcat.c/1.1/Thu Mar 30 05:56:06 2000//Tgbdk-294
/string.c/1.1.1.1/Mon Feb 21 00:46:01 2000//Tgbdk-294
/strlen.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/strncat.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/strncmp.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/strncpy.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/time.c/1.2/Wed Apr 5 03:45:18 2000//Tgbdk-294
/tolower.c/1.2/Sat Mar 25 04:02:45 2000//Tgbdk-294
/toupper.c/1.2/Sat Mar 25 04:02:45 2000//Tgbdk-294
D/asm////
D/consolez80////
D/gb////
D/rrgb////

View file

@ -1 +0,0 @@
gbdk-lib/libc

View file

@ -1 +0,0 @@
:pserver:anonymous@cvs.gbdk.sourceforge.net:/cvsroot/gbdk

View file

@ -1 +0,0 @@
Tgbdk-294

View file

@ -1,43 +1,43 @@
# Makefile for libc
.EXPORT_ALL_VARIABLES:
TOPDIR = ..
CSRC = abs.c atoi.c atol.c isalpha.c isdigit.c \
islower.c isspace.c isupper.c itoa.c labs.c \
printf.c puts.c reverse.c scanf.c strcat.c string.c \
strlen.c strncat.c strncmp.c strncpy.c time.c \
tolower.c toupper.c \
_modulong.c _modslong.c _divulong.c _divslong.c _mullong.c
# free.c malloc.c realloc.c calloc.c ltoa.c
include $(TOPDIR)/Makefile.common
LIBC_OBJ = abs.o atoi.o atol.o isalpha.o isdigit.o \
islower.o isspace.o isupper.o itoa.o labs.o ltoa.o \
printf.o puts.o reverse.o scanf.o strcat.o string.o \
strlen.o strncat.o strncmp.o strncpy.o time.o \
tolower.o toupper.o
# free.o malloc.o realloc.o calloc.o
CFLAGS = -I$(TOPDIR)/include
CFLAGS += -m$(PORT) -v
CC = $(SCC)
all: ports platforms
clean: port-clean ports-clean platform-clean
ports:
for i in $(PORTS); do make port PORT=$$i; done
for i in $(PORTS); do make port THIS=$$i PORT=$$i; done
platforms:
for i in $(PLATFORMS); do make -C $$i platform PLAT=$$i; done
for i in $(PLATFORMS); do make -C $$i platform THIS=$$i; done
# Make all the std libs
# Make all the port specific libs
port: port-clean $(LIBC_OBJ)
mkdir -p $(TOPDIR)/build/$(PORT)
cp $(LIBC_OBJ) $(TOPDIR)/build/$(PORT)
cd $(TOPDIR)/build/$(PORT); ls $(LIBC_OBJ) > $(PORT).lib
# Uses the LIB <- OBJ rule from Makefile.rules
port: port-clean $(LIB)
make -C asm/$(PORT) port
port-clean:
rm -f $(LIBC_OBJ) $(CLEANSPEC)
ports-clean:
for i in $(PORTS); do make -C asm/$$i clean PORT=$$i; done
for i in $(PORTS); do make -C asm/$$i clean THIS=$$i; done
platform-clean:
for i in $(PLATFORMS); do make -C $$i clean PLAT=$$i; done
include Makefile.rules

Some files were not shown because too many files have changed in this diff Show more