Beispiel #1
0
void z_restart (void)
{
    static bool first_restart = TRUE;

    flush_buffer ();

    os_restart_game (RESTART_BEGIN);

    seed_random (0);

    if (!first_restart) {

        fseek (story_fp, blorb_ofs, SEEK_SET);

        if (fread (zmp, 1, h_dynamic_size, story_fp) != h_dynamic_size)
            os_fatal ("Story file read error");

    } else first_restart = FALSE;

    restart_header ();
    restart_screen ();

    sp = fp = stack + STACK_SIZE;
    frame_count = 0;

    if (h_version != V6) {

        long pc = (long) h_start_pc;
        SET_PC (pc);

    } else call (h_start_pc, 0, NULL, 0);

    os_restart_game (RESTART_END);

}/* z_restart */
Beispiel #2
0
void Processor::z_restart() {
	flush_buffer();

	os_restart_game(RESTART_BEGIN);

	seed_random(0);

	if (!first_restart) {
		story_fp->seek(0);

		if (story_fp->read(zmp, h_dynamic_size) != h_dynamic_size)
			error("Story file read error");

	} else {
		first_restart = false;
	}

	restart_header();
	restart_screen();

	_sp = _fp = _stack + STACK_SIZE;
	_frameCount = 0;

	if (h_version != V6 && h_version != V9) {
		long pc = (long)h_start_pc;
		SET_PC(pc);
	} else {
		call(h_start_pc, 0, nullptr, 0);
	}

	os_restart_game(RESTART_END);
}
Beispiel #3
0
void restart_screen (void)
{

    /* Use default settings */

    os_set_colour (h_default_foreground, h_default_background);

    if (os_font_data (TEXT_FONT, &font_height, &font_width))
        os_set_font (TEXT_FONT);

    os_set_text_style (0);

    cursor = TRUE;

    /* Initialise window properties */

    mwin = 1;

    for (cwp = wp; cwp < wp + 8; cwp++) {
        cwp->y_pos = 1;
        cwp->x_pos = 1;
        cwp->y_size = 0;
        cwp->x_size = 0;
        cwp->y_cursor = 1;
        cwp->x_cursor = 1;
        cwp->left = 0;
        cwp->right = 0;
        cwp->nl_routine = 0;
        cwp->nl_countdown = 0;
        cwp->style = 0;
        cwp->colour = (h_default_background << 8) | h_default_foreground;
        cwp->font = TEXT_FONT;
        cwp->font_size = (font_height << 8) | font_width;
        cwp->attribute = 8;
        cwp->true_fore = hx_fore_colour;
        cwp->true_back = hx_back_colour;
    }

    /* Prepare lower/upper windows and status line */

    wp[0].attribute = 15;

    wp[0].left = option_left_margin;
    wp[0].right = option_right_margin;

    wp[0].x_size = h_screen_width;
    wp[1].x_size = h_screen_width;

    if (h_version <= V3)
        wp[7].x_size = h_screen_width;

    os_restart_game (RESTART_WPROP_SET);

    /* Clear the screen, unsplit it and select window 0 */

    erase_screen ((zword) (-1));

}/* restart_screen */