mirror of
https://github.com/cc65/cc65.git
synced 2024-11-18 00:07:21 +00:00
9f2d27d9c1
The Lynx target can't build the usual versions because its library doesn't have conio output and stdio.
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
/* Atari Lynx version of samples/hello.c, using TGI instead of conio */
|
|
|
|
#include <tgi.h>
|
|
|
|
|
|
/*****************************************************************************/
|
|
/* Data */
|
|
/*****************************************************************************/
|
|
|
|
static const char Text[] = "Hello world!";
|
|
|
|
|
|
/*****************************************************************************/
|
|
/* Code */
|
|
/*****************************************************************************/
|
|
|
|
void main (void)
|
|
{
|
|
unsigned int XMax, YMax;
|
|
|
|
tgi_install (tgi_static_stddrv);
|
|
tgi_init ();
|
|
|
|
/* Set screen color. */
|
|
tgi_setcolor (TGI_COLOR_WHITE);
|
|
|
|
/* Clear the screen. */
|
|
tgi_clear();
|
|
|
|
/* Ask for the screen size. */
|
|
XMax = tgi_getmaxx ();
|
|
YMax = tgi_getmaxy ();
|
|
|
|
/* Draw a frame around the screen. */
|
|
tgi_line (0, 0, XMax, 0);
|
|
tgi_lineto (XMax, YMax);
|
|
tgi_lineto (0, YMax);
|
|
tgi_lineto (0, 0);
|
|
|
|
/* Write the greeting in the middle of the screen. */
|
|
tgi_outtextxy ((tgi_getxres () - tgi_gettextwidth (Text)) / 2,
|
|
(tgi_getyres () - tgi_gettextheight (Text)) / 2, Text);
|
|
}
|