Beispiel #1
0
void reset(void)
{
    view_status("booting rom");
    flushdisplay();

    view_status("loading ultra.ini");
    inifile_read(cart.title);

    boot_boot();

    // have to load a second time... boot_boot overwrites some stuff
    // should be fixed
    view_status("loading ultra.ini");
    inifile_read(cart.title);

    view.hidestuff=0; view_changed(VIEW_RESIZE); flushdisplay();

    sym_findfirstos();
    if(cart.isdocalls)
    {
        print("Creating OSCALLS list.\n");
        sym_demooscalls(); // generate oscalls
    }
    else
    {
        sym_addpatches();
    }

    inifile_patches(0);
}
Beispiel #2
0
void boot(char *cartname,int nomemmap)
{
    view.hidestuff=1; view_changed(VIEW_RESIZE); flushdisplay();

    st.pc=0; // pc displayed in exceptions generated by load

    view_status("loading rom");
    flushdisplay();

    if(!cartname) cart_dummy();
    else cart_open(cartname,!nomemmap);

    reset();
}
Beispiel #3
0
static void
view_update (WDiff *view)
{
    int size = view->size;
    int min_size;
    int size1;
    int size2;
    int flags = 0;
    int owidth = 0;
    off_t u;

    u = (view->df[1].move ? view->max : view->df[0].end) - 1;
    if (view->df[0].offs > u) {
	view->df[0].offs = u;
    }
    u = (view->df[0].move ? view->max : view->df[1].end) - 1;
    if (view->df[1].offs > u) {
	view->df[1].offs = u;
    }
    if (view->df[0].offs < 0) {
	view->df[0].offs = 0;
    }
    if (view->df[1].offs < 0) {
	view->df[1].offs = 0;
    }

    /* XXX some more sanity checks (LINES/COLS)? */
#if VERTICAL_SPLIT
    if (size < 2) {
	return;
    }

    size1 = view->half1 + view->bias;
    size2 = view->half2 - view->bias;
    if (view->full) {
	size1 = COLS;
	size2 = 0;
    }

    if (view->display_numbers) {
	owidth = 4;
    }
#else	/* !VERTICAL_SPLIT */

    size1 = view->half1 + view->bias;
    size2 = view->half2 - view->bias;
    if (view->full) {
	size1 = LINES - 2;
	size2 = 0;
    }

    min_size = size1;
    if (size2 && size2 < size1) {
	min_size = size2;
    }

    if (view->display_numbers) {
	owidth = 4;
	if (size >= 8 + 16 * 4 + 2) {
	    owidth = 8;
	}
    }
#endif	/* !VERTICAL_SPLIT */

    if (view->new_frame) {
	Dlg_head *h = view->widget.parent;

#if VERTICAL_SPLIT
	min_size = size1;
	if (size2 && size2 < size1) {
	    min_size = size2;
	}
	view->nbytes = min_size - 2 - 1;
#else	/* !VERTICAL_SPLIT */
	view->nbytes = size - 1;
#endif	/* !VERTICAL_SPLIT */
	if (owidth) {
	    if (view->nbytes - 4 >= owidth + 1) {
		view->nbytes -= owidth + 1;
	    } else if (view->nbytes - 4 > 1) {
		view->nbytes = 4;
	    }
	}
	if (view->nbytes < 0) {
	    view->nbytes = 0;	/* XXX sanity checks should prevent this */
	}
	view->nbytes /= 4;
	if (view->nbytes <= view->subtract) {
	    view->subtract = view->nbytes - 1;
	    if (view->subtract < 0) {
		view->subtract = 0;
	    }
	}
	view->nbytes -= view->subtract;
#if VERTICAL_SPLIT
	view->pbytes = view->nbytes * (size - 2);
#else	/* !VERTICAL_SPLIT */
	view->pbytes = view->nbytes * min_size;
#endif	/* !VERTICAL_SPLIT */
	flags = REINIT_REALLOC;

	tty_setcolor(NORMAL_COLOR);
#if VERTICAL_SPLIT
	if (size1 > 1) {
	    draw_double_box(h, 1, 0,     size, size1);
	}
	if (size2 > 1) {
	    draw_double_box(h, 1, size1, size, size2);
	}
#endif	/* VERTICAL_SPLIT */

	view->new_frame = 0;
    }

    if (view->df[0].last != view->df[0].offs || view->df[1].last != view->df[1].offs || flags) {
	if (view->df[0].last != view->df[0].offs) {
	    flags |= REINIT_READ_LEFT;
	}
	if (view->df[1].last != view->df[1].offs) {
	    flags |= REINIT_READ_RIGHT;
	}
	if (redo_diff(view, flags) < 0) {
	    view->view_quit = 1;
	    return;
	}
	view->df[0].last = view->df[0].offs;
	view->df[1].last = view->df[1].offs;
    }

#if VERTICAL_SPLIT
    if (size1 > 2) {
	view_status(view, view->ord,     size1, 0);
	view_display_file(view, view->ord,     2,         1,         size - 2, size1 - 2,        owidth);
    }
    if (size2 > 2) {
	view_status(view, view->ord ^ 1, size2, size1);
	view_display_file(view, view->ord ^ 1, 2,         size1 + 1, size - 2, size2 - 2,        owidth);
    }
#else	/* !VERTICAL_SPLIT */
    if (size1 > 0) {
	view_status(view, view->ord,     size, 0);
	view_display_file(view, view->ord,     1,         0,         min_size, size,      size1, owidth);
    }
    if (size2 > 0) {
	view_status(view, view->ord ^ 1, size, size1 + 1);
	view_display_file(view, view->ord ^ 1, size1 + 2, 0,         min_size, size,      size2, owidth);
    }
#endif	/* !VERTICAL_SPLIT */
}