BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
riintuilib.c File Reference
#include "blitzlib.h"
#include "blitzexec.h"
#include <graphics/rastport.h>
#include <intuition/intuition.h>
#include <proto/graphics.h>
#include <proto/intuition.h>

Macros

#define __NOLIBBASE__
#define GRAPHICS_BASE_NAME   gfxbase
#define INTUITION_BASE_NAME   intuibase

Functions

void _ipbitmap (void)
void _iplocate (void)
void _ipcolour (void)
void _ipcolour2 (void)
void _ipoutput (void)
void riintuilib_libinit (void)
void riintuilib_libfinit (void)
void ipprint (void)
void ipprint0 (void)
void ipprint1 (void)
static void libinit_c (void)
 init: opens graphics.library and intuition.library.
static void libfinit_c (void)
 finit: closes intuition.library and graphics.library.
static void ipbitmap_c (struct RastPort *rp, struct BitMap *bm)
 IPBitMap rast,bitmap: initialises a Rast object and gives it a bitmap.
static void iplocate_c (ULONG x, ULONG y, struct RastPort *rp)
 IPLocate x,y: moves the pen of the used Rast.
static void ipcolour2_c (ULONG fg, ULONG bg, struct RastPort *rp)
 IPColour fgpen,bgpen: sets the pens of the used Rast and of IPOutput.
static void ipcolour_c (ULONG fg, struct RastPort *rp)
 IPColour fgpen: sets the foreground pen only.
static void setpens (void)
static void doipprint (void)
static void ipprint_c (ULONG ch)
 The output handler, entry 0: one character.
static void ipprint0_c (UBYTE *s)
 The output handler, entry -8: a null terminated string.
static void ipprint1_c (UWORD n, const UBYTE *s)
 The output handler, entry -4: d0 characters at a0.
static void ipoutput_c (struct RastPort *rp)
 IPOutput rast: makes the Rast the output channel (Print draws on it).

Variables

static struct Library * intuibase
static struct Library * gfxbase
static struct RastPort * usedrast
struct { 
   struct IntuiText   it 
   UBYTE   cbuf [1024] 
   UWORD   apen 
   UWORD   bpen 
} pr = { .apen = 1, .bpen = 0 }

Macro Definition Documentation

◆ __NOLIBBASE__

#define __NOLIBBASE__

◆ GRAPHICS_BASE_NAME

#define GRAPHICS_BASE_NAME   gfxbase

◆ INTUITION_BASE_NAME

#define INTUITION_BASE_NAME   intuibase

Function Documentation

◆ _ipbitmap()

void _ipbitmap ( void )

◆ _ipcolour()

void _ipcolour ( void )

◆ _ipcolour2()

void _ipcolour2 ( void )

◆ _iplocate()

void _iplocate ( void )

◆ _ipoutput()

void _ipoutput ( void )

◆ doipprint()

void doipprint ( void )
static

◆ ipbitmap_c()

void ipbitmap_c ( struct RastPort * rp,
struct BitMap * bm )
static

IPBitMap rast,bitmap: initialises a Rast object and gives it a bitmap.

InitRastPort on the Rast, then its BitMap = the Blitz bitmap object.

Parameters
rpa0: the Rast object (ia0|pd0)
bma1: the bitmap object (bitmaplib, ia1|pd1)

◆ ipcolour2_c()

void ipcolour2_c ( ULONG fg,
ULONG bg,
struct RastPort * rp )
static

IPColour fgpen,bgpen: sets the pens of the used Rast and of IPOutput.

SetAPen/SetBPen; a negative word leaves that pen unchanged. The pens are also kept for the IntuiText of IPOutput (their low bytes). Fixed (#696): the original's SetBPen took a2 as the RastPort, which it set to the Rast only with SetAPen (else the caller's a2, the argument stack).

Parameters
fgd0: the foreground pen (a word)
bgd1: the background pen (a word)
rpa0: the used Rast (ua0)

◆ ipcolour_c()

void ipcolour_c ( ULONG fg,
struct RastPort * rp )
static

IPColour fgpen: sets the foreground pen only.

As IPColour fgpen,bgpen with bgpen -1 (unchanged).

Parameters
fgd0: the foreground pen (a word)
rpa0: the used Rast (ua0)

◆ iplocate_c()

void iplocate_c ( ULONG x,
ULONG y,
struct RastPort * rp )
static

IPLocate x,y: moves the pen of the used Rast.

Move with the low words of x and y: the top left corner of the next output of IPOutput to this Rast (fixed #697: the original's IPOutput printed at 0,0).

Parameters
xd0: x (a word)
yd1: y (a word)
rpa0: the used Rast (ua0)

◆ ipoutput_c()

void ipoutput_c ( struct RastPort * rp)
static

IPOutput rast: makes the Rast the output channel (Print draws on it).

Keeps the Rast and installs the handler ipprint with inputoutputlib's dosetout (TOK_setout). The text is printed by PrintIText at the Rast's pen position (fixed #697), JAM1, with the pens of the last IPColour.

Parameters
rpa0: the Rast object (ia0|pd0)

◆ ipprint()

void ipprint ( void )

◆ ipprint0()

void ipprint0 ( void )

◆ ipprint0_c()

void ipprint0_c ( UBYTE * s)
static

The output handler, entry -8: a null terminated string.

Printed directly (the IntuiText points to it).

Parameters
sa0: the string

◆ ipprint1()

void ipprint1 ( void )

◆ ipprint1_c()

void ipprint1_c ( UWORD n,
const UBYTE * s )
static

The output handler, entry -4: d0 characters at a0.

Copied to cbuf with a 0, then printed, in pieces of at most 1023 characters (each piece after the previous one). As PrintIText, the text ends at a 0 among the characters. Fixed (#698): the original copied all d0 characters into the 1024 byte buffer without a limit - from 1024 characters on they ran into the pens behind it (the pens of the next text) and on into the library.

Parameters
nd0: the number of characters (a word)
sa0: the characters

◆ ipprint_c()

void ipprint_c ( ULONG ch)
static

The output handler, entry 0: one character.

A line feed (10, the only single character printlib sends: NPrint's) moves the position to the start of the next line (x 0, y + the Rast's text height); any other character is copied to the buffer with a 0, then printed. Fixed (#699): the original read the character from the address d0 (MOVE.l d0,a0:MOVE.b (a0)+,...), i.e. from low memory, and printed that byte.

Parameters
chd0: the character (its low byte)

◆ libfinit_c()

void libfinit_c ( void )
static

finit: closes intuition.library and graphics.library.

◆ libinit_c()

void libinit_c ( void )
static

init: opens graphics.library and intuition.library.

Any version; the results are not checked.

◆ riintuilib_libfinit()

void riintuilib_libfinit ( void )

◆ riintuilib_libinit()

void riintuilib_libinit ( void )

◆ setpens()

void setpens ( void )
static

Variable Documentation

◆ apen

UWORD apen

◆ bpen

UWORD bpen

◆ cbuf

UBYTE cbuf[1024]

◆ gfxbase

struct Library * gfxbase
static

◆ intuibase

struct Library* intuibase
static

◆ it

struct IntuiText it

◆ [struct]

struct { ... } pr

◆ usedrast

struct RastPort* usedrast
static