BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
blitzhelp.h File Reference
#include <exec/types.h>

Go to the source code of this file.

Macros

#define BL_ALWAYS_INLINE   static inline __attribute__((always_inline))
#define BL_SETW(r, v)
#define BL_SETB(r, v)
#define BL_EXTL(r)
#define BL_SWAP(r)
#define BL_STRCOPY_B_(d, s)
#define BL_STRCOPY(d, s, len)
#define BL_POPL(sp)
#define BL_POPW(sp)
#define BL_CUSTOM   ((UBYTE *)0xdff000)
#define BL_CUSTOMW(cb, o)
#define BL_CUSTOML(cb, o)
#define BL_BLITBUSY(cb)
#define BL_BLITWAIT(cb)
#define BL_BLITWAIT_TST(cb)
#define BL_INTENA   (*(volatile UWORD *)0xdff09a)
#define BL_INTS_OFF()
#define BL_INTS_ON()
#define LVO_SPFix   (-30)
#define LVO_SPFlt   (-36)
#define LVO_SPCmp   (-42)
#define LVO_SPTst   (-48)
#define LVO_SPAbs   (-54)
#define LVO_SPNeg   (-60)
#define LVO_SPAdd   (-66)
#define LVO_SPSub   (-72)
#define LVO_SPMul   (-78)
#define LVO_SPDiv   (-84)
#define LVO_SPFloor   (-90)
#define LVO_SPCeil   (-96)
#define TOK_localloc   0xc000 /* memlib: d0 = size, d1 = flags -> d0 = mem */
#define TOK_locfree   0xc001 /* memlib: a1 = mem */
#define TOK_globalloc   0xc002 /* memlib: like localloc, global list */
#define TOK_globfree   0xc003 /* memlib: a1 = mem, global list */
#define TOK_getvbr   0xc31d /* runerrlib: a0 = VBR */
#define TOK_ctrlcend
#define TOK_endjmp   0xc800 /* exitslib: End */
#define TOK_lmultiply   0xca01 /* lmullib: d0 = d0 * d1 */
#define TOK_ldivide   0xcb01 /* ldivlib: d0 = d0 / d1 */
#define TOK_strcomp2   0xce02 /* strcomplib */
#define TOK_qutofl
#define TOK_fltoqu   0xd301 /* floatquicklib: Float -> Quick (a6 = ffplib) */
#define TOK_setint
#define TOK_clrint   0xc101 /* intlib ClrInt: d0 = level */
#define TOK_vwait   0xc104 /* intlib VWait: d0 = frames */
#define TOK_allocst   0xcf01 /* maxslib: d0 = source, d1 = length -> d0 = copy */
#define TOK_freest   0xcf02 /* maxslib: d0 = copy (or 0) */
#define TOK_setin   ((LIB_inputoutputlib << 7) + 3) /* inputoutputlib: input handler */
#define TOK_setout   ((LIB_inputoutputlib << 7) + 4) /* inputoutputlib: output handler */
#define TOK_iogetsingle   ((LIB_inputoutputlib << 7) + 5) /* -> d0 = character */
#define TOK_iogetstring   ((LIB_inputoutputlib << 7) + 6) /* a0 = buffer, d0 = max */
#define TOK_iooutsingle   ((LIB_inputoutputlib << 7) + 7) /* d0 = character */
#define TOK_iooutstring1   ((LIB_inputoutputlib << 7) + 8) /* a0 = characters, d0 = length */
#define TOK_iooutstring2   ((LIB_inputoutputlib << 7) + 9) /* a0 = string with 0 */
#define TOK_ioctrlcout
#define TOK_ioctrlcin   ((LIB_inputoutputlib << 7) + 13) /* ... of the input (#43) */
#define TOK_ustr   ((LIB_printlib << 7) + 6) /* printlib UStr$: d0 = value, a2 = type */
#define TOK_val   ((LIB_vallib << 7) + 1) /* vallib Val: d0 = string, a2 = length */
#define TOK_exists
#define TOK_execversion   ((LIB_environlib << 7) + 7) /* environlib: -> d0.w */
#define TOK_setevfilter   ((LIB_windowslib << 7) + 58) /* windowslib SetEventFilter */
#define TOK_extbitmap
#define TOK_getpal   ((LIB_palettelib << 7) + 3) /* palettelib: a0 = name, a1 = palette */
#define TOK_getpal2   ((LIB_palettelib << 7) + 4) /* palettelib: and d0 = offset */
#define TOK_showsprite
#define TOK_convertkey   ((LIB_rawkeylib << 7) + 1) /* d0 = code, d1 = qualifier -> d0 */
#define TOK_unconvert   ((LIB_rawkeylib << 7) + 2) /* d0 = ascii -> d0 = code, d1 */
#define TOK_qconvertkey   ((LIB_rawkeylib << 7) + 3)
#define TOK_iffopen   ((LIB_iffiolib << 7) + 1) /* a0 = name */
#define TOK_iffclose   ((LIB_iffiolib << 7) + 2)
#define TOK_iffbyte   ((LIB_iffiolib << 7) + 3) /* -> d0 */
#define TOK_iffword   ((LIB_iffiolib << 7) + 4) /* -> d0 */
#define TOK_ifflong   ((LIB_iffiolib << 7) + 5) /* -> d0 */
#define TOK_ifffind   ((LIB_iffiolib << 7) + 6) /* d0 = id -> d0 = length */
#define TOK_iffskip   ((LIB_iffiolib << 7) + 7) /* d0 = longs */
#define TOK_iffread   ((LIB_iffiolib << 7) + 8) /* a0 = buffer, d0 = bytes */
#define TOK_ilbminit   ((LIB_ilbmifflib << 7) + 1)
#define TOK_ilbmgetbyte   ((LIB_ilbmifflib << 7) + 2)
#define TOK_ilbmbitmap   ((LIB_ilbmifflib << 7) + 3) /* a0 = name, a1 = bitmap */
#define MEMBASE_localloc   0
#define MEMBASE_locfree   4
#define MEMBASE_globalloc   8
#define MEMBASE_globfree   12

