HALRuntimeLibrary: HAL - The HaDes Runtime Library

  • Main Page
  • Modules
  • Data Structures
  • Files
  • Directories

HAL - The HaDes Runtime Library

It provides many functions that are similar to the C standard library functions on normal PCs, but also functions that are specific to the HaDes hardware. See the modules page for all the functions, types and constants that are defined in the HAL.

HAL (HaDes Library) documentation version 1.0 • Copyright © by Florian Fischer and Markus Mitnacht, 2004-2007.


HALRuntimeLibrary: File Index

  • Files
  • Directories
  • File List
  • Globals

HALRuntimeLibrary File List

Here is a list of all documented files with brief descriptions:
hal.hl | Toplevel file for the HAL library
hal3d.hl | Defines 3D Graphics functions
hal3o.hl | Contains functions and data structures for managing complex three-dimensional objects, which are composed of polygons
halalgo.hl | Contains generally useful algorithms, which are usually teached by Dietmar ;-)
halanim.hl | Contains functions to load, draw, and release HaDes Animations (HA files)
halbasic.hl | These are all the important constant definitions of the HAL
haldev.hl | Contains functions to work with I/O devices
halfile.hl | Contains functions to manage the HaDes Flash Filesystem (HFF) and the contained files
halft.hl | Contains functions to receive and send files over any device reliably
halgfx.hl | Contains text mode functions
halhighscore.hl | Implements functions to work with high scores
halintern.hl | Contains internal functions of no interest to the application writer
halkeyboard.hl | Contains keyboard functions
halkeyconf.hl | Contains functions and data structures used to configure keys in an application
halmath.hl | Contains some mathematical functions
halmem.hl | Contains memory management functions
halmenu.hl | Contains menu functions for drawing and using a simple menu in the text or graphics mode
halmouse.hl | Contains functions for the PS/2 Mouse
halmsg.hl | Contains functions to send and receive messages and to configure software timers
halmusic.hl | Contains music playback functions (for HM music data, which is similar, but less powerful, than MIDI)
halpix.hl | Contains graphics mode functions
halps2.hl | Contains functions for the PS/2 connectors
halselect.hl | Contains functions and data structures used for selection lists
halsound.hl | Contains sound playback functions (for waveform data)
halstring.hl | Contains functions to work with strings and compact strings


HALRuntimeLibrary: hal.hl File Reference

  • Globals
temp

hal.hl File Reference

The hal.hl file is the toplevel file for the HAL library. More...

Detailed Description

The hal.hl file is the toplevel file for the HAL library.

It imports all other library files, so that if you import hal;, you've got everything available.
It also contains declarations of the HAL functions that are implemented in Assembler.


HALRuntimeLibrary: hal3d.hl File Reference

temp

hal3d.hl File Reference

Defines 3D Graphics functions. More...

Functions

HgFlatPolygon * | hg_new_flat_polygon (int numPoints)
HgVector * | hg_flat_point (int poly, int i)
HgRoundedPolygon * | hg_new_rounded_polygon (int numVertices)
HgVertex * | hg_rounded_point (int poly, int i)
void | hg_mulmm (int a, int b, int m)
void | hg_mulmv (int matrix, int vector, int result)
void | hg_mulmv_transp (int matrix, int vector, int result)
void | hg_identity ()
void | hg_translate (int dx, int dy, int dz)
void | _hg_rotate (int angle, int matrix, int cos1, int cos2, int sin_pos, int sin_neg)
void | hg_xrotate (int angle)
void | hg_yrotate (int angle)
void | hg_zrotate (int angle)
void | hg_scale (int sx, int sy, int sz)
void | hg_projection (int hangle, int vangle, int near, int far)
void | hg_viewport (int x, int y, int width, int height)
void | hg_mulsv (int scalar, int vector, int result)
int | hg_cross (int v1, int v2, int result)
int | hg_diff (int v1, int v2, int result)
int | hg_sum (int v1, int v2, int result)
void | hg_cartesian (int vector)
int | hg_dotprod (int v1, int v2)
int | hg_norm (int vector)
void | hg_normalize (int vector)
void | hg_light (int x, int y, int z)
void | hg_shade_func (int func)
HgVector * hg_get_light ()
int | hg_transform_point (struct HgPoint *p)
int | hg_clip (int poly, int nvertices)
int | hg_clip_rounded (int poly, int normals, int nvertices)
void | hg_shaded_polygon (struct H3DPolygon *p)
void | hg_flat_polygon (struct HgFlatPolygon *p)
void | hg_rounded_polygon (struct HgRoundedPolygon *p)
int | _hg_calc_shade (int tnormal, int tvertex)
int | _hg_headlight (int tnormal, int tvertex)
void | _hg_getpoint (int p1, int p2, int frac, int res)
int | _hg_clip_dim (int dim, int lb, int ub, int nvertices, int poly, int clipped_poly)
int | _hg_clipr_dim (int dim, int lb, int ub, int nvertices, int poly, int clipped_poly, int normals, int clipped_normals)

Variables

const int | proj_90_90_1_100 [] = {65536,0,0,0,0,65536,0,0,0,0,66859,132395,0,0,-65535,0}
const int | proj_60_45_1_100 [] = {113512,0,0,0,0,158218,0,0,0,0,66859,132395,0,0,-65535,0}
const int | proj_60_45_1_10 [] = {113512,0,0,0,0,158218,0,0,0,0,80099,145635,0,0,-65535,0}
int | _hg_translate [] = {1.0,0,0,0,0,1.0,0,0,0,0,1.0,0}
int | _hg_xrotate [] = {1.0,0,0,0,0,0,0,0,0,0,0,0}
int | _hg_yrotate [] = {0,0,0,0,0,1.0,0,0,0,0,0,0}
int | _hg_zrotate [] = {0,0,0,0,0,0,0,0,0,0,1.0,0}
const int | _hg_origin [] = {0,0,0}
const int | _hg_identity [] = {1.0,0,0,0,0,1.0,0,0,0,0,1.0,0}
int | _hg_pmatrix [] = {0,0,0,0,0,0,0,0,0,0,1.0,0}
int | _hg_tmatrix [12]
int | _hg_imatrix [12]
int | _hg_fmatrix [12]
int | _fvalid = 0
int | _near = -1.0
int | _far = -100.0
int | _hg_xfrom = 0
int | _hg_xto = 639
int | _hg_yfrom = 0
int | _hg_yto = 479
int | _hg_width = 320.0
int | _hg_height = 240.0
int | _hg_light [3]
int | _hg_shade_func = addressof _hg_headlight

Detailed Description

Defines 3D Graphics functions.

Function Documentation

int _hg_calc_shade | ( | int | tnormal,
 |  | int | tvertex
 | ) |

Standard Shade-Funktion.

int _hg_clip_dim | ( | int | dim,
 |  | int | lb,
 |  | int | ub,
 |  | int | nvertices,
 |  | int | poly,
 |  | int | clipped_poly
 | ) |

Clipped das Polygon poly mit nvertices Punkten in der durch dim (0=>X, 1=>Y, 2=>Z) spezifizierten Komponente in den Bereich [lb,ub].

Zurückgegeben wird die Anzahl der Punkte des neuen Polygons, welches in das Array clipped_poly abgelegt wird (entsprechende Größe vorausgesetzt!). Die Arrays sind wie immer Listen von Punkten [p1.x, p1.y, p1.z, p2.x, p2.y, ...].

int _hg_clipr_dim | ( | int | dim,
 |  | int | lb,
 |  | int | ub,
 |  | int | nvertices,
 |  | int | poly,
 |  | int | clipped_poly,
 |  | int | normals,
 |  | int | clipped_normals
 | ) |

Clipped das (rounded) Polygon poly mit nvertices Punkten in der durch dim (0=>X, 1=>Y, 2=>Z) spezifizierten Komponente in den Bereich [lb,ub].

Zurückgegeben wird die Anzahl der Punkte des neuen Polygons, welches in das Array clipped_poly abgelegt wird (entsprechende Größe vorausgesetzt!). Die Arrays sind wie immer Listen von Punkten [p1.x, p1.y, p1.z, p2.x, p2.y, ...]. Zusätzlich werden auch die Normalenvektoren der Punkte neu berechnet.

void _hg_getpoint | ( | int | p1,
 |  | int | p2,
 |  | int | frac,
 |  | int | res
 | ) |

Berechnet res = p1 + frac * (p2-p1).

p1, p2 und res sind 3-dim. Vektoren.

int _hg_headlight | ( | int | tnormal,
 |  | int | tvertex
 | ) |

Erweiterte Shade-Funktion (benutzt transformierten Punkt).

Wir dürfen hier nicht den originalen Vektor verändern!

Variable Documentation

int _far = -100.0

far plane

int _fvalid = 0

Ist die fmatrix gültig oder muss sie zunächst berechnet werden?

int _hg_fmatrix[12]

f=p*t (Transformation+Projektion)

int _hg_height = 240.0

halbe Höhe des Darstellungsbereichs (Fixpunkt)

const int _hg_identity[] = {1.0,0,0,0,0,1.0,0,0,0,0,1.0,0}

Einheitsmatrix.

int _hg_imatrix[12]

inverse Transformationsmatrix

int _hg_light[3]

Licht-Richtungsvektor.

const int _hg_origin[] = {0,0,0}

Ursprung, Nullvektor.

int _hg_pmatrix[] = {0,0,0,0,0,0,0,0,0,0,1.0,0}

verwendete Projektionsmatrix

int _hg_shade_func = addressof _hg_headlight

Shade-Funktion, bekommt als Parameter den transformierten (!) Normalenvektor.

Gibt den Shade-Wert zurück.

int _hg_tmatrix[12]

aktuelle Transformationsmatrix

int _hg_width = 320.0

halbe Breite des Darstellungsbereichs (Fixpunkt)

int _hg_xfrom = 0

linker Rand des Darstellungsbereichs

int _hg_xto = 639

rechter Rand des Darstellungsbereichs

int _hg_yfrom = 0

oberer Rand des Darstellungsbereichs

int _hg_yto = 479

unterer Rand des Darstellungsbereichs

int _near = -1.0

near plane


HALRuntimeLibrary: hal3o.hl File Reference

temp

hal3o.hl File Reference

Contains functions and data structures for managing complex three-dimensional objects, which are composed of polygons. More...

Functions

H3DObject * | h3o_new (int num_vertices, int num_polygons)
H3DPolygon * | h3o_make_poly (struct H3DObject *obj, int poly_number, int vertex_count)
void | h3o_free (struct H3DObject *obj)
int | h3o_obj_vertex_count (struct H3DObject *obj)
HgVertex * | h3o_obj_vertex (struct H3DObject *obj, int n)
int | h3o_obj_poly_count (struct H3DObject *obj)
H3DPolygon * | h3o_obj_poly (struct H3DObject *obj, int n)
int | h3o_poly_get_flags (struct H3DPolygon *poly)
void | h3o_poly_set_flags (struct H3DPolygon *poly, int flags)
int | h3o_poly_get_pattern (struct H3DPolygon *poly)
void | h3o_poly_set_pattern (struct H3DPolygon *poly, int pattern)
int | h3o_poly_vertex_count (struct H3DPolygon *poly)
HgVertex * | h3o_poly_get_vertex (struct H3DPolygon *poly, int n)
void | h3o_poly_set_vertex (struct H3DPolygon *poly, int n, struct HgVertex *vertex)
H3DObject * | h3o_load (int filename, int npatterns, int patterns)
void | h3o_calc_normals (struct H3DObject *obj)
void | _h3o_debug_out (struct H3DObject *obj)
void | _h3o_debug_out_poly (struct H3DObject *obj, struct H3DPolygon *poly)
void | _h3o_debug_out_vertex (struct HgVertex *v, int withNormal)
void | _h3o_debug_out_vector (struct HgVector *v)
void | _h3o_debug_out_fp (int fp)

Variables

const int | H3D_MASK_POLY_ROUNDED = 0x1
const int | H3D_POLY_ROUNDED = 0x1
const int | H3D_POLY_FLAT = 0x0
const int | _H3O_POLY_VCOUNT_MASK = 0x7F
const int | _H3O_POLY_ROUNDED = 0x80

Detailed Description

Contains functions and data structures for managing complex three-dimensional objects, which are composed of polygons.


HALRuntimeLibrary: halalgo.hl File Reference

temp

halalgo.hl File Reference

Contains generally useful algorithms, which are usually teached by Dietmar ;-). More...

Functions

void | sort (int array, int elem_size, int count, int cmpfun)
int | find_binary (int array, int elem_size, int count, int elem, int cmpfun)
int | insert_sorted (int array, int elem_size, int count, int elem, int cmpfun)

Detailed Description

Contains generally useful algorithms, which are usually teached by Dietmar ;-).


HALRuntimeLibrary: halanim.hl File Reference

temp

halanim.hl File Reference

Contains functions to load, draw, and release HaDes Animations (HA files). More...

Data Structures

struct | _AnimFrameHeader
struct | Animation
A HaDes Animation info block You should not use the members directly. More...

Functions

Animation * | anim_load (int file_name, int file_offset)
Animation * | anim_load_at (struct File *file)
void | anim_draw_frame (struct Animation *anim, int frame_no)
int | anim_draw_frame_direct (int filename, int foff, int frame_no)
int | anim_draw_frame_direct_at (struct File *file, int frame_no)
int | anim_find_next (int filename, int foff)
int | anim_find_next_at (struct File *file)
int | anim_get_info (int filename, int foff, struct Animation *anim)
void | anim_draw_scaled_frame (struct Animation *anim, int frame_no, int w, int h)
int | anim_image_pointer (struct Animation *anim, int frame_no)
int | anim_free (struct Animation *anim)
Animation * | anim_new (int width, int height, int imageCount)
int | _anim_read_header (struct File *file, struct Animation *anim)
int | _anim_read_frame_header (struct File *file, struct _AnimFrameHeader *header)
int | _anim_skip_frame (struct File *file)
int | _anim_scale_calc_inc (int origlen, int displen)
void | _anim_scale_line_min (int pixptr, int npix, int width)
void | _anim_scale_line_maj (int pixptr, int npix, int width)

Detailed Description

Contains functions to load, draw, and release HaDes Animations (HA files).


HALRuntimeLibrary: halbasic.hl File Reference

temp

halbasic.hl File Reference

These are all the important constant definitions of the HAL. More...

Variables

int | _delay_1msec = 48000/(3*4)
int | _pmem_size = 0x8000
int | _stack_base = 0x8000
int | _heap_base = 0x10000
int | _mem_size = 0x20000
int | _timerintr_handler = 0
int | _kbdintr_handler = 0
int | _ps2intr_handler = 0
int | _devintr_handler = 0
const int | TRUE = 1
const int | FALSE = 0
const int | PORT_TIMER_DATA = 17
const int | PORT_TIMER_CTRL = 16
const int | PORT_JTAG_CTRL = 32
const int | PORT_JTAG_DATA = 33
const int | UCM_RECV_DATA = 0b1000
const int | PORT_FLASH_STAT = 48
const int | PORT_FLASH_ADDR = 49
const int | PORT_FLASH_DATA = 50
const int | PORT_FLASH_FULL_ERASE = 51
const int | PORT_FLASH_SECTOR_ERASE = 52
const int | PORT_FLASH_FAIL_ADDR = 53
const int | PORT_CON_CTRL = 64
const int | PORT_CON_KEYS = 65
const int | PORT_CON_LEDS = 66
const int | PORT_CON_SEGDATA = 67
const int | PORT_CON_SEGSTAT = 68
const int | CKM_BUTTONS = 0xFF
const int | CKM_SWITCHES = 0xFF00
const int | GDM_FGCOL = 0xF000
const int | GDM_BGCOL = 0x0F00
const int | GDM_CHAR = 0x00FF
const int | PORT_USB_CTRL = 96
const int | PORT_USB_DATA = 97
const int | PORT_POISON_DO = 112
const int | PORT_POISON_UNDO = 113
const int | PORT_PIX_READADDR = 160
const int | PORT_PIX_WRITEADDR = 161
const int | PORT_PIX_DATA = 162
const int | PORT_PIX_FAST = 163
const int | PORT_PIX_TRANS = 164
const int | PORT_PIX_MODE = 165
const int | PORT_PIX_BUFFER = 166
const int | PORT_PIX_CLS = 167
const int | PORT_SOUND_CTRL = 192
const int | PORT_SOUND_DATA = 193
const int | PORT_SOUND_SAMPLEN = 194
const int | PORT_MMC_STATUS = 208
const int | PORT_MMC_ADDRESS = 209
const int | PORT_MMC_DATA = 210
const int | PORT_MMC_FLUSH = 211
const int | PORT_MMC_ERR_ADDRESS = 212
const int | ERR_IRQ_USR1 = 0xE001
const int | ERR_IRQ_XDUMMY1 = 0xE002
const int | ERR_IRQ_XDUMMY2 = 0xE009
const int | ERR_IRQ_USR2 = 0xE00A
const int | ERR_IRQ_OVF = 0xE00B
const int | ERR_IRQ_DIV0 = 0xE00C
const int | ERR_IRQ_XADDR = 0xE00D
const int | ERR_IRQ_MEMADDR = 0xE00E
const int | ERR_IRQ_PCADDR = 0xE00F
const int | ERR_NO_MEMORY = 0xE010
const int | ERR_INVALID_FREE_PTR = 0xE011
const int | ERR_INVALID_REALLOC_PTR = 0xE012
const int | ERR_INVALID_MBS_PTR = 0xE012
const int | ERR_MCOPY_SOURCE = 0xE013
const int | ERR_MCOPY_TARGET = 0xE014
const int | ERR_MCOPY_SIZE = 0xE015
const int | ERR_MFILL_TARGET = 0xE016
const int | ERR_MALLOC_SIZE = 0xE017
const int | ERR_MCOMPARE_PTR = 0xE018
const int | ERR_TIMER_INTERVAL = 0xE020
const int | ERR_TIMER_CALLBACK = 0xE021
const int | ERR_TIMER_HANDLE = 0xE022
const int | ERR_DEV_NUMBER = 0xE030
const int | ERR_DEV_CALLBACK = 0xE031
const int | ERR_FLASH_HANDLE = 0xE040
const int | ERR_FLASH_OVERFLOW = 0xE041
const int | ERR_FLASH_FNAME_TERM = 0xE042
const int | ERR_FLASH_FSIZE = 0xE043
const int | ERR_FLASH_DATA_FAIL = 0xE044
const int | ERR_FLASH_HEADER_FAIL = 0xE045
const int | ERR_FLASH_SERIOUS_FAIL = 0xE046
const int | ERR_FLASH_FS_SIZE = 0xE047
const int | ERR_KEY_DEVICE = 0xE050
const int | ERR_KEY_CALLBACK = 0xE051
const int | ERR_PIX_NO_MEMORY = 0xE060
const int | ERR_PIXALLOC_SIZE = 0xE061
const int | ERR_PIX_NO_DBUF = 0xE062
const int | ERR_GFX_NO_FONT = 0xE068
const int | ERR_GFX_WRONG_FONT = 0xE069
const int | ERR_GFX_DEFAULT_FONT = 0xE06A
const int | ERR_ANIM_FORMAT = 0xE070
const int | ERR_ANIMDRAW_FNO = 0xE071
const int | ERR_ANIMSCALE_DIM = 0xE072
const int | ERR_HSC_WRONG_ENTRY = 0xE080
const int | ERR_MENU_HANDLER_NUM = 0xE090
const int | ERR_MENU_HANDLER_FUNC = 0xE091
const int | ERR_MENU_INIT = 0xE092
const int | ERR_TOO_MANY_NETWORKS = 0xE0A0
const int | ERR_READ_PACKET = 0xE0A1
const int | ERR_WRITE_PACKET = 0xE0A2
const int | ERR_NET_MESSAGE_ID = 0xE0A3
const int | ERR_SYSTEM_ID = 0xE0A4
const int | ERR_MSG_TYPE = 0xE0B0
const int | ERR_MSG_HANDLER_FUNC = 0xE0B1
const int | ERR_MSG_POP_GLOBAL = 0xE0B2
const int | ERR_INSTR_POS = 0xE0C0
const int | ERR_PRINTF_FORMAT = 0xE0D0
const int | DEV_JTAG = 0
const int | DEV_USB = 1
const int | DEV_COUNT = 2
const int | MAX_TIMERS = 8

Detailed Description

These are all the important constant definitions of the HAL.

Variable Documentation

const int FALSE = 0

boolean value

const int TRUE = 1

boolean value


HALRuntimeLibrary: haldev.hl File Reference

temp

haldev.hl File Reference

Contains functions to work with I/O devices. More...

Functions

void | dev_set_callback (int device, int callback)
void | dev_set_interrupt_callback (int device, int callback)
int | dev_read_byte (int device)
void | dev_write_byte (int device, int data)
int | _dev_getaddr (int device)
int | _dev_getstatus (int devaddr)
void | _dev_setstatus (int devaddr, int status)
int | _dev_readdata (int devaddr)
void | _dev_writedata (int devaddr, int data)
void | _devintr ()

Variables

const int | _DS_FLAG_HAS_INTR = 0b00001
const int | _DS_FLAG_RECV_INTR = 0b00010
const int | _DS_FLAG_SEND_INTR = 0b00100
const int | _DS_FLAG_RECV_DATA = 0b01000
const int | _DS_FLAG_SEND_DATA = 0b10000
const int | _DS_MASK_HAS_INTR = 0xFFFE
const int | _DS_MASK_RECV_INTR = 0xFFFD
const int | _DS_MASK_SEND_INTR = 0xFFFB
const int | _devaddr [] = { 32, 96 }
int | _devintr_callback [DEV_COUNT]

Detailed Description

Contains functions to work with I/O devices.


HALRuntimeLibrary: halfile.hl File Reference

temp

halfile.hl File Reference

Contains functions to manage the HaDes Flash Filesystem (HFF) and the contained files. More...

Data Structures

struct | File
Represents an opened file. More...

Functions

int | getsystemid ()
void | setsystemid (int systemid)
int | ffssize ()
int | ffsbusy ()
int | ftotalsize (int dirHandle)
int | fsize_handle (int dirHandle)
int | fattrib (int dirHandle)
void | fname (int dirHandle, int string)
int | fcheckname (int dirHandle, int filename)
void | fheader (int dirHandle, int header)
int | ffirst ()
int | fnext (int dirHandle)
int | fend ()
int | ffind (int filename)
void | fdelete (int dirHandle)
void | fsync ()
int | fgethandle (struct File *file)
File * | fopen_handle (int dirHandle)
File * | fopen (int filename)
File * | fopen_mem (int address, int length)
File * | fcreate (int filename, int length, int attrib)
void | fflush (struct File *file)
void | fclose (struct File *file)
int | fread (struct File *file, int size, int ptr)
int | freadb (struct File *file, int size, int ptr)
int | fget (struct File *file)
int | fgetb (struct File *file)
int | fgets (struct File *file)
int | fget_flash (int fptr)
int | fget_mem (int fptr)
int | fgetw_flash (int fptr)
int | fgetw_mem (int fptr)
int | fwrite (struct File *file, int size, int ptr)
int | fwriteb (struct File *file, int size, int ptr)
void | fputb (struct File *file, int byte)
int | fcheckfail (struct File *file)
int | checkfail_flash ()
int | checkfail_mem ()
void | fput_flash (int byte, int fptr)
void | fput_mem (int byte, int fptr)
int | fsize (struct File *file)
int | fgetattrib (struct File *file)
int | fsetattrib (struct File *file, int attrib)
int | ftell (struct File *file)
int | fseek (struct File *file, int pos, int offset)
int | ftraverse (int accept_func, int nptr, int ptr_buf, int nstr, int str_buf)
int | ffreespace ()
int | checkfs ()
void | _ffsinit ()

Variables

const int | MAX_FNAME = 28
const int | MAX_FLENGTH = 0x7FFFFF
const int | ATTR_ERASED_BIT = 1
const int | ATTR_EXECUTABLE_BIT = 2
const int | ATTR_SHELL_BIT = 4
const int | ATTR_FOLDER_BIT = 8
const int | FLASHADDR_SYSTEM_ID = 0
const int | FLASHADDR_FS_SIZE = 2
const int | FBEGIN = 1
const int | FCURRENT = 2
const int | FEND = 3
const int | FLASH_STAT_BUSY = 0x10
const int | FLASH_STAT_FAIL = 0x0C
int | _FLASH_SIZE = 0
const int | _FLASH_HEADER = 32
const int | _FLASH_BEGIN = 4
const int | _FLASH_ATTRIB = 3
const int | _FLASH_FNAME = 4

Detailed Description

Contains functions to manage the HaDes Flash Filesystem (HFF) and the contained files.


HALRuntimeLibrary: halft.hl File Reference

temp

halft.hl File Reference

Contains functions to receive and send files over any device reliably. More...

Data Structures

struct | HftHeader
The HFT Header information. More...

Functions

int | hft_send_file (int devno, int fname)
void | hft_send_file_header (int devno, struct File *file)
int | hft_send_file_body (int devno, struct File *file)
void | hft_send_string (int devno, int str)
void | hft_send_word (int devno, int word)
int | hft_read_file (int devno, int verbose)
int | hft_read_file_header (int devno, struct HftHeader *header)
int | hft_read_file_body (int devno, struct HftHeader *header, struct File *file, int verbose)
int | hft_read_string (int devno, int str, int size)
int | hft_read_word (int devno)
int | hft_read_byte (int devno)

Variables

const int | _HFT_MSG_RHDR1 [] = C"File "
const int | _HFT_MSG_RHDR2 [] = C" (size "
const int | _HFT_MSG_RHEX [] = C", executable)\n"
const int | _HFT_MSG_RHNEX [] = C")\n"
const int | _HFT_MSG_DONE [] = C"\nDone.\n"
const int | _HFT_MSG_CSUM [] = C"\nChecksum error!\n"
const int | _HFT_MSG_FLASH [] = C"\nFlash error!\n"
const int | _HFT_MSG_BUFFER [] = C"\nBuffer overflow error!\n"
const int | _HFT_MSG_NEQ [] = C" /= "
const int | _HFT_BUFSIZE = 1024
const int | HFT_ERR_NONE = 0
const int | HFT_ERR_FLASH = 1
const int | HFT_ERR_PROTOCOL = 2
const int | HFT_ERR_MEMORY = 3
const int | HFT_ERR_BUFFER = 4

Detailed Description

Contains functions to receive and send files over any device reliably.


HALRuntimeLibrary: halgfx.hl File Reference

temp

halgfx.hl File Reference

Contains text mode functions. More...

Functions

void | gfx_nextline ()
void | gfx_nextline_ai (int col)
void | gfx_nexttab ()
void | gfx_out (int char)
int | gfx_get_font_pixel (int char, int x, int y)
int | gfx_get_font_line (int char, int y)
void | gfx_out_col (int data)
void | gfx_goto (int x, int y)
int | gfx_where ()
int | gfx_wherex ()
int | gfx_wherey ()
void | gfx_cls ()
void | gfx_print (int char)
int | gfx_print_ai (int char, int col)
void | gfx_outstr (int str)
void | gfx_printstr (int str)
void | gfx_printcstr (int cstr)
void | gfx_printcstr_ai (int cstr)
void | gfx_printf (int format)
void | gfx_draw_rect (int char, int width, int height)
void | gfx_clear_rect (int width, int height)
void | gfx_setcol (int fg, int bg)
void | gfx_setfgcol (int fg)
void | gfx_setbgcol (int bg)
void | gfx_setbold (int bold)
int | gfx_isbold ()
int | gfx_getcol ()
int | gfx_storecol ()
void | gfx_loadcol (int col)
int | gfx_load_font_file (int filename)
void | gfx_load_font (struct File *file)
void | gfx_load_default_font ()
void | gfx_load_mem_font (int fontdata)
void | gfx_loadchars (int chars, int pos, int cnt)
Animation * | pix_load_font (int fg, int bg)
int | _gfx_xprintf (int char, int varg, struct _StrPrintfv_Data *data, int buf)
_StrPrintfv_Data * | _gfx_printf_foreach (int char, struct _StrPrintfv_Data *data)

Variables

int | _gfx_fg = 0x77777777
int | _gfx_bg = 0x00000000
int | _gfx_autobold = FALSE
const int | _GFX_FONT_START = _PIX_BUF_ADDR[1] + PIX_SCREEN_SIZE
const int | COL_BLACK = 0
const int | COL_RED = 1
const int | COL_GREEN = 2
const int | COL_BROWN = 3
const int | COL_BLUE = 4
const int | COL_MAGENTA = 5
const int | COL_TURQUOISE = 6
const int | COL_GREY = 7
const int | COL_DARK_GREY = 8
const int | COL_LRED = 9
const int | COL_LGREEN = 10
const int | COL_YELLOW = 11
const int | COL_LBLUE = 12
const int | COL_LMAGENTA = 13
const int | COL_CYAN = 14
const int | COL_WHITE = 15
const int | COL_TO_FG = 12
const int | COL_TO_BG = 8
const int | GFX_WIDTH = 80
int | GFX_HEIGHT = 10
int | GFX_SCREEN_SIZE = GFX_WIDTH * 10
const int | GFX_FONT_WIDTH = 8
int | GFX_FONT_HEIGHT = 0
const int | FONT_DEFAULT [] = "_default.hfon"
const int | FONT_LARGE [] = "ansi8x12.hfon"
const int | FONT_LUCIDA [] = "lucida8x14.hfon"

Detailed Description

Contains text mode functions.


HALRuntimeLibrary: halhighscore.hl File Reference

temp

halhighscore.hl File Reference

Implements functions to work with high scores. More...

Data Structures

