ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
point_at.c File Reference
#include "../../ugbc.h"

Go to the source code of this file.

Functions

void point_at (Environment *_environment, int _x, int _y)
 Emit ASM code for POINT AT ([int],[int]).
void point_at_vars (Environment *_environment, char *_x, char *_y)
 Emit ASM code for POINT AT ([int]x,[int]x).

Function Documentation

◆ point_at()

void point_at ( Environment * _environment,
int _x,
int _y )

Emit ASM code for POINT AT ([int],[int]).

This function outputs a code that draws a pixel on the screen in bitmap mode on coordinates given explicitly and directly as integers.

Precondition
Bitmap must be enabled at least once with instruction BITMAP ENABLE.
Parameters
_environmentCurrent calling environment
_xAbscissa of the point to draw
_yOrdinate of the point
Exceptions
EXIT_FAILURE"CRITICAL: POINT AT (xxx,xxx) needs BITMAP ENABLE"

Definition at line 54 of file point_at.c.

◆ point_at_vars()

void point_at_vars ( Environment * _environment,
char * _x,
char * _y )

Emit ASM code for POINT AT ([int]x,[int]x).

This function outputs a code that draws a pixel on the screen in bitmap mode on coordinates given explicitly and directly as integers. To do this, it calculates both the position in memory where it will draw and the offset within the byte, storing this information in the following special variables:

  • pen_address - offset in memory that refers to the pixel to be modified
Precondition
Bitmap must be enabled at least once with instruction BITMAP ENABLE.
Parameters
_environmentCurrent calling environment
_xExpression with the abscissa of the point to draw
_yExpression with the ordinate of the point
Exceptions
EXIT_FAILURE"CRITICAL: POINT AT (xxx,xxx) needs BITMAP ENABLE"

Definition at line 78 of file point_at.c.