Functions

static ULONG bl_divu_w (ULONG d, UWORD s)
static ULONG bl_divs_w (ULONG d, WORD s)
static ULONG bl_mulu_w (UWORD a, UWORD b)
static LONG bl_muls_w (WORD a, WORD b)
BL_ALWAYS_INLINE ULONG bl_blitoff (const UWORD *bpr, WORD x, WORD y)

Macro Definition Documentation

◆ BL_ALWAYS_INLINE

#define BL_ALWAYS_INLINE   static inline __attribute__((always_inline))

◆ BL_BLITBUSY

#define BL_BLITBUSY ( cb)
Value:
(*(volatile UBYTE *)((UBYTE *)(cb) + 2) & 0x40)

◆ BL_BLITWAIT

#define BL_BLITWAIT ( cb)
Value:
do { (void)BL_BLITBUSY(cb); while (BL_BLITBUSY(cb)) ; } while (0)
#define BL_BLITBUSY(cb)
Definition blitzhelp.h:169

◆ BL_BLITWAIT_TST

#define BL_BLITWAIT_TST ( cb)
Value:
do { \
__asm__ volatile("tst.b 2(%0)" : : "a"(cb) : "cc"); \
while (BL_BLITBUSY(cb)) ; \
} while (0)

◆ BL_CUSTOM

#define BL_CUSTOM   ((UBYTE *)0xdff000)

◆ BL_CUSTOML

#define BL_CUSTOML ( cb,
o )
Value:
(*(volatile ULONG *)((UBYTE *)(cb) + (o)))

◆ BL_CUSTOMW

#define BL_CUSTOMW ( cb,
o )
Value:
(*(volatile UWORD *)((UBYTE *)(cb) + (o)))

◆ BL_EXTL

#define BL_EXTL ( r)
Value:
((ULONG)(LONG)(WORD)(r)) /* EXT.l */

◆ BL_INTENA

#define BL_INTENA   (*(volatile UWORD *)0xdff09a)

◆ BL_INTS_OFF

#define BL_INTS_OFF ( )
Value:
(BL_INTENA = 0x4000)
#define BL_INTENA
Definition blitzhelp.h:195

◆ BL_INTS_ON

#define BL_INTS_ON ( )
Value:
(BL_INTENA = 0xc000)

◆ BL_POPL

#define BL_POPL ( sp)
Value:
(*(const ULONG *)((sp) = (const void *)((const UBYTE *)(sp) - 4)))

◆ BL_POPW

#define BL_POPW ( sp)
Value:
(*(const UWORD *)((sp) = (const void *)((const UBYTE *)(sp) - 2)))

◆ BL_SETB

#define BL_SETB ( r,
v )
Value:
((r) = ((r) & 0xffffff00UL) | (UBYTE)(v)) /* op.b */
static struct @342026374002303043102303243063125232020331002053 v

◆ BL_SETW

#define BL_SETW ( r,
v )
Value:
((r) = ((r) & 0xffff0000UL) | (UWORD)(v)) /* op.w */

◆ BL_STRCOPY

#define BL_STRCOPY ( d,
s,
len )

◆ BL_STRCOPY_B_

