typedef struct { MAPTAB *maptab; /* List of the serial ports */ int16_t maptabsize; /* Number of port drivers */ /* Undocumented, with TOS and MagiC: */ int16_t auxnr; /* Current channel number set for AUX */ int32_t rscon; /* Pointer to currently set Rsconf function */ int32_t iorec; /* Pointer to IOREC of the current channel */ } BCONMAP; See also: Bconmap
typedef struct { uint8_t disctype; /* 0: audio, 1: data */ uint8_t firsttrack, lasttrack, curtrack; uint8_t relposz, relposm, relposs, relposf; uint8_t absposz, absposm, absposs, absposf; uint8_t endposz, endposm, endposs, endposf; uint8_t index, res[3]; uint32_t reserved[123]; } CD_DISC_INFO;
See also: Metadiscinfo
typedef struct { uint8_t trackno; uint8_t minute; uint8_t second; uint8_t frame; } CD_TOC_ENTRY;
See also: CD-ROM Opcodes for Fcntl
typedef struct { int16_t blocktype; /* Type of data in buffer: */ /* 0 : LongInt */ /* 1 : Integer */ /* 2 : Byte */ int32_t blocksize; /* Buffer size */ void *blockaddr; /* Pointer to the buffer */ } DSPBLOCK;
See also: Dsp_MultBlocks DSP programming
typedef struct { void *ibuf; /* Pointer to buffer */ int16_t ibufsiz; /* Size of buffer */ int16_t ibufhd; /* Head index */ int16_t ibuftl; /* Tail index */ int16_t ibuflow; /* Low-water mark */ int16_t ibufhi; /* High-water mark */ } IOREC;
Note: The serial ports are connected directly to a corresponding output buffer. The two last pointers are only used for the serial port in XON/XOFF or RTS/CTS operation.
If the buffer fill-level falls below the low-water mark, the sender is invited to send further characters; on the other hand, if it exceeds the high-water mark then it is signalled not to send any more characters.
See also: Iorec
typedef struct { void (*kb_midivec)(); /* MIDI interrupt vector */ void (*kb_vkbderr)(); /* Keyboard error vector */ void (*kb_vmiderr)(); /* MIDI error vector */ void (*kb_statvec)(); /* Keyboard status */ void (*kb_mousevec)(); /* Keyboard mouse status */ void (*kb_clockvec)(); /* Keyboard clock */ void (*kb_joyvec)(); /* Keyboard joystick status */ void (*kb_midisys)(); /* System Midi vector */ void (*kb_kbdsys)(); /* Keyboard vector */ int8_t drvstat; /* Keyboard driver status */ } KBDVBASE;
Note: For the elements kb_clockvec and kb_joyvec one should note that the address of the packet is passed in register A0 and on the stack; also, the routines should be terminated with an RTS, and if possible run for no more than 1ms.
The element drvstat contains a non-zero value when the IKBD is in the process of sending a packet.
See also: Kbdvbase
typedef struct { int8_t *unshift; /* Table of 'normal' key presses */ int8_t *shift; /* Table of Shift key presses */ int8_t *capslock; /* Table of Capslock key presses */ int8_t *altunshift; /* From TOS 4.00, undocumented! */ int8_t *altshift; /* From TOS 4.00, undocumented! */ int8_t *altcapslock; /* From TOS 4.00, undocumented! */ int8_t *altgr; /* From TOS 4.00, undocumented! */ } KEYTAB;
See also: Keytbl
typedef struct { int16_t (*Bconstat)(); int32_t (*Bconin)(); int32_t (*Bcostat)(); void (*Bconout)(); uint32_t (*Rsconf)(); IOREC *iorec; } MAPTAB;
typedef struct { int8_t *mdr_name; int32_t reserved[3]; } META_DRVINFO;
See also: Drive functions Metaopen
typedef struct { uint32_t drivemap; /* Bits for MetaDOS drives. */ /* ((Bit 0 = Drive A:, etc.) */ int8_t *version; /* Name and version from MetaDOS */ int32_t reserved; /* Reserved */ META_INFO_2 *info; /* Pointer to a second structure */ } META_INFO_1;
Note: The element info is available from MetaDOS V2.30!
See also: Metainit
typedef struct { uint16_t mi_version; /* Version number (0x230 = '02.30') */ int32_t mi_magic; /* Magic constant '_MET' */ const int8_t *mi_log2phys; /* Maps DOS IDs to MetaDOS XBIOS device numbers */ } META_INFO_2;
Note: This structure exists only as of MetaDOS Version 2.30. The parameter mi_log2phys is a pointer to a field that holds for each GEMDOS device the associated MetaDOS drive letter or Null. So with the aid of this information one can determine which MetaDOS drive letter belongs to which GEMDOS drive.
See also: Metainit META_INFO_1
typedef struct { int8_t Name[34]; /* Descriptive text */ int32_t colors; int16_t xres,yres; int32_t fileptr; /* Pointer to the mode file */ } MOD_DESC;
See also: Crazy-Dots XBIOS extension
typedef struct { int8_t topmode; /* 0: Y=0 at bottom */ /* 1: Y=1 at top */ int8_t buttons; /* Similar to IKBD */ int8_t x_scale; /* Additional parameters */ int8_t y_scale; /* Dependent on selected mode */ int16_t x_max; /* Maximum X position */ int16_t y_max; /* Maximum Y position */ int16_t x_start; /* Start position X */ int16_t y_start; /* Start position Y */ } MOUSE;
Note: The elements x_max and following are only available in absolute mode.
typedef struct { int16_t low_w ,mid_w ,high_w; /* Width in pixels */ int16_t low_h ,mid_h ,high_h; /* Height in pixels */ int32_t low_off,mid_off,high_off; /* Offset screen memory<>logbase */ int32_t mono_add,color_add; /* Additional memory requirement */ int8_t clear_scan; /* Scancode of the clear function */ int8_t clear_shift; /* Shiftcode of the clear function */ int8_t setup_shift; /* Shiftcode for setup (mask) */ int8_t invert_shift; /* Shiftcode for inverting the mode */ int8_t abort_shift; /* Shiftcode for termination */ } OVERPATCH;
See also: Oscanpatch OverScan XBIOS extension
typedef struct { void *pb_scrptr; /* Pointer to start of screen memory */ int16_t pb_offset; /* Offset to be added to this */ int16_t pb_width; /* Screen width in dots */ int16_t pb_height; /* Screen height in dots */ int16_t pb_left; /* Left margin in dots */ int16_t pb_right; /* Right margin in dots */ int16_t pb_screz; /* Resolution */ int16_t pb_prrez; /* Printer type (Atari/Epson) */ void *pb_colptr; /* Pointer to colour palette */ int16_t pb_prtype; /* 0: Atari matrix monochrome 1: Atari matrix colour 2: Atari daisywheel monochrome 3: Epson matrix monochrome */ int16_t pb_prport; /* Centronics/RS-232 port */ void *pb_mask; /* Pointer to halftone mask */ } PBDEF;
Note: One has to ensure that the sum of the elements pb_width, pb_left and pb_right corresponds exactly to the actual screen width.
typedef struct { uint16_t next; /* Length of this structure in bytes */ /* Use this to get next descriptor */ uint16_t flags; /* Type of resource and misc flags */ uint32_t start; /* Start address of resource in PCI address space */ uint32_t length; /* Length of resource */ uint32_t offset; /* Offset from PCI to physical CPU address */ uint32_t dmaoffset; /* Offset for DMA-Memory transfers */ } PCI_RSC_DESC;
The flags field is bit-coded as follows:
RSC_ROM | 0x2000 | This is an expansion ROM (must be Memory, not IO) |
RSC_IO | 0x4000 | This is an IO area (memory area if bit is clear) |
RSC_LAST | 0x8000 | Last resource for this device |
FLG_8BIT | 0x0100 | 8-bit accesses are supported |
FLG_16BIT | 0x0200 | 16-bit accesses are supported |
FLG_32BIT | 0x0400 | 32-bit accesses are supported |
FLG_ENDMASK | 0x000F | Bit 0..3 specify which byte ordering is used: |
0: Motorola (big endian) | ||
1: Intel (little endian), address swapped | ||
2: Intel (little endian), lane swapped | ||
3..14: Reserved | ||
15: Unknown. Access card only via BIOS functions |
The start field contains the start address on the PCI bus of the resource. If the resource is not directly accessible, the start address is 0.
The length field contains its length.
The offset field contains the offset from physical CPU to PCI address for the resource - ie. the value that must be added to the PCI address to get the physical address in CPU address space.
The dmaoffset gives the offset that a PCI bus master must add to a CPU memory address to access that address in main memory over the PCI BUS.
What are all these byte orders?
The PCI-bus is defined as a little endian byte ordering bus. The most significant byte of a multi-byte number is located at the lowest address occupied by this number.
The 68xxx-series CPUs are big endian. PCI-bus and CPU are connected together by a host bridge which does some kind of format conversion. The PCI-BIOS knows about the format conversion performed by the host bridge. The PCI-BIOS does not know about any format conversion done (internally) by PCI devices. The driver has to know its device's properties and capabilities.
The table shows what 68xxx data byte (top row) is connected to what PCI-bus data byte (lower right) by what 68xxx-access and format conversion (left column):
68xxx-CPU data bus bits D31..24 D23..16 D15..8 D7..0 ---------------------------------------------------- big endian 32-bit-access +0 D31..24 D23..16 D15..8 D7..0 16-bit-access +0 D15..8 D7..0 16-bit-access +2 D31..24 D23..16 8-bit-access +0 D7..0 8-bit-access +1 D15..8 8-bit-access +2 D23..16 8-bit-access +3 D31..24 ---------------------------------------------------- little endian, lane swapped 32-bit-access +0 D0..7 D15..8 D23..16 D31..24 16-bit-access +0 D0..7 D15..8 16-bit-access +2 D23..16 D31..24 8-bit-access +0 D0..7 8-bit-access +1 D15..8 8-bit-access +2 D23..16 8-bit-access +3 D31..24 ---------------------------------------------------- little endian, address swapped 32-bit-access +0 D31..24 D23..16 D15..8 D7..0 16-bit-access +0 D31..24 D23..16 16-bit-access +2 D15..8 D7..0 8-bit-access +0 D31..24 8-bit-access +1 D23..16 8-bit-access +2 D15..8 8-bit-access +3 D7..0
"Big endian" makes the PCI-bus appear as a big endian resource from the viewpoint of the 68xxx processor. It requires dynamic route changes in the host bridge and seems not to be implemented by any host bridge.
"Little endian, lane swapped" is the easy way to make 8 bit per pixel modes work in the frame buffer of a PCI-device (VGA controller) which does not have its own format conversion. This mode is used in PCI-Macintoshs and for memory and IO accesses in the Milan. In this mode, the address needs no modifications. 8-bit accesses work normal, on 16 and 32 bit accesses endian conversion must be performed on the the read or written data (ror.w #8,d0 for 16 bit, ror.w #8,d0:swap d0:ror.w #8,d0 for 32 bit).
"Little endian, address swapped" is the way to go if accesses to 32 bit registers or 32 bit per pixel frame buffers have top priority. In this mode, 32 bit accesses work without modifications. On 16 bit accesses, the address needs to be XOR'd with a value of 2, on 8-bit accesses the address is XOR'd with a value of 3. The data read or written is in correct format.
See also: get_resource
typedef struct { int8_t name[34]; int16_t mode_id; /* Running number */ int16_t xres,yres; /* Width/height in pixels */ int16_t fx,fy; /* Width/height in total */ int32_t colors; /* Number of simultaneous colours */ int16_t org; /* Organisation of the memory */ int16_t fh10,fv10; /* Line-freq.*10, frame-freq.*10 */ int16_t aspect100; /* 100*pixel-width/pixel-height */ int16_t disp_scan100; int32_t clk; /* Dot clock in Hz */ /* * Register of the graphics controller */ int16_t Clock; /* Frequency number, must be translated */ /* via the IcsLut before writing into the clock register (see below) */ int8_t misc_out; int8_t ts[10]; /* Timing sequencer regs. */ int8_t crtc[35]; /* CRT controller regs. */ int8_t gdc[10]; /* Graphics display controller */ int8_t atc[24]; /* Attributes of controller */ int8_t reserved[18]; } PMODE; static int8_t IcsLut[32] = { 0,16,8,24,4,20,12,28,2,18,10,26,6,22,14, 30,1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31 };
See also: Crazy-Dots XBIOS extension ReadMode GetActiveModeDesc
typedef struct _scrclipblk { int32_t size; /* size of structure */ int32_t blk_status; /* status bits of blk */ int32_t blk_clip_on; /* clipping flag 1:on, 0:off */ int32_t blk_x; /* x pos in total screen */ int32_t blk_y; /* y pos in in total screen */ int32_t blk_w; /* width */ int32_t blk_h; /* height */ } SCRCLIPMEMBLK;
See also: Setscreen, ct60
typedef struct _scrcopyblk { int32_t size; /* size of structure */ int32_t blk_status; /* status bits of blk */ int32_t blk_src_x; /* x pos source in total screen */ int32_t blk_src_y; /* y pos source in total screen */ int32_t blk_dst_x; /* x pos dest in total screen */ int32_t blk_dst_y; /* y pos dest in total screen */ int32_t blk_w; /* width */ int32_t blk_h; /* height */ int32_t blk_op; /* mode operation */ } SCRCOPYMEMBLK;
See also: Setscreen, ct60
typedef struct { int8_t xbra_id[4]; /* XBRA ID: 'CDOT' */ int8_t version[4]; /* At present: '1.10' */ int8_t *sm194_addr; /* Pointer to large screen memory */ int8_t *sm124_addr; /* Pointer to SM124 screen memory */ LINEA *line_A; /* Pointer to LINE_A block */ int16_t scrn_width; /* Screen width */ int16_t scrn_height; /* Screen height */ int16_t scrn_byte_width; /* Screen width in bytes */ int16_t scrn_planes; /* Screen colour planes */ int16_t PhysMode; /* Mode mumber */ int16_t VirtMode; /* x/16 & y/16 each coded in 1 byte */ PMODE *ModStruct; /* Pointer to current graphic mode */ int16_t grau; /* Flag for the VDI driver (Display: Grey/colour) */ int16_t BiosText; /* Flag for the VDI driver */ int16_t CurText; /* Flag for the VDI driver */ int16_t BlitMode; /* Flag for the VDI driver */ } SCREEN;
See also: Crazy-Dots XBIOS extension
/* scrFlags */ #define SCRINFO_OK 1 /* scrClut */ #define NO_CLUT 0 #define HARD_CLUT 1 #define SOFT_CLUT 2 /* scrFormat */ #define INTERLEAVE_PLANES 0 #define STANDARD_PLANES 1 #define PACKEDPIX_PLANES 2 /* bitFlags */ #define STANDARD_BITS 1 #define FALCON_BITS 2 #define INTEL_BITS 8 typedef struct screeninfo { int32_t size; /* Size of structur */ int32_t devID; /* Device ID number */ int8_t name[64]; /* Friendly name of Screen */ int32_t scrFlags; /* Some flags */ int32_t frameadr; /* Adress of framebuffer */ int32_t scrHeight; /* Visible X res */ int32_t scrWidth; /* Visible Y res */ int32_t virtHeight; /* Virtual X res */ int32_t virtWidth; /* Virtual Y res */ int32_t scrPlanes; /* color Planes */ int32_t scrColors; /* # of colors */ int32_t lineWrap; /* # of bytes to next line */ int32_t planeWarp; /* # of bytes to next plane */ int32_t scrFormat; /* Screen format */ int32_t scrClut; /* Type of clut */ int32_t redBits; /* Mask of Red Bits */ int32_t greenBits; /* Mask of Green Bits */ int32_t blueBits; /* Mask of Blue Bits */ int32_t alphaBits; /* Mask of Alpha Bits */ int32_t genlockBits; /* Mask of Genlock Bits */ int32_t unusedBits; /* Mask of unused Bits */ int32_t bitFlags; /* Bits organisation flags */ int32_t maxmem; /* Max. memory in this mode */ int32_t pagemem; /* Needed memory for one page */ int32_t max_x; /* Max. possible width */ int32_t max_y; /* Max. possible heigth */ }SCREENINFO;
See also: Setscreen, Milan Setscreen, ct60
typedef struct { int16_t width; /* Width in pixels */ int16_t height; /* Height in pixels */ int16_t bytes_per_line; /* Bytes per screen line */ int32_t length_of_screen; /* Length of screen memory in bytes */ int32_t physbase_offset; /* Offset start screen mem.<>Physbase */ int32_t logbase_offset; /* Offset start screen mem.<>Logbase */ } SCREEN;
See also: OverScan XBIOS functions Oscantab
/* operations */ #define BLK_CLEAR 0 #define BLK_AND 1 #define BLK_ANDREVERSE 2 #define BLK_COPY 3 #define BLK_ANDINVERTED 4 #define BLK_NOOP 5 #define BLK_XOR 6 #define BLK_OR 7 #define BLK_XNOR 8 #define BLK_EQUIV 9 #define BLK_INVERT 10 #define BLK_ORREVERSE 11 #define BLK_COPYINVERTED 12 #define BLK_ORINVERTED 13 #define BLK_NAND 14 #define BLK_SET 15 typedef struct _scrsetblk { int32_t size; /* size of structure */ int32_t blk_status; /* status bits of blk */ int32_t blk_op; /* mode operation */ int32_t blk_color; /* background fill color */ int32_t blk_x; /* x pos in total screen */ int32_t blk_y; /* y pos in total screen */ int32_t blk_w; /* width */ int32_t blk_h; /* height */ int32_t blk_unused; } SCRFILLMEMBLK;
See also: Setscreen, ct60
typedef struct _scrlineblk { int32_t size; /* size of structure */ int32_t blk_status; /* status bits of blk */ int32_t blk_fgcolor; /* foreground fill color */ int32_t blk_bgcolor; /* background fill color */ int32_t blk_x1; /* x1 pos dest in total screen */ int32_t blk_y1; /* y1 pos dest in total screen */ int32_t blk_x2; /* x2 pos dest in total screen */ int32_t blk_y2; /* y2 pos dest in total screen */ int32_t blk_op; /* mode operation */ int32_t blk_pattern; /* pattern (-1: solid line) */ } SCRLINEMEMBLK;
See also: Setscreen, ct60
#define BLK_ERR 0 #define BLK_OK 1 #define BLK_CLEARED 2 typedef struct _scrblk { int32_t size; /* Size of strukture */ int32_t blk_status; /* Status bits of blk */ int32_t blk_start; /* Start adress */ int32_t blk_len; /* Length of memblk */ int32_t blk_x; /* X pos in total screen */ int32_t blk_y; /* Y pos in total screen */ int32_t blk_w; /* Width */ int32_t blk_h; /* Height */ int32_t blk_wrap; /* Width in bytes, from: 2000-01-13 */ } SCRMEMBLK;
See also: Setscreen, Milan Setscreen, ct60
typedef struct _scrtextureblk { long size; /* size of structure */ long blk_status; /* status bits of blk */ long blk_src_x; /* x pos source */ long blk_src_y; /* y pos source */ long blk_dst_x; /* x pos dest in total screen */ long blk_dst_y; /* y pos dest in total screen */ long blk_w; /* width */ long blk_h; /* height */ long blk_op; /* mode operation */ long blk_src_tex; /* source texture address */ long blk_w_tex; /* width texture */ long blk_h_tex; /* height texture */ }SCRTEXTUREMEMBLK;
See also: Setscreen, ct60
/* mode code xxxx xxxF SOPV 8NNN */ typedef struct { uint16_t Plan:3; /* bit 0-2: NNN (number of planes) */ uint16_t _80Col:1; /* bit 3: 80 column flag (8) */ uint16_t VGA:1; /* bit 4: VGA flag (V) */ uint16_t Pal:1; /* bit 5: PAL flag (P) */ uint16_t Overscan:1; /* bit 6: Overscan flag (O) */ uint16_t STComp:1; /* bit 7: ST-compatible flag (S) */ uint16_t Vertical:1; /* bit 8: Vertical flag (F) */ uint16_t NRJStart:1; /* bit 9: Energy Star mode active or not */ uint16_t Eco:1; /* bit 10: Economiser active or not */ uint16_t Virtual:1; /* bit 11: Virtual screen active or not */ uint16_t ExtClock:1; /* bit 12: External clock 32/36MHz (CT2) */ uint16_t ExtClockEnable:1; /* bit 13: Enable external clock */ uint16_t StandardResol:1; /* bit 14: Standard resolution */ uint16_t DefaultMode:1; /* bit 15: Video default mode */ } VDO_MODE;
See also: VDO_PARAM
typedef struct { int16_t V_Hdl; /* Handle */ VDO_MODE V_mode; /* Video mode like on Falcon */ int16_t V_physw; /* Width of the physical screen */ int16_t V_physh; /* Height of the physical screen */ int16_t V_plan; /* Number of plane */ int16_t V_logw; /* Width of the virtual screen */ int16_t V_logh; /* Height of the virtual screen */ int16_t V_eco; /* Delay in seconds before shut down */ int16_t V_eco2; /* Delay in seconds between the shut down */ /* and the Energy Star mode */ int8_t V_name[33]; /* Name of the video mode (32 bytes maxi) */ /* terminated by a 0. */ int8_t Reserved; /* Reserved for future use */ int32_t V_length; /* Length of buffer */ } VDO_PARAM;
See also: Vread
typedef struct { int16_t x; int16_t y; } VPOS;
See also: Vseek