|
| ULONG | doeditstr2 (ULONG n) |
| | Edit$(Characters): reads a line of up to n characters, without a default.
|
| ULONG | doeditstr (UBYTE *def, ULONG n, const UBYTE *args) |
| | Edit$(DefaultString$,Characters): reads a line of up to n characters over a default string.
|
| void | doinkey (void) |
| | Inkey$: one character from the current input, "" if none came.
|
| ULONG | doinkey2 (ULONG n) |
| | Inkey$(Characters): n attempts to read a character, the characters that came.
|
| ULONG | doedit2 (ULONG n, const void *caller_a6) |
| | Edit(Characters): reads a number of up to n characters, without a default.
|
| ULONG | doedit (ULONG def, ULONG n, const void *caller_a6) |
| | Edit(DefaultValue,Characters): reads a number of up to n characters over a default value.
|
| void | editchk1 (void) |
| void | editchk2 (void) |
| void | editchkz (void) |
| void | editchk (void) |
| void | inkeychk (void) |
| void | editctrlc (void) |
| static ULONG | getsingle (void) |
| static ULONG | editstr (UBYTE *def, ULONG max, ULONG deflen) |
| static ULONG | doeditz (ULONG n, const void *caller_a6, UBYTE *saved_string) |
| static void | editchk1_c (ULONG n) |
| static void | editchk2_c (ULONG n) |
| static void | editchk_c (ULONG n) |
| static void | inkeychk_c (ULONG n) |
| static void | editchkz_c (ULONG n) |
| | BLITZ_ERRCHK_ASM (editctrlc, " .globl _editctrlc\n" "_editctrlc:\n" " jmp _blitz_tok+" BL_ASMTOK(LIB_inputoutputlib, 13)) |
| ULONG doedit |
( |
ULONG | def, |
|
|
ULONG | n, |
|
|
const void * | caller_a6 ) |
Edit(DefaultValue,Characters): reads a number of up to n characters over a default value.
The default is converted with printlib's UStr$ into the library's 80 byte buffer, the line is read over it and converted with Val (see doeditz). Fixed (#129): the padding starts behind the default (the original's first padding space overwrote its last character: UStr$ leaves a3 right behind it, without a 0). UStr$ and Val get their !libs bases from the ALibJsr stubs (#130). By design (#131): n = 80 reads up to 81 characters into the buffer. Errors (debugger only): n = 0 -> "Can't Edit 0 Characters!", n > 80 -> "Can only Edit up to 80 characters".
- Parameters
-
| def | d0: the default value (FFP float) |
| n | d1: the maximum number of characters |
| caller_a6 | a6: the caller's a6, passed on to UStr$ and Val |
- Returns
- d0: the value (FFP float)
| ULONG doedit2 |
( |
ULONG | n, |
|
|
const void * | caller_a6 ) |
Edit(Characters): reads a number of up to n characters, without a default.
The line is read in the library's 80 byte buffer and converted with vallib's Val (see doeditz). Fixed (#129): the buffer starts empty (padded with n spaces). The original put a default "0" there, which its padding overwrote for n >= 2 (#129) and showed only for n = 1; an empty line still gives 0. Val gets the ffplib base although Edit has no !libs: the compiler links the ALibJsr call through a stub that loads the callee's !libs (not a bug, #130). By design (#131): n = 80 reads up to 81 characters into the 80 byte buffer. Errors (debugger only): n = 0 -> "Can't Edit 0 Characters!", n > 80 -> "Can only Edit up to 80 characters".
- Parameters
-
| n | d0: the maximum number of characters |
| caller_a6 | a6: the caller's a6, passed on to Val |
- Returns
- d0: the value (FFP float)
Inkey$: one character from the current input, "" if none came.
Reads one character with inputoutputlib's dogetsingle (d0 negative = none) and appends it to the string at a3. The original's code, an assembler entry: as a C function it saved d2-d7/a2/a6 around the ALibJsr (the handler may change them) and cleared d0/d1/a0/a1 for it, about 160 cycles per call. Like the original it changes what the input handler changes (the handler keeps a3-a6: BlitzKey keeps d1/a0/ a1 too, the C handlers d2-d7/a2/a6).
Out: d0 the string length, 1 or 0; a3 behind the character
| ULONG doinkey2 |
( |
ULONG | n | ) |
|
Inkey$(Characters): n attempts to read a character, the characters that came.
Calls dogetsingle n times and appends every character it returns to the string at a3. n counts as an unsigned long. Fixed (#128): Inkey$(0) is the empty string (the original skipped MOVEQ #0,d6 and returned the caller's d6 as the length). Errors (debugger, inkeychk): "Can't Inkey$ a negative number of
Characters!" (fixed, #1031: the original had no check; a negative n makes about 4 billion attempts).
- Parameters
-
| n | d0: the number of attempts |
- Returns
- d0: the string length (the characters that came)