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

Go to the source code of this file.

Macros

#define CGA_REG_HZ_TOTAL   0x00
#define CGA_REG_HZ_DISP   0x01
#define CGA_REG_HZ_SYNC_POS   0x02
#define CGA_REG_HZ_SYNC_WIDTH   0x03
#define CGA_REG_VT_TOTAL   0x04
#define CGA_REG_VT_TOTAL_ADJUST   0x05
#define CGA_REG_VT_VERT_TOTAL_ADJUST   0x06
#define CGA_REG_VT_VERT_SYNC_POSITION   0x07
#define CGA_REG_INTERLACE_MODE   0x08
#define CGA_REG_MAX_SCAN_LINE_ADDRESS   0x09
#define CGA_REG_CURSOR_START   0x0a
#define CGA_REG_CURSOR_END   0x0b
#define CGA_REG_START_ADDRESS_H   0x0c
#define CGA_REG_START_ADDRESS_L   0x0d
#define CGA_REG_CURSOR_ADDRESS_H   0x0e
#define CGA_REG_CURSOR_ADDRESS_L   0x0f
#define CGA_REG_LPEN_ADDRESS_H   0x10
#define CGA_REG_LPEN_ADDRESS_L   0x11
#define WRITE_REGISTER(r, v)
#define CGA_COLOR_BLUE   0x01
#define CGA_COLOR_GREEN   0x02
#define CGA_COLOR_RED   0x04
#define CGA_COLOR_LIGHT   0x08
#define CGA_COLOR_LIGHT2   0x10
#define CGA_COLOR_CSET1   0x00
#define CGA_COLOR_CSET2   0x20
#define WRITE_COLOR_SELECT_REGISTER(v)
#define CGA_MODE_80x25   0x01
#define CGA_MODE_40x25   0x00
#define CGA_MODE_GRAPHIC   0x02
#define CGA_MODE_TEXT   0x00
#define CGA_MODE_BW   0x04
#define CGA_MODE_COLOR   0x00
#define CGA_MODE_ENABLE   0x08
#define CGA_MODE_DISABLE   0x00
#define CGA_MODE_HIRES   0x10
#define CGA_MODE_LORES   0x00
#define CGA_MODE_BLINK   0x20
#define CGA_MODE_NOBLINK   0x00
#define WRITE_MODE_CONTROL_REGISTER(v)
#define BIOS_VIDEO_MODE(m)

Functions

RGBiCGA_image_nearest_system_color (RGBi *_color)
Variablecga_collision (Environment *_environment, char *_sprite)
void cga_hit (Environment *_environment, char *_sprite_mask, char *_result)
 CGA: emit code to check for collision
void cga_border_color (Environment *_environment, char *_border_color)
 CGA: emit code to change border color
void cga_background_color (Environment *_environment, int _index, int _background_color)
 CGA: emit code to change background color
void cga_background_color_vars (Environment *_environment, char *_index, char *_background_color)
 CGA: emit code to change background color
void cga_background_color_semivars (Environment *_environment, int _index, char *_background_color)
 CGA: emit code to change background color
void cga_background_color_get_vars (Environment *_environment, char *_index, char *_background_color)
 CGA: emit code to retrieve background color
void cga_sprite_common_color (Environment *_environment, char *_index, char *_common_color)
 CGA: emit code to change common sprite's color