struct | Highscore
The high score object. More...
struct | HighscoreEntry
A highscore entry. More...

Functions

Highscore * | hsc_read (int file_name)
int | hsc_is_good_enough (struct Highscore *hsc, int plyr_score)
void | hsc_add (struct Highscore *hsc, int name, int level, int score)
int | hsc_write (struct Highscore *hsc)
void | hsc_free (struct Highscore *hsc)
void | hsc_show (struct Highscore *hsc)
int | _hsc_entry_cmp (struct HighscoreEntry *e1, struct HighscoreEntry *e2)
Highscore * | _hsc_new ()

Variables

const int | HSC_SIZE = 10
const int | HSC_FILE_MAX_SIZE = 100
const int | _HSC_ENTRY_DISK_SIZE = 13
const int | _HSC_COL [] = { COL_YELLOW, COL_WHITE, COL_BROWN }
const int | _HSC_COL_DEF = COL_GREY
const int | _HSC_COL_TITLE = COL_WHITE
const int | _HSC_COL_TITLE_BG = COL_BLUE
const int | _HSC_TITLE [] = C" H I G H S C O R E S "
const int | _HSC_TITLE2 [] = C"Player Level Score "
const int | _HSC_NOBODY [] = C"Nobody"

Detailed Description

Implements functions to work with high scores.


HALRuntimeLibrary: halintern.hl File Reference

temp

halintern.hl File Reference

Contains internal functions of no interest to the application writer. More...

Functions

void __hl_init ()

Detailed Description

Contains internal functions of no interest to the application writer.


HALRuntimeLibrary: halkeyboard.hl File Reference

temp

halkeyboard.hl File Reference

Contains keyboard functions. More...

Functions

void | set_key_down_callback (int callback)
void | set_key_up_callback (int callback)
void | set_char_input_callback (int callback)
int | key_is_down (int keycode)
void | key_get_name (int keycode, int string)
void | load_keytable_mem (int keytbl)
int | load_keytable ()
void | _kbdintr ()
int | _key_start ()
void | _keyintr (int data)
void | _key_update_led ()

Variables

int | _key_is_extended = FALSE
int | _key_is_released = FALSE
int | _key_caps_on = FALSE
int | _key_led_updated = TRUE
int | _key_shift_down = FALSE
int | _key_altgr_down = FALSE
int | _key_tbl = 0
int | _key_memtbl = 0
const int | _KEYTBL_FILE_NAME [] = "_keytbl"
const int | _SCANCODE_OFF = 0
const int | _EXT_SCANCODE_OFF = 128
const int | _NORMAL_ASCII_OFF = 256
const int | _SHIFT_ASCII_OFF = 512
const int | _ALTGR_ASCII_OFF = 768
const int | _NAMES_OFF = 1024
const int | _KEYNAME_LEN = 8
const int | KEY_COUNT = 8
const int | VK_TAB = 9
const int | VK_BACK = 8
const int | VK_RETURN = 13
const int | VK_ENTER = VK_RETURN
const int | VK_ESC = 27
const int | VK_SPACE = 32
const int | VK_DEL = 127
const int | VK_F1 = 128
const int | VK_F2 = 129
const int | VK_F3 = 130
const int | VK_F4 = 131
const int | VK_F5 = 132
const int | VK_F6 = 133
const int | VK_F7 = 134
const int | VK_F8 = 135
const int | VK_F9 = 136
const int | VK_F10 = 137
const int | VK_F11 = 138
const int | VK_F12 = 139
const int | VK_CAPS = 140
const int | VK_LSHIFT = 141
const int | VK_LCTRL = 142
const int | VK_LWIN = 143
const int | VK_ALT = 144
const int | VK_ALTGR = 145
const int | VK_RWIN = 146
const int | VK_CONTEXT_MENU = 147
const int | VK_RCTRL = 148
const int | VK_RSHIFT = 149
const int | VK_INS = 150
const int | VK_HOME = 151
const int | VK_PGUP = 152
const int | VK_END = 153
const int | VK_PGDOWN = 154
const int | VK_LEFT = 155
const int | VK_UP = 156
const int | VK_DOWN = 157
const int | VK_RIGHT = 158
const int | VK_NUMLOCK = 159
const int | VK_NUMDIV = 160
const int | VK_NUMMUL = 161
const int | VK_NUMSUB = 162
const int | VK_NUMADD = 163
const int | VK_NUMRETURN = 164
const int | VK_NUMENTER = VK_NUMRETURN
const int | VK_NUMSEP = 165
const int | VK_NUM0 = 166
const int | VK_NUM1 = 167
const int | VK_NUM2 = 168
const int | VK_NUM3 = 169
const int | VK_NUM4 = 170
const int | VK_NUM5 = 171
const int | VK_NUM6 = 172
const int | VK_NUM7 = 173
const int | VK_NUM8 = 174
const int | VK_NUM9 = 175
const int | VK_MAX = VK_NUM9

Detailed Description

Contains keyboard functions.


HALRuntimeLibrary: halkeyconf.hl File Reference

temp

halkeyconf.hl File Reference

Contains functions and data structures used to configure keys in an application. More...

Data Structures

struct | KeyconfKeyInfo
A key configuration info structure. More...

Functions

void | keyconf_init (int appname, struct KeyconfKeyInfo *data, int keycount)
void | keyconf_set_col (int posx, int posy, int col_highlight, int make_bold)
int | keyconf_get (int index)
void | keyconf_run ()
void | keyconf_set_default ()
void | keyconf_load ()
void | keyconf_save ()
int | _keyconf_capture_key (int kc, int UU, int context)
int | _keyconf_seek (struct File *file, int create)

Variables

int | _keyconf_keycount = 0
const int | _keyconf_file [] = "_keyconf"
int | _keyconf_highlight_col = 0xEEEE4444
int | _keyconf_makebold = FALSE
int | _keyconf_posx = 10
int | _keyconf_posy = 5
const int | KEYCONF_MAX_KEYS = 32
const int | KEYCONF_MAX_APPNAME = 16
const int | KEYCONF_MAX_APPS = 32
KeyconfKeyInfo * | _keyconf_data = 0
int | _keyconf_keys [KEYCONF_MAX_KEYS]
int | _keyconf_appname [KEYCONF_MAX_APPNAME/4]

Detailed Description

Contains functions and data structures used to configure keys in an application.


HALRuntimeLibrary: halmath.hl File Reference

temp

halmath.hl File Reference

Contains some mathematical functions. More...

Functions

int | random ()
int | random_getseed ()
void | random_setseed (int seed)
int | gcd (int a, int b)
int | min (int a, int b)
int | max (int a, int b)
int | abs (int a)
int | bound (int a, int min, int max)
int | sin (int x)
int | cos (int x)
int | tan (int x)
int | sqrt (int x)
int | isqrt (int x)
int | ilogd (int x)
int | fp2int (int fp)
int | int2fp (int int)
int | floor (int fp)
int | ceil (int fp)
int | broken (int fp)

Variables

int | _random_value = 0
const int | _1 = 1 << 16
const int | _NEWTON_ABORT = 0.01
const int | _sines []
const int | MAX_INT = 0x7FFFFFFF
const int | RANDOM_A = 16807
const int | RANDOM_B = 0
const int | RANDOM_M = MAX_INT
const int | RANDOM_Q = 127773
const int | RANDOM_R = 2836

Detailed Description

Contains some mathematical functions.

Variable Documentation

const int _1 = 1 << 16

Die Fixpunkt 1.

const int _NEWTON_ABORT = 0.01

Genauigkeit für Newton-Verfahren (sqrt).

const int _sines[]

Initial value:

 {0,1144,2287,3430,4572,5712,6850,7987,9121,10252,11380,
        12505,13626,14742,15855,16962,18064,19161,20252,21336,22415,
        23486,24550,25607,26656,27697,28729,29753,30767,31772,32768,
        33754,34729,35693,36647,37590,38521,39441,40348,41243,42126,
        42995,43852,44695,45525,46341,47143,47930,48703,49461,50203,
        50931,51643,52339,53020,53684,54332,54963,55578,56175,56756,
        57319,57865,58393,58903,59396,59870,60326,60764,61183,61584,
        61966,62328,62672,62997,63303,63589,63856,64104,64332,64540,
        64729,64898,65048,65177,65287,65376,65446,65496,65526,65536}


HALRuntimeLibrary: halmem.hl File Reference

temp

halmem.hl File Reference

Contains memory management functions. More...

Data Structures

struct | _MemBlock

Functions

int | mmaxalloc ()
int | malloc (int size)
int | realloc (int ptr, int newSize)
void | free (int ptr)
int | mblock_size (int ptr)
void | mcopy (int source, int dest, int size)
void | mfill (int dest, int size, int value)
int | mcompare (int blk1, int blk2, int size)

Variables

volatile int | _malloc_hint = 0x10000
const int | _MemUsedFlag = 0x80000000
const int | _MemPrevFlag = 0x7FFFFFFF

Detailed Description

Contains memory management functions.


HALRuntimeLibrary: halmenu.hl File Reference

temp

halmenu.hl File Reference

Contains menu functions for drawing and using a simple menu in the text or graphics mode. More...

Functions

void | menu_init (int menu_func, int menu_func_len, int menu_strings)
void | menu_set (int menu_ptr)
int | menu_get ()
void | menu_draw ()
int | menu_kbd_handler (int key, int UNUSED, int context)
int | menu_click_handler (int button, struct Point *pos, int context)

Variables

int | _menu_cur = 0
int | _menu_cur_str [8]
int | _menu_func = 0
int | _menu_func_len = 0
int | _menu_strings = 0
const int | _menu_col [] = { 0xEEEE4444, 0xFFFF8888 }
const int | _menu_active_col = 0xBBBB1111
int | _menu_cur_active = 0
int | _menu_min_y = 0

Detailed Description

Contains menu functions for drawing and using a simple menu in the text or graphics mode.


HALRuntimeLibrary: halmouse.hl File Reference

temp

halmouse.hl File Reference

Contains functions for the PS/2 Mouse. More...

Functions

void | set_mouse_callback (int callback)
int | mouse_get_x (int coord)
int | mouse_get_y (int coord)
int | mouse_make_coord (int x, int y)
void | mouse_start_cursor (int click_func, int drag_func, int button_down_func, int button_up_func, int motion_func)
void | mouse_confine_cursor (struct Rect *rect)
void | _mouse_start ()
void | _mouse_enable ()
void | _mouse_disable ()
void | _mouseintr (int data)
int | _cursor_callback (int cur_btn, int coord, int context)
int | _cursor_move (int coord)
void | _cursor_del_pix ()
void | _cursor_draw_pix ()

Variables

int | _mouse_ignore_next = 0
int | _mouse_bctr
int | _mouse_bytes [3]
int | _mouse_started = FALSE
int | _mouse_enabled = FALSE
const int | BTN_MIDDLE = 0b100
const int | BTN_RIGHT = 0b010
const int | BTN_LEFT = 0b001
const int | _CURSOR_TRANSPARENCY = 0x1
const int | _CURSOR_HEIGHT_PIX = 12
const int | _CURSOR_IMAGE [_CURSOR_HEIGHT_PIX]
int | _cursor_pixdata [_CURSOR_HEIGHT_PIX]
Point | _cursor_pos = { 0, 0 }
const struct Rect | _CURSOR_AREA_PIX = { 0, 0, PIX_WIDTH-1, PIX_HEIGHT-1 }
Rect | _cursor_area = { 0, 0, 1, 1 }
int | _cursor_click = 0
int | _cursor_last_btn = 0
int | _cursor_data = 0
int | _cursor_loc = 0
int | _cursor_drawfun = 0
int | _cursor_delfun = 0

Detailed Description

Contains functions for the PS/2 Mouse.


HALRuntimeLibrary: halmsg.hl File Reference

temp

halmsg.hl File Reference

Contains functions to send and receive messages and to configure software timers. More...

Data Structures

struct | Message
A message (informing the program about an event on a device). More...
struct | _MessageHandlers

Functions

int | _msgsend (struct Message *msg)
void | _msgrecv (int do_wait, struct Message *msgTarg)
void | _msg_del_all (int type)
void | do_msgs (int do_forever)
int | msg_dispatch (struct Message *msg)
void | msg_set_handler (int type, int handler)
int | msg_get_handler (int type)
int | msg_exists_handler (int type)
void | msg_push_context (int contextPtr)
void | msg_pop_context ()
int | _mh_ignore_all (int data1, int data2, int context)
int | _mh_quit_all (int data1, int data2, int context)

Variables

const int | MSGBUF_SIZE = 16
const int | MSG_NONE = -1
const int | MSG_DELETED = 0
const int | MSG_KEY = 1
const int | MSG_KEY_DOWN = MSG_KEY
const int | MSG_KEY_UP = 2
const int | MSG_CHAR = 3
const int | MSG_MOUSE = 4
const int | MSG_NETWORK = 6
const int | MSG_SOUND_DONE = 8
const int | MSG_MOUSE_CLICK = 9
const int | MSG_MOUSE_DRAG = 10
const int | MSG_MOUSE_BUTTON_DOWN = 11
const int | MSG_MOUSE_BUTTON_UP = 12
const int | MSG_MOUSE_MOTION = 13
const int | MSG_DEVICE_FIRST = 14
const int | MSG_DEVICE_LAST = MSG_DEVICE_FIRST + DEV_COUNT - 1
const int | MSG_TIMER_FIRST = MSG_DEVICE_LAST + 1
const int | MSG_TIMER_LAST = MSG_TIMER_FIRST + MAX_TIMERS - 1
const int | MSG_FIRST = MSG_KEY
const int | MSG_LAST = MSG_TIMER_LAST
const int | MH_QUIT = -1
int | MH_IGNORE_ALL = addressof _mh_ignore_all
int | MH_QUIT_ALL = addressof _mh_quit_all
volatile int | _msgarr [MSGBUF_SIZE *sizeof record Message]
Message * | _msgbuf
volatile int | _msgstart
volatile int | _msgend
_MessageHandlers * | _msg_handlers = 0

Detailed Description

Contains functions to send and receive messages and to configure software timers.

Function Documentation

void _msg_del_all ( int type )

Deletes all messages that are still waiting inside the message buffer of the given message type type.

int _msgsend ( struct Message * msg )

MESSAGES /////////////////////////////////////// NOTES ON MESSAGES.


HALRuntimeLibrary: halmusic.hl File Reference

temp

halmusic.hl File Reference

Contains music playback functions (for HM music data, which is similar, but less powerful, than MIDI). More...

Data Structures

struct | _HmHeader
struct | _Note
struct | _MusicPlayData
struct | InstrumentList
An instrument list. More...

Functions

int | music_play (int filename, struct InstrumentList *instr)
int | music_play_opened_file (struct File *file, struct InstrumentList *instr)
void | music_stop ()
InstrumentList * | instr_list_new (int size)
void | instr_list_free (struct InstrumentList *instr)
int | instr_load (int file, int offset, struct InstrumentList *instr, int pos)
void | _music_next_note ()
int | _music_on_timer (int handle, int UNUSED, int context)
int | _calc_duration (int samprate, int length)

Variables

_MusicPlayData | _music_play_data
const int | MUSIC_NOTE_MAX = (12 * 8) - 1

Detailed Description

Contains music playback functions (for HM music data, which is similar, but less powerful, than MIDI).


HALRuntimeLibrary: halpix.hl File Reference

temp

halpix.hl File Reference

Contains graphics mode functions. More...

Data Structures

struct | Point
A point. More...
struct | Rect
A rectangle. More...
struct | Point
A point. More...

Functions

void | pix_dbuf_start ()
void | pix_dbuf_stop ()
int | pix_dbuf_enabled ()
void | pix_dbuf_swap ()
void | pix_goto (int x, int y)
void | pix_goto_screen (int x, int y)
int | pix_drawpos (int x, int y)
int | pix_screenpos (int x, int y)
int | pix_where ()
int | pix_toxy (int pos)
int | pix_getpos ()
void | pix_setpos (int pos)
int | pix_getreadpos ()
void | pix_setreadpos (int pos)
void | pix_set_mode (int mode)
int | pix_get_mode ()
void | pix_drawp (int pix)
int | pix_readp ()
void | pix_draww (int word)
int | pix_readw ()
void | pix_cls (int colour)
int | pix_gettrans ()
void | pix_settrans (int col)
int | pix_maxalloc ()
int | pix_alloc (int npix)
void | pix_free ()
int | pix_free_ptr (int ptr, int npix)
void | pix_drawmw (int data_ptr, int target_addr, int size)
void | pix_readmw (int src_addr, int data_ptr, int size)
void | pix_blitw (int src_addr, int src_w, int trg_addr, int blit_w, int blit_h)
void | pix_blit (int src_addr, int src_w, int trg_addr, int blit_w, int blit_h)
void | pix_copy (int src_addr, int trg_addr, int npix)
void | pix_blitwv (int src_addr, int trg_addr, int blit_h)
void | pix_printf (struct Animation *font, int format)
void | pix_printstr (struct Animation *font, int str)
void | pix_print (struct Animation *font, int ch)
void | pix_draw_rect (int col, int w, int h)
void | pix_draw_line (int col, int x1, int y1)
void | pix_draw_poly (int col, int npoints, struct Point *points)
void | pix_draw_poly2 (int col, int npoints, struct Point *points)
void | pix_draw_patpoly (int patterns, int npoints, struct ShadedPoint *points)
void | pix_draw_patpoly2 (int patterns, int npoints, struct ShadedPoint *points)
int | pix_get_pattern (int patterns, int i)
void | _pix_add_line (int x0, int y0, int x1, int y1, int xmin, int xmax)
void | _pix_draw_patlines (int patterns, int ymin, int ymax, int xmin, int xmax, int shademin, int shademax)
void | _pix_add_patline (struct ShadedPoint *p0, struct ShadedPoint *p1, int xmin, int xmax, int shademin, int shademax)
void | _pix_dbuf_set (int bufno)

Variables

const int | _PIX_MEM_SIZE = 1048576
int | _pix_drawbuf_start = 0
int | _pix_screenbuf_start = 0
int | _pix_pos_mask = -1
const int | _PIX_BUF_ADDR [] = { 0, 0x80000 }
const int | _PIX_POS_MASK = _PIX_BUF_ADDR[1] - 1
const int | PIX_WIDTH = 640
const int | PIX_HEIGHT = 480
const int | PIX_SCREEN_SIZE = PIX_WIDTH * PIX_HEIGHT
const int | GM_TEXT = 0
const int | GM_GRAPHICS = 1
int | _pix_free_ptr = PIX_WIDTH * PIX_HEIGHT

Detailed Description

Contains graphics mode functions.


HALRuntimeLibrary: halps2.hl File Reference

temp

halps2.hl File Reference

Contains functions for the PS/2 connectors. More...

Functions

int | is_mouse_present ()
int | is_keyboard_present ()
void | __ps2_init ()
void | _ps2intr ()
void | _ps2_write (int device, int byte)

Variables

const int | _PORT_PS2 [] = { 128, 144 }
int | _key_device = -1
int | _mouse_device = -1

Detailed Description

Contains functions for the PS/2 connectors.

Interrupt handling and enumeration are implemented here.


HALRuntimeLibrary: halselect.hl File Reference

temp

halselect.hl File Reference

Contains functions and data structures used for selection lists. More...

Data Structures

struct | _SelectStringData

Functions

int | select_string (int col_norm, int col_sel, int make_bold, int nstr, int strings)
void | _selstr_draw (struct _SelectStringData *data)
int | _selstr_key_down (int kc, int UU, struct _SelectStringData *data)
int | select_stringlist (int col_norm, int col_sel, int make_bold, int strings)
void | select_files (int col_norm, int col_sel, int make_bold, int accept_func, int target)

Variables

const int | _SELFILES_MAX_PTR = 50
const int | _SELFILES_MAX_STR = MAX_FNAME * _SELFILES_MAX_PTR
const int | _SELLIST_MAX_PTR = 60

Detailed Description

Contains functions and data structures used for selection lists.


HALRuntimeLibrary: halsound.hl File Reference

temp

halsound.hl File Reference

Contains sound playback functions (for waveform data). More...

Data Structures

struct | _SoundPlayData
struct | _SoundTransposeData
struct | _SoundVolumeData
struct | _HsfHeader
struct | _HsfHeader

Functions