#define BL_STRCOPY_B_ ( d,
s )
Value:
do { \
*(d)++ = *(s)++; \
__asm__("" : "+a"(d), "+a"(s)); \
} while (0)
static struct @065163037313156332013005143365272036211065172003 d

◆ BL_SWAP

#define BL_SWAP ( r)
Value:
((ULONG)(r) << 16 | (ULONG)(r) >> 16) /* SWAP */

◆ LVO_SPAbs

#define LVO_SPAbs   (-54)

◆ LVO_SPAdd

#define LVO_SPAdd   (-66)

◆ LVO_SPCeil

#define LVO_SPCeil   (-96)

◆ LVO_SPCmp

#define LVO_SPCmp   (-42)

◆ LVO_SPDiv

#define LVO_SPDiv   (-84)

◆ LVO_SPFix

#define LVO_SPFix   (-30)

◆ LVO_SPFloor

#define LVO_SPFloor   (-90)

◆ LVO_SPFlt

#define LVO_SPFlt   (-36)

◆ LVO_SPMul

#define LVO_SPMul   (-78)

◆ LVO_SPNeg

#define LVO_SPNeg   (-60)

◆ LVO_SPSub

#define LVO_SPSub   (-72)

◆ LVO_SPTst

#define LVO_SPTst   (-48)

◆ MEMBASE_globalloc

#define MEMBASE_globalloc   8

◆ MEMBASE_globfree

#define MEMBASE_globfree   12

◆ MEMBASE_localloc

#define MEMBASE_localloc   0

◆ MEMBASE_locfree

#define MEMBASE_locfree   4

◆ TOK_allocst

#define TOK_allocst   0xcf01 /* maxslib: d0 = source, d1 = length -> d0 = copy */

◆ TOK_clrint

#define TOK_clrint   0xc101 /* intlib ClrInt: d0 = level */

◆ TOK_convertkey

#define TOK_convertkey   ((LIB_rawkeylib << 7) + 1) /* d0 = code, d1 = qualifier -> d0 */

◆ TOK_ctrlcend

#define TOK_ctrlcend
Value:
0xc321 /* runerrlib: end after Ctrl-C, return code 20
(error check code only, #43) */

◆ TOK_endjmp

#define TOK_endjmp   0xc800 /* exitslib: End */

◆ TOK_execversion

#define TOK_execversion   ((LIB_environlib << 7) + 7) /* environlib: -> d0.w */

◆ TOK_exists

#define TOK_exists
Value:
((LIB_fileiolib << 7) + 21) /* fileiolib Exists: d1 = name,
a6 = dos -> d0 = size */

◆ TOK_extbitmap

#define TOK_extbitmap
Value:
((LIB_bitmaplib << 7) + 4) /* bitmaplib: a3 = object,
d1-d3 = w, h, depth */

◆ TOK_fltoqu

#define TOK_fltoqu   0xd301 /* floatquicklib: Float -> Quick (a6 = ffplib) */

◆ TOK_freest

#define TOK_freest   0xcf02 /* maxslib: d0 = copy (or 0) */

◆ TOK_getpal

#define TOK_getpal   ((LIB_palettelib << 7) + 3) /* palettelib: a0 = name, a1 = palette */

◆ TOK_getpal2

#define TOK_getpal2   ((LIB_palettelib << 7) + 4) /* palettelib: and d0 = offset */

◆ TOK_getvbr

#define TOK_getvbr   0xc31d /* runerrlib: a0 = VBR */

◆ TOK_globalloc

#define TOK_globalloc   0xc002 /* memlib: like localloc, global list */

◆ TOK_globfree

#define TOK_globfree   0xc003 /* memlib: a1 = mem, global list */

◆ TOK_iffbyte

#define TOK_iffbyte   ((LIB_iffiolib << 7) + 3) /* -> d0 */

◆ TOK_iffclose

#define TOK_iffclose   ((LIB_iffiolib << 7) + 2)

◆ TOK_ifffind

#define TOK_ifffind   ((LIB_iffiolib << 7) + 6) /* d0 = id -> d0 = length */

◆ TOK_ifflong

#define TOK_ifflong   ((LIB_iffiolib << 7) + 5) /* -> d0 */

◆ TOK_iffopen

#define TOK_iffopen   ((LIB_iffiolib << 7) + 1) /* a0 = name */

◆ TOK_iffread

#define TOK_iffread   ((LIB_iffiolib << 7) + 8) /* a0 = buffer, d0 = bytes */

◆ TOK_iffskip

#define TOK_iffskip   ((LIB_iffiolib << 7) + 7) /* d0 = longs */

