void z_scroll_window (void) { zword win = winarg0 (); zword y, x; flush_buffer (); /* Use the correct set of colours when scrolling the window */ if (win != cwin && h_interpreter_number != INTERP_AMIGA) os_set_colour (lo (wp[win].colour), hi (wp[win].colour)); y = wp[win].y_pos; x = wp[win].x_pos; os_scroll_area (y, x, y + wp[win].y_size - 1, x + wp[win].x_size - 1, (short) zargs[1]); if (win != cwin && h_interpreter_number != INTERP_AMIGA) os_set_colour (lo (cwp->colour), hi (cwp->colour)); }/* z_scroll_window */
void z_scroll_window (void) { zword win = winarg0 (); zword y, x; flush_buffer (); /* Use the correct set of colours when scrolling the window */ if (win != cwin && !amiga_screen_model ()) os_set_colour (lo (wp[win].colour), hi (wp[win].colour)); y = wp[win].y_pos; x = wp[win].x_pos; os_scroll_area (y, x, y + wp[win].y_size - 1, x + wp[win].x_size - 1, (short) zargs[1]); if (win != cwin && !amiga_screen_model ()) os_set_colour (lo (cwp->colour), hi (cwp->colour)); }/* z_scroll_window */
void resize_screen (void) { if (h_version != V6) { int h = wp[0].y_pos + wp[0].y_size; wp[0].x_size = h_screen_width; wp[1].x_size = h_screen_width; wp[7].x_size = h_screen_width; wp[0].y_size = h_screen_height - wp[1].y_size; if (h_version <= V3) wp[0].y_size -= hi (wp[7].font_size); if (os_font_data (TEXT_FONT, &font_height, &font_width)) { int i; for (i = 0; i < 8; i++) wp[i].font_size = (font_height << 8) | font_width; } if (cwin == 0) { int lines = wp[0].y_cursor + font_height - wp[0].y_size - 1; if (lines > 0) { if (lines % font_height != 0) lines += font_height; lines /= font_height; if (wp[0].y_cursor > (font_height * lines)) { os_scroll_area (wp[0].y_pos, wp[0].x_pos, h - 1, wp[0].x_pos + wp[0].x_size - 1, font_height * lines); wp[0].y_cursor -= (font_height * lines); update_cursor (); } } } os_window_height (0, wp[0].y_size); } }/* resize_screen */
void screen_new_line (void) { if (discarding) return; /* Handle newline interrupts at the start (for most cases) */ if (h_interpreter_number != INTERP_MSDOS || story_id != ZORK_ZERO || h_release != 393) countdown (); /* Check whether the last input line gets destroyed */ if (input_window == cwin) input_redraw = TRUE; /* If the cursor has not reached the bottom line, then move it to the next line; otherwise scroll the window or reset the cursor to the top left. */ cwp->x_cursor = cwp->left + 1; if (cwp->y_cursor + 2 * font_height - 1 > cwp->y_size) if (enable_scrolling) { zword y = cwp->y_pos; zword x = cwp->x_pos; os_scroll_area (y, x, y + cwp->y_size - 1, x + cwp->x_size - 1, font_height); } else cwp->y_cursor = 1; else cwp->y_cursor += font_height; update_cursor (); /* See if we need to print a more prompt (unless the game has set the line counter to -999 in order to suppress more prompts). */ if (enable_scrolling && (short) cwp->line_count != -999) { zword above = (cwp->y_cursor - 1) / font_height; zword below = (cwp->y_size - cwp->y_cursor + 1) / font_height; cwp->line_count++; if ((short) cwp->line_count >= (short) above + below - 1) { if (more_prompts) os_more_prompt (); cwp->line_count = f_setup.context_lines; } } /* Handle newline interrupts at the end for Zork Zero under DOS */ if (h_interpreter_number == INTERP_MSDOS && story_id == ZORK_ZERO && h_release == 393) countdown (); }/* screen_new_line */