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

Go to the source code of this file.

Functions

void colormap_at (Environment *_environment, int _address)
 Emit ASM implementation for COLORMAP AT [int]x instruction.
void colormap_at_var (Environment *_environment, char *_address)
 Emit ASM implementation for COLORMAP AT [expression] instruction.
void colormap_clear_with (Environment *_environment, int _foreground, int _background)
 Emit ASM implementation for COLORMAP CLEAR WITH [int]x ON [int]x instruction.
void colormap_clear_with_vars (Environment *_environment, char *_foreground, char *_background)
 Emit ASM implementation for COLORMAP CLEAR WITH [expression] ON [expression] instruction.
void colormap_clear (Environment *_environment)
 Emit ASM implementation for COLORMAP CLEAR instruction.

Function Documentation

◆ colormap_at()

void colormap_at ( Environment * _environment,
int _address )

Emit ASM implementation for COLORMAP AT [int]x instruction.

Emit ASM implementation for COLORMAP AT [int] instruction.

This function allows you to set the starting address, in memory, for the colormap and it is the version that is used when the memory is given as a direct number (i.e.: $2000). The input parameter is decoded and declined according to the hardware limits. So it is not said that exactly the given address is set.

On some machine calling this instruction will define the special variable:

  • colormapAddress (VT_ADDRESS) - the starting address of colormap memory
Parameters
_environmentCurrent calling environment
_addressAddress to use

Definition at line 60 of file colormap.c.

◆ colormap_at_var()

void colormap_at_var ( Environment * _environment,
char * _address )

Emit ASM implementation for COLORMAP AT [expression] instruction.

This function allows you to set the starting address, in memory, for the colormap and it is the version that is used when the memory is given as an expression. The input parameter is decoded and declined according to the hardware limits. So it is not said that exactly the given address is set.

On some machine calling this instruction will define the special variable:

  • colormapAddress (VT_ADDRESS) - the starting address of colormap memory
Parameters
_environmentCurrent calling environment
_addressAddress to use

Definition at line 88 of file colormap.c.

◆ colormap_clear()

void colormap_clear ( Environment * _environment)

Emit ASM implementation for COLORMAP CLEAR instruction.

This function is called when you want to generate code that erases the entire color map, using the default foreground and background color.

Precondition
Bitmap must be enabled at least once with instruction BITMAP ENABLE.
Parameters
_environmentCurrent calling environment
Exceptions
EXIT_FAILURE"CRITICAL: COLORMAP CLEAR WITH xxx AND xxx needs BITMAP ENABLED"

Definition at line 182 of file colormap.c.

◆ colormap_clear_with()

void colormap_clear_with ( Environment * _environment,
int _foreground,
int _background )

Emit ASM implementation for COLORMAP CLEAR WITH [int]x ON [int]x instruction.

Emit ASM implementation for COLORMAP CLEAR WITH [int] ON [int] instruction.

This function is called when you want to generate code that erases the entire color map, using a foreground and a background color. This function is useful if the color indices are given as integers.

Precondition
Bitmap must be enabled at least once with instruction BITMAP ENABLE.
Parameters
_environmentCurrent calling environment
_foregroundIndex of foreground color
_backgroundIndex of background color
Exceptions
EXIT_FAILURE"COLORMAP CLEAR WITH xxx ON xxx needs BITMAP ENABLED"

Definition at line 115 of file colormap.c.

◆ colormap_clear_with_vars()

void colormap_clear_with_vars ( Environment * _environment,
char * _foreground,
char * _background )

Emit ASM implementation for COLORMAP CLEAR WITH [expression] ON [expression] instruction.

This function is called when you want to generate code that erases the entire color map, using a foreground and a background color. This function is useful if the color indices are given as integers.

Precondition
Bitmap must be enabled at least once with instruction BITMAP ENABLE.
Parameters
_environmentCurrent calling environment
_foregroundExpression for index of foreground color
_backgroundExpression for index of background color
Exceptions
EXIT_FAILURE"CRITICAL: COLORMAP CLEAR WITH xxx AND xxx needs BITMAP ENABLED"

Definition at line 144 of file colormap.c.