◆ TOK_iffword

#define TOK_iffword   ((LIB_iffiolib << 7) + 4) /* -> d0 */

◆ TOK_ilbmbitmap

#define TOK_ilbmbitmap   ((LIB_ilbmifflib << 7) + 3) /* a0 = name, a1 = bitmap */

◆ TOK_ilbmgetbyte

#define TOK_ilbmgetbyte   ((LIB_ilbmifflib << 7) + 2)

◆ TOK_ilbminit

#define TOK_ilbminit   ((LIB_ilbmifflib << 7) + 1)

◆ TOK_ioctrlcin

#define TOK_ioctrlcin   ((LIB_inputoutputlib << 7) + 13) /* ... of the input (#43) */

◆ TOK_ioctrlcout

#define TOK_ioctrlcout
Value:
((LIB_inputoutputlib << 7) + 12) /* Ctrl-C check of the output
(error check code only, #43) */

◆ TOK_iogetsingle

#define TOK_iogetsingle   ((LIB_inputoutputlib << 7) + 5) /* -> d0 = character */

◆ TOK_iogetstring

#define TOK_iogetstring   ((LIB_inputoutputlib << 7) + 6) /* a0 = buffer, d0 = max */

◆ TOK_iooutsingle

#define TOK_iooutsingle   ((LIB_inputoutputlib << 7) + 7) /* d0 = character */

◆ TOK_iooutstring1

#define TOK_iooutstring1   ((LIB_inputoutputlib << 7) + 8) /* a0 = characters, d0 = length */

◆ TOK_iooutstring2

#define TOK_iooutstring2   ((LIB_inputoutputlib << 7) + 9) /* a0 = string with 0 */

◆ TOK_ldivide

#define TOK_ldivide   0xcb01 /* ldivlib: d0 = d0 / d1 */

◆ TOK_lmultiply

#define TOK_lmultiply   0xca01 /* lmullib: d0 = d0 * d1 */

◆ TOK_localloc

#define TOK_localloc   0xc000 /* memlib: d0 = size, d1 = flags -> d0 = mem */

◆ TOK_locfree

#define TOK_locfree   0xc001 /* memlib: a1 = mem */

◆ TOK_qconvertkey

#define TOK_qconvertkey   ((LIB_rawkeylib << 7) + 3)

◆ TOK_qutofl

#define TOK_qutofl
Value:
0xd300 /* floatquicklib: Quick -> Float (a6 = ffplib,
BLITZ_ALIBJSR_A6) */

◆ TOK_setevfilter

#define TOK_setevfilter   ((LIB_windowslib << 7) + 58) /* windowslib SetEventFilter */

◆ TOK_setin

#define TOK_setin   ((LIB_inputoutputlib << 7) + 3) /* inputoutputlib: input handler */

◆ TOK_setint

#define TOK_setint
Value:
0xc100 /* intlib SetInt: d0 = level, d1 = code
(Blitz/Amiga variants: BLIBJSR/ALIBJSR) */

◆ TOK_setout

#define TOK_setout   ((LIB_inputoutputlib << 7) + 4) /* inputoutputlib: output handler */

◆ TOK_showsprite

#define TOK_showsprite
Value:
((LIB_spriteslib << 7) + 2) /* spriteslib ShowSprite (Blitz):
d0-d3 = sprite, x, y, channel */

◆ TOK_strcomp2

#define TOK_strcomp2   0xce02 /* strcomplib */

◆ TOK_unconvert

#define TOK_unconvert   ((LIB_rawkeylib << 7) + 2) /* d0 = ascii -> d0 = code, d1 */

◆ TOK_ustr

#define TOK_ustr   ((LIB_printlib << 7) + 6) /* printlib UStr$: d0 = value, a2 = type */

◆ TOK_val

#define TOK_val   ((LIB_vallib << 7) + 1) /* vallib Val: d0 = string, a2 = length */

◆ TOK_vwait

#define TOK_vwait   0xc104 /* intlib VWait: d0 = frames */

Function Documentation

◆ bl_blitoff()

BL_ALWAYS_INLINE ULONG bl_blitoff ( const UWORD * bpr,
WORD x,
WORD y )

◆ bl_divs_w()

ULONG bl_divs_w ( ULONG d,
WORD s )
inlinestatic

◆ bl_divu_w()

ULONG bl_divu_w ( ULONG d,
UWORD s )
inlinestatic

◆ bl_muls_w()

LONG bl_muls_w ( WORD a,
WORD b )
inlinestatic

◆ bl_mulu_w()

ULONG bl_mulu_w ( UWORD a,
UWORD b )
inlinestatic