void timetrav::port_write(Uint16 port, Uint8 value) { char s[80]; static char display_string[9] = {0}; switch(port) { case 0x1180: case 0x1181: case 0x1182: case 0x1183: case 0x1184: case 0x1185: case 0x1186: case 0x1187: m_video_overlay_needs_update = true; display_string[port & 0x07] = value; draw_string(display_string, 0, 0, get_active_video_overlay()); video_blit(); break; default: sprintf(s, "Unmapped write to port %x, value %x", port, value); printline(s); break; } }
void sprite_blit(Sprite * sprite) { Uint8 frame; if (sprite->current_animation == 0) { memset(&sprite->rect, 0, sizeof(SDL_Rect)); return; } frame = sprite->animation[sprite->current_animation]->current_frame; frame = sprite->animation[sprite->current_animation]->frame[frame]; video_erase(&sprite->rect); if (frame) { sprite->rect.x = sprite->x; sprite->rect.y = sprite->y; video_blit(sprite->sdl_frame[frame], NULL, &sprite->rect); } else memset(&sprite->rect, 0, sizeof(SDL_Rect)); }
void benchmark::start() { g_ldp->play(); // start the disc playing immediately Uint32 timer = refresh_ms_time(); Uint32 ms_to_run = m_seconds_to_run * 1000; // how many ms to run the test ... if (m_game_uses_video_overlay) { // draw overlay on all surfaces for (int i = 0; i < m_video_overlay_count; i++) { m_video_overlay_needs_update = true; video_blit(); } } // run for 60 seconds while (!get_quitflag() && (elapsed_ms_time(timer) < ms_to_run)) { SDL_check_input(); SDL_Delay(1000); // don't hog CPU } }