void printi(int number) { char s[32]; int sign; int i; i = 0; sign = number; if (sign < 0) { number = -number; } do { s[i++] = number % 10 + '0'; }while ((number /= 10) > 0); if (sign < 0) { s[i++] = '-'; } i = i -1; for (; i >= 0; i--) { screen_char(s[i], screen_black, screen_red); } }
/* * screen_word * * Display a string of characters on the screen. If the word doesn't fit * then use wrapping or clipping depending on the current setting of the * enable_wrapping flag. * */ void screen_word (const zchar *s) { int width; if (discarding) return; if (*s == ZC_INDENT && cwp->x_cursor != cwp->left + 1) screen_char (*s++); if (units_left () < (width = os_string_width (s))) { if (!enable_wrapping) { zchar c; while ((c = *s++) != 0) if (c == ZC_NEW_FONT || c == ZC_NEW_STYLE) { int arg = (int) *s++; if (c == ZC_NEW_FONT) os_set_font (arg); if (c == ZC_NEW_STYLE) os_set_text_style (arg); } else screen_char (c); return; } if (*s == ' ' || *s == ZC_INDENT || *s == ZC_GAP) width = os_string_width (++s); #ifdef AMIGA if (cwin == 0) Justifiable (); #endif screen_new_line (); } os_display_string (s); cwp->x_cursor += width; }/* screen_word */
void screen_string(int8 *string, color back_color, color fore_color) { int i = 0; while (string[i] != '\0') { screen_char(string[i++], back_color, fore_color); } }
void Processor::stream_char(zchar c) { if (ostream_screen) screen_char(c); if (ostream_script && enable_scripting) script_char(c); if (enable_scripting) scrollback_char(c); }
void stream_char (zchar c) { if (ostream_screen) screen_char (c); if (ostream_script && enable_scripting) script_char (c); }/* stream_char */
void printx(int number) { char *hex = "0123456789ABCDEF"; int value; int i = 7; while (i >= 0) { value = number >> i*4; screen_char(hex[value&0xf], screen_black, screen_red); i--; } }
void printx(int number) { char hex[16] = { '0','1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; int i = 7; int value; while (i >= 0) { value = number >> 4*i; screen_char(hex[value&0xf], screen_black, screen_red); i--; } }
static void pad_status_line (int column) { int spaces; flush_buffer (); spaces = units_left () / os_char_width (' ') - column; /* while (spaces--) */ /* Justin Wesley's fix for narrow displays (Agenda PDA) */ while (spaces-- > 0) screen_char (' '); }/* pad_status_line */
/* * screen_mssg_on * * Start printing a so-called debugging message. The contents of the * message are passed to the message stream, a Frotz specific output * stream with maximum priority. * */ void screen_mssg_on (void) { if (cwin == 0) { /* messages in window 0 only */ os_set_text_style (0); if (cwp->x_cursor != cwp->left + 1) screen_new_line (); screen_char (ZC_INDENT); } else discarding = TRUE; /* discard messages in other windows */ }/* screen_mssg_on */
static void anim_edit_loop() { #define BLINK_PERIOD 30 int loop = BLINK_PERIOD; while (1) { unsigned long now = clock(); while (now == clock()) {} if (kbhit()) { handle_anim_edit_key(cgetc()); loop = 0; } if (loop-- == 0) { // Blink. punch(screen_char() ^ 0x80, color); loop = BLINK_PERIOD; } } }
static void show_cursor() { hidden_screen_char = screen_char(); hidden_color = screen_color(); }
void printchar(int8 str) { screen_char(str, screen_black, screen_red); }