Ejemplo n.º 1
0
void f_screen(void) {
    if (in_graphics_mode && in_splitscreen)
	erase_graphics_top();
    in_splitscreen = FALSE;
    ztc_box[FG_Y1] = clear_box[FG_Y1] = 0;
    ibm_screen_bottom = MaxY;
    gr_mode();
}
Ejemplo n.º 2
0
int main(void)
{
    engine_sel = ENGINE_SEL_WRAP_OPT;
    engine_state = ENGINE_RUN;

    show_hotkeys();

#ifdef MIXED_MODE
    // our program just uses the bottom 4 lines of the display
    gotoxy(0,MAXROWPAIRCNT);
    POKE(TEXTWINDOW_TOP_EDGE,MAXROWPAIRCNT);
    gr_mode(SS_PAGE2OFF, SS_MIXEDON);
#else
    gr_mode(SS_PAGE2OFF, SS_MIXEDOFF);
#endif
    glider(gr_page[0]);

    while (engine_state == ENGINE_RUN) {
        switch (engine_sel) {
            case ENGINE_SEL_WRAP_NAIVE:
                naive_wrap_engine();
                break;
            case ENGINE_SEL_NOWRAP_NAIVE:
                naive_nowrap_engine();
                break;
            case ENGINE_SEL_WRAP_OPT:
                opt_wrap_engine();
                break;
            case ENGINE_SEL_NOWRAP_OPT:
                opt_nowrap_engine();
                break;
            default:
#ifdef MIXED_MODE
                printf("bogus engine selection!\n");
#endif
                engine_state = ENGINE_STOP;
                break;
        }
    }
    
    // all done
    POKE(TEXTWINDOW_TOP_EDGE,0);
    softsw(SS_TEXTON);
    
    return EXIT_SUCCESS;
}
Ejemplo n.º 3
0
void s_screen(void) {
    int save_vis;

    if (in_graphics_mode && !in_splitscreen) {
	if (turtle_shown && (screen_y_coord > (MaxY - (4*texth+1)))) {
	    save_vis = current_vis;
	    current_vis = -1;
	    lhome(NIL);
	    current_vis = save_vis;
	}
	erase_graphics_top();
    }
    if (!have_been_in_graphics_mode) gr_mode();
    in_splitscreen = TRUE;
    ztc_box[FG_Y1] = 4*texth+1;
    clear_box[FG_Y1] = 4*texth;
    ibm_screen_bottom = MaxY - (ztc_box[FG_Y1]);
    y_max = 4;
    gr_mode();
}
Ejemplo n.º 4
0
void label(char *s) {
    gr_mode();
    moveto(g_round(screen_x_coord), g_round(screen_y_coord));
    outtext(s);
}
Ejemplo n.º 5
0
/*
 * returning 1 will cause the currently running engine to exit
 */
uint8_t process_keys(void) 
{
    uint8_t c;

    if (kbhit() > 0) {
        c=cgetc();
        CLEARKEYBUF;
        if (c == 'p') {
#ifdef MIXED_MODE
            printf("PAUSED. Press p to Continue.\n");
#endif
            wait_for_keypress('p');
        }
        else if (c == '1') {
            engine_sel = ENGINE_SEL_WRAP_NAIVE;
            engine_state = ENGINE_RUN;
#ifdef MIXED_MODE
            printf("Naive wrap mode enabled.\n");
#endif
            return 1;
        }
        else if (c == '2') {
            engine_sel = ENGINE_SEL_NOWRAP_NAIVE;
            engine_state = ENGINE_RUN;
#ifdef MIXED_MODE
            printf("Naive nowrap mode enabled.\n");
#endif
            return 1;
        }
        else if (c == '3') {
            engine_sel = ENGINE_SEL_WRAP_OPT;
            engine_state = ENGINE_RUN;
#ifdef MIXED_MODE
            printf("Optimized wrap mode enabled.\n");
#endif
            return 1;
        }
        else if (c == '4') {
            engine_sel = ENGINE_SEL_NOWRAP_OPT;
            engine_state = ENGINE_RUN;
#ifdef MIXED_MODE
            printf("Optimized nowrap mode enabled.\n");
#endif
            return 1;
        }
        else if (tolower(c) == 'q') {
            engine_state = ENGINE_STOP;
            return 1;
        }
        else if (c == '?') {
            memcpy((uint8_t *)0x5000,0x400,0x800);
            text_mode();
            printf("\n\n\n\n\n\n\n");
            show_hotkeys();
#ifdef MIXED_MODE
            gotoxy(0,MAXROWPAIRCNT);
            POKE(TEXTWINDOW_TOP_EDGE,MAXROWPAIRCNT);
            gr_mode(SS_PAGE2OFF, SS_MIXEDON);
#else
            gr_mode(SS_PAGE2OFF, SS_MIXEDOFF);
#endif
            memcpy((uint8_t *)0x400,0x5000,0x800);
        }
        else if (tolower(c) == 'r')
            randomize(gr_page[find_page()], 400);
        else if (tolower(c) == 'g')
            gospergun(gr_page[find_page()]);
        else if (tolower(c) == 's')
            simkins(gr_page[find_page()]);
    }
    return 0;
}