Difference between revisions of "CPCRSlib"
(added category) |
|||
Line 8: | Line 8: | ||
[[CPCWYZlib|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|WYZTracker]]. | [[CPCWYZlib|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|WYZTracker]]. | ||
+ | |||
+ | == installation == | ||
+ | |||
+ | On Ubuntu Lucid Lynx : | ||
+ | |||
+ | <pre> | ||
+ | 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 | ||
+ | </pre> | ||
+ | |||
+ | now it should work. | ||
+ | |||
+ | == usage == | ||
+ | |||
+ | <pre> | ||
+ | #include "cpcrslib.h" // CPC Library | ||
+ | |||
+ | int main(void) { | ||
+ | cpc_PrintStr("Hello World!"); | ||
+ | while (!cpc_AnyKeyPressed()) { } | ||
+ | return 0; | ||
+ | } | ||
+ | </pre> | ||
+ | |||
+ | Compile the contents by running the compiler, pre-processor and linker in one go by typing: | ||
+ | |||
+ | <pre> | ||
+ | zcc +cpc -create-app -make-app -O3 -unsigned -o hello.bin hello.c -lcpcrslib -lndos -zorg=16384 | ||
+ | </pre> | ||
+ | |||
+ | you'll have a hello.cpc file ready to be run on your CPC. | ||
[[Category:Programming]] [[Category:C]][[Category:CrossDev]] | [[Category:Programming]] [[Category:C]][[Category:CrossDev]] |
Revision as of 10:09, 11 August 2010
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. 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
#include "cpcrslib.h" // CPC Library int main(void) { cpc_PrintStr("Hello World!"); while (!cpc_AnyKeyPressed()) { } return 0; }
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.