|
| BB_BOOL | dofirstitem (UBYTE *base) |
| | FirstItem(Arrayname()): make the first item the current one.
|
| void | doadditem (void) |
| void | donextitem (void) |
| void | doreslist (UBYTE *base) |
| | ResetList Arrayname(): no current item (the next NextItem gives the first). Errors (debugger only): "Array is not a List" (lchk).
|
| void | dokillitem (void) |
| void | doaddfirst (void) |
| void | doclearlist (void) |
| void | doaddlast (void) |
| void | dopushcurrent (UBYTE *base) |
| | PushItem Arrayname(): push the list and its current item on the item stack.
|
| void | dopopcurrent (UBYTE *base) |
| | PopItem Arrayname(): pop the current item from the item stack into the given list.
|
| void | doprevitem (void) |
| BB_BOOL | dolastitem (UBYTE *base) |
| | LastItem(Arrayname()): make the last item the current one, as FirstItem.
|
| void | setstack (ULONG n) |
| | ItemStackSize Max Items: a new item stack.
|
| void | dosortlist (UBYTE *base, WORD offset) |
| | SortList Arrayname(),sizeof .type\offset: sort a list by a long of its elements.
|
| static void | doinit (void) |
| | The library's init: an empty item stack of 8 entries.
|
| void | lchk (void) |
| void | lchk2 (void) |
| void | pushchk (void) |
| void | popchk (void) |
| BL_ALWAYS_INLINE void | unlinkitem (struct bb_listitem *item) |
| BL_ALWAYS_INLINE void | linkitem (struct bb_listitem *item, struct bb_listitem *after) |
| static BLITZ_ENTRYPOINT void | doclearlist_c (UBYTE *base) |
| | ClearList Arrayname(): empty a list.
|
| | BLITZ_ALIAS_EP (doclearlist, doclearlist_c) |
| BL_ALWAYS_INLINE BB_BOOL | firstitem2 (UBYTE *base) |
| BL_ALWAYS_INLINE BB_BOOL | lastitem2 (UBYTE *base) |
| static BLITZ_ENTRYPOINT void | dokillitem_c (UBYTE *base) |
| | KillItem Arrayname(): remove the current item.
|
| | BLITZ_ALIAS_EP (dokillitem, dokillitem_c) |
| static BLITZ_ENTRYPOINT BB_BOOL | doadditem_c (UBYTE *base) |
| | AddItem(Arrayname()): insert an item after the current one.
|
| | BLITZ_ALIAS_EP (doadditem, doadditem_c) |
| static BLITZ_ENTRYPOINT BB_BOOL | doaddfirst_c (UBYTE *base) |
| | AddFirst(Arrayname()): add an item at the beginning of the list, as AddItem; it becomes current.
|
| | BLITZ_ALIAS_EP (doaddfirst, doaddfirst_c) |
| static BLITZ_ENTRYPOINT BB_BOOL | doaddlast_c (UBYTE *base) |
| | AddLast(Arrayname()): add an item at the end of the list, as AddItem; it becomes current.
|
| | BLITZ_ALIAS_EP (doaddlast, doaddlast_c) |
| static BB_BOOL | donextitem_c (UBYTE *base) |
| | NextItem(Arrayname()): make the next item the current one.
|
| | BLITZ_ALIAS (donextitem, donextitem_c) |
| static BB_BOOL | doprevitem_c (UBYTE *base) |
| | PrevItem Arrayname(): make the previous item the current one, as NextItem backwards (without a current item it does LastItem).
|
| | BLITZ_ALIAS (doprevitem, doprevitem_c) |
| static void | lchk_c (UBYTE *base) |
| static void | lchk2_c (UBYTE *base) |
| static void | pushchk_c (UBYTE *base) |
| static void | popchk_c (UBYTE *base) |
| BB_BOOL donextitem_c |
( |
UBYTE * | base | ) |
|
|
static |
NextItem(Arrayname()): make the next item the current one.
Without a current item it does FirstItem. At the end the current item stays. Errors (debugger only): "Array is not a List" (lchk).
The current item is read into a data register (the empty asm with a "+d" operand): MOVE sets the flags there, where GCC tested an address register with CMPA.w #0 (10 cycles); the middle item, the common case, goes straight through to its own RTS. The entry is an alias of the static C function: with the function itself in the !subs table above (its address taken before its body) GCC put the RTS behind the rare exits and branched to it (BRA.s, 10 cycles).
- Parameters
-
- Returns
- d0: BB_TRUE if there is a next item, BB_FALSE at the end
| void dosortlist |
( |
UBYTE * | base, |
|
|
WORD | offset ) |
SortList Arrayname(),sizeof .type\offset: sort a list by a long of its elements.
Sorts the used items ascending by the long at offset in the element (bubble sort; every pass ends one item earlier). The current item stays the same item. Interrupts disabled meanwhile. Errors (debugger only): "Array is not a List" (lchk). DIFF: a3 is not changed (the original destroys a3 and d6). Fixed (#201): the keys are compared signed (the original took the sign of the difference, CMP.l:BMI, which wraps for keys more than 2^31 apart); items with equal keys are not swapped.
- Parameters
-
| base | d0: the list array |
| offset | d1: the offset of the key in the element |