Difference between revisions of "CPCRSlib"

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search
(Sources of projects using z88dk and cpcrslib)
Line 58: Line 58:
 
== Sources of projects using z88dk and cpcrslib ==
 
== Sources of projects using z88dk and cpcrslib ==
  
* [http://cpcrulez.fr/zip/index.php?download=nanako-srcs Nanako Descends to Hell]
+
*[http://espsoft.amstrad.es/?p=151 Small Games for Smart Minds] by ESP Soft.
* [http://cpcrulez.fr/zip/index.php?download=nanako2-srcs Nanako in Classic Japanese Monster Castle]
+
*[http://espsoft.amstrad.es/?p=180 Mariano The Dragon] by ESP Soft.
* [http://cpcrulez.fr/zip/index.php?download=coding_src-Platformer_Medley_block_1 Mari Stormbringer Plateform Medley #1 ]
+
*[http://cpcrulez.fr/zip/index.php?download=nanako-srcs Nanako Descends to Hell] by The Mojon Twins
 +
*[http://cpcrulez.fr/zip/index.php?download=nanako2-srcs Nanako in Classic Japanese Monster Castle] by The Mojon Twins
 +
*[http://cpcrulez.fr/zip/index.php?download=coding_src-Platformer_Medley_block_1 Mari Stormbringer Plateform Medley #1] by The Mojon Twins
 +
*Sort'em by LuBlu Entertainment.
 +
*[http://www.mojontwins.com/?page_id=171 Phantomas Thales #1: Marsport] by The Mojon Twins.
 +
*[http://www.mojontwins.com/juegos_mojonos/cheril-of-the-bosque-cpc/ Cheril of the Bosque] by The Mojon Twins.
 +
*[http://www.mojontwins.com/juegos_mojonos/lala-prologue-cpc/ Lala Prologue] by The Mojon Twins.
 +
*[http://cpcfreak.cpc-live.com/ Blue Angel 69] by Kevin Thacker.
 +
 
  
 
[[Category:Programming]] [[Category:C]][[Category:CrossDev]]
 
[[Category:Programming]] [[Category:C]][[Category:CrossDev]]

Revision as of 08:36, 24 October 2012

CPCRSlib is a C library containing routines and functions that allow to the handling of sprites and tile-mapping in Amstrad CPC.

The library is written to be used with Z88DK compiler or with SDCC complier. CPCRSlib also incorporates keyboard routines to redefine and to detect keys, as well as general routines to change to the screen mode or the colours.

It can be found an explanation of each function/routine included in the library in http://www.amstrad.es/programacion/cpcrslib.html

Last release of the library can be downloaded at: code.google.com/p/cpcrslib/downloads/list

CPCWYZlib is included in the downloadable package of CPCRSlib. CPCWYZlib includes a music player and SFX player coded by WYZ, which can play music created with WYZTracker.

installation

On Ubuntu Lucid Lynx :

cd cpcrslib/
z80asm -v -xcpcrslib.lib @cpcrslib.lst
sudo cp cpcrslib.lib /usr/share/z88dk/lib/clibs/
sudo cp cpcrslib.h /usr/share/z88dk/include

now it should work.

Usage

A classic "Hello world" from cpcrslib :

#include "cpcrslib.h"	// CPC Library

int main(void) {
	cpc_PrintStr("Hello World!");
	while (!cpc_AnyKeyPressed()) {	}
	return 0;
}

You should provide a zcc_opt.def in the source directory :

	DEFINE DEFINED_myzorg
	defc myzorg = 16384

IF !NEED_appstartup
	DEFINE	NEED_appstartup
	defc reqpag = 32
	defc NEED_expanded = 1
ENDIF

Compile the contents by running the compiler, pre-processor and linker in one go by typing:

zcc +cpc -create-app -make-app -O3 -unsigned -o hello.bin hello.c -lcpcrslib -lndos -zorg=16384

you'll have a hello.cpc file ready to be run on your CPC.

Sources of projects using z88dk and cpcrslib