void cga_raster_at (Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
 CGA: emit code to set raster irq
void cga_next_raster (Environment *_environment)
 CGA: emit code to wait for next raster irq
void cga_next_raster_at (Environment *_environment, char *_label, char *_positionlo, char *_positionhi)
 CGA: emit code to wait for next raster irq at different position
void cga_bank_select (Environment *_environment, int _bank)
int cga_screen_mode_enable (Environment *_environment, ScreenMode *_screen_mode)
void console_calculate (Environment *_environment)
void console_calculate_vars (Environment *_environment)
void cga_bitmap_enable (Environment *_environment, int _width, int _height, int _colors)
void cga_bitmap_disable (Environment *_environment)
void cga_tilemap_enable (Environment *_environment, int _width, int _height, int _colors, int _tile_width, int _tile_height)
void cga_bitmap_at (Environment *_environment, char *_address)
void cga_colormap_at (Environment *_environment, char *_address)
void cga_textmap_at (Environment *_environment, char *_address)
void cga_pset_int (Environment *_environment, int _x, int _y, int *_c)
void cga_pset_vars (Environment *_environment, char *_x, char *_y, char *_c)
void cga_pget_color_vars (Environment *_environment, char *_x, char *_y, char *_result)
void cga_screen_on (Environment *_environment)
void cga_screen_off (Environment *_environment)
void cga_screen_rows (Environment *_environment, char *_rows)
void cga_screen_columns (Environment *_environment, char *_columns)
void cga_sprite_data_set (Environment *_environment, char *_sprite, char *_address)
void cga_sprite_data_from (Environment *_environment, char *_sprite, char *_image)
void cga_sprite_enable (Environment *_environment, char *_sprite)
void cga_sprite_disable (Environment *_environment, char *_sprite)
void cga_sprite_at (Environment *_environment, char *_sprite, char *_x, char *_y)
void cga_sprite_expand_vertical (Environment *_environment, char *_sprite)
void cga_sprite_expand_horizontal (Environment *_environment, char *_sprite)
void cga_sprite_compress_vertical (Environment *_environment, char *_sprite)
void cga_sprite_compress_horizontal (Environment *_environment, char *_sprite)
void cga_sprite_multicolor (Environment *_environment, char *_sprite)
void cga_sprite_monocolor (Environment *_environment, char *_sprite)
void cga_sprite_color (Environment *_environment, char *_sprite, char *_color)
void cga_sprite_priority (Environment *_environment, char *_sprite, char *_priority)
void cga_tiles_at (Environment *_environment, char *_address)
void cga_vertical_scroll (Environment *_environment, char *_displacement)
void cga_horizontal_scroll (Environment *_environment, char *_displacement)
void cga_busy_wait (Environment *_environment, char *_timing)
void cga_get_width (Environment *_environment, char *_result)
void cga_tiles_get (Environment *_environment, char *_result)
void cga_get_height (Environment *_environment, char *_result)
void cga_cls (Environment *_environment)
void cga_cls_box (Environment *_environment, char *_x1, char *_y1, char *_w, char *_h)
void cga_scroll_text (Environment *_environment, int _direction, int _overlap)
void cga_text (Environment *_environment, char *_text, char *_text_size, int _raw)
void cga_initialization (Environment *_environment)
void cga_finalization (Environment *_environment)
void cga_hscroll_line (Environment *_environment, int _direction, int _overlap)
void cga_hscroll_screen (Environment *_environment, int _direction, int _overlap)
void cga_back (Environment *_environment)
void cga_cline (Environment *_environment, char *_characters)
int cga_image_size (Environment *_environment, int _width, int _height, int _mode)
Variablecga_sprite_converter (Environment *_environment, char *_source, int _width, int _height, int _depth, RGBi *_color, int _slot_x, int _slot_y)
Variablecga_image_converter (Environment *_environment, char *_data, int _width, int _height, int _depth, int _offset_x, int _offset_y, int _frame_width, int _frame_height, int _mode, int _transparent_color, int _flags)
void cga_blit_image (Environment *_environment, char *_sources[], int _source_count, char *_blit, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _flags)
void cga_put_image (Environment *_environment, Resource *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_flags)
void cga_wait_vbl (Environment *_environment)
Variablecga_new_image (Environment *_environment, int _width, int _height, int _mode)
Variablecga_new_images (Environment *_environment, int _frames, int _width, int _height, int _mode)
Variablecga_new_sequence (Environment *_environment, int _sequences, int _frames, int _width, int _height, int _mode)
void cga_get_image (Environment *_environment, char *_image, char *_x, char *_y, char *_frame, char *_sequence, int _frame_size, int _frame_count, int _palette)
void cga_scroll (Environment *_environment, int _dx, int _dy)
void cga_put_tile (Environment *_environment, char *_tile, char *_x, char *_y)
void cga_move_tiles (Environment *_environment, char *_tile, char *_x, char *_y)
void cga_put_tiles (Environment *_environment, char *_tile, char *_x, char *_y, char *_w, char *_h)
void cga_tile_at (Environment *_environment, char *_x, char *_y, char *_result)
void cga_use_tileset (Environment *_environment, char *_tileset)
Variablecga_get_raster_line (Environment *_environment)
void cga_move_memory_video (Environment *_environment, char *_from, char *_to, char *_size)
void cga_move_video_memory (Environment *_environment, char *_from, char *_to, char *_size)
void cga_colors_vars (Environment *_environment, char *_foreground_color, char *_background_color)
void cga_slice_image (Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
void cga_slice_image_copy (Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
void cga_slice_image_extract (Environment *_environment, char *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_destination)
int cga_palette_extract (Environment *_environment, char *_data, int _width, int _height, int _depth, int _flags, RGBi *_palette)
void cga_calculate_sequence_frame_offset (Environment *_environment, char *_offset, char *_sequence, char *_frame, int _frame_size, int _frame_count)
void cga_flip_image (Environment *_environment, Resource *_image, char *_frame, char *_sequence, int _frame_size, int _frame_count, char *_direction)
void cga_screen (Environment *_environment, char *_x, char *_y, char *_c)

Variables

int lastUsedSlotInCommonPalette = 0

Macro Definition Documentation

◆ BIOS_VIDEO_MODE

#define BIOS_VIDEO_MODE ( m)
Value:
outline1("MOV AX, 0x%4.4x", m ) \
outline0("INT 0x10")
#define outline1(s, a)
Definition ugbc.h:4253

Definition at line 143 of file cga.c.

◆ CGA_COLOR_BLUE

#define CGA_COLOR_BLUE   0x01

Definition at line 109 of file cga.c.

◆ CGA_COLOR_CSET1

#define CGA_COLOR_CSET1   0x00

Definition at line 114 of file cga.c.

◆ CGA_COLOR_CSET2

#define CGA_COLOR_CSET2   0x20

Definition at line 115 of file cga.c.

◆ CGA_COLOR_GREEN

#define CGA_COLOR_GREEN   0x02

Definition at line 110 of file cga.c.

◆ CGA_COLOR_LIGHT

#define CGA_COLOR_LIGHT   0x08

Definition at line 112 of file cga.c.

◆ CGA_COLOR_LIGHT2

#define CGA_COLOR_LIGHT2   0x10

Definition at line 113 of file cga.c.

◆ CGA_COLOR_RED

#define CGA_COLOR_RED   0x04

Definition at line 111 of file cga.c.

◆ CGA_MODE_40x25

#define CGA_MODE_40x25   0x00

Definition at line 122 of file cga.c.

◆ CGA_MODE_80x25

#define CGA_MODE_80x25   0x01

Definition at line 121 of file cga.c.

◆ CGA_MODE_BLINK

#define CGA_MODE_BLINK   0x20

Definition at line 136 of file cga.c.

◆ CGA_MODE_BW

#define CGA_MODE_BW   0x04

Definition at line 127 of file cga.c.

◆ CGA_MODE_COLOR

#define CGA_MODE_COLOR   0x00

Definition at line 128 of file cga.c.

◆ CGA_MODE_DISABLE

#define CGA_MODE_DISABLE   0x00

Definition at line 131 of file cga.c.

◆ CGA_MODE_ENABLE

#define CGA_MODE_ENABLE   0x08

Definition at line 130 of file cga.c.

◆ CGA_MODE_GRAPHIC

#define CGA_MODE_GRAPHIC   0x02

Definition at line 124 of file cga.c.

◆ CGA_MODE_HIRES

#define CGA_MODE_HIRES   0x10

Definition at line 133 of file cga.c.

◆ CGA_MODE_LORES

#define CGA_MODE_LORES   0x00

Definition at line 134 of file cga.c.

◆ CGA_MODE_NOBLINK

#define CGA_MODE_NOBLINK   0x00

Definition at line 137 of file cga.c.

◆ CGA_MODE_TEXT

#define CGA_MODE_TEXT   0x00

Definition at line 125 of file cga.c.

◆ CGA_REG_CURSOR_ADDRESS_H

#define CGA_REG_CURSOR_ADDRESS_H   0x0e

Definition at line 99 of file cga.c.

◆ CGA_REG_CURSOR_ADDRESS_L

#define CGA_REG_CURSOR_ADDRESS_L   0x0f

Definition at line 100 of file cga.c.

◆ CGA_REG_CURSOR_END

#define CGA_REG_CURSOR_END   0x0b

Definition at line 96 of file cga.c.

◆ CGA_REG_CURSOR_START

#define CGA_REG_CURSOR_START   0x0a

Definition at line 95 of file cga.c.

◆ CGA_REG_HZ_DISP

#define CGA_REG_HZ_DISP   0x01

Definition at line 86 of file cga.c.

◆ CGA_REG_HZ_SYNC_POS

#define CGA_REG_HZ_SYNC_POS   0x02

Definition at line 87 of file cga.c.

◆ CGA_REG_HZ_SYNC_WIDTH

#define CGA_REG_HZ_SYNC_WIDTH   0x03

Definition at line 88 of file cga.c.

◆ CGA_REG_HZ_TOTAL

#define CGA_REG_HZ_TOTAL   0x00

Definition at line 85 of file cga.c.

◆ CGA_REG_INTERLACE_MODE

#define CGA_REG_INTERLACE_MODE   0x08

Definition at line 93 of file cga.c.

◆ CGA_REG_LPEN_ADDRESS_H

#define CGA_REG_LPEN_ADDRESS_H   0x10

Definition at line 101 of file cga.c.

◆ CGA_REG_LPEN_ADDRESS_L

#define CGA_REG_LPEN_ADDRESS_L   0x11

Definition at line 102 of file cga.c.

◆ CGA_REG_MAX_SCAN_LINE_ADDRESS

#define CGA_REG_MAX_SCAN_LINE_ADDRESS   0x09

Definition at line 94 of file cga.c.

◆ CGA_REG_START_ADDRESS_H

#define CGA_REG_START_ADDRESS_H   0x0c

Definition at line 97 of file cga.c.

◆ CGA_REG_START_ADDRESS_L

#define CGA_REG_START_ADDRESS_L   0x0d

Definition at line 98 of file cga.c.

◆ CGA_REG_VT_TOTAL

#define CGA_REG_VT_TOTAL   0x04

Definition at line 89 of file cga.c.

◆ CGA_REG_VT_TOTAL_ADJUST

#define CGA_REG_VT_TOTAL_ADJUST   0x05

Definition at line 90 of file cga.c.

◆ CGA_REG_VT_VERT_SYNC_POSITION

#define CGA_REG_VT_VERT_SYNC_POSITION   0x07

Definition at line 92 of file cga.c.

◆ CGA_REG_VT_VERT_TOTAL_ADJUST

#define CGA_REG_VT_VERT_TOTAL_ADJUST   0x06

Definition at line 91 of file cga.c.

◆ WRITE_COLOR_SELECT_REGISTER

#define WRITE_COLOR_SELECT_REGISTER ( v)
Value:
outline1("MOV AL, 0x%2.2x", v ) \
outline0("CALL WRITECGACOLORSELECTREG")

Definition at line 117 of file cga.c.

◆ WRITE_MODE_CONTROL_REGISTER

#define WRITE_MODE_CONTROL_REGISTER ( v)
Value:
outline1("MOV AL, 0x%2.2x", v ) \
outline0("CALL WRITECGAMODECONTROLREG")

Definition at line 139 of file cga.c.

◆ WRITE_REGISTER

#define WRITE_REGISTER ( r,
v )
Value:
outline1("MOV AH, 0x%2.2x", r ) \
outline1("MOV AL, 0x%2.2x", v ) \
outline0("CALL WRITECGAREG")

Definition at line 104 of file cga.c.

Function Documentation

◆ cga_back()

void cga_back ( Environment * _environment)

Definition at line 1300 of file cga.c.

◆ cga_background_color()

void cga_background_color ( Environment * _environment,
int _index,
int _background_color )

CGA: emit code to change background color

This function can be used to issue code aimed at changing the background color of the screen.

Parameters
_environmentCurrent calling environment
_indexIndex of the background color
_background_colorBackground color to use

Definition at line 227 of file cga.c.

◆ cga_background_color_get_vars()

void cga_background_color_get_vars ( Environment * _environment,
char * _index,
char * _background_color )

CGA: emit code to retrieve background color

This function can be used to issue code aimed at retrieving the background color of the screen.

Parameters
_environmentCurrent calling environment
_indexIndex of the background color
_background_colorBackground color to use

Definition at line 289 of file cga.c.

◆ cga_background_color_semivars()

void cga_background_color_semivars ( Environment * _environment,
int _index,
char * _background_color )

CGA: emit code to change background color

This function can be used to issue code aimed at changing the background color of the screen.

Parameters
_environmentCurrent calling environment
_indexIndex of the background color
_background_colorBackground color to use

Definition at line 268 of file cga.c.

◆ cga_background_color_vars()

void cga_background_color_vars ( Environment * _environment,
char * _index,
char * _background_color )

CGA: emit code to change background color

This function can be used to issue code aimed at changing the background color of the screen.

Parameters
_environmentCurrent calling environment
_indexIndex of the background color
_background_colorBackground color to use

Definition at line 247 of file cga.c.

◆ cga_bank_select()

void cga_bank_select ( Environment * _environment,
int _bank )

Definition at line 361 of file cga.c.

◆ cga_bitmap_at()

void cga_bitmap_at ( Environment * _environment,
char * _address )

Definition at line 830 of file cga.c.

◆ cga_bitmap_disable()

void cga_bitmap_disable ( Environment * _environment)

Definition at line 799 of file cga.c.

◆ cga_bitmap_enable()

void cga_bitmap_enable ( Environment * _environment,
int _width,
int _height,
int _colors )

Definition at line 776 of file cga.c.

◆ cga_blit_image()

void cga_blit_image ( Environment * _environment,
char * _sources[],
int _source_count,
char * _blit,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
int _flags )

Definition at line 1541 of file cga.c.

◆ cga_border_color()

void cga_border_color ( Environment * _environment,
char * _border_color )

CGA: emit code to change border color

This function can be used to issue code aimed at changing the border color of the screen.

Parameters
_environmentCurrent calling environment
_border_colorBorder color to use

Definition at line 206 of file cga.c.

◆ cga_busy_wait()

void cga_busy_wait ( Environment * _environment,
char * _timing )

Definition at line 995 of file cga.c.

◆ cga_calculate_sequence_frame_offset()

void cga_calculate_sequence_frame_offset ( Environment * _environment,
char * _offset,
char * _sequence,
char * _frame,
int _frame_size,
int _frame_count )

Definition at line 1716 of file cga.c.

◆ cga_cline()

void cga_cline ( Environment * _environment,
char * _characters )

Definition at line 1304 of file cga.c.

◆ cga_cls()

void cga_cls ( Environment * _environment)

Definition at line 1011 of file cga.c.

◆ cga_cls_box()

void cga_cls_box ( Environment * _environment,
char * _x1,
char * _y1,
char * _w,
char * _h )

Definition at line 1022 of file cga.c.

◆ cga_collision()

Variable * cga_collision ( Environment * _environment,
char * _sprite )

Definition at line 174 of file cga.c.

◆ cga_colormap_at()

void cga_colormap_at ( Environment * _environment,
char * _address )

Definition at line 834 of file cga.c.

◆ cga_colors_vars()

void cga_colors_vars ( Environment * _environment,
char * _foreground_color,
char * _background_color )

Definition at line 1686 of file cga.c.

◆ cga_finalization()

void cga_finalization ( Environment * _environment)

Definition at line 1275 of file cga.c.

◆ cga_flip_image()

void cga_flip_image ( Environment * _environment,
Resource * _image,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _direction )

Definition at line 1720 of file cga.c.

◆ cga_get_height()

void cga_get_height ( Environment * _environment,
char * _result )

Definition at line 1007 of file cga.c.

◆ cga_get_image()

void cga_get_image ( Environment * _environment,
char * _image,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
int _palette )

Definition at line 1640 of file cga.c.

◆ cga_get_raster_line()

Variable * cga_get_raster_line ( Environment * _environment)

Definition at line 1668 of file cga.c.

◆ cga_get_width()

void cga_get_width ( Environment * _environment,
char * _result )

Definition at line 999 of file cga.c.

◆ cga_hit()

void cga_hit ( Environment * _environment,
char * _sprite_mask,
char * _result )

CGA: emit code to check for collision

This function can be used to issue code aimed at verifying if a sprite has had a collision with a tile. The result (0 = no collision, 0xff = collision occurred) is returned in the output variable.

  • Parameters
    _environmentCurrent calling environment
    _sprite_maskSprite mask to use
    _resultWhere to store the result

Definition at line 193 of file cga.c.

◆ cga_horizontal_scroll()

void cga_horizontal_scroll ( Environment * _environment,
char * _displacement )

Definition at line 991 of file cga.c.

◆ cga_hscroll_line()

void cga_hscroll_line ( Environment * _environment,
int _direction,
int _overlap )

Definition at line 1292 of file cga.c.

◆ cga_hscroll_screen()

void cga_hscroll_screen ( Environment * _environment,
int _direction,
int _overlap )

Definition at line 1296 of file cga.c.

◆ cga_image_converter()

Variable * cga_image_converter ( Environment * _environment,
char * _data,
int _width,
int _height,
int _depth,
int _offset_x,
int _offset_y,
int _frame_width,
int _frame_height,
int _mode,
int _transparent_color,
int _flags )

Definition at line 1515 of file cga.c.

◆ CGA_image_nearest_system_color()

RGBi * CGA_image_nearest_system_color ( RGBi * _color)

Definition at line 147 of file cga.c.

◆ cga_image_size()

int cga_image_size ( Environment * _environment,
int _width,
int _height,
int _mode )

Definition at line 1308 of file cga.c.

◆ cga_initialization()

void cga_initialization ( Environment * _environment)

Definition at line 1091 of file cga.c.

◆ cga_move_memory_video()

void cga_move_memory_video ( Environment * _environment,
char * _from,
char * _to,
char * _size )

Definition at line 1678 of file cga.c.

◆ cga_move_tiles()

void cga_move_tiles ( Environment * _environment,
char * _tile,
char * _x,
char * _y )

Definition at line 1652 of file cga.c.

◆ cga_move_video_memory()

void cga_move_video_memory ( Environment * _environment,
char * _from,
char * _to,
char * _size )

Definition at line 1682 of file cga.c.

◆ cga_new_image()

Variable * cga_new_image ( Environment * _environment,
int _width,
int _height,
int _mode )

Definition at line 1553 of file cga.c.

◆ cga_new_images()

Variable * cga_new_images ( Environment * _environment,
int _frames,
int _width,
int _height,
int _mode )

Definition at line 1577 of file cga.c.

◆ cga_new_sequence()

Variable * cga_new_sequence ( Environment * _environment,
int _sequences,
int _frames,
int _width,
int _height,
int _mode )

Definition at line 1608 of file cga.c.

◆ cga_next_raster()

void cga_next_raster ( Environment * _environment)

CGA: emit code to wait for next raster irq

This function outputs assembly code needed to wait for the next raster. Meanwhile, the execution of the main code will resume where it left off.

Parameters
_environmentCurrent calling environment

Definition at line 340 of file cga.c.

◆ cga_next_raster_at()

void cga_next_raster_at ( Environment * _environment,
char * _label,
char * _positionlo,
char * _positionhi )

CGA: emit code to wait for next raster irq at different position

This function outputs assembly code needed to wait for the next raster on a different position with a different code to execute. Meanwhile, the execution of the main code will resume where it left off.

Parameters
_environmentCurrent calling environment
_labelLabel to jump to when vertical raster reach the value given
_positionloThe vertical position to wait for (bits 7..0)
_positionhiThe vertical position to wait for (bit 8)

Definition at line 357 of file cga.c.

◆ cga_palette_extract()

int cga_palette_extract ( Environment * _environment,
char * _data,
int _width,
int _height,
int _depth,
int _flags,
RGBi * _palette )

Definition at line 1702 of file cga.c.

◆ cga_pget_color_vars()

void cga_pget_color_vars ( Environment * _environment,
char * _x,
char * _y,
char * _result )

Definition at line 889 of file cga.c.

◆ cga_pset_int()

void cga_pset_int ( Environment * _environment,
int _x,
int _y,
int * _c )

Definition at line 842 of file cga.c.

◆ cga_pset_vars()

void cga_pset_vars ( Environment * _environment,
char * _x,
char * _y,
char * _c )

Definition at line 863 of file cga.c.

◆ cga_put_image()

void cga_put_image ( Environment * _environment,
Resource * _image,
char * _x,
char * _y,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _flags )

Definition at line 1545 of file cga.c.

◆ cga_put_tile()

void cga_put_tile ( Environment * _environment,
char * _tile,
char * _x,
char * _y )

Definition at line 1648 of file cga.c.

◆ cga_put_tiles()

void cga_put_tiles ( Environment * _environment,
char * _tile,
char * _x,
char * _y,
char * _w,
char * _h )

Definition at line 1656 of file cga.c.

◆ cga_raster_at()

void cga_raster_at ( Environment * _environment,
char * _label,
char * _positionlo,
char * _positionhi )

CGA: emit code to set raster irq

This function outputs assembly code needed to initialize a raster routine. In other words, asynchronously and in parallel with the execution of the main program, the routine starting from the label provided will be executed when the vertical brush on the screen reaches the value of _position. This function is particularly useful when the position is communicated is given as an integer.

Parameters
_environmentCurrent calling environment
_labelLabel to jump to when vertical raster reach the value given
_positionloThe vertical position to wait for (bits 7..0)
_positionhiThe vertical position to wait for (bit 8)

Definition at line 326 of file cga.c.

◆ cga_screen()

void cga_screen ( Environment * _environment,
char * _x,
char * _y,
char * _c )

Definition at line 1724 of file cga.c.

◆ cga_screen_columns()

void cga_screen_columns ( Environment * _environment,
char * _columns )

Definition at line 927 of file cga.c.

◆ cga_screen_mode_enable()

int cga_screen_mode_enable ( Environment * _environment,
ScreenMode * _screen_mode )

Definition at line 365 of file cga.c.

◆ cga_screen_off()

void cga_screen_off ( Environment * _environment)

Definition at line 915 of file cga.c.

◆ cga_screen_on()

void cga_screen_on ( Environment * _environment)

Definition at line 907 of file cga.c.

◆ cga_screen_rows()

void cga_screen_rows ( Environment * _environment,
char * _rows )

Definition at line 923 of file cga.c.

◆ cga_scroll()

void cga_scroll ( Environment * _environment,
int _dx,
int _dy )

Definition at line 1644 of file cga.c.

◆ cga_scroll_text()

void cga_scroll_text ( Environment * _environment,
int _direction,
int _overlap )

Definition at line 1026 of file cga.c.

◆ cga_slice_image()

void cga_slice_image ( Environment * _environment,
char * _image,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _destination )

Definition at line 1690 of file cga.c.

◆ cga_slice_image_copy()

void cga_slice_image_copy ( Environment * _environment,
char * _image,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _destination )

Definition at line 1694 of file cga.c.

◆ cga_slice_image_extract()

void cga_slice_image_extract ( Environment * _environment,
char * _image,
char * _frame,
char * _sequence,
int _frame_size,
int _frame_count,
char * _destination )

Definition at line 1698 of file cga.c.

◆ cga_sprite_at()

void cga_sprite_at ( Environment * _environment,
char * _sprite,
char * _x,
char * _y )

Definition at line 947 of file cga.c.

◆ cga_sprite_color()

void cga_sprite_color ( Environment * _environment,
char * _sprite,
char * _color )

Definition at line 975 of file cga.c.

◆ cga_sprite_common_color()

void cga_sprite_common_color ( Environment * _environment,
char * _index,
char * _common_color )

CGA: emit code to change common sprite's color

This function can be used to issue code aimed at changing the common color of the sprites.

Parameters
_environmentCurrent calling environment
_indexIndex of the background color
_common_colorIndex of the color to use

Definition at line 307 of file cga.c.

◆ cga_sprite_compress_horizontal()

void cga_sprite_compress_horizontal ( Environment * _environment,
char * _sprite )

Definition at line 963 of file cga.c.

◆ cga_sprite_compress_vertical()

void cga_sprite_compress_vertical ( Environment * _environment,
char * _sprite )

Definition at line 959 of file cga.c.

◆ cga_sprite_converter()

Variable * cga_sprite_converter ( Environment * _environment,
char * _source,
int _width,
int _height,
int _depth,
RGBi * _color,
int _slot_x,
int _slot_y )

Definition at line 1370 of file cga.c.

◆ cga_sprite_data_from()

void cga_sprite_data_from ( Environment * _environment,
char * _sprite,
char * _image )

Definition at line 935 of file cga.c.

◆ cga_sprite_data_set()

void cga_sprite_data_set ( Environment * _environment,
char * _sprite,
char * _address )

Definition at line 931 of file cga.c.

◆ cga_sprite_disable()

void cga_sprite_disable ( Environment * _environment,
char * _sprite )

Definition at line 943 of file cga.c.

◆ cga_sprite_enable()

void cga_sprite_enable ( Environment * _environment,
char * _sprite )

Definition at line 939 of file cga.c.

◆ cga_sprite_expand_horizontal()

void cga_sprite_expand_horizontal ( Environment * _environment,
char * _sprite )

Definition at line 955 of file cga.c.

◆ cga_sprite_expand_vertical()

void cga_sprite_expand_vertical ( Environment * _environment,
char * _sprite )

Definition at line 951 of file cga.c.

◆ cga_sprite_monocolor()

void cga_sprite_monocolor ( Environment * _environment,
char * _sprite )

Definition at line 971 of file cga.c.

◆ cga_sprite_multicolor()

void cga_sprite_multicolor ( Environment * _environment,
char * _sprite )

Definition at line 967 of file cga.c.

◆ cga_sprite_priority()

void cga_sprite_priority ( Environment * _environment,
char * _sprite,
char * _priority )

Definition at line 979 of file cga.c.

◆ cga_text()

void cga_text ( Environment * _environment,
char * _text,
char * _text_size,
int _raw )

Definition at line 1038 of file cga.c.

◆ cga_textmap_at()

void cga_textmap_at ( Environment * _environment,
char * _address )

Definition at line 838 of file cga.c.

◆ cga_tile_at()

void cga_tile_at ( Environment * _environment,
char * _x,
char * _y,
char * _result )

Definition at line 1660 of file cga.c.

◆ cga_tilemap_enable()

void cga_tilemap_enable ( Environment * _environment,
int _width,
int _height,
int _colors,
int _tile_width,
int _tile_height )

Definition at line 803 of file cga.c.

◆ cga_tiles_at()

void cga_tiles_at ( Environment * _environment,
char * _address )

Definition at line 983 of file cga.c.

◆ cga_tiles_get()

void cga_tiles_get ( Environment * _environment,
char * _result )

Definition at line 1003 of file cga.c.

◆ cga_use_tileset()

void cga_use_tileset ( Environment * _environment,
char * _tileset )

Definition at line 1664 of file cga.c.

◆ cga_vertical_scroll()

void cga_vertical_scroll ( Environment * _environment,
char * _displacement )

Definition at line 987 of file cga.c.

◆ cga_wait_vbl()

void cga_wait_vbl ( Environment * _environment)

Definition at line 1549 of file cga.c.

◆ console_calculate()

void console_calculate ( Environment * _environment)

Definition at line 754 of file cga.c.

◆ console_calculate_vars()

void console_calculate_vars ( Environment * _environment)

Definition at line 768 of file cga.c.

Variable Documentation

◆ lastUsedSlotInCommonPalette

int lastUsedSlotInCommonPalette = 0

Definition at line 79 of file cga.c.