Changes
FIOLIB
,Converts character to upper case.
</pre>
This is a small example program, that shows how to use the '''FIOLIB''':
<pre>
/*
FTEST.C - 03.02.2005 - 174 Lines
FTEST.C is to show how to write programs for
the Amstrad CPC under FutureOS in Small-C.
compile (under CP/M):
A>cc -M ftest
A>zmac ftest=ftest
A>zlink ftest=fiolib,ftest,printf1
A>comfu ftest
COMFU.COM converts FTEST.COM to FTEST.SMC
by appending an 128 byte FutureOS header.
*/
#include fiolib.h
#include printf1.h
main()
{
char s[80];
int n,l,h;
mode(1);
pen1(1);
ink(16,068);
plot(270,040);
plot(279,043);
plot(288,046);
plot(297,049);
plot(306,052);
plot(315,055);
move(018,180);
draw(306,153);
pen1(2);
draw(072,135);
plot(270,033);
plot(279,028);
plot(288,024);
plot(297,021);
plot(306,019);
plot(315,018);
move(009,009);
draw(019,192);
move(029,009);
draw(039,192);
move(049,009);
draw(059,192);
move(069,009);
draw(079,192);
move(089,009);
draw(099,192);
move(109,009);
draw(119,192);
move(129,009);
draw(139,192);
move(149,009);
draw(159,192);
move(160,100);
circle(12);
move(200,110);
circle(18);
move(240,120);
circle(24);
move(280,130);
circle(30);
pen1(1);
printf("Hello, world\n\nThis is a test");
printf(" for the\nCPC Small-C library\n");
printf("\nby TFM of FutureSoft\n");
pen1(2);
printf("\nlet's write ... in pen 2\n");
printf("\nLook at variables H and L: high=%d, low=%d\n",h,l);
pen1(3);
printf("\nPress a KEY to continue\n");
getchar();
pen1(0);
printf("\nHi, this is a number: %d\n",12345);
pen1(1);
puts("This is a 0 terminated string.");
printf("\nPress any key to show 64 x 32 mode 2");
getkey(&n);
mode(2);
s64x32();
pen2(2);
printf("The pressed KEY was: %d\n",n);
pen2(3);
printf("\nPress a key again");
getkey(&n);
pen2(4);
printf("\nThe pressed KEY was: %d\n",n);
move(018,198);
draw(504,180);
draw(072,153);
printf("\nNow the screen has 64 columns");
printf(" in every line.....................");
pen2(1);
printf("And there are 99 lines");
pen2(0);
printf("\nAnd there are 32 lines");
locate(36,9);
printf("X <-- function: LOCATE(36,9)\n\n");
puts("Please enter a text string: ");
gets(s);
puts("\n\n\nAnd now edit the string: ");
edst(s);
printf("\n\n\nPress any key to resize to 80 x 25 mode 2\n\n");
plot(190,090);
plot(199,093);
plot(208,096);
plot(217,099);
plot(226,102);
plot(235,105);
plot(190,081);
plot(199,082);
plot(208,083);
plot(217,084);
plot(226,085);
plot(235,086);
move(160,100);
circle(12);
move(200,110);
circle(18);
move(240,120);
circle(24);
move(280,130);
circle(30);
getchar();
cls();
s80x25();
ink(16,084);
printf("Well, that's the END for today...\n\n");
}
</pre>
== Weblinks ==
* FIOLIB and demo applications: http://www.colorado-boys-muenchen.de/users/futureos/files/FIO.zip