|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
#include "blitzlib.h"#include "blitzobj.h"#include <proto/intuition.h>#include <proto/graphics.h>Data Structures | |
| struct | scrobj |
Macros | |
| #define | __NOLIBBASE__ |
| #define | BLTZ 0x624c745aUL /* "bLtZ" */ |
| #define | FOUND 1UL |
| #define | DUMMYF ((const UBYTE *)&dummy + sizeof(dummy)) |
Functions | |
| void | dosmousex (void) |
| SMouseX - the mouse x position on the used screen (inline, a0 = the used screen object; d0.w = Screen.MouseX). | |
| void | dosmousey (void) |
| SMouseY - the mouse y position on the used screen (inline, a0 = the used screen object; d0.w = Screen.MouseY). | |
| void | doshowscreen (void) |
| ShowScreen Screen# - ScreenToFront (inline, a0 = the screen object, a6 = intuition). | |
| void | doscreenpens2 (void) |
| void | doscreenpens (void) |
| void | dosviewport (void) |
| ViewPort(Screen#) - the address of the screen's ViewPort (inline, a0 = the screen object; result d0 = screen + 44). | |
| void | freescreen (void) |
| void | dohidescreen (void) |
| HideScreen Screen# - ScreenToBack (inline, a0 = the screen object, a6 = intuition). | |
| void | dobeepscreen (void) |
| BeepScreen Screen# - DisplayBeep (inline, a0 = the screen object, a6 = intuition). | |
| void | domovescreen (void) |
| MoveScreen Screen#,deltax,deltay - intuition MoveScreen (inline, a0 = the screen object, d1.w/d2.w = the deltas, a6 = intuition). | |
| void | screenslib_doinit (void) |
| void | modechk (void) |
| void | prescreen (void) |
| void | prescreen2 (void) |
| void | loadscreenchk (void) |
| void | showbmchk0 (void) |
| void | showbmchk (void) |
| void | stagschk (void) |
| static struct DBufInfo * | dbufof (const struct scrobj *obj) |
| static UWORD | execversion (void) |
| static ULONG | allocst (const UBYTE *s, ULONG len) |
| static void | doinit_c (void) |
| Library init: ScreenPens on (NS_EXTENDED), the default pens of the Workbench, the Exec version (environlib ExecVersion) in romrevision. | |
| static void | doscreenpens2_c (UWORD on) |
| ScreenPens On|Off - use the ScreenPens for the following Screens. | |
| BLITZ_ALIAS (doscreenpens2, doscreenpens2_c) | |
| static void | doscreenpens_c (UWORD p0, UWORD p1, UWORD p2, UWORD p3, UWORD p4, UWORD p5, const UBYTE *args) |
| ScreenPens Text,Shine,Shadow,Fill,FillText,Background,HighLight - the DrawInfo pens of the following Screens (pens 2-8 of SA_Pens). | |
| BLITZ_ALIAS (doscreenpens, doscreenpens_c) | |
| static void | freescreen_ (struct scrobj *obj, struct IntuitionBase *IntuitionBase) |
| static void | freescreen_c (struct IntuitionBase *intui) |
| CloseScreen Screen# and the object's free routine (_free). | |
| static void | openscreen (UBYTE *bitmap, ULONG *ifont, WORD used, ULONG viewmode, const UBYTE *title, UBYTE dpen, UBYTE bpen, const UBYTE *args, struct IntuitionBase *IntuitionBase) |
| void | _screen (ULONG viewmode, const UBYTE *title, UBYTE dpen, UBYTE bpen, ULONG *ifont, WORD used, const UBYTE *args, struct IntuitionBase *intui) |
| Screen Screen#,X,Y,W,H,D,Viewmode,Title$,Dpen,Bpen - open a screen (_screen). | |
| void | _screen2 (ULONG viewmode, const UBYTE *title, UBYTE dpen, UBYTE bpen, UBYTE *bitmap, ULONG *ifont, WORD used, const UBYTE *args, struct IntuitionBase *intui) |
| Screen Screen#,X,Y,W,H,D,Viewmode,Title$,Dpen,Bpen,BitMap# - open a screen on a bitmap (_screen2). | |
| static void | modec (UWORD mode, const UBYTE *title, ULONG len, const UBYTE *gfx, ULONG *ifont, WORD used, struct IntuitionBase *intui) |
| void | domode (UWORD mode, const UBYTE *gfx, ULONG *ifont, WORD used, struct IntuitionBase *intui) |
| Screen Screen#,Mode - open a screen from a mode number. | |
| void | domode2 (UWORD mode, const UBYTE *title, const UBYTE *gfx, ULONG *ifont, WORD used, const ULONG *lens, struct IntuitionBase *intui) |
| Screen Screen#,Mode,Title$ - as domode with a title. | |
| void | dowbscreen (WORD used, struct IntuitionBase *intui) |
| WbToScreen Screen# - the Workbench screen as a screen object. | |
| static int | prefix (const UBYTE *title, const UBYTE *pfx) |
| static void | findscreen (const UBYTE *title, WORD used, struct IntuitionBase *intui) |
| void | dofstoscreen (WORD used, struct IntuitionBase *intui) |
| FindScreen Screen# - the frontmost screen as a screen object. | |
| void | dofindscreen (const UBYTE *title, WORD used, struct IntuitionBase *intui) |
| FindScreen Screen#,Title$ - the first screen whose title or default title starts with Title$, as a screen object. | |
| static ULONG | loadscreen (struct scrobj *obj, const UBYTE *name) |
| void | doloadscreen (struct scrobj *obj, const UBYTE *name) |
| LoadScreen Screen#,Filename$ - load an ILBM into the screen's bitmap (ilbmifflib ilbmbitmap; its result is not checked here). | |
| void | doloadscreen2 (struct scrobj *obj, const UBYTE *name, ULONG pal) |
| LoadScreen Screen#,Filename$,Palette# - load the file's palette (palettelib getpal2) and the ILBM into the screen's bitmap. | |
| static void | showbitmap2 (struct IntuitionBase *intui, struct GfxBase *GfxBase) |
| static void | intshowbitmap (const struct bb_bitmap *bm, struct Screen *scr, struct IntuitionBase *intui, struct GfxBase *GfxBase) |
| static void | agashowbitmap (const struct bb_bitmap *bm, struct scrobj *obj, struct GfxBase *GfxBase) |
| static void | showbitmap (const struct bb_bitmap *bm, struct scrobj *obj, struct GfxBase *GfxBase) |
| void | doshowbitmap0 (struct scrobj *obj, struct GfxBase *gfx) |
| ShowBitMap - show the used screen's own bitmap again. | |
| void | doshowbitmap1 (const struct bb_bitmap *bm, struct scrobj *obj, struct GfxBase *gfx) |
| ShowBitMap BitMap# - show a bitmap in the used screen. | |
| static ULONG | duntags (struct scrobj *obj, struct IntuitionBase *IntuitionBase) |
| static const ULONG * | tagstart (const UBYTE *title, const ULONG *lens, ULONG *ifont, WORD used, struct IntuitionBase *intui) |
| ULONG | doscreentags3 (const UBYTE *title, const ULONG *tags, ULONG *ifont, WORD used, const ULONG *lens, struct IntuitionBase *intui) |
| ScreenTags(Screen#,Title$,&TagList) - open a screen with a tag list. | |
| ULONG | doscreentags (UWORD n, const UBYTE *title, ULONG *ifont, WORD used, const ULONG *lens, struct IntuitionBase *intui) |
| ScreenTags(Screen#,Title$,Tag,Data...) - open a screen with tags given as arguments. | |
| ULONG | doscreentags2 (const UBYTE *title, ULONG *ifont, WORD used, const ULONG *lens, struct IntuitionBase *intui) |
| ScreenTags(Screen#,Title$) - as doscreentags without user tags. | |
| static void | prescreen_c (ULONG vm, const UBYTE *ifont, const UBYTE *args) |
| static void | prescreen2_c (ULONG vm, const struct bb_bitmap *bm, const UBYTE *ifont, const UBYTE *args) |
| static void | loadscreenchk_c (const struct scrobj *obj) |
| static void | modechk_c (UWORD mode) |
| static void | showbmchk0_c (const struct scrobj *obj) |
| static void | showbmchk_c (const struct bb_bitmap *bm, const struct scrobj *obj) |
| static void | stagschk_c (UWORD n) |
Variables | |
| struct { | |
| UWORD romrevision | |
| struct ExtNewScreen ns | |
| struct { | |
| struct TagItem displayid | |
| struct TagItem pens | |
| ULONG end | |
| } tags | |
| UWORD pens [13] | |
| UWORD defstype | |
| } | sd |
| struct { | |
| ULONG len | |
| UWORD depth | |
| UWORD height | |
| UWORD width | |
| UWORD y | |
| UWORD x | |
| } | dummy |
| static LONG | errcode = -1 |
| struct { | |
| struct TagItem title font error | |
| ULONG usertags [32] | |
| } | tl |
| static const char | mess1 [] = "Can't open Screen" |
| static const char | mess8 [] = "Can't find WorkBench" |
| static const char | mess12 [] = "Can't find Screen" |
| static const char | mess13 [] = "Can't find CopIns!" |
| const char | mess2 [] |
| const char | mess3 [] |
| const char | mess5 [] |
| const char | mess6 [] |
| const char | mess7 [] |
| const char | mess9 [] |
| const char | mess10 [] |
| const char | mess11 [] |
| const char | mess14 [] |
| const char | tagsmess [] |
| static struct GfxBase * | dbufgfx |
| #define __NOLIBBASE__ |
| #define BLTZ 0x624c745aUL /* "bLtZ" */ |
| #define FOUND 1UL |
| void _screen | ( | ULONG | viewmode, |
| const UBYTE * | title, | ||
| UBYTE | dpen, | ||
| UBYTE | bpen, | ||
| ULONG * | ifont, | ||
| WORD | used, | ||
| const UBYTE * | args, | ||
| struct IntuitionBase * | intui ) |
Screen Screen#,X,Y,W,H,D,Viewmode,Title$,Dpen,Bpen - open a screen (_screen).
a3 = the screen object, which becomes the used screen; its old screen is freed first. The width is rounded UP to a multiple of 16; the ExtNewScreen gets SA_DisplayID (= viewmode) and SA_Pens (ScreenPens), the current IntuiFont and the type CUSTOMSCREEN | the ScreenPens flag NS_EXTENDED; the screen gets "bLtZ" in UserData.
Fixed (#247): the old screen's DBufInfo is freed with the graphics base that allocated it; the original passed a2 = the argument stack as graphics base (FreeDBufInfo through garbage). Fixed (#250): SA_DisplayID gets the whole viewmode (the original only its low word). Fixed (#251): "Can't open Screen" is raised in the normal code (the original's BEQ err1 goes into the error area). Errors (prescreen, debugger only): "Uninitialized IntuiFont", width < 320, height < 10, "Illegal number of BitPlanes".
| viewmode | d1: the view mode |
| title | d2: the title |
| dpen | d3.b: DetailPen |
| bpen | d4.b: BlockPen |
| ifont | a1: intuifontlib's TextAttr pointer |
| used | d6.w: the offset of the used screen in the globals |
| args | a2: the argument stack: x, y, w, h, d (words), title length (long), popped from the top |
| intui | a6: intuition.library |
| void _screen2 | ( | ULONG | viewmode, |
| const UBYTE * | title, | ||
| UBYTE | dpen, | ||
| UBYTE | bpen, | ||
| UBYTE * | bitmap, | ||
| ULONG * | ifont, | ||
| WORD | used, | ||
| const UBYTE * | args, | ||
| struct IntuitionBase * | intui ) |
Screen Screen#,X,Y,W,H,D,Viewmode,Title$,Dpen,Bpen,BitMap# - open a screen on a bitmap (_screen2).
As _screen with CUSTOMBITMAP and the bitmap as CustomBitMap.
Errors (prescreen2, debugger only): those of _screen, "Uninitialized BitMap", "Can't use specified BitMap" (smaller than the screen).
| bitmap | a0: the bitmap object |
|
static |
|
static |
| BLITZ_ALIAS | ( | doscreenpens | , |
| doscreenpens_c | ) |
| BLITZ_ALIAS | ( | doscreenpens2 | , |
| doscreenpens2_c | ) |
|
static |
| void dobeepscreen | ( | void | ) |
BeepScreen Screen# - DisplayBeep (inline, a0 = the screen object, a6 = intuition).
Errors: "Uninitialized Screen" (loadscreenchk, debugger only).
| void dofindscreen | ( | const UBYTE * | title, |
| WORD | used, | ||
| struct IntuitionBase * | intui ) |
FindScreen Screen#,Title$ - the first screen whose title or default title starts with Title$, as a screen object.
a3 = the screen object, which becomes the used screen. The screen is never closed by the library.
The object's old screen is freed (closed if this object opened it; Fixed (#248): the original also closed a "bLtZ" screen the object had only found). Fixed (#247): the original freed it with a2 = the argument stack as graphics base. The object is marked FOUND. Errors: "Can't find Screen" (err12, in the normal code with its text; fixed, #251: the original's text is in the error area).
| title | d1: the title prefix |
| used | d6.w: the offset of the used screen in the globals |
| intui | a6: intuition.library |
| void dofstoscreen | ( | WORD | used, |
| struct IntuitionBase * | intui ) |
FindScreen Screen# - the frontmost screen as a screen object.
a3 = the screen object, which becomes the used screen. Notes and errors as dofindscreen.
| used | d6.w: the offset of the used screen in the globals |
| intui | a6: intuition.library |
| void dohidescreen | ( | void | ) |
HideScreen Screen# - ScreenToBack (inline, a0 = the screen object, a6 = intuition).
Errors: "Uninitialized Screen" (loadscreenchk, debugger only).
|
static |
Library init: ScreenPens on (NS_EXTENDED), the default pens of the Workbench, the Exec version (environlib ExecVersion) in romrevision.
| void doloadscreen | ( | struct scrobj * | obj, |
| const UBYTE * | name ) |
LoadScreen Screen#,Filename$ - load an ILBM into the screen's bitmap (ilbmifflib ilbmbitmap; its result is not checked here).
Errors: "Uninitialized Screen" (loadscreenchk, debugger only).
| obj | a0: the screen object |
| name | d1: the file name |
| void doloadscreen2 | ( | struct scrobj * | obj, |
| const UBYTE * | name, | ||
| ULONG | pal ) |
LoadScreen Screen#,Filename$,Palette# - load the file's palette (palettelib getpal2) and the ILBM into the screen's bitmap.
Errors: "Uninitialized Screen" (loadscreenchk, debugger only).
| obj | a0: the screen object |
| name | d1: the file name |
| pal | a1: the palette object |
| void domode | ( | UWORD | mode, |
| const UBYTE * | gfx, | ||
| ULONG * | ifont, | ||
| WORD | used, | ||
| struct IntuitionBase * | intui ) |
Screen Screen#,Mode - open a screen from a mode number.
depth = mode & 7 (0 = 8), bit 3 hires (640, HIRES), bit 4 interlace (height * 2, LACE), height 200 (NTSC, bit 0 of GfxBase+207) or 256; pens 1/2, no title. Through a fake a2 stack (dummydata) into the long form (_screen), with its notes.
Errors: "Illegal Mode" before V39 (modechk, debugger only).
| mode | d1.w: the mode |
| gfx | a0: graphics.library |
| ifont | a1: intuifontlib's TextAttr pointer |
| used | d6.w: the offset of the used screen in the globals |
| intui | a6: intuition.library |
| void domode2 | ( | UWORD | mode, |
| const UBYTE * | title, | ||
| const UBYTE * | gfx, | ||
| ULONG * | ifont, | ||
| WORD | used, | ||
| const ULONG * | lens, | ||
| struct IntuitionBase * | intui ) |
Screen Screen#,Mode,Title$ - as domode with a title.
| title | d2: the title |
| lens | a2: the argument stack, -4(a2) = the title's length |
| void domovescreen | ( | void | ) |
MoveScreen Screen#,deltax,deltay - intuition MoveScreen (inline, a0 = the screen object, d1.w/d2.w = the deltas, a6 = intuition).
Errors: "Uninitialized Screen" (loadscreenchk, debugger only).
| void doscreenpens | ( | void | ) |
| void doscreenpens2 | ( | void | ) |
|
static |
ScreenPens On|Off - use the ScreenPens for the following Screens.
Sets or clears the NS_EXTENDED flag ($1000) of the screen type, so that OpenScreen reads the tag list with SA_Pens and SA_DisplayID.
| on | d0.w: <> 0 = on |
|
static |
ScreenPens Text,Shine,Shadow,Fill,FillText,Background,HighLight - the DrawInfo pens of the following Screens (pens 2-8 of SA_Pens).
MOVEM d0-d5,pens+4:MOVE -(a2),pens+16; the NS_EXTENDED flag is not changed.
| p0 | d0.w: TEXTPEN |
| p1 | d1.w: SHINEPEN |
| p2 | d2.w: SHADOWPEN |
| p3 | d3.w: FILLPEN |
| p4 | d4.w: FILLTEXTPEN |
| p5 | d5.w: BACKGROUNDPEN |
| args | a2: the argument stack, -2(a2) = HIGHLIGHTTEXTPEN |
| ULONG doscreentags | ( | UWORD | n, |
| const UBYTE * | title, | ||
| ULONG * | ifont, | ||
| WORD | used, | ||
| const ULONG * | lens, | ||
| struct IntuitionBase * | intui ) |
ScreenTags(Screen#,Title$,Tag,Data...) - open a screen with tags given as arguments.
As doscreentags3, the tag/data pairs from the argument stack.
No limit for the 16 user pairs in the command (the pairs lie on the argument stack in reverse order and cannot be linked with TAG_MORE as in the &TagList form, #249). Errors (debugger only, stagschk): more than 15 pairs -> "Too Many Tags" (Fixed (#1039): the original has no check and writes behind usertags).
| n | d7.w: the number of tag/data pairs on the a2 stack |
| title | d1: the title |
| ifont | a1: intuifontlib's TextAttr pointer |
| used | d6.w: the offset of the used screen in the globals |
| lens | a2: the argument stack: the title's length, then the pairs |
| intui | a6: intuition.library |
| ULONG doscreentags2 | ( | const UBYTE * | title, |
| ULONG * | ifont, | ||
| WORD | used, | ||
| const ULONG * | lens, | ||
| struct IntuitionBase * | intui ) |
ScreenTags(Screen#,Title$) - as doscreentags without user tags.
| ULONG doscreentags3 | ( | const UBYTE * | title, |
| const ULONG * | tags, | ||
| ULONG * | ifont, | ||
| WORD | used, | ||
| const ULONG * | lens, | ||
| struct IntuitionBase * | intui ) |
ScreenTags(Screen#,Title$,&TagList) - open a screen with a tag list.
a3 = the screen object, which becomes the used screen; its old screen is freed first. OpenScreenTagList (V36+) with SA_Title (a copy), SA_Font (the IntuiFont), SA_ErrorCode and the user tags, copied up to TAG_END; the screen gets "bLtZ" in UserData.
Fixed (#249): at most 15 tags are copied, a longer list is linked with TAG_MORE from the 16th entry on; the original copied it without a limit into the 32 longs. Fixed (#247): the original freed the old screen with a2 as graphics base.
| title | d1: the title |
| tags | d2: the tag list |
| ifont | a1: intuifontlib's TextAttr pointer |
| used | d6.w: the offset of the used screen in the globals |
| lens | a2: the argument stack, -4(a2) = the title's length |
| intui | a6: intuition.library |
| void doshowbitmap0 | ( | struct scrobj * | obj, |
| struct GfxBase * | gfx ) |
ShowBitMap - show the used screen's own bitmap again.
As doshowbitmap1 with the screen's BitMap.
Errors: "Uninitialized Screen" (showbmchk0, debugger only).
| obj | a1: the used screen object |
| gfx | a6: graphics.library |
ShowBitMap BitMap# - show a bitmap in the used screen.
V39+ (environlib ExecVersion): ChangeVPBitMap, the DBufInfo allocated once per object. Before: the plane pointers into the BPLxPT moves of the screen's copper list or, for interlace, into the screen's BitMap + MakeVPort, then MrgCop/LoadView with interrupts off. a3 = intuition.
Errors: "Can't find CopIns!" (err13, in the normal code with its text, before V39; fixed, #251); debugger only (showbmchk): "Uninitialized Screen", "Uninitialized BitMap", "Screen and BitMap MUST be same size".
| bm | a0: the bitmap object |
| obj | a1: the used screen object |
| gfx | a6: graphics.library |
| void doshowscreen | ( | void | ) |
ShowScreen Screen# - ScreenToFront (inline, a0 = the screen object, a6 = intuition).
Errors: "Uninitialized Screen" (loadscreenchk, debugger only).
| void dosmousex | ( | void | ) |
SMouseX - the mouse x position on the used screen (inline, a0 = the used screen object; d0.w = Screen.MouseX).
Errors: "Uninitialized Screen" (loadscreenchk, debugger only).
| void dosmousey | ( | void | ) |
SMouseY - the mouse y position on the used screen (inline, a0 = the used screen object; d0.w = Screen.MouseY).
Errors: "Uninitialized Screen" (loadscreenchk, debugger only).
| void dosviewport | ( | void | ) |
ViewPort(Screen#) - the address of the screen's ViewPort (inline, a0 = the screen object; result d0 = screen + 44).
Errors: "Uninitialized Screen" (loadscreenchk, debugger only).
| void dowbscreen | ( | WORD | used, |
| struct IntuitionBase * | intui ) |
WbToScreen Screen# - the Workbench screen as a screen object.
a3 = the screen object; the first screen with type WBENCHSCREEN, which becomes the used screen. It is never closed by the library.
The object's old screen is freed (closed if this object opened it; Fixed (#248): the original also closed a "bLtZ" screen the object had only found). Fixed (#247): the original freed it with a2 = the argument stack as graphics base. The object is marked FOUND. Errors: "Can't find WorkBench" (err8, in the normal code with its text; fixed, #251: the original's text is in the error area).
| used | d6.w: the offset of the used screen in the globals |
| intui | a6: intuition.library |
|
static |
|
static |
|
static |
| void freescreen | ( | void | ) |
|
static |
|
static |
CloseScreen Screen# and the object's free routine (_free).
a3 = the screen object. Only screens the library opened ("bLtZ" in UserData) are closed (the title copy freed with maxslib $CF02, the DBufInfo with FreeDBufInfo); screens of WbToScreen/FindScreen are only forgotten. The declaration still loads graphics.library into a2; the DBufInfo is freed with the base that allocated it (dbufgfx, #247).
| intui | a6: intuition.library |
|
static |
|
static |
| void loadscreenchk | ( | void | ) |
|
static |
|
static |
| void modechk | ( | void | ) |
|
static |
|
static |
|
static |
| void prescreen | ( | void | ) |
| void prescreen2 | ( | void | ) |
|
static |
|
static |
| void screenslib_doinit | ( | void | ) |
|
static |
|
static |
| void showbmchk | ( | void | ) |
| void showbmchk0 | ( | void | ) |
|
static |
| void stagschk | ( | void | ) |
|
static |
|
static |
|
static |
| UWORD defstype |
| UWORD depth |
| struct TagItem displayid |
| struct { ... } dummy |
| ULONG end |
|
static |
| struct TagItem title font error |
| UWORD height |
| ULONG len |
|
static |
| const char mess10[] |
| const char mess11[] |
|
static |
|
static |
| const char mess14[] |
|
extern |
| const char mess3[] |
| const char mess5[] |
| const char mess6[] |
| const char mess7[] |
|
static |
|
extern |
| struct ExtNewScreen ns |
| UWORD pens[13] |
| UWORD romrevision |
| struct { ... } sd |
| struct { ... } tags |
| const char tagsmess[] |
| struct { ... } tl |
| ULONG usertags[32] |
| UWORD width |
| UWORD x |
| UWORD y |