|
| void | _ZoneInit1 (void) |
| void | _ZoneInit2 (void) |
| void | _ZoneInit (void) |
| void | _SetZone2 (void) |
| void | _SetZone (void) |
| void | _ZoneTest (void) |
| void | _TestZoneRange2 (void) |
| void | _TestZoneRange (void) |
| void | _ZoneTable (void) |
| void | _jfire (void) |
| void | _jvert (void) |
| void | _jhoriz (void) |
| void | _allfire (void) |
| void | _allfire2 (void) |
| void | _ZoneTableSize (void) |
| void | _NewZoneTable (void) |
| void | _UseZoneTable (void) |
| void | _FreeZoneTable (void) |
| void | _zonetablenumber (void) |
| void | _zonemode (void) |
| void | _setzonemode (void) |
| void | _fouradaptor (void) |
| void | _zoneinfox1 (void) |
| void | _zoneinfoy1 (void) |
| void | _zoneinfox2 (void) |
| void | _zoneinfoy2 (void) |
| void | _readjoypad (void) |
| void | rizonejoylib_libfinit (void) |
| void | _Initmem (void) |
| static struct zonetable ** | entry (ULONG n) |
| static struct zone * | zone (struct zonetable *zt, ULONG off) |
| static void | free_mem (struct zonetable *table) |
| static void | initmem_c (void) |
| | init: the 68020 mode and zone table 0 with 256 zones.
|
| static void | libfinit_c (void) |
| | finit: frees every zone table of the list.
|
| static ULONG | zoneinit_c (ULONG zonenum, ULONG lastnum) |
| | ZoneInit start_num,end_num: clears the zones start..end of the current table.
|
| static ULONG | zoneinit1_c (void) |
| | ZoneInit: clears all zones of the current table.
|
| static ULONG | zoneinit2_c (ULONG zonenum) |
| | ZoneInit zone_num: clears one zone of the current table.
|
| static BB_BOOL | doset (ULONG n, UWORD x1, UWORD y1, UWORD x2, UWORD y2) |
| static BB_BOOL | setzone_c (ULONG n, UWORD x1, UWORD y1, UWORD x2, UWORD y2) |
| | SetZone(num,x1,y1,x2,y2): sets a rectangular zone of the current table.
|
| static BB_BOOL | setzone2_c (ULONG n, UWORD x, UWORD y, UWORD r) |
| | SetZone(num,x,y,radius): sets a circular zone of the current table.
|
| void | zonetests (void) |
| static ULONG | zonetable_c (void) |
| | ZoneTable: the address of the current zone table.
|
| static ULONG | zonetablesize_c (void) |
| | ZoneTableSize: the number of zones of the current table.
|
| static void | clearzones (struct zonetable *zt) |
| static BB_BOOL | newzonetable_c (ULONG n, ULONG num) |
| | NewZoneTable table#,num_zones: allocates zone table n.
|
| static BB_BOOL | usezonetable_c (ULONG n) |
| | UseZoneTable table#: makes table n the current one.
|
| static BB_BOOL | freezonetable_c (ULONG n) |
| | FreeZoneTable table#: frees zone table n (1..15).
|
| static ULONG | zonetablenumber_c (void) |
| | ZoneTableNumber: the number of the current zone table.
|
| static ULONG | zonemode_c (void) |
| | ZoneMode: -1 for the 68020 mode, 0 for the 68000 mode.
|
| static void | setzonemode_c (ULONG mode) |
| | SetZoneMode mode: sets the zone test mode, only on a 68020 or better.
|
| static ULONG | zoneinfo (ULONG zonenum, UWORD off) |
| static ULONG | jfire_c (UWORD port) |
| | JFire(port): the fire buttons of a joystick port.
|
| static ULONG | vert (UWORD d) |
| static ULONG | adaptor (UBYTE first, UBYTE second) |
| static ULONG | jvert_c (UWORD port) |
| | JVert(port): the vertical direction of a joystick port.
|
| static ULONG | jhoriz_c (ULONG port) |
| | JHoriz(port): the horizontal direction of a joystick port.
|
| static ULONG | allfire2_c (UWORD bits) |
| | AllFire(joybits): the fire buttons of the ports asked for.
|
| static ULONG | allfire_c (void) |
| | AllFire: the fire buttons of all four ports (joybits %1111).
|
| static ULONG | fouradaptor_c (ULONG status) |
| | JAdaptorStatus On/Off: switches the reading of the four player adaptor.
|
| static ULONG | readpad (UBYTE fire, UWORD go, UWORD data) |
| static ULONG | readjoypad_c (UWORD port) |
| | ReadJoyPad(port#): the buttons of a CD32 pad.
|
FreeZoneTable table#: frees zone table n (1..15).
The entry is cleared: fixed (#868), the original left the freed block there. Table 0 always becomes the current one, as the manual documents ("change the currently used zonetable to table number 0"; no defect, #869). Fixed (#872): n is compared unsigned, a negative n is refused (the original freed the current table).
- Parameters
-
- Returns
- d0: BB_TRUE done, BB_FALSE bad number or no such table
init: the 68020 mode and zone table 0 with 256 zones.
is020 and the 68020 mode from AttnFlags (AFB_68020); table 0 (2052 bytes, MEMF_PUBLIC) is the current one, all zones cleared; without memory there is no table. All 16 entries of the list are cleared: fixed (#871), the original cleared only entry 0, so the next run of a program with the library still loaded found the tables of the run before, freed by its finit. The four player adaptor's status is set to on, the manual's default: fixed (#1132), the original kept the status of the run before (after JAdaptorStatus Off the next run started with the adaptor off).
| ULONG jfire_c |
( |
UWORD | port | ) |
|
|
static |
JFire(port): the fire buttons of a joystick port.
Ports 1, 2: CIAA PRA /FIR1 resp. /FIR0, the second button through POTGO/POTINP; ports 3, 4: the four player adaptor (CIAB PRA SEL/BUSY), 0 if it is switched off (JAdaptorStatus).
- Parameters
-
- Returns
- d0: 1 = fire, + 2 = the second button (ports 1, 2); 0 for other ports
| BB_BOOL newzonetable_c |
( |
ULONG | n, |
|
|
ULONG | num ) |
|
static |
NewZoneTable table#,num_zones: allocates zone table n.
n 1..15, num_zones 1..65535 (1: fixed, #1136, the original refused a table of one zone, which the manual allows; the manual's 65536 is refused, the zone loops count in words, #1137); an old table of that number is freed first. All zones of the new table are cleared and the current table stays as it is; a replaced current table stays current under its new block: fixed (#875), the original ran ZoneInit on the current table and left AllocMem's garbage in the new one. If the AllocMem fails after the free, the table no longer exists (its entry cleared, 0 returned) and, if it was the current one, table 0 becomes current: fixed (#874, D-018), the original left the freed block in the entry and in _zonetable. Fixed (#872): n is compared unsigned, a negative n is refused (the original passed it: entry -1 is _zonetable).
- Parameters
-
| n | d0: the table number |
| num | d1: the number of zones |
- Returns
- d0: BB_TRUE done, BB_FALSE bad arguments or no memory
| BB_BOOL setzone2_c |
( |
ULONG | n, |
|
|
UWORD | x, |
|
|
UWORD | y, |
|
|
UWORD | r ) |
|
static |
SetZone(num,x,y,radius): sets a circular zone of the current table.
x1, y1 = the centre, x2 = radius^2 (a word), y2 = -1. The radius is a word, like the coordinates (the original's MULS.w); one outside 0-255 is refused (BB_FALSE, nothing stored): fixed (#867, W7 decision Q1 (a)), the original stored the radius squared's low word, so radius 256 and more wrapped (256: 0, 300: 24464). Results otherwise as the rectangle form.
- Parameters
-
| n | d0: the zone number |
| x | d1: the centre x |
| y | d2: the centre y |
| r | d3: the radius (a word, 0-255) |
- Returns
- d0: BB_TRUE done, BB_FALSE no table, out of range or a radius outside 0-255
| BB_BOOL setzone_c |
( |
ULONG | n, |
|
|
UWORD | x1, |
|
|
UWORD | y1, |
|
|
UWORD | x2, |
|
|
UWORD | y2 ) |
|
static |
SetZone(num,x1,y1,x2,y2): sets a rectangular zone of the current table.
The corners are ordered (EXG) so that x1 < x2 and y1 < y2 (the manual's "x2,y2 should be the bottom left" means the bottom right; either order works, #1137). Without a table the result is 0: fixed (#876, the original returned -1, "done"). num is compared unsigned: fixed (#873), the original wrote a negative num before the table. A rectangle whose bottom edge (the larger y) is -1 is refused: fixed (#866), y2 = -1 marks a circle, the original stored it and the zone tests took it for a circle.
- Parameters
-
| n | d0: the zone number |
| x1 | d1: a corner x |
| y1 | d2: a corner y |
| x2 | d3: the other corner x |
| y2 | d4: the other corner y |
- Returns
- d0: BB_TRUE done, BB_FALSE no table, out of range or a bottom edge of -1
| ULONG zonetable_c |
( |
void | | ) |
|
|
static |
ZoneTable: the address of the current zone table.
The table: the zone count (a long), then per zone x1, x2, y1, y2 (words, 8 bytes); a circle has the radius squared in x2 and -1 in y2; table 0 is 2052 bytes. The manual differs ("+0: x1, +2: y1, +4: x2,
+6: y2", "+4: radius of zone", "8 words (16 bytes)", "2048 bytes"); the library's layout is the one programs use (#1137).
- Returns
- d0: the table, 0 if none (fixed, #876: the original returned -1)