void | sound_low_set_callback (int func)
int | sound_get_buffer_status ()
void | sound_set_sample_rate (int rate)
void | sound_play_sample (int sam)
void | sound_play (int filename, int offset, int repeats)
void | sound_play_vol (int filename, int offset, int repeats, int vol, int vol_target)
void | sound_play_transpos (int filename, int offset, int repeats, int transpos)
int | sound_find_next (int filename, int offset)
int | sound_is_playing ()
void | sound_done_set_callback (int func)
void | _soundintr ()
void | _sound_play_init (struct _HsfInfo *info, int repeats)
int | _sound_get_info (int filename, int offset, struct _HsfInfo *info)
int | _sound_transpose_sample_rate (int orig_samprate, int transpos)
void | _sound_play_rate (struct _HsfInfo *info, int sample_rate, int repeats)
int | _sound_calc_offset (int samples)
void | _sound_send_done ()
void | _sound_play_refill ()
void | _sound_play_vol_refill ()
void | _sound_transpos_down_refill ()
void | _sound_transpos_up_refill ()
function | _sound_play_get_next_sample () returns(sample) vars(nodd

Variables

const int | _SOUND_FLAG_BUFSTAT = 0b1100
const int | _SOUND_FLAG_HAS_INTR = 0b1
int | _sndintr_handler = 0
volatile int | _snd_refiller = 0
volatile int | _snd_isuser = 0
_SoundPlayData | _sound_play_data
_SoundTransposeData | _sound_transp_data
const int | _sound_transp_tab [12]
_SoundVolumeData | _sound_vol_data = { 1.0, 0.0 }
const int | SOUND_BUFFER_FULL = 0b1100
const int | SOUND_BUFFER_GOOD = 0b1000
const int | SOUND_BUFFER_BAD = 0b0100
const int | SOUND_BUFFER_EMPTY = 0b0000
const int | SAMPLE_RATE_MIN = 11025
const int | SAMPLE_RATE_MAX = 44100

Detailed Description

Contains sound playback functions (for waveform data).

Variable Documentation

const int _sound_transp_tab[12]

Initial value:

 { 1.000000, 1.059463, 1.122462, 1.189207, 1.259921, 1.334840,
                                1.414213, 1.498307, 1.587401, 1.681793, 1.781797, 1.887748
                              }


HALRuntimeLibrary: halstring.hl File Reference

temp

halstring.hl File Reference

Contains functions to work with strings and compact strings. More...

Data Structures

struct | _StrPrintfv_Data

Functions

int | format_hex (int num, int str)
int | format_hexnum (int num, int str, int len)
int | format_dec (int num, int str)
int | format_fp (int fp, int str)
int | conv_hex (int str)
int | conv_dec (int str)
int | strlen (int str)
int | strcopy (int src, int target, int max_len)
int | strcompare (int str1, int str2)
int | char_upper (int char)
int | char_lower (int char)
int | strcompare_nocase (int str1, int str2)
int | strcat (int str, int target, int max_len)
int | cstr_foreach (int cstr, int func, int initial)
int | strpack (int orig, int compact)
int | cstr_unpack (int cstr, int noncompact)
int | _cstr_unpack_foreach (int char, int data)
int | cstrlen (int cstr)
int | _cstrlen_foreach (int char, int data)
_StrPrintfv_Data * | _strprintfv_foreach (int char, struct _StrPrintfv_Data *data)
void | strprintfv (int format, int target, int target_len, int va_start, int va_count)
void | strprintfxv (int format, int target, int target_len, int xfunction, int va_start, int va_count)
void | strprintf (int format, int target, int target_len)
void | strprintfx (int format, int target, int target_len, int xfunction)

Variables

const int | _STR_BIGBUF = 1024

Detailed Description

Contains functions to work with strings and compact strings.


HALRuntimeLibrary: Data Structures

  • Data Structures
  • Data Fields

HALRuntimeLibrary Data Structures

Here are the data structures with brief descriptions:
Animation | A HaDes Animation info block You should not use the members directly
File | Represents an opened file
H3DObject | A three-dimensional object composed of several polygons
H3DPolygon | One of the polygons
HftHeader | The HFT Header information
HgFlatPolygon | A flat-shaded generic polygon
HgFlatQuad | A flat-shaded quad
HgFlatTriangle | A flat-shaded triangle
HgPoint | A three-dimensional point
HgRoundedPolygon | A rounded generic polygon
HgRoundedQuad | A rounded quad
HgRoundedTriangle | A rounded triangle
HgVector | A three-dimensional vector
HgVertex | A vertex, consisting of a point and a normal
Highscore | The high score object
HighscoreEntry | A highscore entry
InstrumentList | An instrument list
KeyconfKeyInfo | A key configuration info structure
Message | A message (informing the program about an event on a device)
Point | A point
Rect | A rectangle


HALRuntimeLibrary: Animation Struct Reference

  • Data Structures
  • Data Fields

Animation Struct Reference
[Animation functions]

A HaDes Animation info block You should not use the members directly. More...

Data Fields

int | width
int | height
int | transparency
int | imageCount
int | pixAddr

Detailed Description

A HaDes Animation info block You should not use the members directly.

Use the anim_*() functions instead.

Field Documentation

int Animation::height

frame height (pixels)

int Animation::imageCount

frame count

int Animation::pixAddr

pix memory start address

int Animation::transparency

transparent colour (-1 for none)

int Animation::width

frame width (pixels)

The documentation for this struct was generated from the following file:
  • halanim.hl


HALRuntimeLibrary: File Struct Reference

  • Data Structures
  • Data Fields

File Struct Reference
[File Functions]

Represents an opened file. More...

Data Fields

int | dirHandle
int | length
int | remain
int | fptr
int | fget_func
int | fgetw_func
int | fput_func
int | checkfail_func
int | begin

Detailed Description

Represents an opened file.

You should not access the elements directly, use status functions like fgetattrib() and fsize() instead.

Field Documentation

int File::begin

Zeiger auf den Dateianfang (die Nutzdaten betreffend).

int File::checkfail_func

Zeiger auf die passende checkfail-Funktion.

int File::dirHandle

Flash-Zeiger auf den Dateianfang (>0, falls Header vorhanden).

int File::fget_func

Zeiger auf die passende fget-Funktion.

int File::fgetw_func

Zeiger auf eine Funktion die ein komplettes Wort liest (Optimierung!).

int File::fptr

aktueller Schreib-/Lesezeiger

int File::fput_func

Zeiger auf die passende fput-Funktion.

int File::length

Länge der Datei (nur Nutzdaten).

int File::remain

Anzahl noch ungelesener/ungeschriebener Bytes.

The documentation for this struct was generated from the following file:
  • halfile.hl


HALRuntimeLibrary: H3DObject Struct Reference

  • Data Structures
  • Data Fields

H3DObject Struct Reference
[3D Object Functions]

A three-dimensional object composed of several polygons. More...

Data Fields

int | numVertices
HgVertex * | vertices
int | numPolygons
int | polygons

Detailed Description

A three-dimensional object composed of several polygons.

These polygons may share their vertices, which are saved separately as HgVertex objects and are accessible via the H3DObject too. Use the provided functions to access the members.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: H3DPolygon Struct Reference

  • Data Structures
  • Data Fields

H3DPolygon Struct Reference
[3D Object Functions]

One of the polygons. More...

Data Fields

int | flags
int | pattern
HgVector | normal
int | numVertices
int | vertices [_H3D_VA_SIZE]

Detailed Description

One of the polygons.

They are always part of a H3DObject. Note that the vertices are pointers to a H3OVertex, which is also part of the H3DObject. Please use the provided inline functions to access the members. Note: sizeof(H3DPolygon) is meaningless because it contains a flexible array

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: HftHeader Struct Reference

  • Data Structures
  • Data Fields

HftHeader Struct Reference
[File transfer functions]

The HFT Header information. More...

Data Fields

int | name [MAX_FNAME]
int | size
int | attr

Detailed Description

The HFT Header information.

The documentation for this struct was generated from the following file:
  • halft.hl


HALRuntimeLibrary: HgFlatPolygon Struct Reference

  • Data Structures
  • Data Fields

HgFlatPolygon Struct Reference
[3D Drawing Functions]

A flat-shaded generic polygon. More...

Data Fields

int | pattern
HgVector | normal
int | numPoints
int | points [_MAX_VERTICES *sizeof record HgVector]

Detailed Description

A flat-shaded generic polygon.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: HgFlatQuad Struct Reference

  • Data Structures
  • Data Fields

HgFlatQuad Struct Reference
[3D Drawing Functions]

A flat-shaded quad. More...

Data Fields

int | pattern
HgVector | normal
int | numPoints
int | points [4 *sizeof record HgVector]

Detailed Description

A flat-shaded quad.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: HgFlatTriangle Struct Reference

  • Data Structures
  • Data Fields

HgFlatTriangle Struct Reference
[3D Drawing Functions]

A flat-shaded triangle. More...

Data Fields

int | pattern
HgVector | normal
int | numPoints
int | points [3 *sizeof record HgVector]

Detailed Description

A flat-shaded triangle.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: HgPoint Struct Reference

  • Data Structures
  • Data Fields

HgPoint Struct Reference
[3D Drawing Functions]

A three-dimensional point. More...

Data Fields

int | x
int | y
int | z

Detailed Description

A three-dimensional point.

This can be used as a 3-D vector parameter for the HG Functions.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: HgRoundedPolygon Struct Reference

  • Data Structures
  • Data Fields

HgRoundedPolygon Struct Reference
[3D Drawing Functions]

A rounded generic polygon. More...

Data Fields

int | pattern
HgVector | normal
int | numVertices
int | vertices [_MAX_VERTICES *sizeof record HgVertex]

Detailed Description

A rounded generic polygon.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: HgRoundedQuad Struct Reference

  • Data Structures
  • Data Fields

HgRoundedQuad Struct Reference
[3D Drawing Functions]

A rounded quad. More...

Data Fields

int | pattern
HgVector | normal
int | numVertices
int | vertices [4 *sizeof record HgVertex]

Detailed Description

A rounded quad.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: HgRoundedTriangle Struct Reference

  • Data Structures
  • Data Fields

HgRoundedTriangle Struct Reference
[3D Drawing Functions]

A rounded triangle. More...

Data Fields

int | pattern
HgVector | normal
int | numVertices
int | vertices [3 *sizeof record HgVertex]

Detailed Description

A rounded triangle.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: HgVector Struct Reference

  • Data Structures
  • Data Fields

HgVector Struct Reference
[3D Drawing Functions]

A three-dimensional vector. More...

Data Fields

int | x
int | y
int | z

Detailed Description

A three-dimensional vector.

This can be used as a 3-D vector parameter for the HG Functions. It can also be used interchangingly with HgPoint.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: HgVertex Struct Reference

  • Data Structures
  • Data Fields

HgVertex Struct Reference
[3D Drawing Functions]

A vertex, consisting of a point and a normal. More...

Data Fields

HgPoint | pos
HgVector | normal

Detailed Description

A vertex, consisting of a point and a normal.

The documentation for this struct was generated from the following file:
  • hal3d_types.hl


HALRuntimeLibrary: Highscore Struct Reference

  • Data Structures
  • Data Fields

Highscore Struct Reference
[Highscore Functions]

The high score object. More...

Data Fields

int | file_name [MAX_FNAME]
HighscoreEntry * | data

Detailed Description

The high score object.

Don't use the members directly, use the hsc_* functions instead

The documentation for this struct was generated from the following file:
  • halhighscore.hl


HALRuntimeLibrary: HighscoreEntry Struct Reference

  • Data Structures
  • Data Fields

HighscoreEntry Struct Reference
[Highscore Functions]

A highscore entry. More...

Data Fields

int | is_new
int | level
int | score
int | player [9]

Detailed Description

A highscore entry.

The documentation for this struct was generated from the following file:
  • halhighscore.hl


HALRuntimeLibrary: InstrumentList Struct Reference

  • Data Structures
  • Data Fields

InstrumentList Struct Reference

An instrument list. More...

Data Fields

int | count
_HsfInfo * | info

Detailed Description

An instrument list.

Please use the instr_*() functions instead of accessing the members directly.

The documentation for this struct was generated from the following file:
  • halmusic.hl


HALRuntimeLibrary: KeyconfKeyInfo Struct Reference

  • Data Structures
  • Data Fields

KeyconfKeyInfo Struct Reference
[Key configuration]

A key configuration info structure. More...

Data Fields

int | name
int | default

Detailed Description

A key configuration info structure.

The documentation for this struct was generated from the following file:
  • halkeyconf.hl


HALRuntimeLibrary: Message Struct Reference

  • Data Structures
  • Data Fields

Message Struct Reference
[Message handling]

A message (informing the program about an event on a device). More...

Data Fields

int | type
int | param1
int | param2

Detailed Description

A message (informing the program about an event on a device).

Field Documentation

int Message::param1

Parameter (message type specific).

int Message::param2

2nd Parameter (message type specific)

int Message::type

Message type (MSG_*).

The documentation for this struct was generated from the following file:
  • halmsg.hl


HALRuntimeLibrary: Point Struct Reference

  • Data Structures
  • Data Fields

Point Struct Reference
[Graphics mode functions, Graphics mode functions]

A point. More...

Data Fields

int | x
int | y
int | shade

Detailed Description

A point.

shade should be a value between 0 and 15, inclusive.

The documentation for this struct was generated from the following file:
  • halpix.hl


HALRuntimeLibrary: Rect Struct Reference

  • Data Structures
  • Data Fields

Rect Struct Reference
[Graphics mode functions]

A rectangle. More...

Data Fields

Point start
Point end

Detailed Description

A rectangle.

Field Documentation

struct Point Rect::end

The bottom-right edge.

struct Point Rect::start

The top-left edge.

The documentation for this struct was generated from the following file:
  • halpix.hl


HALRuntimeLibrary: Data Fields

  • Data Structures
  • Data Fields
  • All
  • Variables
Here is a list of all documented struct and union fields with links to the struct/union documentation for each field:

  • begin : File
  • checkfail_func : File
  • dirHandle : File
  • end : Rect
  • fget_func : File
  • fgetw_func : File
  • fptr : File
  • fput_func : File
  • height : Animation
  • imageCount : Animation
  • length : File
  • param1 : Message
  • param2 : Message
  • pixAddr : Animation
  • remain : File
  • start : Rect
  • transparency : Animation
  • type : Message
  • width : Animation


HALRuntimeLibrary: Module Index

HALRuntimeLibrary Modules

Here is a list of all modules:
  • 3D Drawing Functions
  • 3D Object Functions
  • Algorithms
  • Animation functions
  • Mathematical functions
  • Display functions
  • Basic Functions
  • Hardware access
  • Error numbers
  • Device I/O functions
  • File Functions
  • File transfer functions
  • Text screen functions
  • Highscore Functions
  • Keyboard handling
  • Key configuration
  • Memory management
  • Menu functions
  • Mouse Functions
  • Message handling
  • Music playback functions
  • Graphics mode functions
  • PS/2 connectors
  • Selection lists
  • Waveform sound playback functions
  • String functions
  • Timer functions


HALRuntimeLibrary: 3D Drawing Functions

3D Drawing Functions

Functions for basic 3D displays. More...

Data Structures

struct | HgPoint
A three-dimensional point. More...
struct | HgVector
A three-dimensional vector. More...
struct | HgVertex
A vertex, consisting of a point and a normal. More...
struct | HgFlatPolygon
A flat-shaded generic polygon. More...
struct | HgFlatTriangle
A flat-shaded triangle. More...
struct | HgFlatQuad
A flat-shaded quad. More...
struct | HgRoundedPolygon
A rounded generic polygon. More...
struct | HgRoundedTriangle
A rounded triangle. More...
struct | HgRoundedQuad
A rounded quad. More...

Functions

HgFlatPolygon * | hg_new_flat_polygon (int numPoints)
HgVector * | hg_flat_point (int poly, int i)
HgRoundedPolygon * | hg_new_rounded_polygon (int numVertices)
HgVertex * | hg_rounded_point (int poly, int i)
void | hg_mulmm (int a, int b, int m)
void | hg_mulmv (int matrix, int vector, int result)
void | hg_mulmv_transp (int matrix, int vector, int result)
void | hg_identity ()
void | hg_translate (int dx, int dy, int dz)
void | _hg_rotate (int angle, int matrix, int cos1, int cos2, int sin_pos, int sin_neg)
void | hg_xrotate (int angle)
void | hg_yrotate (int angle)
void | hg_zrotate (int angle)
void | hg_scale (int sx, int sy, int sz)
void | hg_projection (int hangle, int vangle, int near, int far)
void | hg_viewport (int x, int y, int width, int height)
void | hg_mulsv (int scalar, int vector, int result)
int | hg_cross (int v1, int v2, int result)
int | hg_diff (int v1, int v2, int result)
int | hg_sum (int v1, int v2, int result)
void | hg_cartesian (int vector)
int | hg_dotprod (int v1, int v2)
int | hg_norm (int vector)
void | hg_normalize (int vector)
void | hg_light (int x, int y, int z)
void | hg_shade_func (int func)
HgVector * hg_get_light ()
int | hg_transform_point (struct HgPoint *p)
int | hg_clip (int poly, int nvertices)
int | hg_clip_rounded (int poly, int normals, int nvertices)
void | hg_shaded_polygon (struct H3DPolygon *p)
void | hg_flat_polygon (struct HgFlatPolygon *p)
void | hg_rounded_polygon (struct HgRoundedPolygon *p)

Variables

const int | _MAX_VERTICES = 32

Detailed Description

Functions for basic 3D displays.

Function Documentation

void _hg_rotate | ( | int | angle,
 |  | int | matrix,
 |  | int | cos1,
 |  | int | cos2,
 |  | int | sin_pos,
 |  | int | sin_neg
 | ) |

Verwendet matrix als Rotationsmatrix.

An den entsprechenden Stellen cos1, cos2, sin_pos, sin_neg werden die Werte cos(angle), sin(angle) bzw. -sin(angle) eingetragen. Anschließend wird diese Matrix mit der aktuellen Transformationsmatrix multipliziert. Die inverse Transformation wird ebenfalls berechnet.

void hg_cartesian ( int vector )

Für einen Vektor mit homogenen Koordinaten (4-dim.

) werden die kartesischen Koordinaten berechnet, die 4. Komponente wird auf 1 gesetzt.

int hg_clip | ( | int | poly,
 |  | int | nvertices
 | ) |

Clipped das Polygon poly mit nvertices Ecken in den Einheitswürfel.

int hg_clip_rounded | ( | int | poly,
 |  | int | normals,
 |  | int | nvertices
 | ) |

Clipped das (rounded) Polygon poly mit nvertices Ecken in den Einheitswürfel.

Zusätzlich werden auch die Normalenvektoren der Punkte neu berechnet.

int hg_cross | ( | int | v1,
 |  | int | v2,
 |  | int | result
 | ) |

Berechnet Kreuzprodukt r = result = v1 x v2 (alle 3-dim.

). result muss einen von v1,v2 disjunkten Speicherbereich adressieren.

int hg_diff | ( | int | v1,
 |  | int | v2,
 |  | int | result
 | ) |

Berechnet die Differenz zweier Vektoren r = result = v1 - v2 (alle 3-dim.

). Speicherbereiche müssen hier nicht disjunkt sein.

int hg_dotprod | ( | int | v1,
 |  | int | v2
 | ) |

Berechnet Skalarprodukt r = <v1,v2> (beide 3-dim.).

struct HgVector* hg_flat_point | ( | int | poly,
 |  | int | i
 | ) |

Gets a pointer to the i'th point of the given flat polygon. Does not check whether it exists. INLINE.

void hg_flat_polygon ( struct HgFlatPolygon * p )

Zeichnet schattiertes flaches Polygon im HgFlatPolygon Format.

struct HgVector* hg_get_light ( )

Gibt den transformierten (und normalisierten) Licht-Vektor zurück.

Zuvor muss dieser jedoch mit hg_light() definiert werden.

void hg_identity ( )

Schreibt die Einheitsmatrix (für homogene Koordinaten) in die Transformationsmatrix "tmatrix" (_hg_tmatrix).

void hg_light | ( | int | x,
 |  | int | y,
 |  | int | z
 | ) |

Definiert die Lichtrichtung [(x,y,z) muss nicht normalisiert sein].

void hg_mulmm | ( | int | a,
 |  | int | b,
 |  | int | m
 | ) |

Multipliziert zwei 4x4-Matrizen ("m" für Matrix) a und b.

Es wird vorausgesetzt, dass in der vierten Zeile (implizit) jeweils der Einheitsvektor (0,0,0,1) steht. Sowohl a,b als auch m besitzen daher nur 12 Einträge.

void hg_mulmv | ( | int | matrix,
 |  | int | vector,
 |  | int | result
 | ) |

Berechnet result = matrix * vector (Matrix mit 4.

Zeile = (0,0,0,1), 3-dim. Vektoren), die Speicherbereiche von result und vector dürfen sich nicht überlappen.

void hg_mulmv_transp | ( | int | matrix,
 |  | int | vector,
 |  | int | result
 | ) |

Berechnet result = matrix^T * vector (Matrix mit 4.

Zeile = (0,0,0,1), 3-dim. Vektoren), die Speicherbereiche von result und vector dürfen sich nicht überlappen. Dies ist eine spezielle Funktion für Normalenvektor-Transformationen; die 4. Komponente der homogenen Koordinaten wird gänzlich ignoriert.

void hg_mulsv | ( | int | scalar,
 |  | int | vector,
 |  | int | result
 | ) |

Berechnet result = scalar * vector (alle 3-dim.

), vector und result können auf die gleiche Speicheradresse zeigen.

struct HgFlatPolygon* hg_new_flat_polygon ( int numPoints )

Creates a new flat-shaded polygon with the given number of points on the heap.

The polygon's data is not initialized, but the number of points is set.

struct HgRoundedPolygon* hg_new_rounded_polygon ( int numVertices )

Creates a new rounded polygon with the given number of points on the heap.

The polygon's data is not initialized, but the number of points is set.

int hg_norm ( int vector )

Liefert die Norm des 3-dim. Vektors vector.

void hg_normalize ( int vector )

Normalisiert den 3-dim. Vektor vector, so dass ||vector||=1.

void hg_projection | ( | int | hangle,
 |  | int | vangle,
 |  | int | near,
 |  | int | far
 | ) |

Berechnet die Projektionsmatrix zu den Parametern hangle (horizontaler Öffnungswinkel), vangle (vertikaler Öffnungswinkel), near und far (Begrenzungen des sichtbaren Volumens in Z-Richtung).

Die Winkel sind in Grad (1-179) anzugeben, für near und far werden positive Fixpunktzahlen erwartet (z.B. 1.0 und 100.0).

struct HgVertex* hg_rounded_point | ( | int | poly,
 |  | int | i
 | ) |

Gets a pointer to the i'th vertex of the given rounded polygon. Does not check whether it exists. INLINE.

void hg_rounded_polygon ( struct HgRoundedPolygon * p )

Zeichnet schattiertes "rounded" Polygon im HgRoundedPolygon Format.

void hg_scale | ( | int | sx,
 |  | int | sy,
 |  | int | sz
 | ) |

Multipliziert tmatrix mit der Skalierungsmatrix(sx,sy,sz).

Die Parameter sind Fixpunktzahlen.

void hg_shade_func ( int func )

Definiert die Shade-Funktion (0 setzt die Standard-Funktion ein).

Die Shade-Funktion bekommt als einzigen Parameter einen Zeiger auf den transformierten (!) und normalisierten Normalenvektor (also ref HgVector). Zurückgeliefert werden muss der Shade-Wert (im Bereich 0..15).

void hg_shaded_polygon ( struct H3DPolygon * p )

Zeichnet schattiertes Polygon.

int hg_sum | ( | int | v1,
 |  | int | v2,
 |  | int | result
 | ) |

Berechnet die Summe zweier Vektoren r = result = v1 + v2 (alle 3-dim.

). Speicherbereiche müssen hier nicht disjunkt sein.

int hg_transform_point ( struct HgPoint * p )

Transformiert einen einzelnen Punkt mit der aktuellen Matrix.

Gibt die Bildschirmkoordinaten zurück.

void hg_translate | ( | int | dx,
 |  | int | dy,
 |  | int | dz
 | ) |

Multipliziert tmatrix mit der Translationsmatrix(dx,dy,dz).

Die Parameter sind Fixpunktzahlen.

void hg_viewport | ( | int | x,
 |  | int | y,
 |  | int | width,
 |  | int | height
 | ) |

Legt den Darstellungsbereich fest (in Bildschirmkoordinaten).

(x,y) ist der linke obere Punkt des Darstellungsfensters, das eine Höhe (Breite) von height (width) Pixeln besitzt.

void hg_xrotate ( int angle )

Multipliziert tmatrix mit der X-Rotationsmatrix(angle), bewirkt also eine Drehung um angle Grad (als Integer [0.

.360] anzugeben).

void hg_yrotate ( int angle )

Multipliziert tmatrix mit der Y-Rotationsmatrix(angle), bewirkt also eine Drehung um angle Grad (als Integer [0.

.360] anzugeben).

void hg_zrotate ( int angle )

Multipliziert tmatrix mit der Z-Rotationsmatrix(angle), bewirkt also eine Drehung um angle Grad (als Integer [0.

.360] anzugeben).

Variable Documentation

const int _MAX_VERTICES = 32

The maximum number of vertices that a polygon can hold.


HALRuntimeLibrary: 3D Object Functions

3D Object Functions

Functions and data structures for managing complex three-dimensional objects, which are composed of polygons. More...

Data Structures

struct | H3DObject
A three-dimensional object composed of several polygons. More...
struct | H3DPolygon
One of the polygons. More...

Functions

H3DObject * | h3o_new (int num_vertices, int num_polygons)
H3DPolygon * | h3o_make_poly (struct H3DObject *obj, int poly_number, int vertex_count)
void | h3o_free (struct H3DObject *obj)
int | h3o_obj_vertex_count (struct H3DObject *obj)
HgVertex * | h3o_obj_vertex (struct H3DObject *obj, int n)
int | h3o_obj_poly_count (struct H3DObject *obj)
H3DPolygon * | h3o_obj_poly (struct H3DObject *obj, int n)
int | h3o_poly_get_flags (struct H3DPolygon *poly)
void | h3o_poly_set_flags (struct H3DPolygon *poly, int flags)
int | h3o_poly_get_pattern (struct H3DPolygon *poly)
void | h3o_poly_set_pattern (struct H3DPolygon *poly, int pattern)
int | h3o_poly_vertex_count (struct H3DPolygon *poly)
HgVertex * | h3o_poly_get_vertex (struct H3DPolygon *poly, int n)
void | h3o_poly_set_vertex (struct H3DPolygon *poly, int n, struct HgVertex *vertex)
H3DObject * | h3o_load (int filename, int npatterns, int patterns)
void | h3o_calc_normals (struct H3DObject *obj)

Variables

const int | _H3D_VA_SIZE = 1
const int | H3D_MASK_POLY_ROUNDED = 0x1
const int | H3D_POLY_ROUNDED = 0x1
const int | H3D_POLY_FLAT = 0x0
const int | _H3O_POLY_VCOUNT_MASK = 0x7F
const int | _H3O_POLY_ROUNDED = 0x80

Detailed Description

Functions and data structures for managing complex three-dimensional objects, which are composed of polygons.

These can be loaded from a file or created programmatically.

Function Documentation

void h3o_calc_normals ( struct H3DObject * obj )

Calculates all of the normals for the polygons and points of the given H3DObject.

Note: This is a very expensive operation...

void h3o_free ( struct H3DObject * obj )

Frees the H3DObject and all polygons and vertices that are part of it.

struct H3DObject* h3o_load | ( | int | filename,
 |  | int | npatterns,
 |  | int | patterns
 | ) |

Loads a H3O from file.

Creates the object and returns it. If an error occured, NULL is returned.

Parameters:
filename | NON-COMPACT file name string.
npatterns | Number of patterns available. Must be at least 0.
patterns | Pointer to an array that contains pointers to all the available patterns

struct H3DPolygon* h3o_make_poly | ( | struct H3DObject * | obj,
 |  | int | poly_number,
 |  | int | vertex_count
 | ) |

Creates a new H3DPolygon as a part of the given H3DObject.

The polygon is initialized to zero.

Parameters:
poly_number | The polygon's index in the obj. If there's already a polygon there, that is replaced.
vertex_count | Number of vertices of the new polygon.
Returns:
A pointer to the created polygon.

struct H3DObject* h3o_new | ( | int | num_vertices,
 |  | int | num_polygons
 | ) |

Creates a new H3DObject which contains the specified number of vertices and polygons.

Note: the polygons are not yet created, this must be done with h3o_make_poly(). Another note: After defining all of the polygons, you should call h3o_calc_normals() to compute normal vectors before rendering the polygons! Otherwise lighting will not work.

struct H3DPolygon* h3o_obj_poly | ( | struct H3DObject * | obj,
 |  | int | n
 | ) |

Gets the n'th polygon in the H3DObject. But it may be 0 if that hasn't yet been created (h3o_make_poly).

int h3o_obj_poly_count ( struct H3DObject * obj )

Gets the number of polygons in the H3DObject.

struct HgVertex* h3o_obj_vertex | ( | struct H3DObject * | obj,
 |  | int | n
 | ) |

Gets the n'th vertex in that H3DObject.

int h3o_obj_vertex_count ( struct H3DObject * obj )

Gets the number of vertices in the H3DObject.

int h3o_poly_get_flags ( struct H3DPolygon * poly )

Gets the polygon's flags.

int h3o_poly_get_pattern ( struct H3DPolygon * poly )

Gets the polygon's pattern pointer.

struct HgVertex* h3o_poly_get_vertex | ( | struct H3DPolygon * | poly,
 |  | int | n
 | ) |

Gets the n'th vertex in that H3DPolygon.

void h3o_poly_set_flags | ( | struct H3DPolygon * | poly,
 |  | int | flags
 | ) |

Sets the polygon's flags.

void h3o_poly_set_pattern | ( | struct H3DPolygon * | poly,
 |  | int | pattern
 | ) |

Sets the polygon's pattern pointer.

void h3o_poly_set_vertex | ( | struct H3DPolygon * | poly,
 |  | int | n,
 |  | struct HgVertex * | vertex
 | ) |

Sets the n'th vertex in that H3DPolygon.

int h3o_poly_vertex_count ( struct H3DPolygon * poly )

Gets the number of vertices in the H3DPolygon.

Variable Documentation

const int _H3D_VA_SIZE = 1

size of any variable array used here

const int H3D_POLY_FLAT = 0x0

The polygon is flat, i.e. its normal vector is orthogonal to it.

const int H3D_POLY_ROUNDED = 0x1

The polygon is rounded, i.e. normal vectors are averaged with adjacent polygons.


HALRuntimeLibrary: Algorithms

Algorithms

Some generally useful algorithms for managing data. More...

Functions

void | sort (int array, int elem_size, int count, int cmpfun)
int | find_binary (int array, int elem_size, int count, int elem, int cmpfun)
int | insert_sorted (int array, int elem_size, int count, int elem, int cmpfun)

Detailed Description

Some generally useful algorithms for managing data.

Function Documentation

int find_binary | ( | int | array,
 |  | int | elem_size,
 |  | int | count,
 |  | int | elem,
 |  | int | cmpfun
 | ) |

Finds an element in the given sorted array and returns a pointer to it (if it is present) or a pointer to the element *before* which it would be inserted, if it isn't.

If the element is not present and should be inserted after the last element of the array, a pointer after that last element is returned.

Parameters:
array | Pointer to the beginning of the array
elem_size | Size of each array element, and the new element, in words
count | Total count of elements in the array
elem | Pointer to the new element
cmpfun | Pointer to function with signature 'bool cmpfun(p1, p2)' which should return true if the object @p1 is less than the object @p2.
Returns:
Pointer to the found element, or the element before which it should be inserted. Also returns a boolean variable signalling if the element was found.

int insert_sorted | ( | int | array,
 |  | int | elem_size,
 |  | int | count,
 |  | int | elem,
 |  | int | cmpfun
 | ) |

Inserts a new element into the given sorted array and keeps it sorted.

Note that if the new element is greater than all of the existing elements in the array, it is not inserted. (where should it be?) However if an equal element is already present in the array, the new element is still inserted (before it). Otherwise, the new element is copied into the array at the matching position.

Parameters:
array | Pointer to the beginning of the array
elem_size | Size of each array element, and the new element, in words
count | Total count of elements in the array
elem | Pointer to the new element
cmpfun | Pointer to function with signature 'bool cmpfun(p1, p2)' which should return true if the object @p1 is less than the object @p2.

void sort | ( | int | array,
 |  | int | elem_size,
 |  | int | count,
 |  | int | cmpfun
 | ) |

Sorts the given array.

Parameters:
array | Pointer to the beginning of the array
elem_size | Size of each array element, in words
count | Total count of elements to be sorted
cmpfun | Pointer to function with signature 'bool cmpfun(p1, p2)' which should return true if the object @p1 is less than the object @p2.


HALRuntimeLibrary: Animation functions

Animation functions

Functions to load and display HaDes Animations (HA files) on the pixel screen. More...

Data Structures

struct | Animation
A HaDes Animation info block You should not use the members directly. More...

Functions

Animation * | anim_load (int file_name, int file_offset)
Animation * | anim_load_at (struct File *file)
void | anim_draw_frame (struct Animation *anim, int frame_no)
int | anim_draw_frame_direct (int filename, int foff, int frame_no)
int | anim_draw_frame_direct_at (struct File *file, int frame_no)
int | anim_find_next (int filename, int foff)
int | anim_find_next_at (struct File *file)
int | anim_get_info (int filename, int foff, struct Animation *anim)
void | anim_draw_scaled_frame (struct Animation *anim, int frame_no, int w, int h)
int | anim_image_pointer (struct Animation *anim, int frame_no)
int | anim_free (struct Animation *anim)
Animation * | anim_new (int width, int height, int imageCount)

Detailed Description

Functions to load and display HaDes Animations (HA files) on the pixel screen.

Function Documentation

void anim_draw_frame | ( | struct Animation * | anim,
 |  | int | frame_no
 | ) |

Draws an animation frame to the current graphics position.

The animation's transparency setting is used. The current graphics position is restored afterwards.

int anim_draw_frame_direct | ( | int | filename,
 |  | int | foff,
 |  | int | frame_no
 | ) |

Draws an animation frame directly from the flash at the current graphics position.

The animation's transparency setting is used. The current graphics position is restored afterwards.

Warning:
The animation should not be compressed, because then only a part of the frame would be drawn.
Parameters:
filename | Name of the file (NON compact string)
foff | Offset of the animation inside the file
frame_no | Number of the frame to draw.
Returns:
TRUE if drawing succeeded, FALSE otherwise.

int anim_draw_frame_direct_at | ( | struct File * | file,
 |  | int | frame_no
 | ) |

Draws an animation frame directly from the flash at the current graphics position.

The animation's transparency setting is used. The current graphics position is restored afterwards.

Warning:
The animation should not be compressed, because then only a part of the frame would be drawn.
Parameters:
file | Opened file which is positioned at the start of the animation
frame_no | Number of the frame to draw.
Returns:
TRUE if drawing succeeded, FALSE otherwise.

int anim_find_next | ( | int | filename,
 |  | int | foff
 | ) |

Given a file which contains several animations, and the offset of one of these animations in the file, returns the offset of the next animation in the file, or 0 if an error occurs.

int anim_find_next_at ( struct File * file )

Given an opened file that is located at the start of an animation, seeks forward until just after the end of that animation.

Returns:
TRUE if the animation's header is correct, FALSE otherwise. If FALSE is returned, the new file position is invalid.

int anim_free ( struct Animation * anim )

Frees the main memory resources associated with the given animation The pixel memory resources will only be freed if no other animations have since been loaded.

Returns:
TRUE if the pixel resources could be freed, FALSE otherwise.

int anim_get_info | ( | int | filename,
 |  | int | foff,
 |  | struct Animation * | anim
 | ) |

Reads information about the animation into the given Animation structure.

No images are loaded, the resulting animation can not be drawn. But you'll get its width, height, and transparency.

Parameters:
filename | Name of the file (NON compact string)
foff | Offset of the animation inside the file
anim | Animation structure into which the information will be read
Returns:
TRUE if reading the information succeeded, FALSE otherwise.

int anim_image_pointer | ( | struct Animation * | anim,
 |  | int | frame_no
 | ) |

Gets a pixel memory pointer to a given frame in this animation.

struct Animation* anim_load | ( | int | file_name,
 |  | int | file_offset
 | ) |

Loads an animation from a file.

Parameters:
file_name | is the file name
file_offset | is the offset (in bytes) within the file where the animation starts. Normally you would use 0 here.
Returns:
Pointer to a dynamically allocated Animation handle. If the animation could not be loaded, returns 0 instead. The second return is the file_offset after the end of the animation (inside the file).

struct Animation* anim_load_at ( struct File * file )

Loads an animation which starts at the current file position of the given, opened file.

If loading succeeds, a handle to the created animation is returned, and the file position is advanced just after the end of the animation. The file will be left open.
If loading fails, NULL is returned and the new file position is arbitrary.

struct Animation* anim_new | ( | int | width,
 |  | int | height,
 |  | int | imageCount
 | ) |

Makes a new animation with the specified dimensions.


HALRuntimeLibrary: Mathematical functions

Mathematical functions

Mathematical functions provided by the HAL. More...

Functions

int | divfp (int a, int b)
int | random ()
int | random_getseed ()
void | random_setseed (int seed)
int | gcd (int a, int b)
int | min (int a, int b)
int | max (int a, int b)
int | abs (int a)
int | bound (int a, int min, int max)
int | sin (int x)
int | cos (int x)
int | tan (int x)
int | sqrt (int x)
int | isqrt (int x)
int | ilogd (int x)
int | fp2int (int fp)
int | int2fp (int int)
int | floor (int fp)
int | ceil (int fp)
int | broken (int fp)

Detailed Description

Mathematical functions provided by the HAL.

Function Documentation

int abs ( int a )

Returns the absolute value of the given value.

int bound | ( | int | a,
 |  | int | min,
 |  | int | max
 | ) |

Returns the value of a, bounded to the range [min, max] (both inclusive).

int broken ( int fp )

Gets just the broken part of the given fixpoint value, as a fixpoint value of course.

int ceil ( int fp )

Computes the next greater-or-equal integer value for the given fixpoint value.

int cos ( int x )

Computes the cosine of the INT variale x, which must be in the range [0,360], and returns it as a FP number.

int divfp | ( | int | a,
 |  | int | b
 | ) |

Fixpoint Division.

int floor ( int fp )

Computes the next less-or-equal integer value for the given fixpoint value.

int fp2int ( int fp )

Converts a fixpoint number to an integer.

Precision is lost, but the resulting number is rounded.

int gcd | ( | int | a,
 |  | int | b
 | ) |

Returns the greatest common divisor (gcd) of a, b.

int ilogd ( int x )

Computes the integer part of the dual logarithm (Logarithmus Dualis) of the UNSIGNED INT variable x.

If x is zero, where the logarithm is undefined, zero is returned.

int int2fp ( int int )

Converts an integer number to a fixpoint.

The number's absolute value must be less than 2^15, otherwise the result will be invalid, because it overflows.

int isqrt ( int x )

Computes the square root of the INT variable x and returns it as an FP number.

The method works for all x in range [0, 2^29]. If x is negative, zero will be returned.

int max | ( | int | a,
 |  | int | b
 | ) |

Returns the larger one of two values.

int min | ( | int | a,
 |  | int | b
 | ) |

Returns the smaller one of two values.

int random ( )

Computes a new pseudo-random value in the range 0.

.MAX_INT. Algorithm: Minimal Standard Random Number Generator.

int random_getseed ( )

Gets the current random seed.

void random_setseed ( int seed )

Sets the random seed to seed.

int sin ( int x )

Computes the sine of the INT variale x, which must be in the range [0,360], and returns it as a FP number.

int sqrt ( int x )

Computes the square root of the FP variable x and returns it as an FP number.

Newton's method is used to compute the root. If x is negative, and thus, the root would be undefined, zero is returned.

int tan ( int x )

Computes the tangent of the INT variale x, which must be in the range [0,360], and returns it as a FP number.

For x=90 and x=270, where the tangent is undefined, 0 will be returned.


HALRuntimeLibrary: Display functions

Display functions

Functions to display values on the 4-segment display. More...

Functions

void | emptydisplay ()
void | display (int value, int blink)
void | displayhex (int value, int blink)

Detailed Description

Functions to display values on the 4-segment display.

Function Documentation

void display | ( | int | value,
 |  | int | blink
 | ) |

Display the given value decimally.

Parameters:
value | Number to display. It must be less than 1000.
blink | Should the number blink (non-zero) or not (zero)?

void displayhex | ( | int | value,
 |  | int | blink
 | ) |

Display the given value hexadecimally.

Parameters:
value | Number to display. It must be less than 2^16.
blink | Should the number blink (non-zero) or not (zero)?

void emptydisplay ( )

Empty all of the display.


HALRuntimeLibrary: Basic Functions

Basic Functions

Functions

void | delay (int msec)
void | fatal_error (int err)

Function Documentation

void delay ( int msec )

Waits for some time.

Parameters:
msec Number of milliseconds to wait.

void fatal_error ( int err )

Stops the processor, while displaying a fatal error number on the segment display.

(By convention, these are in the range 0xE000 ... 0xE0FF for the HAL library, and 0xE100 ... 0xEFFF for the application program.)

Parameters:
err The error number, a 16 bit hexadecimal number.


HALRuntimeLibrary: Hardware access

Hardware access

Functions and constants to directly access the XBus hardware. More...

Variables

const int | PORT_TIMER_DATA = 17
const int | PORT_TIMER_CTRL = 16
const int | PORT_JTAG_CTRL = 32
const int | PORT_JTAG_DATA = 33
const int | UCM_RECV_DATA = 0b1000
const int | PORT_FLASH_STAT = 48
const int | PORT_FLASH_ADDR = 49
const int | PORT_FLASH_DATA = 50
const int | PORT_FLASH_FULL_ERASE = 51
const int | PORT_FLASH_SECTOR_ERASE = 52
const int | PORT_FLASH_FAIL_ADDR = 53
const int | PORT_CON_CTRL = 64
const int | PORT_CON_KEYS = 65
const int | PORT_CON_LEDS = 66
const int | PORT_CON_SEGDATA = 67
const int | PORT_CON_SEGSTAT = 68
const int | CKM_BUTTONS = 0xFF
const int | CKM_SWITCHES = 0xFF00
const int | GDM_FGCOL = 0xF000
const int | GDM_BGCOL = 0x0F00
const int | GDM_CHAR = 0x00FF
const int | PORT_USB_CTRL = 96
const int | PORT_USB_DATA = 97
const int | PORT_POISON_DO = 112
const int | PORT_POISON_UNDO = 113
const int | PORT_PIX_READADDR = 160
const int | PORT_PIX_WRITEADDR = 161
const int | PORT_PIX_DATA = 162
const int | PORT_PIX_FAST = 163
const int | PORT_PIX_TRANS = 164
const int | PORT_PIX_MODE = 165
const int | PORT_PIX_BUFFER = 166
const int | PORT_PIX_CLS = 167
const int | PORT_SOUND_CTRL = 192
const int | PORT_SOUND_DATA = 193
const int | PORT_SOUND_SAMPLEN = 194
const int | PORT_MMC_STATUS = 208
const int | PORT_MMC_ADDRESS = 209
const int | PORT_MMC_DATA = 210
const int | PORT_MMC_FLUSH = 211
const int | PORT_MMC_ERR_ADDRESS = 212

Detailed Description

Functions and constants to directly access the XBus hardware.

Variable Documentation

const int CKM_BUTTONS = 0xFF

selection mask for the XConsole switch status port, selecting the button status

const int CKM_SWITCHES = 0xFF00

selection mask for the XConsole switch status port, selecting switch status

const int GDM_BGCOL = 0x0F00

selection mask for XGfx character data which selects the background colour

const int GDM_CHAR = 0x00FF

selection mask for XGfx character data which selects the displayed character

const int GDM_FGCOL = 0xF000

selection mask for XGfx character data which selects the foreground colour

const int PORT_CON_CTRL = 64

hardware IO address for the XConsole control port

const int PORT_CON_KEYS = 65

hardware IO address for the XConsole switch status port

const int PORT_CON_LEDS = 66

hardware IO address for the XConsole LED port

const int PORT_CON_SEGDATA = 67

hardware IO address for the XConsole 7-segment data port

const int PORT_CON_SEGSTAT = 68

hardware IO address for the XConsole 7-segment status port

const int PORT_FLASH_ADDR = 49

hardware IO address for the XFlash address port

const int PORT_FLASH_DATA = 50

hardware IO address for the XFlash data port

const int PORT_FLASH_FAIL_ADDR = 53

hardware IO address for the XFlash fail address port

const int PORT_FLASH_FULL_ERASE = 51

hardware IO address for the XFlash full erase port

const int PORT_FLASH_SECTOR_ERASE = 52

hardware IO address for the XFlash sector erase port

const int PORT_FLASH_STAT = 48

hardware IO address for the XFlash status port

const int PORT_JTAG_CTRL = 32

hardware IO address for the XJtag control port

const int PORT_PIX_BUFFER = 166

hardware IO address for the XPix Double buffering port

const int PORT_PIX_CLS = 167

hardware IO address for the XPix Clear Screen port

const int PORT_PIX_DATA = 162

hardware IO address for the XPix data port

const int PORT_PIX_FAST = 163

hardware IO address for the XPix fast data port

const int PORT_PIX_MODE = 165

hardware IO address for the XPix Graphics mode port

const int PORT_PIX_READADDR = 160

hardware IO address for the XPix read address port

const int PORT_PIX_TRANS = 164

hardware IO address for the XPix transparency port

const int PORT_PIX_WRITEADDR = 161

hardware IO address for the XPix write address port

const int PORT_POISON_DO = 112

(emulated) hardware IO address for the SetPoison port

const int PORT_POISON_UNDO = 113

(emulated) hardware IO address for the ClearPoison port

const int PORT_SOUND_CTRL = 192

hardware IO address for the XSound control port

const int PORT_TIMER_CTRL = 16

hardware IO address for XTimerPro control port

const int PORT_TIMER_DATA = 17

hardware IO address for XTimerPro data port

const int PORT_USB_CTRL = 96

hardware IO address for the XUSB control port

const int UCM_RECV_DATA = 0b1000

bit mask for the XJtag Control have_recv_data flag


HALRuntimeLibrary: Error numbers

Error numbers

These error numbers are reported when one of the HAL functions finds any error. More...

Variables

const int | ERR_IRQ_USR1 = 0xE001
const int | ERR_IRQ_XDUMMY1 = 0xE002
const int | ERR_IRQ_XDUMMY2 = 0xE009
const int | ERR_IRQ_USR2 = 0xE00A
const int | ERR_IRQ_OVF = 0xE00B
const int | ERR_IRQ_DIV0 = 0xE00C
const int | ERR_IRQ_XADDR = 0xE00D
const int | ERR_IRQ_MEMADDR = 0xE00E
const int | ERR_IRQ_PCADDR = 0xE00F
const int | ERR_NO_MEMORY = 0xE010
const int | ERR_INVALID_FREE_PTR = 0xE011
const int | ERR_INVALID_REALLOC_PTR = 0xE012
const int | ERR_INVALID_MBS_PTR = 0xE012
const int | ERR_MCOPY_SOURCE = 0xE013
const int | ERR_MCOPY_TARGET = 0xE014
const int | ERR_MCOPY_SIZE = 0xE015
const int | ERR_MFILL_TARGET = 0xE016
const int | ERR_MALLOC_SIZE = 0xE017
const int | ERR_MCOMPARE_PTR = 0xE018
const int | ERR_TIMER_INTERVAL = 0xE020
const int | ERR_TIMER_CALLBACK = 0xE021
const int | ERR_TIMER_HANDLE = 0xE022
const int | ERR_DEV_NUMBER = 0xE030
const int | ERR_DEV_CALLBACK = 0xE031
const int | ERR_FLASH_HANDLE = 0xE040
const int | ERR_FLASH_OVERFLOW = 0xE041
const int | ERR_FLASH_FNAME_TERM = 0xE042
const int | ERR_FLASH_FSIZE = 0xE043
const int | ERR_FLASH_DATA_FAIL = 0xE044
const int | ERR_FLASH_HEADER_FAIL = 0xE045
const int | ERR_FLASH_SERIOUS_FAIL = 0xE046
const int | ERR_FLASH_FS_SIZE = 0xE047
const int | ERR_KEY_DEVICE = 0xE050
const int | ERR_KEY_CALLBACK = 0xE051
const int | ERR_PIX_NO_MEMORY = 0xE060
const int | ERR_PIXALLOC_SIZE = 0xE061
const int | ERR_PIX_NO_DBUF = 0xE062
const int | ERR_GFX_NO_FONT = 0xE068
const int | ERR_GFX_WRONG_FONT = 0xE069
const int | ERR_GFX_DEFAULT_FONT = 0xE06A
const int | ERR_ANIM_FORMAT = 0xE070
const int | ERR_ANIMDRAW_FNO = 0xE071
const int | ERR_ANIMSCALE_DIM = 0xE072
const int | ERR_HSC_WRONG_ENTRY = 0xE080
const int | ERR_MENU_HANDLER_NUM = 0xE090
const int | ERR_MENU_HANDLER_FUNC = 0xE091
const int | ERR_MENU_INIT = 0xE092
const int | ERR_TOO_MANY_NETWORKS = 0xE0A0
const int | ERR_READ_PACKET = 0xE0A1
const int | ERR_WRITE_PACKET = 0xE0A2
const int | ERR_NET_MESSAGE_ID = 0xE0A3
const int | ERR_SYSTEM_ID = 0xE0A4
const int | ERR_MSG_TYPE = 0xE0B0
const int | ERR_MSG_HANDLER_FUNC = 0xE0B1
const int | ERR_MSG_POP_GLOBAL = 0xE0B2
const int | ERR_INSTR_POS = 0xE0C0
const int | ERR_PRINTF_FORMAT = 0xE0D0

Detailed Description

These error numbers are reported when one of the HAL functions finds any error.

The processor is then halted.

Variable Documentation

const int ERR_ANIM_FORMAT = 0xE070

format of the animation file passed to anim_load() is invalid

const int ERR_ANIMDRAW_FNO = 0xE071

invalid frame number in anim_draw_frame()

const int ERR_ANIMSCALE_DIM = 0xE072

invalid dimensions in anim_draw_scaled_frame()

const int ERR_DEV_CALLBACK = 0xE031

invalid callback function passed to a dev_*() function

const int ERR_DEV_NUMBER = 0xE030

invalid device number passed to a dev_*() function

const int ERR_FLASH_DATA_FAIL = 0xE044

Flash-Fehler beim Schreiben von Nutzdaten.

const int ERR_FLASH_FNAME_TERM = 0xE042

Nicht-terminierter Dateiname (kein 0-Byte).

const int ERR_FLASH_FS_SIZE = 0xE047

Größe des Dateisystems ist inkorrekt.

const int ERR_FLASH_FSIZE = 0xE043

Gesamtgröße einer Datei ist nicht korrekt.

const int ERR_FLASH_HANDLE = 0xE040

Fehlerhafte Angabe eines dirHandles (out of range).

const int ERR_FLASH_HEADER_FAIL = 0xE045

Flash-Fail bei Header-Programmierung.

const int ERR_FLASH_OVERFLOW = 0xE041

Zeiger zeigt über das Flash-Ende hinaus.

const int ERR_FLASH_SERIOUS_FAIL = 0xE046

Schwerer Flash-Fehler (Hardware defekt).

const int ERR_GFX_DEFAULT_FONT = 0xE06A

the default font is missing on the Flash

const int ERR_GFX_NO_FONT = 0xE068

no font is loaded, but you are trying to draw characters

const int ERR_GFX_WRONG_FONT = 0xE069

the font that is being loaded is invalid

const int ERR_HSC_WRONG_ENTRY = 0xE080

invalid level or score in highscore entry

const int ERR_INSTR_POS = 0xE0C0

invalid insertion position for instrument

const int ERR_INVALID_FREE_PTR = 0xE011

an invalid pointer was passed to free()

const int ERR_INVALID_MBS_PTR = 0xE012

an invalid pointer was passed to mblock_size()

const int ERR_INVALID_REALLOC_PTR = 0xE012

an invalid pointer was passed to realloc()

const int ERR_IRQ_DIV0 = 0xE00C

Interrupt DIVbyZERO occured.

const int ERR_IRQ_MEMADDR = 0xE00E

Interrupt: Invalid Memory Address occured.

const int ERR_IRQ_OVF = 0xE00B

Interrupt OVF occured.

const int ERR_IRQ_PCADDR = 0xE00F

Interrupt: Invalid Jump Target occured.

const int ERR_IRQ_USR1 = 0xE001

Interrupt USR1 occured.

const int ERR_IRQ_USR2 = 0xE00A

Interrupt USR2 occured.

const int ERR_IRQ_XADDR = 0xE00D

Interrupt: Invalid IO Address occured.

const int ERR_IRQ_XDUMMY1 = 0xE002

Interrupt XDUMMY1 occured.

const int ERR_IRQ_XDUMMY2 = 0xE009

Interrupt XDUMMY2 occured.

const int ERR_KEY_CALLBACK = 0xE051

invalid callback function passed to a key_*()

const int ERR_KEY_DEVICE = 0xE050

keyboard command sent where no keyboard is attached (or at least, no keyboard was found during enumeration)

const int ERR_MALLOC_SIZE = 0xE017

invalid size passed to malloc()

const int ERR_MCOMPARE_PTR = 0xE018

invalid pointer passed to mcompare()

const int ERR_MCOPY_SIZE = 0xE015

an invalid size was passed to mcopy()

const int ERR_MCOPY_SOURCE = 0xE013

an invalid source pointer was passed to mcopy()

const int ERR_MCOPY_TARGET = 0xE014

an invalid target pointer was passed to mcopy()

const int ERR_MENU_HANDLER_FUNC = 0xE091

menu keyboard handler detects an invalid function pointer in the _menu_funcs

const int ERR_MENU_HANDLER_NUM = 0xE090

menu keyboard handler detects an invalid function number in the current menu

const int ERR_MENU_INIT = 0xE092

menu must be initialized before being used!

const int ERR_MFILL_TARGET = 0xE016

an invalid target pointer was passed to mfill()

const int ERR_MSG_HANDLER_FUNC = 0xE0B1

an invalid callback function was passed to msg_set_callback()

const int ERR_MSG_POP_GLOBAL = 0xE0B2

can't delete the global message handler context

const int ERR_MSG_TYPE = 0xE0B0

an invalid message type was passed to msg_set_callback()

const int ERR_NET_MESSAGE_ID = 0xE0A3

Ungültige MessageID angegeben.

const int ERR_NO_MEMORY = 0xE010

malloc() cannot find any free memory

const int ERR_PIX_NO_DBUF = 0xE062

double buffering is not enabled (but the function requires it)

const int ERR_PIX_NO_MEMORY = 0xE060

pix_alloc() can't find any pixel memory

const int ERR_PIXALLOC_SIZE = 0xE061

invalid size passed to pix_alloc()

const int ERR_PRINTF_FORMAT = 0xE0D0

invalid format character in printf format string

const int ERR_READ_PACKET = 0xE0A1

Fehler beim Einlesen eines Paketes (Paketgröße überschritten).

const int ERR_SYSTEM_ID = 0xE0A4

Beim Öffnen eines Netzwerkes wurde die SystemID 0 gelesen (das ist nicht erlaubt).

const int ERR_TIMER_CALLBACK = 0xE021

invalid callback passed to timer_start()

const int ERR_TIMER_HANDLE = 0xE022

invalid timer handle passed to a timer_*() function

const int ERR_TIMER_INTERVAL = 0xE020

invalid interval passed to timer_start()

const int ERR_TOO_MANY_NETWORKS = 0xE0A0

Fehler beim Erzeugen einer Netzwerkverbindung: Pro Device darf nur ein Netzwerk angelegt werden.

const int ERR_WRITE_PACKET = 0xE0A2

Fehler beim Schreiben eines Paketes (Paketgröße überschritten).


HALRuntimeLibrary: Device I/O functions

Device I/O functions

Various functions to work with I/O devices: synchronous and asynchronous read and write of data. More...

Functions

void | dev_set_callback (int device, int callback)
void | dev_set_interrupt_callback (int device, int callback)
int | dev_read_byte (int device)
void | dev_write_byte (int device, int data)

Variables

const int | DEV_JTAG = 0
const int | DEV_USB = 1
const int | DEV_COUNT = 2
const int | _devaddr [] = { 32, 96 }
int | _devintr_callback [DEV_COUNT]

Detailed Description

Various functions to work with I/O devices: synchronous and asynchronous read and write of data.

Function Documentation

int dev_read_byte ( int device )

Reads a byte synchronously from a device.

This method will not block; if no data is present, -1 will be returned instead (which is not a valid byte value). WARNING: Interrupt mode will be disabled. If a callback handler was registered before, you will need to re-register it after you have stopped using the device synchronously for reading.

void dev_set_callback | ( | int | device,
 |  | int | callback
 | ) |

Sets a callback when new data arrives on the given device.

It also enables interrupt-based mode.

Parameters:
device | A device number
callback | Pointer to the callback function. Its signature must be 'callback(device, data, context) returns(status)'. If NULL, callbacks will be disabled.

void dev_set_interrupt_callback | ( | int | device,
 |  | int | callback
 | ) |

Sets a callback when new data arrives on the given device.

It enables interrupt-based mode. The difference between dev_set_interrupt_callback and dev_set_callback is that the callback function passed to dev_set_interrupt_callback will be executed in interrupt mode. Blocks message generation for that device.

Parameters:
device | A device number
callback | Pointer to the callback function. Its signature must be 'callback(device, data) returns()'. If zero, callbacks will be disabled.

void dev_write_byte | ( | int | device,
 |  | int | data
 | ) |

Writes a byte synchronously to a device.

Waits until the device can accept the byte.

Variable Documentation

const int DEV_COUNT = 2

The total count of known devices.

const int DEV_JTAG = 0

The device number for the JTAG device.

const int DEV_USB = 1

The device number for the USB device.


HALRuntimeLibrary: File Functions

File Functions

Constants and functions to manage the HaDes Flash Filesystem (HFF) and the contained files. More...

Data Structures

struct | File
Represents an opened file. More...

Functions

int | getsystemid ()
void | setsystemid (int systemid)
int | ffssize ()
int | ffsbusy ()
int | ftotalsize (int dirHandle)
int | fsize_handle (int dirHandle)
int | fattrib (int dirHandle)
void | fname (int dirHandle, int string)
int | fcheckname (int dirHandle, int filename)
void | fheader (int dirHandle, int header)
int | ffirst ()
int | fnext (int dirHandle)
int | fend ()
int | ffind (int filename)
void | fdelete (int dirHandle)
void | fsync ()
int | fgethandle (struct File *file)
File * | fopen_handle (int dirHandle)
File * | fopen (int filename)
File * | fopen_mem (int address, int length)
File * | fcreate (int filename, int length, int attrib)
void | fflush (struct File *file)
void | fclose (struct File *file)
int | fread (struct File *file, int size, int ptr)
int | freadb (struct File *file, int size, int ptr)
int | fget (struct File *file)
int | fgetb (struct File *file)
int | fgets (struct File *file)
int | fget_flash (int fptr)
int | fget_mem (int fptr)
int | fgetw_flash (int fptr)
int | fgetw_mem (int fptr)
int | fwrite (struct File *file, int size, int ptr)
int | fwriteb (struct File *file, int size, int ptr)
void | fputb (struct File *file, int byte)
int | fcheckfail (struct File *file)
int | checkfail_flash ()
int | checkfail_mem ()
void | fput_flash (int byte, int fptr)
void | fput_mem (int byte, int fptr)
int | fsize (struct File *file)
int | fgetattrib (struct File *file)
int | fsetattrib (struct File *file, int attrib)
int | ftell (struct File *file)
int | fseek (struct File *file, int pos, int offset)
int | ftraverse (int accept_func, int nptr, int ptr_buf, int nstr, int str_buf)
int | ffreespace ()
int | checkfs ()

Variables

const int | MAX_FNAME = 28
const int | MAX_FLENGTH = 0x7FFFFF
const int | ATTR_ERASED_BIT = 1
const int | ATTR_EXECUTABLE_BIT = 2
const int | ATTR_SHELL_BIT = 4
const int | ATTR_FOLDER_BIT = 8
const int | FLASHADDR_SYSTEM_ID = 0
const int | FLASHADDR_FS_SIZE = 2
const int | FBEGIN = 1
const int | FCURRENT = 2
const int | FEND = 3
const int | FLASH_STAT_BUSY = 0x10
const int | FLASH_STAT_FAIL = 0x0C
int | _FLASH_SIZE = 0
const int | _FLASH_HEADER = 32
const int | _FLASH_BEGIN = 4
const int | _FLASH_ATTRIB = 3
const int | _FLASH_FNAME = 4

Detailed Description

Constants and functions to manage the HaDes Flash Filesystem (HFF) and the contained files.

Function Documentation

int checkfs ( )

Untersucht das Dateisystem auf Fehler.

Überprüft werden Überlauf und Dateinamen. Das Attributfeld wird nicht betrachtet. Ist das Dateisystem in Ordnung, wird 0 zurückgegeben, sonst der fatal_error-Fehlercode. dirHandle zeigt (im Erfolgsfall) auf den ersten freien Speicherplatz und gibt somit die Belegung des Flashspeichers an. Im Fehlerfall ist dies ein Zeiger auf die fehlerhafte Datei. numfiles ist die Anzahl unbeschädigter und ungelöschter Dateien.

int fattrib ( int dirHandle )

Liest Attribute der Datei, auf die dirHandle zeigt.

int fcheckfail ( struct File * file )

Prüft auf Fehler.

Gibt die Fehleradresse zurück, oder 0, falls kein Fehler aufgetreten.

int fcheckname | ( | int | dirHandle,
 |  | int | filename
 | ) |

Überprüft Name der Datei, auf die dirHandle zeigt.

Parameters:
dirHandle | Zeiger auf die zu überprüfende Datei.
filename | Vergleichsstring (non-compact)
Returns:
1, falls Übereinstimmung

void fclose ( struct File * file )

Schließt die Datei "file".

struct File* fcreate | ( | int | filename,
 |  | int | length,
 |  | int | attrib
 | ) |

Erstellt neue Datei mit dem angegebenen Namen.

Falls bereits eine Datei mit diesem Namen existiert, wird diese gelöscht.

Parameters:
filename | Name der neuen Datei (non-compact)
length | Länge (nur Nutzdaten) in Bytes (0 < length <= MAX_FLENGTH)
attrib | Attributwert

void fdelete ( int dirHandle )

Löscht die Datei, auf die dirHandle zeigt.

int fend ( )

Ermittelt Ende der File-Liste, d.h.

dirHandle zeigt auf den ersten freien Speicherbereich (dort kann dann eine neue Datei angelegt werden).

int ffind ( int filename )

Sucht die Datei mit dem in filename angegebenen Namen.

int ffirst ( )

Liefert Zeiger auf die erste Datei in der File-Liste (oder 0, falls überhaupt keine existiert):.

void fflush ( struct File * file )

Schreibt alle gecacheten Daten der Datei heraus.

int ffreespace ( )

Berechnet den noch zur Verfügung stehenden Speicherplatz (Bytes) auf dem Flash.

Die Header-Größe wird dabei berücksichtigt. Bedeutet: Angenommen, wir wollten eine Datei anlegen. Dann gibt bytes die maximale Länge (wenn nicht schon durch MAX_FLENGTH beschränkt) dieser Datei an. Mehr Speicherplatz kann nämlich nicht zur Verfügung gestellt werden. Anschließend ist der Flash voll.

int ffsbusy ( )

Gibt an, ob das Dateisystem (bzw.

die zuständige Hardware, auf der es läuft) derzeit beschäftigt ist.

int ffssize ( )

Gibt die Größe des Dateisystems in Bytes zurück.

int fget ( struct File * file )

Liest das nächste Word aus einer Datei.

Falls das Dateiende bereits erreicht ist, wird 0 zurückgegeben. Der Anwender dieser Funktion muss selbst dafür sorgen, dass noch genügend Bytes gelesen werden können.

Parameters:
file File-Struktur der Datei, aus der gelesen werden soll
Returns:
Gelesenes Word

int fgetattrib ( struct File * file )

Liefert das Attributfeld einer Datei (0, falls die Datei kein solches besitzt).

int fgetb ( struct File * file )

Liest das nächste Byte aus einer Datei.

Falls das Dateiende bereits erreicht ist, wird 0 zurückgegeben. Der Anwender dieser Funktion muss selbst dafür sorgen, dass noch mindestens ein Bytes gelesen werden kann.

Parameters:
file File-Struktur der Datei, aus der gelesen werden soll
Returns:
Gelesenes Byte

int fgethandle ( struct File * file )

Liefert passendes dirHandle zu einer File-Struktur.

Falls es sich um keine Flash-Datei handeln sollte, wird 0 zurückgegeben.

int fgets ( struct File * file )

Liest das nächste Half-Word (16 bit) aus einer Datei.

Falls das Dateiende bereits erreicht ist, wird 0 zurückgegeben. Der Anwender dieser Funktion muss selbst dafür sorgen, dass noch mindestens zwei Bytes gelesen werden können.

Parameters:
file File-Struktur der Datei, aus der gelesen werden soll
Returns:
Gelesenes Half-Word, nicht vorzeichen-erweitert

void fheader | ( | int | dirHandle,
 |  | int | header
 | ) |

Legt den Header der Datei, auf die dirHandle zeigt, (kompakt) im Array header ab.

Parameters:
header Array der Größe _FLASH_HEADER/4 Words.

void fname | ( | int | dirHandle,
 |  | int | string
 | ) |

Liest Name der Datei, auf die dirHandle zeigt.

Parameters:
string Zeiger auf ein Array mit mindestens MAX_FNAME Einträgen (non-compact).

int fnext ( int dirHandle )

Zeiger auf die nächste Datei (0, falls keine weitere existiert):.

struct File* fopen ( int filename )

Öffnet Datei zum Lesen.

Parameters:
filename Name der zu öffnenden Datei (non-compact)
Returns:
File-Struktur dieser Datei

struct File* fopen_handle ( int dirHandle )

Öffnet Datei zum Lesen.

Parameters:
dirHandle Zeiger auf den Dateianfang
Returns:
File-Struktur dieser Datei

struct File* fopen_mem | ( | int | address,
 |  | int | length
 | ) |

Öffnet eine Datei aus dem Hauptspeicher.

Anzugeben sind Startadresse und die Länge in Words. Die Datei besitzt dann eine Länge von length*4 Bytes. Um die Speicherverwaltung muss sich der Benutzer selbst kümmern (z.B. Speicherplatz für die Datei zur Verfügung stellen).

void fputb | ( | struct File * | file,
 |  | int | byte
 | ) |

Schreibt ein Byte in eine Datei.

Prüft nicht auf Schreibfehler.

int fread | ( | struct File * | file,
 |  | int | size,
 |  | int | ptr
 | ) |

Liest Words aus einer Datei.

Wird 0 zurückgegeben, bedeutet dies: Entweder wurden falsche Parameter angegeben (size <= 0) oder der Lesezeiger der Datei befand sich bereits am Ende. Falls am Ende der Datei kein ganzes Word mehr gelesen werden kann, da nur noch 3 oder weniger Bytes übrig sind, werden diese ignoriert und der Dateizeiger bleibt vor den Restbytes stehen.

Parameters:
file | File-Struktur der Datei, aus der gelesen werden soll
size | Anzahl Words, die gelesen werden sollen
ptr | Ziel-Array (hier werden die Daten abgelegt)
Returns:
Anzahl der gelesenen Worte

int freadb | ( | struct File * | file,
 |  | int | size,
 |  | int | ptr
 | ) |

Liest Bytes aus einer Datei.

Wird 0 zurückgegeben, bedeutet dies: Entweder wurden falsche Parameter angegeben (size <= 0) oder der Lesezeiger der Datei befand sich bereits am Ende.

Parameters:
file | File-Struktur der Datei, aus der gelesen werden soll
size | Anzahl Bytes, die gelesen werden sollen
ptr | Ziel-Array (hier werden die Daten abgelegt, ein Byte pro Word)
Returns:
Anzahl der gelesenen Bytes

int fseek | ( | struct File * | file,
 |  | int | pos,
 |  | int | offset
 | ) |

Setzt den Schreib-/Lesezeiger relativ zu pos: pos = FBEGIN | FCURRENT | FEND.

int fsetattrib | ( | struct File * | file,
 |  | int | attrib
 | ) |

Setzt Attribute einer Datei.

Bei Erfolg wird 1 zurückgegeben. Das Gelöscht-Attribut kann mit dieser Funktion nicht gesetzt werden, stattdessen ist fdelete zu verwenden. Bereits gesetzte Attribut-Bits können nicht wieder zurückgesetzt werden.

int fsize ( struct File * file )

Liefert die Länge (nur Nutzdaten) einer Datei in Bytes.

int fsize_handle ( int dirHandle )

Liefert die Länge der Datei (nur Nutzdaten), auf die dirHandle zeigt.

void fsync ( )

Schreibt alle gecacheten Daten des Dateisystems heraus.

int ftell ( struct File * file )

Liefert jetzigen Schreib-/Lesezeiger zu einer File-Struktur.

int ftotalsize ( int dirHandle )

Liest die Größe der Datei (Header + Nutzdaten) in Bytes, auf die dirHandle zeigt.

int fwrite | ( | struct File * | file,
 |  | int | size,
 |  | int | ptr
 | ) |

Schreibt Words in eine Datei.

Wird 0 zurückgegeben, bedeutet dies: Entweder wurden falsche Parameter angegeben (size <= 0) oder der Schreibzeiger der Datei befand sich bereits am Ende.

Parameters:
file | File-Struktur der Datei, in die geschrieben werden soll
size | Anzahl Words, die geschrieben werden sollen
ptr | Quell-Array (enthält zu schreibende Daten)
Returns:
Anzahl der (vollständig!!!) geschriebenen Words

int fwriteb | ( | struct File * | file,
 |  | int | size,
 |  | int | ptr
 | ) |

Schreibt Bytes in eine Datei.

Wird 0 zurückgegeben, bedeutet dies: Entweder wurden falsche Parameter angegeben (size <= 0) oder der Schreibzeiger der Datei befand sich bereits am Ende.

Parameters:
file | File-Struktur der Datei, in die geschrieben werden soll
size | Anzahl Bytes, die geschrieben werden sollen
ptr | Quell-Array (pro Word wird das niedrigstwertige Byte geschrieben)
Returns:
Anzahl der geschriebenen Bytes

int getsystemid ( )

Liest die global eindeutige SystemID an Adresse FLASHADDR_GLOBAL_ID.

void setsystemid ( int systemid )

Schreibt die SystemID.

Variable Documentation

const int _FLASH_ATTRIB = 3

relative Position des Attribute-Bytes

const int _FLASH_BEGIN = 4

Hier beginnt das Flash-Filesystem.

const int _FLASH_FNAME = 4

relative Position des Dateinamens

const int _FLASH_HEADER = 32

Header-Größe (muss durch 4 teilbar sein!).

int _FLASH_SIZE = 0

Flash-Größe.

const int ATTR_ERASED_BIT = 1

Attribut[0]: Datei ist gelöscht.

const int ATTR_EXECUTABLE_BIT = 2

Attribut[1]: Ausführbare Datei.

const int ATTR_FOLDER_BIT = 8

Attribut[3]: Dies ist ein Ordner.

const int ATTR_SHELL_BIT = 4

Attribut[2]: Dies ist die System-Shell.

const int FBEGIN = 1

Constant for fseek(): Seek from the start of the file.

const int FCURRENT = 2

Constant for fseek(): Seek from current position.

const int FEND = 3

Constant for fseek(): Seek from the end of the file.

const int FLASH_STAT_BUSY = 0x10

Lösch-/Schreibvorgang läuft.

const int FLASH_STAT_FAIL = 0x0C

Flash-Fail aufgetreten. (0x8 or 0x4).

const int FLASHADDR_FS_SIZE = 2

Flash-Adresse, an der die Größe des Filesystems in Millionen Bytes (2 Byte) zu finden ist (<_FLASH_BEGIN).

const int FLASHADDR_SYSTEM_ID = 0

Flash-Adresse, an der eine global eindeutige SystemID (1 Byte) zu finden ist (<_FLASH_BEGIN).

const int MAX_FLENGTH = 0x7FFFFF

Maximale Dateigröße (24 bits sind reserviert) -- FIXME.

const int MAX_FNAME = 28

Maximale Länge eines Dateinamens (inkl. 0-Abschluss).


HALRuntimeLibrary: File transfer functions

File transfer functions

Functions to receive and send files over any device. More...

Data Structures

struct | HftHeader
The HFT Header information. More...

Functions

int | hft_send_file (int devno, int fname)
void | hft_send_file_header (int devno, struct File *file)
int | hft_send_file_body (int devno, struct File *file)
void | hft_send_string (int devno, int str)
void | hft_send_word (int devno, int word)
int | hft_read_file (int devno, int verbose)
int | hft_read_file_header (int devno, struct HftHeader *header)
int | hft_read_file_body (int devno, struct HftHeader *header, struct File *file, int verbose)
int | hft_read_string (int devno, int str, int size)
int | hft_read_word (int devno)
int | hft_read_byte (int devno)

Variables

const int | HFT_ERR_NONE = 0
const int | HFT_ERR_FLASH = 1
const int | HFT_ERR_PROTOCOL = 2
const int | HFT_ERR_MEMORY = 3
const int | HFT_ERR_BUFFER = 4
int | HftHeader::size
int | HftHeader::attr

Detailed Description

Functions to receive and send files over any device.

Function Documentation

int hft_read_byte ( int devno )

reads synchronously and blocks until data is present

int hft_read_file | ( | int | devno,
 |  | int | verbose
 | ) |

Reads a file from the device using the HFT protocol.

The file is placed on the flash.

Parameters:
verbose If set, some status information will be written to the text mode screen.

int hft_read_file_header | ( | int | devno,
 |  | struct HftHeader * | header
 | ) |

Parameters:
header Header structure to place the read data in.

int hft_read_string | ( | int | devno,
 |  | int | str,
 |  | int | size
 | ) |

Parameters:
str | Pointer to the buffer where the string will be placed
size | Size of the buffer pointed to by str.

Variable Documentation

const int HFT_ERR_BUFFER = 4

Return code for buffer error (internal buffer overflow).

const int HFT_ERR_FLASH = 1

Return code for flash error (file could not be read from or written to).

const int HFT_ERR_MEMORY = 3

Return code for memory error (some buffer is too small).

const int HFT_ERR_NONE = 0

Return code for no error (this is guaranteed to be zero).

const int HFT_ERR_PROTOCOL = 2

Return code for protocol error (there's something wrong with the received data).


HALRuntimeLibrary: Text screen functions

Text screen functions

Functions to fill the text-mode screen. More...

Functions

void | gfx_nextline ()
void | gfx_nextline_ai (int col)
void | gfx_nexttab ()
void | gfx_out (int char)
int | gfx_get_font_pixel (int char, int x, int y)
int | gfx_get_font_line (int char, int y)
void | gfx_out_col (int data)
void | gfx_goto (int x, int y)
int | gfx_where ()
int | gfx_wherex ()
int | gfx_wherey ()
void | gfx_cls ()
void | gfx_print (int char)
int | gfx_print_ai (int char, int col)
void | gfx_outstr (int str)
void | gfx_printstr (int str)
void | gfx_printcstr (int cstr)
void | gfx_printcstr_ai (int cstr)
void | gfx_printf (int format)
void | gfx_draw_rect (int char, int width, int height)
void | gfx_clear_rect (int width, int height)
void | gfx_setcol (int fg, int bg)
void | gfx_setfgcol (int fg)
void | gfx_setbgcol (int bg)
void | gfx_setbold (int bold)
int | gfx_isbold ()
int | gfx_getcol ()
int | gfx_storecol ()
void | gfx_loadcol (int col)
int | gfx_load_font_file (int filename)
void | gfx_load_font (struct File *file)
void | gfx_load_default_font ()
void | gfx_load_mem_font (int fontdata)
void | gfx_loadchars (int chars, int pos, int cnt)

Variables

const int | COL_BLACK = 0
const int | COL_RED = 1
const int | COL_GREEN = 2
const int | COL_BROWN = 3
const int | COL_BLUE = 4
const int | COL_MAGENTA = 5
const int | COL_TURQUOISE = 6
const int | COL_GREY = 7
const int | COL_DARK_GREY = 8
const int | COL_LRED = 9
const int | COL_LGREEN = 10
const int | COL_YELLOW = 11
const int | COL_LBLUE = 12
const int | COL_LMAGENTA = 13
const int | COL_CYAN = 14
const int | COL_WHITE = 15
const int | COL_TO_FG = 12
const int | COL_TO_BG = 8
const int | GFX_WIDTH = 80
int | GFX_HEIGHT = 10
int | GFX_SCREEN_SIZE = GFX_WIDTH * 10
const int | GFX_FONT_WIDTH = 8
int | GFX_FONT_HEIGHT = 0
const int | FONT_DEFAULT [] = "_default.hfon"
const int | FONT_LARGE [] = "ansi8x12.hfon"
const int | FONT_LUCIDA [] = "lucida8x14.hfon"

Detailed Description

Functions to fill the text-mode screen.

Function Documentation

void gfx_clear_rect | ( | int | width,
 |  | int | height
 | ) |

Clears a rectangle with the current background colour.

The size (width x height) is given in characters, it starts at the current position.

void gfx_cls ( )

Clears the screen by filling it with the current background colour.

The original screen position is restored.

void gfx_draw_rect | ( | int | char,
 |  | int | width,
 |  | int | height
 | ) |

Draws a rectangle of the given characters, with size width x height, starting at the current position.

int gfx_getcol ( )

Gets the current foreground and background colour.

void gfx_goto | ( | int | x,
 |  | int | y
 | ) |

Goes to the given screen position.

int gfx_isbold ( )

Returns TRUE if automatic bold printing is enabled, FALSE otherwise.

void gfx_load_default_font ( )

Loads the default font file from the flash.

void gfx_load_font ( struct File * file )

Loads the given opened font file.

int gfx_load_font_file ( int filename )

Loads the given font file from the flash.

Returns FALSE if the file couldn't be found, TRUE on success.

void gfx_load_mem_font ( int fontdata )

Loads a font from the memory.

void gfx_loadchars | ( | int | chars,
 |  | int | pos,
 |  | int | cnt
 | ) |

Loads some special characters to the character set.

Parameters:
chars | Character data to load. Its format should be one word per character line.
pos | Position in the system character table where the characters should be loaded.
cnt | Number of characters to load. Note that sizeof chars must be more than gfx_get_font_width()*cnt.

void gfx_loadcol ( int col )

Sets the current colour in internal format.

void gfx_nextline ( )

Moves the current screen address to the start of the next line.

void gfx_nextline_ai ( int col )

Moves the current screen address to the start of the next line, auto-indenting to column //col.

void gfx_nexttab ( )

Moves the current screen address to the next tabbing position.

void gfx_out ( int char )

Output a ASCII byte with the current colour.

Special characters like '\n' are NOT treated specially. The graphics address moves to the next charater (like always).

void gfx_out_col ( int data )

Outputs a traditional GFX halfword with embedded colour and character.

The character is printed, and the foreground and background colours are set to the halfword's value.

void gfx_outstr ( int str )

Prints the given zero-terminated string.

Special characters like '\n' are NOT treated specially.

void gfx_print ( int char )

Prints an ASCII character.

The characters '\n', '' and '' are treated specially. Others are simply printed to the screen (like gfx_out).

int gfx_print_ai | ( | int | char,
 |  | int | col
 | ) |

Prints an ASCII character.

The characters '\n', '' and '' are treated specially. '\n' especially indents to the column //col. Others are simply printed to the screen (like gfx_out). For technical reasons, returns the AI column.

void gfx_printcstr ( int cstr )

Prints the given zero-terminated COMPACT string.

void gfx_printcstr_ai ( int cstr )

Prints the given zero-terminated COMPACT string with auto indentation to the current X position.

void gfx_printf ( int format )

Prints the given zero-terminated COMPACT format string, inserting all of the variable arguments.

In addition to the format specifiers supported by strprintf(), gfx_printf supports the following format codes (where n is a number in 0 to 15):

  • nF Sets the Foreground Colour to n.
  • nB Sets the Background Colour to n.
  • 1* Enables bold printing.
  • * Disables bold printing.

void gfx_printstr ( int str )

Prints the given zero-terminated string.

void gfx_setbgcol ( int bg )

Sets the background colour for the following gfx_print() or gfx_out() calls.

The foreground colour remains unchanged. bg must be in the range 0 to 15.

void gfx_setbold ( int bold )

Enables / disables automatic bold printing.

When bold printing is enabled, each character is drawn twice, moving one pixel to the right before drawing the second time. Thus, bold characters are one pixel wider.

Parameters:
bold TRUE: enable bold printing; FALSE: disable.
Warning:
GFX_FONT_WIDTH and GFX_WIDTH will be wrong while automatic bold printing is enabled because they don't account for the extra pixel used.

void gfx_setcol | ( | int | fg,
 |  | int | bg
 | ) |

Sets the foreground and background colours for the following gfx_print() or gfx_out() calls.

fg and bg must be in the range 0 to 15.

void gfx_setfgcol ( int fg )

Sets the foreground colour for the following gfx_print() or gfx_out() calls.

The background colour remains unchanged. fg must be in the range 0 to 15.

int gfx_storecol ( )

Gets the current colour in internal format.

int gfx_where ( )

Gets the current screen position.

int gfx_wherex ( )

Gets the current screen x position only.

int gfx_wherey ( )

Gets the current screen y position only.

Variable Documentation

const int COL_BLACK = 0

The 16 standard colours. black.

const int COL_BLUE = 4

dark blue

const int COL_BROWN = 3

brown / dark yellow

const int COL_CYAN = 14

light cyan

const int COL_DARK_GREY = 8

dark grey

const int COL_GREEN = 2

green

const int COL_GREY = 7

light grey

const int COL_LBLUE = 12

light blue

const int COL_LGREEN = 10

light green

const int COL_LMAGENTA = 13

light magenta

const int COL_LRED = 9

light red

const int COL_MAGENTA = 5

magenta

const int COL_RED = 1

red

const int COL_TO_BG = 8

shift width for making a background colour

const int COL_TO_FG = 12

shift width for making a foreground colour

const int COL_TURQUOISE = 6

turquoise

const int COL_WHITE = 15

white

const int COL_YELLOW = 11

light yellow

const int FONT_DEFAULT[] = "_default.hfon"

File name of the default font file.

const int FONT_LARGE[] = "ansi8x12.hfon"

File name of the large font file.

const int FONT_LUCIDA[] = "lucida8x14.hfon"

File name of the even larger lucida console font file.

int GFX_FONT_HEIGHT = 0

Height of the currently loaded font in pixels. Do not modify!

const int GFX_FONT_WIDTH = 8

Width of the currently loaded font in pixels.

int GFX_HEIGHT = 10

Height of the screen in characters. Do not modify!

int GFX_SCREEN_SIZE = GFX_WIDTH * 10

Total capacity of the screen in characters. Do not modify!

const int GFX_WIDTH = 80

Width of the screen in characters.


HALRuntimeLibrary: Highscore Functions

Highscore Functions

Some functions for reading, writing, manipulating and displaying high scores. More...

Data Structures

struct | Highscore
The high score object. More...
struct | HighscoreEntry
A highscore entry. More...

Functions

Highscore * | hsc_read (int file_name)
int | hsc_is_good_enough (struct Highscore *hsc, int plyr_score)
void | hsc_add (struct Highscore *hsc, int name, int level, int score)
int | hsc_write (struct Highscore *hsc)
void | hsc_free (struct Highscore *hsc)
void | hsc_show (struct Highscore *hsc)

Variables

const int | HSC_SIZE = 10
const int | HSC_FILE_MAX_SIZE = 100
const int | _HSC_ENTRY_DISK_SIZE = 13
const int | _HSC_COL [] = { COL_YELLOW, COL_WHITE, COL_BROWN }
const int | _HSC_COL_DEF = COL_GREY
const int | _HSC_COL_TITLE = COL_WHITE
const int | _HSC_COL_TITLE_BG = COL_BLUE
const int | _HSC_TITLE [] = C" H I G H S C O R E S "
const int | _HSC_TITLE2 [] = C"Player Level Score "
const int | _HSC_NOBODY [] = C"Nobody"

Detailed Description

Some functions for reading, writing, manipulating and displaying high scores.

Function Documentation

void hsc_add | ( | struct Highscore * | hsc,
 |  | int | name,
 |  | int | level,
 |  | int | score
 | ) |

Adds the player to the high score.

void hsc_free ( struct Highscore * hsc )

Frees all memory related to the Highscore object.

int hsc_is_good_enough | ( | struct Highscore * | hsc,
 |  | int | plyr_score
 | ) |

Is the player good enough to enter the high score?

struct Highscore* hsc_read ( int file_name )

Reads a high score from the given file or creates a new empty one, if that file doesn't exist.

Returns:
Pointer to the Highscore object.

void hsc_show ( struct Highscore * hsc )

Draws the high-score on the (text mode) screen.

The screen is cleared first.

int hsc_write ( struct Highscore * hsc )

Writes the (new players in the) high score to its file.

If the file is full, it is deleted and a new one is created.

Variable Documentation

const int HSC_FILE_MAX_SIZE = 100

Number of players saved in the high score file before that one is rewritten.

const int HSC_SIZE = 10

Number of players shown in the high score.


HALRuntimeLibrary: Keyboard handling

Keyboard handling

Functions for keyboard handling. More...

Functions

void | set_key_down_callback (int callback)
void | set_key_up_callback (int callback)
void | set_char_input_callback (int callback)
int | key_is_down (int keycode)
void | key_get_name (int keycode, int string)
void | load_keytable_mem (int keytbl)
int | load_keytable ()

Variables

const int | KEY_COUNT = 8
const int | VK_TAB = 9
const int | VK_BACK = 8
const int | VK_RETURN = 13
const int | VK_ENTER = VK_RETURN
const int | VK_ESC = 27
const int | VK_SPACE = 32
const int | VK_DEL = 127
const int | VK_F1 = 128
const int | VK_F2 = 129
const int | VK_F3 = 130
const int | VK_F4 = 131
const int | VK_F5 = 132
const int | VK_F6 = 133
const int | VK_F7 = 134
const int | VK_F8 = 135
const int | VK_F9 = 136
const int | VK_F10 = 137
const int | VK_F11 = 138
const int | VK_F12 = 139
const int | VK_CAPS = 140
const int | VK_LSHIFT = 141
const int | VK_LCTRL = 142
const int | VK_LWIN = 143
const int | VK_ALT = 144
const int | VK_ALTGR = 145
const int | VK_RWIN = 146
const int | VK_CONTEXT_MENU = 147
const int | VK_RCTRL = 148
const int | VK_RSHIFT = 149
const int | VK_INS = 150
const int | VK_HOME = 151
const int | VK_PGUP = 152
const int | VK_END = 153
const int | VK_PGDOWN = 154
const int | VK_LEFT = 155
const int | VK_UP = 156
const int | VK_DOWN = 157
const int | VK_RIGHT = 158
const int | VK_NUMLOCK = 159
const int | VK_NUMDIV = 160
const int | VK_NUMMUL = 161
const int | VK_NUMSUB = 162
const int | VK_NUMADD = 163
const int | VK_NUMRETURN = 164
const int | VK_NUMENTER = VK_NUMRETURN
const int | VK_NUMSEP = 165
const int | VK_NUM0 = 166
const int | VK_NUM1 = 167
const int | VK_NUM2 = 168
const int | VK_NUM3 = 169
const int | VK_NUM4 = 170
const int | VK_NUM5 = 171
const int | VK_NUM6 = 172
const int | VK_NUM7 = 173
const int | VK_NUM8 = 174
const int | VK_NUM9 = 175
const int | VK_MAX = VK_NUM9

Detailed Description

Functions for keyboard handling.

Support for the built-in switches as well as an external PS/2 keyboard is provided. There are also numerous VK_* keycode constants for all the special keys here.

Function Documentation

void key_get_name | ( | int | keycode,
 |  | int | string
 | ) |

Gets the name of a key and saves it into the given NON-COMPACT string, which must be at least nine words long.

int key_is_down ( int keycode )

Gets the keyboard status of some special keys.

Currently supported is VK_LSHIFT or VK_RSHIFT for the shift key and VK_ALTGR for the altGr key. For all other keys, returns FALSE.

int load_keytable ( )

Vor dem ersten Aufruf einer set_X_callback Funktion muss entweder load_keytable() oder load_keytable_mem() aufgerufen werden.

load_keytable() versucht, die Datei mit dem Namen _KEYTBL_FILE_NAME vom Flash zu laden. Zurückgegeben wird file_found=true, falls erfolgreich.

void load_keytable_mem ( int keytbl )

Vor dem ersten Aufruf einer set_X_callback Funktion muss entweder load_keytable() oder load_keytable_mem() aufgerufen werden.

load_keytable_mem() öffnet eine im Hauptspeicher liegende Keytable. keytbl ist dabei ein Zeiger auf den Beginn des Speicherbereichs, in dem die Übersetzungstabelle zu finden ist. Die Tabelle muss in kompakter Form (BigEndian) gespeichert sein, siehe halfile-Implementierung von Memory-Files. Die halkeyboard verwaltet nur die File-Zeiger, der eigentliche Speicherbereich muss von der Anwendung zur Verfügung gestellt und verwaltet werden. Eine Standard-Keytable steht über die Konstante DEFAULT_KEYTBL zur Verfügung, diese wird bei Verwendung in die ausführbare Datei integriert. Beispielaufruf: load_keytable_mem(DEFAULT_KEYTBL); set_X_callback...

void set_char_input_callback ( int callback )

The callback function 'callback(char, UNUSED, context) returns(status)' will be called whenever an ASCII character is input.

That happens for all 'normal' keys on the PS/2 keyboard such as letters, numbers and punctuation keys, but not for the special keys such as ENTER, the function keys or the cursor keys. Use set_key_down_callback() to get notified with their keycodes when they are pressed. For a description of the context parameter and the return value, see msg_set_handler().

void set_key_down_callback ( int callback )

The callback function 'callback(keycode, UNUSED, context) returns(status)' will be called whenever a key is pressed (repeatedly).

The keycode parameter is one of the above numbers, or an upper-case ASCII character for the letter keys, or the main ASCII character for number and punctuation keys. The function will also be called whenever one of the builtin switches is pressed. Their key mapping is [F1] (for the leftmost switch) up to [Fn], where n == KEY_COUNT. For a description of the context parameter and the return value, see msg_set_handler().

void set_key_up_callback ( int callback )

The callback function 'callback(keycode, UNUSED, context) returns(status)' will be called whenever a key is released (repeatedly).

See set_key_down_callback() for more information.

Variable Documentation

const int KEY_COUNT = 8

Number of switches that are present on the expansion board.

const int VK_MAX = VK_NUM9

Biggest VK_ constant.


HALRuntimeLibrary: Key configuration

Key configuration

Functions and data structures for configuring keys in an application. More...

Data Structures

struct | KeyconfKeyInfo
A key configuration info structure. More...

Functions

void | keyconf_init (int appname, struct KeyconfKeyInfo *data, int keycount)
void | keyconf_set_col (int posx, int posy, int col_highlight, int make_bold)
int | keyconf_get (int index)
void | keyconf_run ()
void | keyconf_set_default ()
void | keyconf_load ()
void | keyconf_save ()

Variables

const int | KEYCONF_MAX_KEYS = 32
const int | KEYCONF_MAX_APPNAME = 16
const int | KEYCONF_MAX_APPS = 32
KeyconfKeyInfo * | _keyconf_data = 0
int | _keyconf_keys [KEYCONF_MAX_KEYS]
int | _keyconf_appname [KEYCONF_MAX_APPNAME/4]

Detailed Description

Functions and data structures for configuring keys in an application.

Function Documentation

int keyconf_get ( int index )

Gets a possibly reconfigured key.

Parameters:
index The index of the key in the keys table

void keyconf_init | ( | int | appname,
 |  | struct KeyconfKeyInfo * | data,
 |  | int | keycount
 | ) |

Initializes the Keyconf library.

This must be done before using it. If any settings have been stored previously, they will be loaded again.

Parameters:
appname | Name of this application. COMPACT STRING which must not be longer than KEYCONF_MAX_APPNAME characters.
data | Keyconf data. Information about the names and default keys for all defined keys, as a lot of KeyconfKeyInfo structures concatenated to each other. The data must be available while the library is active. It will not be modified.
keycount | Number of keys defined in data.

void keyconf_load ( )

Tries to load the saved key configuration for this application.

This is automatically done by keyconf_init().

void keyconf_run ( )

Performs keyboard configuration.

Draws a configuration list onto the current screen using the GFX library and lets the user input some new keys. After he's done, stores the new keys in the configuration file.

void keyconf_save ( )

Saves the current configuration to a file This is automatically done by keyconf_run().

void keyconf_set_col | ( | int | posx,
 |  | int | posy,
 |  | int | col_highlight,
 |  | int | make_bold
 | ) |

Sets the keyconf appearance.

For the background and the unselected strings, the current GFX colour is always used.

Parameters:
posx | GFX x position of the keyconf screen
posy | GFX y position of the keyconf screen
col_highlight | Colour for the highlighted string and for the title
make_bold | Is the highlighted string drawn in bold?

Variable Documentation

const int KEYCONF_MAX_APPNAME = 16

The maximum length of an appname in characters (including the terminating zero).

const int KEYCONF_MAX_APPS = 32

The maximum number of applications that can store key info using the KEYCONF library.

const int KEYCONF_MAX_KEYS = 32

The maximum number of keys that can be configured for a given application.


HALRuntimeLibrary: Memory management

Memory management

Functions to allocate, deallocate, copy and fill raw memory. More...

Functions

int | mmaxalloc ()
int | malloc (int size)
int | realloc (int ptr, int newSize)
void | free (int ptr)
int | mblock_size (int ptr)
void | mcopy (int source, int dest, int size)
void | mfill (int dest, int size, int value)
int | mcompare (int blk1, int blk2, int size)

Detailed Description

Functions to allocate, deallocate, copy and fill raw memory.

Function Documentation

void free ( int ptr )

real free:

Parameters:
ptr Pointer to a memory block you no longer need. If ptr is NULL, does nothing and safely returns.

int malloc ( int size )

real malloc: ** first-fit strategy **

Parameters:
size requested block size in words
Returns:
pointer to the block; if no memory is found, the processor is stopped.

int mblock_size ( int ptr )

Gets the block size of a memory block which has been allocated by malloc() In some cases, this may be actually a bit more than the requested amount.

Parameters:
ptr is the pointer as returned by malloc

int mcompare | ( | int | blk1,
 |  | int | blk2,
 |  | int | size
 | ) |

Compare two memory blocks.

void mcopy | ( | int | source,
 |  | int | dest,
 |  | int | size
 | ) |

Copy a memory block.

void mfill | ( | int | dest,
 |  | int | size,
 |  | int | value
 | ) |

Fill a memory block.

int mmaxalloc ( )

Get the largest possible memory block that can be allocated.

The result is given in words.

Note:
If your memory is fragmented, this can be a lot less than the total free memory.

int realloc | ( | int | ptr,
 |  | int | newSize
 | ) |

real realloc: re-allocates this memblock to a new size, if possible if not possible, allocates a new mem-block and copies the data to it warning: you must use the returned pointer from now on!


HALRuntimeLibrary: Menu functions

Menu functions

Functions to work with text mode menus, drawing and using them. More...

Functions

void | menu_init (int menu_func, int menu_func_len, int menu_strings)
void | menu_set (int menu_ptr)
int | menu_get ()
void | menu_draw ()
int | menu_kbd_handler (int key, int UNUSED, int context)
int | menu_click_handler (int button, struct Point *pos, int context)

Detailed Description

Functions to work with text mode menus, drawing and using them.

A menu is a 8-element array of indices into the function pointer array menu_func, which contains a list of pointers to functions. All of these must have neither parameters nor return values. They are named by zero-terminated strings in the menu_strings NON COMPACT string, which is a concatenated string of the descriptions in the same order. Indices are counted from one, the special index zero means 'no element'. A small 'media player' example:

 var menu_func = { addressof start, addressof stop, addressof quit };
 var menu_strings = "Start\0Stop\0Quit";
 var my_menu = { 1, 2, 0, 0, 0, 0, 0, 3 };   // start&stop are on the left (F1, F2), quit on the right (F8)
 ...
 menu_init(menu_func, sizeof menu_func, menu_strings);
 menu_set(my_menu);

Function Documentation

int menu_click_handler | ( | int | button,
 |  | struct Point * | pos,
 |  | int | context
 | ) |

A mouse-click handler which should be registered with start_cursor() or at least called in your own click handler.

It will select the matching menu function and call it (if the mouse is over the menu and it is left-clicked).

void menu_draw ( )

Redraws the current menu.

int menu_get ( )

Gets the current menu.

void menu_init | ( | int | menu_func,
 |  | int | menu_func_len,
 |  | int | menu_strings
 | ) |

Initializes the MENU system for the text mode.

This must be called before using any of the menu functions.

Parameters:
menu_func Pointer to a static array of function pointers which point to all the functions used in the menus.

int menu_kbd_handler | ( | int | key,
 |  | int | UNUSED,
 |  | int | context
 | ) |

A keydown handler which should be registered with set_key_down_callback() or at least called when a function key is pressed.

It will select the matching menu function and call it.

void menu_set ( int menu_ptr )

Changes the current menu.

Parameters:
menu_ptr A pointer to an function-index array of eight elements. The array must not be disallocated while it is set as a menu! It should be a static array. See the group overview for further details.


HALRuntimeLibrary: Mouse Functions

Mouse Functions

Constants and functions for working with the PS/2 mouse. More...

Functions

void | set_mouse_callback (int callback)
int | mouse_get_x (int coord)
int | mouse_get_y (int coord)
int | mouse_make_coord (int x, int y)
void | mouse_start_cursor (int click_func, int drag_func, int button_down_func, int button_up_func, int motion_func)
void | mouse_confine_cursor (struct Rect *rect)

Variables

const int | BTN_MIDDLE = 0b100
const int | BTN_RIGHT = 0b010
const int | BTN_LEFT = 0b001
const int | _CURSOR_TRANSPARENCY = 0x1
const int | _CURSOR_HEIGHT_PIX = 12
const int | _CURSOR_IMAGE [_CURSOR_HEIGHT_PIX]
int | _cursor_pixdata [_CURSOR_HEIGHT_PIX]
Point | _cursor_pos = { 0, 0 }
const struct Rect | _CURSOR_AREA_PIX = { 0, 0, PIX_WIDTH-1, PIX_HEIGHT-1 }
Rect | _cursor_area = { 0, 0, 1, 1 }
int | _cursor_click = 0
int | _cursor_last_btn = 0
int | _cursor_data = 0
int | _cursor_loc = 0
int | _cursor_drawfun = 0
int | _cursor_delfun = 0

Detailed Description

Constants and functions for working with the PS/2 mouse.

Function Documentation

void mouse_confine_cursor ( struct Rect * rect )

Confines the mouse cursor to a given area of the screen.

int mouse_get_x ( int coord )

Extracts the X coordinate from a packed coord word (as it is sent to the mouse callback).

int mouse_get_y ( int coord )

Extracts the Y coordinate from a packed coord word (as it is sent to the mouse callback).

int mouse_make_coord | ( | int | x,
 |  | int | y
 | ) |

Creates a packed coord word from the given X and Y coordinates.

void mouse_start_cursor | ( | int | click_func,
 |  | int | drag_func,
 |  | int | button_down_func,
 |  | int | button_up_func,
 |  | int | motion_func
 | ) |

Starts the mouse cursor in pixel mode.

Any of the given callback functions can be NULL, if you don't need it.

Parameters:
click_func | Function with signature click_func(button, ref Point pos, context) returns(status) which will be called when a mouse button is clicked. button will be a single BTN_x constant.
drag_func | Function with signature drag_func(buttons, ref Point pos, context) returns(status) which will be called when the mouse is moved while button(s) are down. buttons will be a bit-mask composed of one or more of the BTN_x constants.
button_down_func | Function with signature button_down_func(button, ref Point pos, context) returns(status) which will be called whenever a button is pressed or released. button will be a single BTN_x constant.
button_up_func | Function with signature button_up_func(button, ref Point pos, context) returns(status) which will be called whenever a button is pressed or released. button will be a single BTN_x constant.
motion_func | Function with signature motion_func(buttons, ref Point pos, context) returns(status) which will be called when the mouse is moved while no buttons are down. buttons will always be zero and is only present to provide compatibility with drag_func. This function isn't good for double buffering!

void set_mouse_callback ( int callback )

Sets a callback function which will be called as soon as the mouse's status has changed.

The callback function should be function callback(buttons, coords, context) returns(status) where buttons is a bit mask of the mouse button status (use the BTN_X masks) and coords is a packed word which contains both the X and Y movement. You can use the mouse_get_x() and mouse_get_y() functions to extract the actual movement.
The context and status variables are described at msg_set_handler().
Note: This enables / disables the mouse hardware!

Variable Documentation

const int _CURSOR_IMAGE[_CURSOR_HEIGHT_PIX]

Initial value:

 {
  0x01111111,
  0x00111111,
  0x0F011111,
  0x0FF01111,
  0x0FFF0111,
  0x0FFFF011,
  0x0FFFFF01,
  0x0FFFFFF0,
  0x000FF000,
  0x1110FF01,
  0x1110FF01,
  0x11110011
}

const int BTN_LEFT = 0b001

is the left button down? (mask for buttons)

const int BTN_MIDDLE = 0b100

is the middle button down? (mask for buttons)

const int BTN_RIGHT = 0b010

is the right button down? (mask for buttons)


HALRuntimeLibrary: Message handling

Message handling

Functions, constants and types for message handling. More...

Data Structures

struct | Message
A message (informing the program about an event on a device). More...

Functions

void | do_msgs (int do_forever)
int | msg_dispatch (struct Message *msg)
void | msg_set_handler (int type, int handler)
int | msg_get_handler (int type)
int | msg_exists_handler (int type)
void | msg_push_context (int contextPtr)
void | msg_pop_context ()

Variables

const int | MSGBUF_SIZE = 16
const int | MSG_NONE = -1
const int | MSG_DELETED = 0
const int | MSG_KEY = 1
const int | MSG_KEY_DOWN = MSG_KEY
const int | MSG_KEY_UP = 2
const int | MSG_CHAR = 3
const int | MSG_MOUSE = 4
const int | MSG_NETWORK = 6
const int | MSG_SOUND_DONE = 8
const int | MSG_MOUSE_CLICK = 9
const int | MSG_MOUSE_DRAG = 10
const int | MSG_MOUSE_BUTTON_DOWN = 11
const int | MSG_MOUSE_BUTTON_UP = 12
const int | MSG_MOUSE_MOTION = 13
const int | MSG_DEVICE_FIRST = 14
const int | MSG_DEVICE_LAST = MSG_DEVICE_FIRST + DEV_COUNT - 1
const int | MSG_TIMER_FIRST = MSG_DEVICE_LAST + 1
const int | MSG_TIMER_LAST = MSG_TIMER_FIRST + MAX_TIMERS - 1
const int | MSG_FIRST = MSG_KEY
const int | MSG_LAST = MSG_TIMER_LAST
const int | MH_QUIT = -1
int | MH_IGNORE_ALL = addressof _mh_ignore_all
int | MH_QUIT_ALL = addressof _mh_quit_all

Detailed Description

Functions, constants and types for message handling.

Function Documentation

void do_msgs ( int do_forever )

Fetches messages and calls the associated callback functions until (do_forever = FALSE) no more messages are waiting OR (do_forever = TRUE) a processed message returns the QUIT code.

int msg_dispatch ( struct Message * msg )

Immediately processes a single message to the registered handler(s) as if it had just been received from the interrupt handlers.

Parameters:
msg The message to dispatch.
Returns:
FALSE if the message handler returned the MH_QUIT return code, TRUE otherwise.

int msg_exists_handler ( int type )

Returns TRUE if, in any of the message handler stack frames, a handler for the given message types exists.

int msg_get_handler ( int type )

Gets the currently registered message handler for the current message handler stack frame.

This may be NULL.

void msg_pop_context ( )

Deletes the current message handler context.

Note: the global context (which already exists at program start) cannot be deleted. Any attempt to do so will lead to a fatal error.

void msg_push_context ( int contextPtr )

Pushes a new message handler context onto the message handler context stack.

The new context is initially empty, i.e. contains no handlers. Any handlers you register to the new context (using msg_set_handler()) will replace and/or extend the functionality that the old context's handlers provided.

Parameters:
contextPtr Pointer to arbitrary user data. The pointer will be passed to all message handlers of this message context. Note: You must not delete the pointed-to data as long as the message context exists!

void msg_set_handler | ( | int | type,
 |  | int | handler
 | ) |

Registers a new message handler for the given message type and the current message handler stack frame.

Note that you should not use this function directly for most of the message types. Use the message-specific registration functions, such as set_key_down_handler(), timer_start() and set_mouse_callback() instead. They will perform device-specific initializations in addition to registering your message handler.
The handler function's signature must be function Handler(param1, param2, context) returns(retcode), where param1 and param2 are message-specific parameters and context is a pointer to the handler's context, which was specified with msg_push_context(). The handler's return code is:

  • TRUE if the message was processed
  • FALSE if the message was not processed, and other message handlers on the stack should be searched
  • MH_QUIT if the message was processed and the current message loop should be terminated. do_msgs() will return whenever a message handler returns this code.
    If handler is NULL, the first handler found for the given message type is cleared, even if it has been registered in a lower handler stack frame.
    Additionally, you may use the special handlers MH_IGNORE_ALL, which marks every message as processed, but does nothing, and MH_QUIT_ALL, which quits the message loop whenever a message is received.
    Parameters:
    type | The message type to register the handler for (see the MSG_x constants)
    handler | Address of the handler function.

Variable Documentation

int MH_IGNORE_ALL = addressof _mh_ignore_all

Special message handler that marks every incoming message as processed, but doesn't do anything.

const int MH_QUIT = -1

This return code is used by a message handler which wants to signal to the do_msgs() function that it is time to quit the message loop.

int MH_QUIT_ALL = addressof _mh_quit_all

Special message handler that quits the message loop whenever a message occurs.

const int MSG_CHAR = 3

ASCII input via keyboard.

const int MSG_DELETED = 0

this message has been deleted

const int MSG_DEVICE_FIRST = 14

device message for first device (device #0)

const int MSG_DEVICE_LAST = MSG_DEVICE_FIRST + DEV_COUNT - 1

device message for last device

const int MSG_FIRST = MSG_KEY

number of first real existing message (MSG_INVALID doesn't count!)

const int MSG_KEY = 1

a key was pressed

const int MSG_KEY_DOWN = MSG_KEY

a key was pressed (alternate name)

const int MSG_KEY_UP = 2

a key was released

const int MSG_LAST = MSG_TIMER_LAST

number of last existing message

const int MSG_MOUSE = 4

mouse status has changed

const int MSG_MOUSE_BUTTON_DOWN = 11

mouse button was pressed

const int MSG_MOUSE_BUTTON_UP = 12

mouse button was released

const int MSG_MOUSE_CLICK = 9

mouse button was clicked

const int MSG_MOUSE_DRAG = 10

mouse was dragged (motion with button(s) down)

const int MSG_MOUSE_MOTION = 13

mouse was moved (while no buttons are down)

const int MSG_NETWORK = 6

network packet received

const int MSG_NONE = -1

there's no message present at all

const int MSG_SOUND_DONE = 8

sound playback has stopped

const int MSG_TIMER_FIRST = MSG_DEVICE_LAST + 1

a timer message for timer handle 1 has occured

const int MSG_TIMER_LAST = MSG_TIMER_FIRST + MAX_TIMERS - 1

a timer message for the last timer handle has occured

const int MSGBUF_SIZE = 16

count of messages that can be stored at a time


HALRuntimeLibrary: Music playback functions

Music playback functions

Constants and functions to play back HM music files. More...

Functions

int | music_play (int filename, struct InstrumentList *instr)
int | music_play_opened_file (struct File *file, struct InstrumentList *instr)
void | music_stop ()
InstrumentList * | instr_list_new (int size)
void | instr_list_free (struct InstrumentList *instr)
int | instr_load (int file, int offset, struct InstrumentList *instr, int pos)

Variables

const int | MUSIC_NOTE_MAX = (12 * 8) - 1

Detailed Description

Constants and functions to play back HM music files.

HM supports monophonic music only, but several "instruments" (sound samples) may be used for a single song.

See also:
Waveform sound playback functions for waveform data playback.

Function Documentation

void instr_list_free ( struct InstrumentList * instr )

Frees the given instrument list.

Note: You must not do this before the music has stopped!

struct InstrumentList* instr_list_new ( int size )

Makes a new instrument list of the given size (allocates it with malloc()).

The list is all empty, initially. You should set at least the first instrument (index 0), which is used as default, before playing music, otherwise you'll not hear anything

int instr_load | ( | int | file,
 |  | int | offset,
 |  | struct InstrumentList * | instr,
 |  | int | pos
 | ) |

Loads a given sound file (+offset) into the instrument list at the given position.

int music_play | ( | int | filename,
 |  | struct InstrumentList * | instr
 | ) |

Plays a music, given by its file name.

Uses the specified instrument list, which must live longer than the music plays (i.e. it should be a global variable). Returns TRUE if the music could be loaded successfully.

int music_play_opened_file | ( | struct File * | file,
 |  | struct InstrumentList * | instr
 | ) |

Plays a music given by an already opened file.

Uses the specified instrument list, which must live longer than the music plays (i.e. it should be a global variable). Returns TRUE if the music could be loaded successfully, FALSE otherwise. In every case, the file will be closed by HalMusic, so you shouldn't to this yourself.

void music_stop ( )

Stops the currently running music (if any).

Variable Documentation

const int MUSIC_NOTE_MAX = (12 * 8) - 1

supports 8 octaves (c0 ... h7)


HALRuntimeLibrary: Graphics mode functions

Graphics mode functions

Constants and functions to fill the graphics screen. More...

Data Structures

struct | Point
A point. More...
struct | Rect
A rectangle. More...
struct | Point
A point. More...

Functions

Animation * | pix_load_font (int fg, int bg)
void | pix_dbuf_start ()
void | pix_dbuf_stop ()
int | pix_dbuf_enabled ()
void | pix_dbuf_swap ()
void | pix_goto (int x, int y)
void | pix_goto_screen (int x, int y)
int | pix_drawpos (int x, int y)
int | pix_screenpos (int x, int y)
int | pix_where ()
int | pix_toxy (int pos)
int | pix_getpos ()
void | pix_setpos (int pos)
int | pix_getreadpos ()
void | pix_setreadpos (int pos)
void | pix_set_mode (int mode)
int | pix_get_mode ()
void | pix_drawp (int pix)
int | pix_readp ()
void | pix_draww (int word)
int | pix_readw ()
void | pix_cls (int colour)
int | pix_gettrans ()
void | pix_settrans (int col)
int | pix_maxalloc ()
int | pix_alloc (int npix)
void | pix_free ()
int | pix_free_ptr (int ptr, int npix)
void | pix_drawmw (int data_ptr, int target_addr, int size)
void | pix_readmw (int src_addr, int data_ptr, int size)
void | pix_blitw (int src_addr, int src_w, int trg_addr, int blit_w, int blit_h)
void | pix_blit (int src_addr, int src_w, int trg_addr, int blit_w, int blit_h)
void | pix_copy (int src_addr, int trg_addr, int npix)
void | pix_blitwv (int src_addr, int trg_addr, int blit_h)
void | pix_printf (struct Animation *font, int format)
void | pix_printstr (struct Animation *font, int str)
void | pix_print (struct Animation *font, int ch)
void | pix_draw_rect (int col, int w, int h)
void | pix_draw_line (int col, int x1, int y1)
void | pix_draw_poly (int col, int npoints, struct Point *points)
void | pix_draw_poly2 (int col, int npoints, struct Point *points)
void | pix_draw_patpoly (int patterns, int npoints, struct ShadedPoint *points)
void | pix_draw_patpoly2 (int patterns, int npoints, struct ShadedPoint *points)
int | pix_get_pattern (int patterns, int i)

Variables

const int | PIX_WIDTH = 640
const int | PIX_HEIGHT = 480
const int | PIX_SCREEN_SIZE = PIX_WIDTH * PIX_HEIGHT
const int | GM_TEXT = 0
const int | GM_GRAPHICS = 1
int | _pix_free_ptr = PIX_WIDTH * PIX_HEIGHT

Detailed Description

Constants and functions to fill the graphics screen.

Function Documentation

int pix_alloc ( int npix )

Allocates npix pixels of off-screen pixel memory storage.

If not enough memory is available, the processor will be stopped.

Returns:
The start address of the allocated pixel memory block

void pix_blit | ( | int | src_addr,
 |  | int | src_w,
 |  | int | trg_addr,
 |  | int | blit_w,
 |  | int | blit_h
 | ) |

Copies ("blits") a rectangular image inside graphics memory, using fast word transfer.

The target address will be treated as on-screen. If you want to copy inside the off-screen memory, you can call pix_drawmw() directly (only one call for the whole image is required then)

Parameters:
src_addr | Source address in graphics memory
src_w | Width of the source image (if the image is copied from screen, should be PIX_WIDTH)
trg_addr | Target address in graphics memory
blit_w | Width of the sub-image to be blitted. Can be any integer.
blit_h | Height of the sub-image to be blitted

void pix_blitw | ( | int | src_addr,
 |  | int | src_w,
 |  | int | trg_addr,
 |  | int | blit_w,
 |  | int | blit_h
 | ) |

Copies ("blits") a rectangular image inside graphics memory, using fast word transfer.

The target address will be treated as on-screen. If you want to copy inside the off-screen memory, you can call pix_drawmw() directly (only one call for the whole image is required then)

Parameters:
src_addr | Source address in graphics memory
src_w | Width of the source image (if the image is copied from screen, should be PIX_WIDTH)
trg_addr | Target address in graphics memory
blit_w | Width of the sub-image to be blitted (must be a multiple of 8)
blit_h | Height of the sub-image to be blitted

void pix_blitwv | ( | int | src_addr,
 |  | int | trg_addr,
 |  | int | blit_h
 | ) |

This function is the opposite of using readmw() / drawmw() to read/write a horizontally linear part of the graphics memory: it reads a linear part (width of 8) from the offscreen memory at src_addr and writes it vertically to the onscreen memory at trg_addr The original position address is restored after the operation is done This function is an optimized version of pix_blitw(), which is useful because so many images (e.g.

fonts) have a width of 8 pixel and you can save a lot of time here.

void pix_cls ( int colour )

Fills the drawing area with a given colour.

(If single buffering, the drawing area is the screen. If double buffering, the drawing area is offscreen.) The rest of the off-screen memory is not touched. The XPix Drawing Address is left in an unspecified position.

Note:
It is advised to not access the XPix at all after starting the clear-screen operation because it will be busy clearing the screen, and accessing it would stall the CPU for a long time (approx. 5 ms).

int pix_dbuf_enabled ( )

Is double buffering currently enabled? (returns a boolean).

void pix_dbuf_start ( )

Activates double-buffering.

void pix_dbuf_stop ( )

Terminates double buffering and returns to screen zero.

void pix_dbuf_swap ( )

When double-buffering is enabled: Swap the buffers.

void pix_draw_line | ( | int | col,
 |  | int | x1,
 |  | int | y1
 | ) |

Draws a line with the given colour to the position (x1, y1), starting at the current pixel position.

That position will be restored when done. The graphics card transparency will be set to NONE.

void pix_draw_patpoly | ( | int | patterns,
 |  | int | npoints,
 |  | struct ShadedPoint * | points
 | ) |

Draws a convex polygon with the given pattern between the given edge list.

The edge list should NOT be closed; this will be done automatically. If the polygon is concave, the cutouts will be filled up (so the results are wrong). The current pixel position will be restored after drawing. The graphics card transparency will be set to NONE.

void pix_draw_patpoly2 | ( | int | patterns,
 |  | int | npoints,
 |  | struct ShadedPoint * | points
 | ) |

Just like pix_draw_patpoly, but should be faster.

However, the polygon's points must be defined in counter-clockwise order.

void pix_draw_poly | ( | int | col,
 |  | int | npoints,
 |  | struct Point * | points
 | ) |

Draws a convex polygon with the given colour between the given edge list.

The edge list should NOT be closed; this will be done automatically. If the polygon is concave, the cutouts will be filled up (so the results are wrong). The current pixel position will be restored after drawing. The graphics card transparency will be set to NONE.

void pix_draw_poly2 | ( | int | col,
 |  | int | npoints,
 |  | struct Point * | points
 | ) |

same as pix_draw_poly, but should be faster however, the poly must be defined in CCW order

void pix_draw_rect | ( | int | col,
 |  | int | w,
 |  | int | h
 | ) |

Draws a filled rectangle with the given colour, width and height, starting at the current pixel position.

That position will be restored when done. The graphics card transparency will be set to NONE.

void pix_drawmw | ( | int | data_ptr,
 |  | int | target_addr,
 |  | int | size
 | ) |

Draws multiple words (= 8 packed pixels) from main memory to graphics memory.

Parameters:
data_ptr | Pointer to the data in main memory
target_addr | Target address in graphics memory
size | Number of pixels(!) to copy

void pix_drawp ( int pix )

Draws a single pixel at the current screen address pix should be in range 0 to 15 (otherwise it will be taken mod 16).

int pix_drawpos | ( | int | x,
 |  | int | y
 | ) |

Calculates the pixel position for the given drawing coordinates.

If double-buffering is enabled (see pix_dbuf_start()), this will be inside the off-screen buffer.

void pix_draww ( int word )

Draws a word (8 pixels, highest bits first) at the current screen address.

void pix_free ( )

Frees all of the off-screen pixel memory.

int pix_free_ptr | ( | int | ptr,
 |  | int | npix
 | ) |

Frees the last allocated block of off-screen pixel memory.

This will only work if that block was allocated last.

Returns:
TRUE if the block could be freed

int pix_get_mode ( )

Gets the current graphics mode.

This may be GM_TEXT or GM_GRAPHICS.

int pix_get_pattern | ( | int | patterns,
 |  | int | i
 | ) |

Extracts a pointer to the i'th pattern from a standard pattern array at patterns.

int pix_getpos ( )

Gets the current screen write address.

int pix_getreadpos ( )

Gets the current screen read address.

int pix_gettrans ( )

Gets the currently transparent colour Returns -1 if none is transparent.

void pix_goto | ( | int | x,
 |  | int | y
 | ) |

Moves to a given XY position for drawing.

If double-buffering is enabled (see pix_dbuf_start()), this will move to the off-screen buffer.

void pix_goto_screen | ( | int | x,
 |  | int | y
 | ) |

Moves to a given on-screen XY position for direct drawing.

This will only make a difference from the normal pix_goto() if double buffering is enabled.

struct Animation* pix_load_font | ( | int | fg,
 |  | int | bg
 | ) |

Loads the characters from the text-mode character memory and converts them to an Animation.

Parameters:
fg | Foreground colour for the resulting font
bg | Background colour for the resulting font. You may use -1 here to create a transparent font.

int pix_maxalloc ( )

Gets the size of the free offscreen pixel memory, in pixels.

Note:
When double buffering is enabled, lots of memory will be used for the second buffer, which means there'll be a lot less free.

void pix_print | ( | struct Animation * | font,
 |  | int | ch
 | ) |

Draws a single character with the given font, starting at the current pixel address.

Newlines or tabs are not processed specially. Wrapping will not work. If the font doesn't have enough characters, it is assumed to start from character 0 and the missing ones are printed blank.

void pix_printf | ( | struct Animation * | font,
 |  | int | format
 | ) |

Draws the given zero-terminated COMPACT format string, inserting all of the variable arguments.

void pix_printstr | ( | struct Animation * | font,
 |  | int | str
 | ) |

Draws a NON-COMPACT string with the given font, starting at the current pixel address.

Newlines or tabs are not processed specially. Wrapping will not work. If the font doesn't have enough characters, it is assumed to start from character 0 and the missing ones are printed blank.

void pix_readmw | ( | int | src_addr,
 |  | int | data_ptr,
 |  | int | size
 | ) |

Reads multiple words (= 8 packed pixels) from graphics memory to main memory.

Parameters:
src_addr | Source address in graphics memory
data_ptr | Pointer to the data in main memory (enough must have been allocated!)
size | Number of pixels(!) to copy

int pix_readp ( )

Reads a single pixel from the pixel memory at the current screen address.

int pix_readw ( )

Reads a word (8 pixels, highest bits first) from the current screen address.

int pix_screenpos | ( | int | x,
 |  | int | y
 | ) |

Calculates the pixel position for the given onscreen coordinates.

This will only make a difference from pix_drawpos() if double buffering is enabled.

void pix_set_mode ( int mode )

Sets the current graphics mode.

Parameters:
mode New graphics mode. This may be GM_TEXT for the text mode (default) or GM_GRAPHICS for the graphics mode.

void pix_setpos ( int pos )

Sets the current screen write address.

void pix_setreadpos ( int pos )

Sets the current screen read address.

void pix_settrans ( int col )

Sets the currently transparent colour.

This colour is ignored when being drawn (pix_drawp(), pix_draww()) and the screen is left unchanged instead. The parameter should be in the range from 0 to 15 (inclusive) or -1 to make no colour transparent.

int pix_toxy ( int pos )

Calculates XY coordinates (in dbuf mode: ignores the buffer).

int pix_where ( )

Gets the current XY write position (works whatever buffer we're drawing on).

Variable Documentation

const int GM_GRAPHICS = 1

Graphics mode; 640x480 pixels at 60 Hz.

const int GM_TEXT = 0

Text mode; 80x60 characters at 60 Hz.

const int PIX_HEIGHT = 480

Screen height.

const int PIX_SCREEN_SIZE = PIX_WIDTH * PIX_HEIGHT

Screen size, in pixels,.

const int PIX_WIDTH = 640

Screen width.


HALRuntimeLibrary: PS/2 connectors

PS/2 connectors

Functions for the PS/2 connectors. More...

Functions

int | is_mouse_present ()
int | is_keyboard_present ()

Variables

const int | _PORT_PS2 [] = { 128, 144 }
int | _key_device = -1
int | _mouse_device = -1

Detailed Description

Functions for the PS/2 connectors.

Function Documentation

int is_keyboard_present ( )

Checks if an external PS/2 keyboard is attached to the computer.

int is_mouse_present ( )

Checks if an external PS/2 mouse is attached to the computer.


HALRuntimeLibrary: Selection lists

Selection lists

Functions and data structures for selection lists. More...

Functions

int | select_string (int col_norm, int col_sel, int make_bold, int nstr, int strings)
void | _selstr_draw (struct _SelectStringData *data)
int | _selstr_key_down (int kc, int UU, struct _SelectStringData *data)
int | select_stringlist (int col_norm, int col_sel, int make_bold, int strings)
void | select_files (int col_norm, int col_sel, int make_bold, int accept_func, int target)

Detailed Description

Functions and data structures for selection lists.


HALRuntimeLibrary: Waveform sound playback functions

Waveform sound playback functions

Constants and functions to play back waveform sounds. More...

Functions

void | sound_low_set_callback (int func)
int | sound_get_buffer_status ()
void | sound_set_sample_rate (int rate)
void | sound_play_sample (int sam)
void | sound_play (int filename, int offset, int repeats)
void | sound_play_vol (int filename, int offset, int repeats, int vol, int vol_target)
void | sound_play_transpos (int filename, int offset, int repeats, int transpos)
int | sound_find_next (int filename, int offset)
int | sound_is_playing ()
void | sound_done_set_callback (int func)

Variables

const int | SOUND_BUFFER_FULL = 0b1100
const int | SOUND_BUFFER_GOOD = 0b1000
const int | SOUND_BUFFER_BAD = 0b0100
const int | SOUND_BUFFER_EMPTY = 0b0000
const int | SAMPLE_RATE_MIN = 11025
const int | SAMPLE_RATE_MAX = 44100

Detailed Description

Constants and functions to play back waveform sounds.

They may optionally be transposed or their volume may be changed. Loops are also supported.

See also:
Music playback functions for music playback.

Function Documentation

void sound_done_set_callback ( int func )

Sets the given callback function function callback(UNUSED1, UNUSED2, context) returns(status) as sound playback callback function.

It will be called whenever the sound playback has stopped.

int sound_find_next | ( | int | filename,
 |  | int | offset
 | ) |

Assuming that the file given by filename is a PAK file consisting of HSF sound files only (i.e.

just all those sound files concatenated together), finds the starting position of the next sound after the one starting at offset. If no more sounds follow or the file doesn't exist or whatever other error may occur, returns -1.

int sound_get_buffer_status ( )

Gets the current sound buffer status.

Returns one of the SOUND_BUFFER_* constants.
Warning: This is a low-level function. Using it directly may cause conflicts with the higher-level functions sound_play_*(), which you should normally use instead.

int sound_is_playing ( )

Checks if there's currently some sound playing.

void sound_low_set_callback ( int func )

Sets the given callback function function callback() returns() as sound buffer callback function.

It will be called whenever the sound buffer runs low. If func=0, disables sound interrupts.
Warning: This is a low-level function. Using it directly may cause conflicts with the higher-level functions sound_play_*(), which you should normally use instead.

void sound_play | ( | int | filename,
 |  | int | offset,
 |  | int | repeats
 | ) |

Plays a sound file from the flash.

Parameters:
filename | NON-COMPACT file name string of the sound file
offset | Offset (in bytes) of the sound inside the file
repeats | Number of repeats of the sound to play. If the sound file defines a loop range, only that part of the sound will be repeated.

void sound_play_sample ( int sam )

Plays a sound sample.

The sample must be in the native format [FIXME: which is it?...]
Warning: This is a low-level function. Using it directly may cause conflicts with the higher-level functions sound_play_*(), which you should normally use instead.

void sound_play_transpos | ( | int | filename,
 |  | int | offset,
 |  | int | repeats,
 |  | int | transpos
 | ) |

Plays a sound file from the flash and transposes it.

Parameters:
filename | NON-COMPACT file name string of the sound file
offset | Offset (in bytes) of the sound inside the file
repeats | Number of repeats of the sound to play. If the sound file defines a loop range, only that part of the sound will be repeated.
transpos | Transposition of the sound in half tones (0 is neutral, positive means upwards)

void sound_play_vol | ( | int | filename,
 |  | int | offset,
 |  | int | repeats,
 |  | int | vol,
 |  | int | vol_target
 | ) |

Plays a sound file from the flash and changes its volume.

Parameters:
filename | NON-COMPACT file name string of the sound file
offset | Offset (in bytes) of the sound inside the file
repeats | Number of repeats of the sound to play. If the sound file defines a loop range, only that part of the sound will be repeated.
vol | This FIXPOINT number gives the factor by which the sound's volume is multiplied. For better quality, you should store the sound normalized to its maximum volume and use numbers < 1.0 here only.
vol_target | FIXPOINT number of the volume to reach at the end of the sound. The sound's volume will be faded towards this value, however this may not work correctly with long samples because of the limited resolution of fixpoint numbers.

void sound_set_sample_rate ( int rate )

Sets the sound sample rate (in Hz)
Warning: This is a low-level function.

Using it directly may cause conflicts with the higher-level functions sound_play_*(), which you should normally use instead.

Variable Documentation

const int SAMPLE_RATE_MAX = 44100

maximum sample rate used

const int SAMPLE_RATE_MIN = 11025

minimum sample rate supported by the hardware


HALRuntimeLibrary: String functions

String functions

Various functions to work with strings: creating, duplicating, and converting them from and to numbers. More...

Functions

int | format_hex (int num, int str)
int | format_hexnum (int num, int str, int len)
int | format_dec (int num, int str)
int | format_fp (int fp, int str)
int | conv_hex (int str)
int | conv_dec (int str)
int | strlen (int str)
int | strcopy (int src, int target, int max_len)
int | strcompare (int str1, int str2)
int | char_upper (int char)
int | char_lower (int char)
int | strcompare_nocase (int str1, int str2)
int | strcat (int str, int target, int max_len)
int | cstr_foreach (int cstr, int func, int initial)
int | strpack (int orig, int compact)
int | cstr_unpack (int cstr, int noncompact)
int | _cstr_unpack_foreach (int char, int data)
int | cstrlen (int cstr)
int | _cstrlen_foreach (int char, int data)
_StrPrintfv_Data * | _strprintfv_foreach (int char, struct _StrPrintfv_Data *data)
void | strprintfv (int format, int target, int target_len, int va_start, int va_count)
void | strprintfxv (int format, int target, int target_len, int xfunction, int va_start, int va_count)
void | strprintf (int format, int target, int target_len)
void | strprintfx (int format, int target, int target_len, int xfunction)

Detailed Description

Various functions to work with strings: creating, duplicating, and converting them from and to numbers.

Function Documentation

int char_lower ( int char )

Converts a character to lower case.

int char_upper ( int char )

Converts a character to upper case.

int conv_dec ( int str )

Converts a string representation of a decimal number to an integer.

str must be a NON-COMPACT string. The string is parsed from left to right. When a non-digit is found, the function returns. count is the number of digits found. This includes the leading minus (if present).

int conv_hex ( int str )

Converts a string representation of a positive number (hex) to an integer.

str has to be a NON-COMPACT string. The string is parsed from left to right. When a non-hex digit is found, the function returns. count is the number of hex digits found.

int cstr_foreach | ( | int | cstr,
 |  | int | func,
 |  | int | initial
 | ) |

Executes a function (given by its address) for each character of the given compact string (up to, and not including, the terminating zero).

The function must have the signature function func(char, data) returns(new_data) where char is the current compact string character; data is a user-defined parameter and new_data is a user-defined return value, which will be passed to the next invocation of func. For the first invocation, func will be passed the initial value; and the last new_data is returned by cstr_foreach itself.
It should also be possible to use a function func(char) returns() if the data parameter is not required. In that case, the return value of cstr_foreach should be ignored too.

int cstr_unpack | ( | int | cstr,
 |  | int | noncompact
 | ) |

Unpacks the compact string "orig" and writes the resulting non-compact string into array "noncompact" which must have proper length.

"orig" and "noncompact" must not point to overlapping memory locations. Returns a pointer to "noncompact".

int cstrlen ( int cstr )

Gives the string length (in characters) of the given compact string cstr.

int format_dec | ( | int | num,
 |  | int | str
 | ) |

Prints the given value decimally into the given string.

Parameters:
str | String to fill with the value. Must be at least 12 words long (including terminating zero!)
num | Number to print

int format_hex | ( | int | num,
 |  | int | str
 | ) |

Prints the given value hexadecimally into the given string.

Parameters:
str | String to fill with the value. Must be at least 9 words long (including terminating zero!)
num | Number to print
Returns:
Pointer to the first non-zero character

int format_hexnum | ( | int | num,
 |  | int | str,
 |  | int | len
 | ) |

Prints the given value hexadecimally into the given string, where required with leading zeros.

Parameters:
str | String to fill with the value. Must be at least len+1 words long (including terminating zero!)
len | Number of nibbles to take into account (= length of the string, excluding terminating zero).
num | Number to print
Returns:
ptr=str

int strcat | ( | int | str,
 |  | int | target,
 |  | int | max_len
 | ) |

appends the NON_COMPACT string str to the NON_COMPACT string target, which has the length max_len (including terminating zero).

If the string doesn't fit, only the first part is appended. The resulting string is always zero-terminated.

Returns:
Number of appended characters (including the zero).

int strcompare | ( | int | str1,
 |  | int | str2
 | ) |

Compares two non-compact strings str1 and str2 (case sensitive).

If the strings are equal, 0 is returned.

int strcompare_nocase | ( | int | str1,
 |  | int | str2
 | ) |

Compares two non-compact strings str1 and str2 (case insensitive).

If the strings are equal, 0 is returned.

int strcopy | ( | int | src,
 |  | int | target,
 |  | int | max_len
 | ) |

copies the NON_COMPACT string src to the NON_COMPACT buffer target, which has the length max_len (including the terminating zero).

If the string doesn't fit, only the first part is copied. The resulting string is always zero-terminated.

Returns:
Number of copied characters (including the zero).

int strlen ( int str )

Calculates the length of the NON-COMPACT string str.

int strpack | ( | int | orig,
 |  | int | compact
 | ) |

Packs the non-compact string "orig" and writes the resulting compact string into array "compact" which must have proper length.

"orig" and "compact" must not point to overlapping memory locations. Returns a pointer to "compact".

void strprintf | ( | int | format,
 |  | int | target,
 |  | int | target_len
 | ) |

Copies the given COMPACT format string to the given NON-COMPACT target string (with buffer length target_len), inserting all of the variable arguments according to the format string.

The following formats are supported:

  • c Insert the argument as a character
  • s Insert the argument as a COMPACT ("small") string
  • S Insert the argument as a NON-COMPACT ("large") string
  • d Format the argument as an integer number (like format_dec())
  • x Format the argument as hexadecimal number (like format_hex())
  • f Format the argument as fixpoint number (like format_fp())
  • %% Insert a percent sign. The format specifier (excluding c and %%) may be preceded by a (decimal) number, which specifies the minimum length (in characters) of the inserted string. If the inserted string would be shorter, it will be padded with spaces (or zeroes, if the number starts with a zero) to the required length. The inserted string will not be shortened, however, if it exceeds the specified length.

void strprintfx | ( | int | format,
 |  | int | target,
 |  | int | target_len,
 |  | int | xfunction
 | ) |

Formats the given format string like strprintf.

However, calls the add-on function xfunction whenever an unknown format specifier is found. Its syntax must be as follows:
xfunction(char, va_current, ref _StrPrintfv_Data data, buf) returns(proceed)
xfunction's arguments are:

  • char The format character
  • va_current The value of the current variable argument as passed to strprintfx
  • data Pointer to the internal StrPrintfv data, from which you can read format_pad and format_len
  • buf Pointer to a buffer where the inserted string should be stored. xfunction's return value should be:
  • TRUE if the format character was correctly processed, the buffer should be inserted and the variable argument was used up
  • FALSE if the format character was correctly processed, but no insertion should be performed and no variable argument was used up
  • -1 if the format character was not recognized


HALRuntimeLibrary: Timer functions

Timer functions

Functions, constants and types for timers and stop watches. More...

Functions

int | timer_start (int interval, int do_loop, int callback)
void | timer_stop (int handle)
int | watch_start ()
int | watch_get_time (int token)

Variables

const int | MAX_TIMERS = 8
const int | TIMER_RESOLUTION = 8000
int | _timerbuf [MAX_TIMERS *sizeof record _TimerData]

Detailed Description

Functions, constants and types for timers and stop watches.

Function Documentation

int timer_start | ( | int | interval,
 |  | int | do_loop,
 |  | int | callback
 | ) |

Setup a new timer and register a message handler in the current handler frame for it.

Parameters:
interval | Timer interval in ms
do_loop | if non-zero, timer will be repeated; if zero, timer will be single-shot only
callback | Address of a callback function of signature callback(timer_handle, UNUSED, context) returns(status). The callback function's context parameter is a pointer to arbitrary user data, and it is the same as the msg_push_context() pointer at the registration time. The callback's return value should be TRUE normally. However, a callback may return MH_QUIT to stop the currently running message loop.
Returns:
A handle to the timer. If zero, creation of the timer failed (because required resources are missing)

void timer_stop ( int handle )

stop a timer

Parameters:
handle The timer's handle

int watch_get_time ( int token )

gets the current time (in microseconds) for the given stopwatch (modulo 2^32)

Parameters:
token The stop watch token returned by watch_start().

int watch_start ( )

start a stop watch

Returns:
a stop watch token which you must pass whenever you want to get the watch's time

Variable Documentation

int _timerbuf[MAX_TIMERS *sizeof record _TimerData]

basic timer resolution in µs (you can lower it, but that wastes CPU power)

const int MAX_TIMERS = 8

The maximum number of timers that are supported at the same time.


HALRuntimeLibrary: Directory Hierarchy

HALRuntimeLibrary Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • temp


HALRuntimeLibrary: temp/ Directory Reference

temp

temp Directory Reference

Files

file | hal.hl
file | hal3d.hl
file | hal3d_types.hl
file | hal3o.hl
file | halalgo.hl
file | halanim.hl
file | halasm.hl
file | halbasic.hl
file | haldev.hl
file | halfile.hl
file | halft.hl
file | halgfx.hl
file | halhighscore.hl
file | halintern.hl
file | halkeyboard.hl
file | halkeyconf.hl
file | halmath.hl
file | halmem.hl
file | halmenu.hl
file | halmouse.hl
file | halmsg.hl
file | halmusic.hl
file | halnet.hl
file | halpix.hl
file | halps2.hl
file | halselect.hl
file | halsound.hl
file | halstring.hl
file | haltime.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- _ -

  • _1 : halmath.hl
  • _far : hal3d.hl
  • _FLASH_ATTRIB : halfile.hl
  • _FLASH_BEGIN : halfile.hl
  • _FLASH_FNAME : halfile.hl
  • _FLASH_HEADER : halfile.hl
  • _FLASH_SIZE : halfile.hl
  • _fvalid : hal3d.hl
  • _hg_calc_shade() : hal3d.hl
  • _hg_clip_dim() : hal3d.hl
  • _hg_clipr_dim() : hal3d.hl
  • _hg_fmatrix : hal3d.hl
  • _hg_getpoint() : hal3d.hl
  • _hg_headlight() : hal3d.hl
  • _hg_height : hal3d.hl
  • _hg_identity : hal3d.hl
  • _hg_imatrix : hal3d.hl
  • _hg_light : hal3d.hl
  • _hg_origin : hal3d.hl
  • _hg_pmatrix : hal3d.hl
  • _hg_rotate() : hal3d.hl
  • _hg_shade_func : hal3d.hl
  • _hg_tmatrix : hal3d.hl
  • _hg_width : hal3d.hl
  • _hg_xfrom : hal3d.hl
  • _hg_xto : hal3d.hl
  • _hg_yfrom : hal3d.hl
  • _hg_yto : hal3d.hl
  • _msg_del_all() : halmsg.hl
  • _msgsend() : halmsg.hl
  • _near : hal3d.hl
  • _NEWTON_ABORT : halmath.hl


HALRuntimeLibrary: Data Fields - Variables

  • Data Structures
  • Data Fields
  • All
  • Variables

  • begin : File
  • checkfail_func : File
  • dirHandle : File
  • end : Rect
  • fget_func : File
  • fgetw_func : File
  • fptr : File
  • fput_func : File
  • height : Animation
  • imageCount : Animation
  • length : File
  • param1 : Message
  • param2 : Message
  • pixAddr : Animation
  • remain : File
  • start : Rect
  • transparency : Animation
  • type : Message
  • width : Animation


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- k -

  • KEY_COUNT : halkeyboard.hl
  • key_get_name() : halkeyboard.hl
  • key_is_down() : halkeyboard.hl
  • keyconf_get() : halkeyconf.hl
  • keyconf_init() : halkeyconf.hl
  • keyconf_load() : halkeyconf.hl
  • KEYCONF_MAX_APPNAME : halkeyconf.hl
  • KEYCONF_MAX_APPS : halkeyconf.hl
  • KEYCONF_MAX_KEYS : halkeyconf.hl
  • keyconf_run() : halkeyconf.hl
  • keyconf_save() : halkeyconf.hl
  • keyconf_set_col() : halkeyconf.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- l -

  • load_keytable() : halkeyboard.hl
  • load_keytable_mem() : halkeyboard.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- m -

  • malloc() : halmem.hl
  • max() : halmath.hl
  • MAX_FLENGTH : halfile.hl
  • MAX_FNAME : halfile.hl
  • MAX_TIMERS : halbasic.hl
  • mblock_size() : halmem.hl
  • mcompare() : halmem.hl
  • mcopy() : halmem.hl
  • menu_click_handler() : halmenu.hl
  • menu_draw() : halmenu.hl
  • menu_get() : halmenu.hl
  • menu_init() : halmenu.hl
  • menu_kbd_handler() : halmenu.hl
  • menu_set() : halmenu.hl
  • mfill() : halmem.hl
  • MH_IGNORE_ALL : halmsg.hl
  • MH_QUIT : halmsg.hl
  • MH_QUIT_ALL : halmsg.hl
  • min() : halmath.hl
  • mmaxalloc() : halmem.hl
  • mouse_confine_cursor() : halmouse.hl
  • mouse_get_x() : halmouse.hl
  • mouse_get_y() : halmouse.hl
  • mouse_make_coord() : halmouse.hl
  • mouse_start_cursor() : halmouse.hl
  • MSG_CHAR : halmsg.hl
  • MSG_DELETED : halmsg.hl
  • MSG_DEVICE_FIRST : halmsg.hl
  • MSG_DEVICE_LAST : halmsg.hl
  • msg_dispatch() : halmsg.hl
  • msg_exists_handler() : halmsg.hl
  • MSG_FIRST : halmsg.hl
  • msg_get_handler() : halmsg.hl
  • MSG_KEY : halmsg.hl
  • MSG_KEY_DOWN : halmsg.hl
  • MSG_KEY_UP : halmsg.hl
  • MSG_LAST : halmsg.hl
  • MSG_MOUSE : halmsg.hl
  • MSG_MOUSE_BUTTON_DOWN : halmsg.hl
  • MSG_MOUSE_BUTTON_UP : halmsg.hl
  • MSG_MOUSE_CLICK : halmsg.hl
  • MSG_MOUSE_DRAG : halmsg.hl
  • MSG_MOUSE_MOTION : halmsg.hl
  • MSG_NETWORK : halmsg.hl
  • MSG_NONE : halmsg.hl
  • msg_pop_context() : halmsg.hl
  • msg_push_context() : halmsg.hl
  • msg_set_handler() : halmsg.hl
  • MSG_SOUND_DONE : halmsg.hl
  • MSG_TIMER_FIRST : halmsg.hl
  • MSG_TIMER_LAST : halmsg.hl
  • MSGBUF_SIZE : halmsg.hl
  • MUSIC_NOTE_MAX : halmusic.hl
  • music_play() : halmusic.hl
  • music_play_opened_file() : halmusic.hl
  • music_stop() : halmusic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- a -

  • abs() : halmath.hl
  • anim_draw_frame() : halanim.hl
  • anim_draw_frame_direct() : halanim.hl
  • anim_draw_frame_direct_at() : halanim.hl
  • anim_find_next() : halanim.hl
  • anim_find_next_at() : halanim.hl
  • anim_free() : halanim.hl
  • anim_get_info() : halanim.hl
  • anim_image_pointer() : halanim.hl
  • anim_load() : halanim.hl
  • anim_load_at() : halanim.hl
  • anim_new() : halanim.hl
  • ATTR_ERASED_BIT : halfile.hl
  • ATTR_EXECUTABLE_BIT : halfile.hl
  • ATTR_FOLDER_BIT : halfile.hl
  • ATTR_SHELL_BIT : halfile.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- b -

  • bound() : halmath.hl
  • broken() : halmath.hl
  • BTN_LEFT : halmouse.hl
  • BTN_MIDDLE : halmouse.hl
  • BTN_RIGHT : halmouse.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- c -

  • ceil() : halmath.hl
  • char_lower() : halstring.hl
  • char_upper() : halstring.hl
  • checkfs() : halfile.hl
  • CKM_BUTTONS : halbasic.hl
  • CKM_SWITCHES : halbasic.hl
  • COL_BLACK : halgfx.hl
  • COL_BLUE : halgfx.hl
  • COL_BROWN : halgfx.hl
  • COL_CYAN : halgfx.hl
  • COL_DARK_GREY : halgfx.hl
  • COL_GREEN : halgfx.hl
  • COL_GREY : halgfx.hl
  • COL_LBLUE : halgfx.hl
  • COL_LGREEN : halgfx.hl
  • COL_LMAGENTA : halgfx.hl
  • COL_LRED : halgfx.hl
  • COL_MAGENTA : halgfx.hl
  • COL_RED : halgfx.hl
  • COL_TO_BG : halgfx.hl
  • COL_TO_FG : halgfx.hl
  • COL_TURQUOISE : halgfx.hl
  • COL_WHITE : halgfx.hl
  • COL_YELLOW : halgfx.hl
  • conv_dec() : halstring.hl
  • conv_hex() : halstring.hl
  • cos() : halmath.hl
  • cstr_foreach() : halstring.hl
  • cstr_unpack() : halstring.hl
  • cstrlen() : halstring.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- d -

  • DEV_COUNT : halbasic.hl
  • DEV_JTAG : halbasic.hl
  • dev_read_byte() : haldev.hl
  • dev_set_callback() : haldev.hl
  • dev_set_interrupt_callback() : haldev.hl
  • DEV_USB : halbasic.hl
  • dev_write_byte() : haldev.hl
  • do_msgs() : halmsg.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- e -

  • ERR_ANIM_FORMAT : halbasic.hl
  • ERR_ANIMDRAW_FNO : halbasic.hl
  • ERR_ANIMSCALE_DIM : halbasic.hl
  • ERR_DEV_CALLBACK : halbasic.hl
  • ERR_DEV_NUMBER : halbasic.hl
  • ERR_FLASH_DATA_FAIL : halbasic.hl
  • ERR_FLASH_FNAME_TERM : halbasic.hl
  • ERR_FLASH_FS_SIZE : halbasic.hl
  • ERR_FLASH_FSIZE : halbasic.hl
  • ERR_FLASH_HANDLE : halbasic.hl
  • ERR_FLASH_HEADER_FAIL : halbasic.hl
  • ERR_FLASH_OVERFLOW : halbasic.hl
  • ERR_FLASH_SERIOUS_FAIL : halbasic.hl
  • ERR_GFX_DEFAULT_FONT : halbasic.hl
  • ERR_GFX_NO_FONT : halbasic.hl
  • ERR_GFX_WRONG_FONT : halbasic.hl
  • ERR_HSC_WRONG_ENTRY : halbasic.hl
  • ERR_INSTR_POS : halbasic.hl
  • ERR_INVALID_FREE_PTR : halbasic.hl
  • ERR_INVALID_MBS_PTR : halbasic.hl
  • ERR_INVALID_REALLOC_PTR : halbasic.hl
  • ERR_IRQ_DIV0 : halbasic.hl
  • ERR_IRQ_MEMADDR : halbasic.hl
  • ERR_IRQ_OVF : halbasic.hl
  • ERR_IRQ_PCADDR : halbasic.hl
  • ERR_IRQ_USR1 : halbasic.hl
  • ERR_IRQ_USR2 : halbasic.hl
  • ERR_IRQ_XADDR : halbasic.hl
  • ERR_IRQ_XDUMMY1 : halbasic.hl
  • ERR_IRQ_XDUMMY2 : halbasic.hl
  • ERR_KEY_CALLBACK : halbasic.hl
  • ERR_KEY_DEVICE : halbasic.hl
  • ERR_MALLOC_SIZE : halbasic.hl
  • ERR_MCOMPARE_PTR : halbasic.hl
  • ERR_MCOPY_SIZE : halbasic.hl
  • ERR_MCOPY_SOURCE : halbasic.hl
  • ERR_MCOPY_TARGET : halbasic.hl
  • ERR_MENU_HANDLER_FUNC : halbasic.hl
  • ERR_MENU_HANDLER_NUM : halbasic.hl
  • ERR_MENU_INIT : halbasic.hl
  • ERR_MFILL_TARGET : halbasic.hl
  • ERR_MSG_HANDLER_FUNC : halbasic.hl
  • ERR_MSG_POP_GLOBAL : halbasic.hl
  • ERR_MSG_TYPE : halbasic.hl
  • ERR_NET_MESSAGE_ID : halbasic.hl
  • ERR_NO_MEMORY : halbasic.hl
  • ERR_PIX_NO_DBUF : halbasic.hl
  • ERR_PIX_NO_MEMORY : halbasic.hl
  • ERR_PIXALLOC_SIZE : halbasic.hl
  • ERR_PRINTF_FORMAT : halbasic.hl
  • ERR_READ_PACKET : halbasic.hl
  • ERR_SYSTEM_ID : halbasic.hl
  • ERR_TIMER_CALLBACK : halbasic.hl
  • ERR_TIMER_HANDLE : halbasic.hl
  • ERR_TIMER_INTERVAL : halbasic.hl
  • ERR_TOO_MANY_NETWORKS : halbasic.hl
  • ERR_WRITE_PACKET : halbasic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- f -

  • FALSE : halbasic.hl
  • fattrib() : halfile.hl
  • FBEGIN : halfile.hl
  • fcheckfail() : halfile.hl
  • fcheckname() : halfile.hl
  • fclose() : halfile.hl
  • fcreate() : halfile.hl
  • FCURRENT : halfile.hl
  • fdelete() : halfile.hl
  • fend() : halfile.hl
  • FEND : halfile.hl
  • ffind() : halfile.hl
  • ffirst() : halfile.hl
  • fflush() : halfile.hl
  • ffreespace() : halfile.hl
  • ffsbusy() : halfile.hl
  • ffssize() : halfile.hl
  • fget() : halfile.hl
  • fgetattrib() : halfile.hl
  • fgetb() : halfile.hl
  • fgethandle() : halfile.hl
  • fgets() : halfile.hl
  • fheader() : halfile.hl
  • find_binary() : halalgo.hl
  • FLASH_STAT_BUSY : halfile.hl
  • FLASH_STAT_FAIL : halfile.hl
  • FLASHADDR_FS_SIZE : halfile.hl
  • FLASHADDR_SYSTEM_ID : halfile.hl
  • floor() : halmath.hl
  • fname() : halfile.hl
  • fnext() : halfile.hl
  • FONT_DEFAULT : halgfx.hl
  • FONT_LARGE : halgfx.hl
  • FONT_LUCIDA : halgfx.hl
  • fopen() : halfile.hl
  • fopen_handle() : halfile.hl
  • fopen_mem() : halfile.hl
  • format_dec() : halstring.hl
  • format_hex() : halstring.hl
  • format_hexnum() : halstring.hl
  • fp2int() : halmath.hl
  • fputb() : halfile.hl
  • fread() : halfile.hl
  • freadb() : halfile.hl
  • free() : halmem.hl
  • fseek() : halfile.hl
  • fsetattrib() : halfile.hl
  • fsize() : halfile.hl
  • fsize_handle() : halfile.hl
  • fsync() : halfile.hl
  • ftell() : halfile.hl
  • ftotalsize() : halfile.hl
  • fwrite() : halfile.hl
  • fwriteb() : halfile.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- g -

  • gcd() : halmath.hl
  • GDM_BGCOL : halbasic.hl
  • GDM_CHAR : halbasic.hl
  • GDM_FGCOL : halbasic.hl
  • getsystemid() : halfile.hl
  • gfx_clear_rect() : halgfx.hl
  • gfx_cls() : halgfx.hl
  • gfx_draw_rect() : halgfx.hl
  • GFX_FONT_HEIGHT : halgfx.hl
  • GFX_FONT_WIDTH : halgfx.hl
  • gfx_getcol() : halgfx.hl
  • gfx_goto() : halgfx.hl
  • GFX_HEIGHT : halgfx.hl
  • gfx_isbold() : halgfx.hl
  • gfx_load_default_font() : halgfx.hl
  • gfx_load_font() : halgfx.hl
  • gfx_load_font_file() : halgfx.hl
  • gfx_load_mem_font() : halgfx.hl
  • gfx_loadchars() : halgfx.hl
  • gfx_loadcol() : halgfx.hl
  • gfx_nextline() : halgfx.hl
  • gfx_nextline_ai() : halgfx.hl
  • gfx_nexttab() : halgfx.hl
  • gfx_out() : halgfx.hl
  • gfx_out_col() : halgfx.hl
  • gfx_outstr() : halgfx.hl
  • gfx_print() : halgfx.hl
  • gfx_print_ai() : halgfx.hl
  • gfx_printcstr() : halgfx.hl
  • gfx_printcstr_ai() : halgfx.hl
  • gfx_printf() : halgfx.hl
  • gfx_printstr() : halgfx.hl
  • GFX_SCREEN_SIZE : halgfx.hl
  • gfx_setbgcol() : halgfx.hl
  • gfx_setbold() : halgfx.hl
  • gfx_setcol() : halgfx.hl
  • gfx_setfgcol() : halgfx.hl
  • gfx_storecol() : halgfx.hl
  • gfx_where() : halgfx.hl
  • gfx_wherex() : halgfx.hl
  • gfx_wherey() : halgfx.hl
  • GFX_WIDTH : halgfx.hl
  • GM_GRAPHICS : halpix.hl
  • GM_TEXT : halpix.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- h -

  • H3D_POLY_FLAT : hal3o.hl
  • H3D_POLY_ROUNDED : hal3o.hl
  • h3o_calc_normals() : hal3o.hl
  • h3o_free() : hal3o.hl
  • h3o_load() : hal3o.hl
  • h3o_make_poly() : hal3o.hl
  • h3o_new() : hal3o.hl
  • h3o_obj_poly() : hal3o.hl
  • h3o_obj_poly_count() : hal3o.hl
  • h3o_obj_vertex() : hal3o.hl
  • h3o_obj_vertex_count() : hal3o.hl
  • h3o_poly_get_flags() : hal3o.hl
  • h3o_poly_get_pattern() : hal3o.hl
  • h3o_poly_get_vertex() : hal3o.hl
  • h3o_poly_set_flags() : hal3o.hl
  • h3o_poly_set_pattern() : hal3o.hl
  • h3o_poly_set_vertex() : hal3o.hl
  • h3o_poly_vertex_count() : hal3o.hl
  • HFT_ERR_BUFFER : halft.hl
  • HFT_ERR_FLASH : halft.hl
  • HFT_ERR_MEMORY : halft.hl
  • HFT_ERR_NONE : halft.hl
  • HFT_ERR_PROTOCOL : halft.hl
  • hft_read_byte() : halft.hl
  • hft_read_file() : halft.hl
  • hft_read_file_header() : halft.hl
  • hft_read_string() : halft.hl
  • hg_cartesian() : hal3d.hl
  • hg_clip() : hal3d.hl
  • hg_clip_rounded() : hal3d.hl
  • hg_cross() : hal3d.hl
  • hg_diff() : hal3d.hl
  • hg_dotprod() : hal3d.hl
  • hg_flat_point() : hal3d.hl
  • hg_flat_polygon() : hal3d.hl
  • hg_get_light() : hal3d.hl
  • hg_identity() : hal3d.hl
  • hg_light() : hal3d.hl
  • hg_mulmm() : hal3d.hl
  • hg_mulmv() : hal3d.hl
  • hg_mulmv_transp() : hal3d.hl
  • hg_mulsv() : hal3d.hl
  • hg_new_flat_polygon() : hal3d.hl
  • hg_new_rounded_polygon() : hal3d.hl
  • hg_norm() : hal3d.hl
  • hg_normalize() : hal3d.hl
  • hg_projection() : hal3d.hl
  • hg_rounded_point() : hal3d.hl
  • hg_rounded_polygon() : hal3d.hl
  • hg_scale() : hal3d.hl
  • hg_shade_func() : hal3d.hl
  • hg_shaded_polygon() : hal3d.hl
  • hg_sum() : hal3d.hl
  • hg_transform_point() : hal3d.hl
  • hg_translate() : hal3d.hl
  • hg_viewport() : hal3d.hl
  • hg_xrotate() : hal3d.hl
  • hg_yrotate() : hal3d.hl
  • hg_zrotate() : hal3d.hl
  • hsc_add() : halhighscore.hl
  • HSC_FILE_MAX_SIZE : halhighscore.hl
  • hsc_free() : halhighscore.hl
  • hsc_is_good_enough() : halhighscore.hl
  • hsc_read() : halhighscore.hl
  • hsc_show() : halhighscore.hl
  • HSC_SIZE : halhighscore.hl
  • hsc_write() : halhighscore.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- i -

  • ilogd() : halmath.hl
  • insert_sorted() : halalgo.hl
  • instr_list_free() : halmusic.hl
  • instr_list_new() : halmusic.hl
  • instr_load() : halmusic.hl
  • int2fp() : halmath.hl
  • is_keyboard_present() : halps2.hl
  • is_mouse_present() : halps2.hl
  • isqrt() : halmath.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- p -

  • pix_alloc() : halpix.hl
  • pix_blit() : halpix.hl
  • pix_blitw() : halpix.hl
  • pix_blitwv() : halpix.hl
  • pix_cls() : halpix.hl
  • pix_dbuf_enabled() : halpix.hl
  • pix_dbuf_start() : halpix.hl
  • pix_dbuf_stop() : halpix.hl
  • pix_dbuf_swap() : halpix.hl
  • pix_draw_line() : halpix.hl
  • pix_draw_patpoly() : halpix.hl
  • pix_draw_patpoly2() : halpix.hl
  • pix_draw_poly() : halpix.hl
  • pix_draw_poly2() : halpix.hl
  • pix_draw_rect() : halpix.hl
  • pix_drawmw() : halpix.hl
  • pix_drawp() : halpix.hl
  • pix_drawpos() : halpix.hl
  • pix_draww() : halpix.hl
  • pix_free() : halpix.hl
  • pix_free_ptr() : halpix.hl
  • pix_get_mode() : halpix.hl
  • pix_get_pattern() : halpix.hl
  • pix_getpos() : halpix.hl
  • pix_getreadpos() : halpix.hl
  • pix_gettrans() : halpix.hl
  • pix_goto() : halpix.hl
  • pix_goto_screen() : halpix.hl
  • PIX_HEIGHT : halpix.hl
  • pix_load_font() : halgfx.hl
  • pix_maxalloc() : halpix.hl
  • pix_print() : halpix.hl
  • pix_printf() : halpix.hl
  • pix_printstr() : halpix.hl
  • pix_readmw() : halpix.hl
  • pix_readp() : halpix.hl
  • pix_readw() : halpix.hl
  • PIX_SCREEN_SIZE : halpix.hl
  • pix_screenpos() : halpix.hl
  • pix_set_mode() : halpix.hl
  • pix_setpos() : halpix.hl
  • pix_setreadpos() : halpix.hl
  • pix_settrans() : halpix.hl
  • pix_toxy() : halpix.hl
  • pix_where() : halpix.hl
  • PIX_WIDTH : halpix.hl
  • PORT_CON_CTRL : halbasic.hl
  • PORT_CON_KEYS : halbasic.hl
  • PORT_CON_LEDS : halbasic.hl
  • PORT_CON_SEGDATA : halbasic.hl
  • PORT_CON_SEGSTAT : halbasic.hl
  • PORT_FLASH_ADDR : halbasic.hl
  • PORT_FLASH_DATA : halbasic.hl
  • PORT_FLASH_FAIL_ADDR : halbasic.hl
  • PORT_FLASH_FULL_ERASE : halbasic.hl
  • PORT_FLASH_SECTOR_ERASE : halbasic.hl
  • PORT_FLASH_STAT : halbasic.hl
  • PORT_JTAG_CTRL : halbasic.hl
  • PORT_PIX_BUFFER : halbasic.hl
  • PORT_PIX_CLS : halbasic.hl
  • PORT_PIX_DATA : halbasic.hl
  • PORT_PIX_FAST : halbasic.hl
  • PORT_PIX_MODE : halbasic.hl
  • PORT_PIX_READADDR : halbasic.hl
  • PORT_PIX_TRANS : halbasic.hl
  • PORT_PIX_WRITEADDR : halbasic.hl
  • PORT_POISON_DO : halbasic.hl
  • PORT_POISON_UNDO : halbasic.hl
  • PORT_SOUND_CTRL : halbasic.hl
  • PORT_TIMER_CTRL : halbasic.hl
  • PORT_TIMER_DATA : halbasic.hl
  • PORT_USB_CTRL : halbasic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- r -

  • random() : halmath.hl
  • random_getseed() : halmath.hl
  • random_setseed() : halmath.hl
  • realloc() : halmem.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- s -

  • SAMPLE_RATE_MAX : halsound.hl
  • SAMPLE_RATE_MIN : halsound.hl
  • set_char_input_callback() : halkeyboard.hl
  • set_key_down_callback() : halkeyboard.hl
  • set_key_up_callback() : halkeyboard.hl
  • set_mouse_callback() : halmouse.hl
  • setsystemid() : halfile.hl
  • sin() : halmath.hl
  • sort() : halalgo.hl
  • sound_done_set_callback() : halsound.hl
  • sound_find_next() : halsound.hl
  • sound_get_buffer_status() : halsound.hl
  • sound_is_playing() : halsound.hl
  • sound_low_set_callback() : halsound.hl
  • sound_play() : halsound.hl
  • sound_play_sample() : halsound.hl
  • sound_play_transpos() : halsound.hl
  • sound_play_vol() : halsound.hl
  • sound_set_sample_rate() : halsound.hl
  • sqrt() : halmath.hl
  • strcat() : halstring.hl
  • strcompare() : halstring.hl
  • strcompare_nocase() : halstring.hl
  • strcopy() : halstring.hl
  • strlen() : halstring.hl
  • strpack() : halstring.hl
  • strprintf() : halstring.hl
  • strprintfx() : halstring.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- t -

  • tan() : halmath.hl
  • TRUE : halbasic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- u -

  • UCM_RECV_DATA : halbasic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t
  • u
  • v

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- v -

  • VK_MAX : halkeyboard.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- _ -

  • _hg_calc_shade() : hal3d.hl
  • _hg_clip_dim() : hal3d.hl
  • _hg_clipr_dim() : hal3d.hl
  • _hg_getpoint() : hal3d.hl
  • _hg_headlight() : hal3d.hl
  • _hg_rotate() : hal3d.hl
  • _msg_del_all() : halmsg.hl
  • _msgsend() : halmsg.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- k -

  • key_get_name() : halkeyboard.hl
  • key_is_down() : halkeyboard.hl
  • keyconf_get() : halkeyconf.hl
  • keyconf_init() : halkeyconf.hl
  • keyconf_load() : halkeyconf.hl
  • keyconf_run() : halkeyconf.hl
  • keyconf_save() : halkeyconf.hl
  • keyconf_set_col() : halkeyconf.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- l -

  • load_keytable() : halkeyboard.hl
  • load_keytable_mem() : halkeyboard.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- m -

  • malloc() : halmem.hl
  • max() : halmath.hl
  • mblock_size() : halmem.hl
  • mcompare() : halmem.hl
  • mcopy() : halmem.hl
  • menu_click_handler() : halmenu.hl
  • menu_draw() : halmenu.hl
  • menu_get() : halmenu.hl
  • menu_init() : halmenu.hl
  • menu_kbd_handler() : halmenu.hl
  • menu_set() : halmenu.hl
  • mfill() : halmem.hl
  • min() : halmath.hl
  • mmaxalloc() : halmem.hl
  • mouse_confine_cursor() : halmouse.hl
  • mouse_get_x() : halmouse.hl
  • mouse_get_y() : halmouse.hl
  • mouse_make_coord() : halmouse.hl
  • mouse_start_cursor() : halmouse.hl
  • msg_dispatch() : halmsg.hl
  • msg_exists_handler() : halmsg.hl
  • msg_get_handler() : halmsg.hl
  • msg_pop_context() : halmsg.hl
  • msg_push_context() : halmsg.hl
  • msg_set_handler() : halmsg.hl
  • music_play() : halmusic.hl
  • music_play_opened_file() : halmusic.hl
  • music_stop() : halmusic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- a -

  • abs() : halmath.hl
  • anim_draw_frame() : halanim.hl
  • anim_draw_frame_direct() : halanim.hl
  • anim_draw_frame_direct_at() : halanim.hl
  • anim_find_next() : halanim.hl
  • anim_find_next_at() : halanim.hl
  • anim_free() : halanim.hl
  • anim_get_info() : halanim.hl
  • anim_image_pointer() : halanim.hl
  • anim_load() : halanim.hl
  • anim_load_at() : halanim.hl
  • anim_new() : halanim.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- b -

  • bound() : halmath.hl
  • broken() : halmath.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- c -

  • ceil() : halmath.hl
  • char_lower() : halstring.hl
  • char_upper() : halstring.hl
  • checkfs() : halfile.hl
  • conv_dec() : halstring.hl
  • conv_hex() : halstring.hl
  • cos() : halmath.hl
  • cstr_foreach() : halstring.hl
  • cstr_unpack() : halstring.hl
  • cstrlen() : halstring.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- d -

  • dev_read_byte() : haldev.hl
  • dev_set_callback() : haldev.hl
  • dev_set_interrupt_callback() : haldev.hl
  • dev_write_byte() : haldev.hl
  • do_msgs() : halmsg.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- f -

  • fattrib() : halfile.hl
  • fcheckfail() : halfile.hl
  • fcheckname() : halfile.hl
  • fclose() : halfile.hl
  • fcreate() : halfile.hl
  • fdelete() : halfile.hl
  • fend() : halfile.hl
  • ffind() : halfile.hl
  • ffirst() : halfile.hl
  • fflush() : halfile.hl
  • ffreespace() : halfile.hl
  • ffsbusy() : halfile.hl
  • ffssize() : halfile.hl
  • fget() : halfile.hl
  • fgetattrib() : halfile.hl
  • fgetb() : halfile.hl
  • fgethandle() : halfile.hl
  • fgets() : halfile.hl
  • fheader() : halfile.hl
  • find_binary() : halalgo.hl
  • floor() : halmath.hl
  • fname() : halfile.hl
  • fnext() : halfile.hl
  • fopen() : halfile.hl
  • fopen_handle() : halfile.hl
  • fopen_mem() : halfile.hl
  • format_dec() : halstring.hl
  • format_hex() : halstring.hl
  • format_hexnum() : halstring.hl
  • fp2int() : halmath.hl
  • fputb() : halfile.hl
  • fread() : halfile.hl
  • freadb() : halfile.hl
  • free() : halmem.hl
  • fseek() : halfile.hl
  • fsetattrib() : halfile.hl
  • fsize() : halfile.hl
  • fsize_handle() : halfile.hl
  • fsync() : halfile.hl
  • ftell() : halfile.hl
  • ftotalsize() : halfile.hl
  • fwrite() : halfile.hl
  • fwriteb() : halfile.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- g -

  • gcd() : halmath.hl
  • getsystemid() : halfile.hl
  • gfx_clear_rect() : halgfx.hl
  • gfx_cls() : halgfx.hl
  • gfx_draw_rect() : halgfx.hl
  • gfx_getcol() : halgfx.hl
  • gfx_goto() : halgfx.hl
  • gfx_isbold() : halgfx.hl
  • gfx_load_default_font() : halgfx.hl
  • gfx_load_font() : halgfx.hl
  • gfx_load_font_file() : halgfx.hl
  • gfx_load_mem_font() : halgfx.hl
  • gfx_loadchars() : halgfx.hl
  • gfx_loadcol() : halgfx.hl
  • gfx_nextline() : halgfx.hl
  • gfx_nextline_ai() : halgfx.hl
  • gfx_nexttab() : halgfx.hl
  • gfx_out() : halgfx.hl
  • gfx_out_col() : halgfx.hl
  • gfx_outstr() : halgfx.hl
  • gfx_print() : halgfx.hl
  • gfx_print_ai() : halgfx.hl
  • gfx_printcstr() : halgfx.hl
  • gfx_printcstr_ai() : halgfx.hl
  • gfx_printf() : halgfx.hl
  • gfx_printstr() : halgfx.hl
  • gfx_setbgcol() : halgfx.hl
  • gfx_setbold() : halgfx.hl
  • gfx_setcol() : halgfx.hl
  • gfx_setfgcol() : halgfx.hl
  • gfx_storecol() : halgfx.hl
  • gfx_where() : halgfx.hl
  • gfx_wherex() : halgfx.hl
  • gfx_wherey() : halgfx.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- h -

  • h3o_calc_normals() : hal3o.hl
  • h3o_free() : hal3o.hl
  • h3o_load() : hal3o.hl
  • h3o_make_poly() : hal3o.hl
  • h3o_new() : hal3o.hl
  • h3o_obj_poly() : hal3o.hl
  • h3o_obj_poly_count() : hal3o.hl
  • h3o_obj_vertex() : hal3o.hl
  • h3o_obj_vertex_count() : hal3o.hl
  • h3o_poly_get_flags() : hal3o.hl
  • h3o_poly_get_pattern() : hal3o.hl
  • h3o_poly_get_vertex() : hal3o.hl
  • h3o_poly_set_flags() : hal3o.hl
  • h3o_poly_set_pattern() : hal3o.hl
  • h3o_poly_set_vertex() : hal3o.hl
  • h3o_poly_vertex_count() : hal3o.hl
  • hft_read_byte() : halft.hl
  • hft_read_file() : halft.hl
  • hft_read_file_header() : halft.hl
  • hft_read_string() : halft.hl
  • hg_cartesian() : hal3d.hl
  • hg_clip() : hal3d.hl
  • hg_clip_rounded() : hal3d.hl
  • hg_cross() : hal3d.hl
  • hg_diff() : hal3d.hl
  • hg_dotprod() : hal3d.hl
  • hg_flat_point() : hal3d.hl
  • hg_flat_polygon() : hal3d.hl
  • hg_get_light() : hal3d.hl
  • hg_identity() : hal3d.hl
  • hg_light() : hal3d.hl
  • hg_mulmm() : hal3d.hl
  • hg_mulmv() : hal3d.hl
  • hg_mulmv_transp() : hal3d.hl
  • hg_mulsv() : hal3d.hl
  • hg_new_flat_polygon() : hal3d.hl
  • hg_new_rounded_polygon() : hal3d.hl
  • hg_norm() : hal3d.hl
  • hg_normalize() : hal3d.hl
  • hg_projection() : hal3d.hl
  • hg_rounded_point() : hal3d.hl
  • hg_rounded_polygon() : hal3d.hl
  • hg_scale() : hal3d.hl
  • hg_shade_func() : hal3d.hl
  • hg_shaded_polygon() : hal3d.hl
  • hg_sum() : hal3d.hl
  • hg_transform_point() : hal3d.hl
  • hg_translate() : hal3d.hl
  • hg_viewport() : hal3d.hl
  • hg_xrotate() : hal3d.hl
  • hg_yrotate() : hal3d.hl
  • hg_zrotate() : hal3d.hl
  • hsc_add() : halhighscore.hl
  • hsc_free() : halhighscore.hl
  • hsc_is_good_enough() : halhighscore.hl
  • hsc_read() : halhighscore.hl
  • hsc_show() : halhighscore.hl
  • hsc_write() : halhighscore.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- i -

  • ilogd() : halmath.hl
  • insert_sorted() : halalgo.hl
  • instr_list_free() : halmusic.hl
  • instr_list_new() : halmusic.hl
  • instr_load() : halmusic.hl
  • int2fp() : halmath.hl
  • is_keyboard_present() : halps2.hl
  • is_mouse_present() : halps2.hl
  • isqrt() : halmath.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- p -

  • pix_alloc() : halpix.hl
  • pix_blit() : halpix.hl
  • pix_blitw() : halpix.hl
  • pix_blitwv() : halpix.hl
  • pix_cls() : halpix.hl
  • pix_dbuf_enabled() : halpix.hl
  • pix_dbuf_start() : halpix.hl
  • pix_dbuf_stop() : halpix.hl
  • pix_dbuf_swap() : halpix.hl
  • pix_draw_line() : halpix.hl
  • pix_draw_patpoly() : halpix.hl
  • pix_draw_patpoly2() : halpix.hl
  • pix_draw_poly() : halpix.hl
  • pix_draw_poly2() : halpix.hl
  • pix_draw_rect() : halpix.hl
  • pix_drawmw() : halpix.hl
  • pix_drawp() : halpix.hl
  • pix_drawpos() : halpix.hl
  • pix_draww() : halpix.hl
  • pix_free() : halpix.hl
  • pix_free_ptr() : halpix.hl
  • pix_get_mode() : halpix.hl
  • pix_get_pattern() : halpix.hl
  • pix_getpos() : halpix.hl
  • pix_getreadpos() : halpix.hl
  • pix_gettrans() : halpix.hl
  • pix_goto() : halpix.hl
  • pix_goto_screen() : halpix.hl
  • pix_load_font() : halgfx.hl
  • pix_maxalloc() : halpix.hl
  • pix_print() : halpix.hl
  • pix_printf() : halpix.hl
  • pix_printstr() : halpix.hl
  • pix_readmw() : halpix.hl
  • pix_readp() : halpix.hl
  • pix_readw() : halpix.hl
  • pix_screenpos() : halpix.hl
  • pix_set_mode() : halpix.hl
  • pix_setpos() : halpix.hl
  • pix_setreadpos() : halpix.hl
  • pix_settrans() : halpix.hl
  • pix_toxy() : halpix.hl
  • pix_where() : halpix.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- r -

  • random() : halmath.hl
  • random_getseed() : halmath.hl
  • random_setseed() : halmath.hl
  • realloc() : halmem.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- s -

  • set_char_input_callback() : halkeyboard.hl
  • set_key_down_callback() : halkeyboard.hl
  • set_key_up_callback() : halkeyboard.hl
  • set_mouse_callback() : halmouse.hl
  • setsystemid() : halfile.hl
  • sin() : halmath.hl
  • sort() : halalgo.hl
  • sound_done_set_callback() : halsound.hl
  • sound_find_next() : halsound.hl
  • sound_get_buffer_status() : halsound.hl
  • sound_is_playing() : halsound.hl
  • sound_low_set_callback() : halsound.hl
  • sound_play() : halsound.hl
  • sound_play_sample() : halsound.hl
  • sound_play_transpos() : halsound.hl
  • sound_play_vol() : halsound.hl
  • sound_set_sample_rate() : halsound.hl
  • sqrt() : halmath.hl
  • strcat() : halstring.hl
  • strcompare() : halstring.hl
  • strcompare_nocase() : halstring.hl
  • strcopy() : halstring.hl
  • strlen() : halstring.hl
  • strpack() : halstring.hl
  • strprintf() : halstring.hl
  • strprintfx() : halstring.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • f
  • g
  • h
  • i
  • k
  • l
  • m
  • p
  • r
  • s
  • t

- t -

  • tan() : halmath.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- _ -

  • _1 : halmath.hl
  • _far : hal3d.hl
  • _FLASH_ATTRIB : halfile.hl
  • _FLASH_BEGIN : halfile.hl
  • _FLASH_FNAME : halfile.hl
  • _FLASH_HEADER : halfile.hl
  • _FLASH_SIZE : halfile.hl
  • _fvalid : hal3d.hl
  • _hg_fmatrix : hal3d.hl
  • _hg_height : hal3d.hl
  • _hg_identity : hal3d.hl
  • _hg_imatrix : hal3d.hl
  • _hg_light : hal3d.hl
  • _hg_origin : hal3d.hl
  • _hg_pmatrix : hal3d.hl
  • _hg_shade_func : hal3d.hl
  • _hg_tmatrix : hal3d.hl
  • _hg_width : hal3d.hl
  • _hg_xfrom : hal3d.hl
  • _hg_xto : hal3d.hl
  • _hg_yfrom : hal3d.hl
  • _hg_yto : hal3d.hl
  • _near : hal3d.hl
  • _NEWTON_ABORT : halmath.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- k -

  • KEY_COUNT : halkeyboard.hl
  • KEYCONF_MAX_APPNAME : halkeyconf.hl
  • KEYCONF_MAX_APPS : halkeyconf.hl
  • KEYCONF_MAX_KEYS : halkeyconf.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- m -

  • MAX_FLENGTH : halfile.hl
  • MAX_FNAME : halfile.hl
  • MAX_TIMERS : halbasic.hl
  • MH_IGNORE_ALL : halmsg.hl
  • MH_QUIT : halmsg.hl
  • MH_QUIT_ALL : halmsg.hl
  • MSG_CHAR : halmsg.hl
  • MSG_DELETED : halmsg.hl
  • MSG_DEVICE_FIRST : halmsg.hl
  • MSG_DEVICE_LAST : halmsg.hl
  • MSG_FIRST : halmsg.hl
  • MSG_KEY : halmsg.hl
  • MSG_KEY_DOWN : halmsg.hl
  • MSG_KEY_UP : halmsg.hl
  • MSG_LAST : halmsg.hl
  • MSG_MOUSE : halmsg.hl
  • MSG_MOUSE_BUTTON_DOWN : halmsg.hl
  • MSG_MOUSE_BUTTON_UP : halmsg.hl
  • MSG_MOUSE_CLICK : halmsg.hl
  • MSG_MOUSE_DRAG : halmsg.hl
  • MSG_MOUSE_MOTION : halmsg.hl
  • MSG_NETWORK : halmsg.hl
  • MSG_NONE : halmsg.hl
  • MSG_SOUND_DONE : halmsg.hl
  • MSG_TIMER_FIRST : halmsg.hl
  • MSG_TIMER_LAST : halmsg.hl
  • MSGBUF_SIZE : halmsg.hl
  • MUSIC_NOTE_MAX : halmusic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- a -

  • ATTR_ERASED_BIT : halfile.hl
  • ATTR_EXECUTABLE_BIT : halfile.hl
  • ATTR_FOLDER_BIT : halfile.hl
  • ATTR_SHELL_BIT : halfile.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- b -

  • BTN_LEFT : halmouse.hl
  • BTN_MIDDLE : halmouse.hl
  • BTN_RIGHT : halmouse.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- c -

  • CKM_BUTTONS : halbasic.hl
  • CKM_SWITCHES : halbasic.hl
  • COL_BLACK : halgfx.hl
  • COL_BLUE : halgfx.hl
  • COL_BROWN : halgfx.hl
  • COL_CYAN : halgfx.hl
  • COL_DARK_GREY : halgfx.hl
  • COL_GREEN : halgfx.hl
  • COL_GREY : halgfx.hl
  • COL_LBLUE : halgfx.hl
  • COL_LGREEN : halgfx.hl
  • COL_LMAGENTA : halgfx.hl
  • COL_LRED : halgfx.hl
  • COL_MAGENTA : halgfx.hl
  • COL_RED : halgfx.hl
  • COL_TO_BG : halgfx.hl
  • COL_TO_FG : halgfx.hl
  • COL_TURQUOISE : halgfx.hl
  • COL_WHITE : halgfx.hl
  • COL_YELLOW : halgfx.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- d -

  • DEV_COUNT : halbasic.hl
  • DEV_JTAG : halbasic.hl
  • DEV_USB : halbasic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- e -

  • ERR_ANIM_FORMAT : halbasic.hl
  • ERR_ANIMDRAW_FNO : halbasic.hl
  • ERR_ANIMSCALE_DIM : halbasic.hl
  • ERR_DEV_CALLBACK : halbasic.hl
  • ERR_DEV_NUMBER : halbasic.hl
  • ERR_FLASH_DATA_FAIL : halbasic.hl
  • ERR_FLASH_FNAME_TERM : halbasic.hl
  • ERR_FLASH_FS_SIZE : halbasic.hl
  • ERR_FLASH_FSIZE : halbasic.hl
  • ERR_FLASH_HANDLE : halbasic.hl
  • ERR_FLASH_HEADER_FAIL : halbasic.hl
  • ERR_FLASH_OVERFLOW : halbasic.hl
  • ERR_FLASH_SERIOUS_FAIL : halbasic.hl
  • ERR_GFX_DEFAULT_FONT : halbasic.hl
  • ERR_GFX_NO_FONT : halbasic.hl
  • ERR_GFX_WRONG_FONT : halbasic.hl
  • ERR_HSC_WRONG_ENTRY : halbasic.hl
  • ERR_INSTR_POS : halbasic.hl
  • ERR_INVALID_FREE_PTR : halbasic.hl
  • ERR_INVALID_MBS_PTR : halbasic.hl
  • ERR_INVALID_REALLOC_PTR : halbasic.hl
  • ERR_IRQ_DIV0 : halbasic.hl
  • ERR_IRQ_MEMADDR : halbasic.hl
  • ERR_IRQ_OVF : halbasic.hl
  • ERR_IRQ_PCADDR : halbasic.hl
  • ERR_IRQ_USR1 : halbasic.hl
  • ERR_IRQ_USR2 : halbasic.hl
  • ERR_IRQ_XADDR : halbasic.hl
  • ERR_IRQ_XDUMMY1 : halbasic.hl
  • ERR_IRQ_XDUMMY2 : halbasic.hl
  • ERR_KEY_CALLBACK : halbasic.hl
  • ERR_KEY_DEVICE : halbasic.hl
  • ERR_MALLOC_SIZE : halbasic.hl
  • ERR_MCOMPARE_PTR : halbasic.hl
  • ERR_MCOPY_SIZE : halbasic.hl
  • ERR_MCOPY_SOURCE : halbasic.hl
  • ERR_MCOPY_TARGET : halbasic.hl
  • ERR_MENU_HANDLER_FUNC : halbasic.hl
  • ERR_MENU_HANDLER_NUM : halbasic.hl
  • ERR_MENU_INIT : halbasic.hl
  • ERR_MFILL_TARGET : halbasic.hl
  • ERR_MSG_HANDLER_FUNC : halbasic.hl
  • ERR_MSG_POP_GLOBAL : halbasic.hl
  • ERR_MSG_TYPE : halbasic.hl
  • ERR_NET_MESSAGE_ID : halbasic.hl
  • ERR_NO_MEMORY : halbasic.hl
  • ERR_PIX_NO_DBUF : halbasic.hl
  • ERR_PIX_NO_MEMORY : halbasic.hl
  • ERR_PIXALLOC_SIZE : halbasic.hl
  • ERR_PRINTF_FORMAT : halbasic.hl
  • ERR_READ_PACKET : halbasic.hl
  • ERR_SYSTEM_ID : halbasic.hl
  • ERR_TIMER_CALLBACK : halbasic.hl
  • ERR_TIMER_HANDLE : halbasic.hl
  • ERR_TIMER_INTERVAL : halbasic.hl
  • ERR_TOO_MANY_NETWORKS : halbasic.hl
  • ERR_WRITE_PACKET : halbasic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- f -

  • FALSE : halbasic.hl
  • FBEGIN : halfile.hl
  • FCURRENT : halfile.hl
  • FEND : halfile.hl
  • FLASH_STAT_BUSY : halfile.hl
  • FLASH_STAT_FAIL : halfile.hl
  • FLASHADDR_FS_SIZE : halfile.hl
  • FLASHADDR_SYSTEM_ID : halfile.hl
  • FONT_DEFAULT : halgfx.hl
  • FONT_LARGE : halgfx.hl
  • FONT_LUCIDA : halgfx.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- g -

  • GDM_BGCOL : halbasic.hl
  • GDM_CHAR : halbasic.hl
  • GDM_FGCOL : halbasic.hl
  • GFX_FONT_HEIGHT : halgfx.hl
  • GFX_FONT_WIDTH : halgfx.hl
  • GFX_HEIGHT : halgfx.hl
  • GFX_SCREEN_SIZE : halgfx.hl
  • GFX_WIDTH : halgfx.hl
  • GM_GRAPHICS : halpix.hl
  • GM_TEXT : halpix.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- h -

  • H3D_POLY_FLAT : hal3o.hl
  • H3D_POLY_ROUNDED : hal3o.hl
  • HFT_ERR_BUFFER : halft.hl
  • HFT_ERR_FLASH : halft.hl
  • HFT_ERR_MEMORY : halft.hl
  • HFT_ERR_NONE : halft.hl
  • HFT_ERR_PROTOCOL : halft.hl
  • HSC_FILE_MAX_SIZE : halhighscore.hl
  • HSC_SIZE : halhighscore.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- p -

  • PIX_HEIGHT : halpix.hl
  • PIX_SCREEN_SIZE : halpix.hl
  • PIX_WIDTH : halpix.hl
  • PORT_CON_CTRL : halbasic.hl
  • PORT_CON_KEYS : halbasic.hl
  • PORT_CON_LEDS : halbasic.hl
  • PORT_CON_SEGDATA : halbasic.hl
  • PORT_CON_SEGSTAT : halbasic.hl
  • PORT_FLASH_ADDR : halbasic.hl
  • PORT_FLASH_DATA : halbasic.hl
  • PORT_FLASH_FAIL_ADDR : halbasic.hl
  • PORT_FLASH_FULL_ERASE : halbasic.hl
  • PORT_FLASH_SECTOR_ERASE : halbasic.hl
  • PORT_FLASH_STAT : halbasic.hl
  • PORT_JTAG_CTRL : halbasic.hl
  • PORT_PIX_BUFFER : halbasic.hl
  • PORT_PIX_CLS : halbasic.hl
  • PORT_PIX_DATA : halbasic.hl
  • PORT_PIX_FAST : halbasic.hl
  • PORT_PIX_MODE : halbasic.hl
  • PORT_PIX_READADDR : halbasic.hl
  • PORT_PIX_TRANS : halbasic.hl
  • PORT_PIX_WRITEADDR : halbasic.hl
  • PORT_POISON_DO : halbasic.hl
  • PORT_POISON_UNDO : halbasic.hl
  • PORT_SOUND_CTRL : halbasic.hl
  • PORT_TIMER_CTRL : halbasic.hl
  • PORT_TIMER_DATA : halbasic.hl
  • PORT_USB_CTRL : halbasic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- s -

  • SAMPLE_RATE_MAX : halsound.hl
  • SAMPLE_RATE_MIN : halsound.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- t -

  • TRUE : halbasic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- u -

  • UCM_RECV_DATA : halbasic.hl


HALRuntimeLibrary: Data Fields

  • All
  • Functions
  • Variables
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • k
  • m
  • p
  • s
  • t
  • u
  • v

- v -

  • VK_MAX : halkeyboard.hl


HALRuntimeLibrary: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.