static SCREEN_UPDATE_IND16( lastfght ) { lastfght_state *state = screen.machine().driver_data<lastfght_state>(); #ifdef MAME_DEBUG #if 1 // gfx roms viewer (toggle with enter, use pgup/down to browse) int x, y, count = 0; UINT8 *gfxdata = screen.machine().root_device().memregion("gfx1")->base(); UINT8 data; if (screen.machine().input().code_pressed_once(KEYCODE_ENTER)) state->m_view_roms ^= 1; if (state->m_view_roms) { if (screen.machine().input().code_pressed_once(KEYCODE_PGDN)) state->m_base += 512 * 256; if (screen.machine().input().code_pressed_once(KEYCODE_PGUP)) state->m_base -= 512 * 256; state->m_base %= state->memregion("gfx1")->bytes(); count = state->m_base; bitmap.fill(get_black_pen(screen.machine()), cliprect ); for (y = 0 ; y < 256; y++) { for (x = 0; x < 512; x++) { data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(screen.machine()) : gfxdata[count]; // white grid or data bitmap.pix16(y, x) = data; count++; } } popmessage("%x", state->m_base); return 0; } #endif #endif copybitmap(bitmap, state->m_bitmap[state->m_dest ^ 1], 0, 0, 0, 0, cliprect); return 0; }
UINT32 lastfght_state::screen_update_lastfght(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { #ifdef MAME_DEBUG #if 1 // gfx roms viewer (toggle with enter, use pgup/down to browse) int x, y, count = 0; UINT8 *gfxdata = memregion("gfx1")->base(); UINT8 data; if (machine().input().code_pressed_once(KEYCODE_ENTER)) m_view_roms ^= 1; if (m_view_roms) { if (machine().input().code_pressed_once(KEYCODE_PGDN)) m_base += 512 * 256; if (machine().input().code_pressed_once(KEYCODE_PGUP)) m_base -= 512 * 256; m_base %= memregion("gfx1")->bytes(); count = m_base; bitmap.fill(get_black_pen(machine()), cliprect ); for (y = 0 ; y < 256; y++) { for (x = 0; x < 512; x++) { data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(machine()) : gfxdata[count]; // white grid or data bitmap.pix16(y, x) = data; count++; } } popmessage("%x", m_base); return 0; } #endif #endif copybitmap(bitmap, m_bitmap[m_dest ^ 1], 0, 0, 0, 0, cliprect); return 0; }
void overlay_ingame_interface(int ogl) { int ta,tb; int xoff2,yoff2,destx,desty,xxx,yyy; get_screen_coordinates(&xoff2,&yoff2,&destx,&desty,&xxx,&yyy); /* print ingame message list */ update_arpro_cheats(); #ifdef HAS_CONSOLE update_scripts(); #endif if (!silent_hud) for(tb=0;tb<MSG_LIST_SIZE;tb++){ ta=tb+mbase; if(ta>=MSG_LIST_SIZE) ta-=MSG_LIST_SIZE; if(MsgList[ta].messagetime>0){ MsgList[ta].messagetime -= (INT32) skip_frame_count; #ifndef RAINE_DOS if (ogl) opengl_text(MsgList[ta].message,0,(((MSG_LIST_SIZE-1)-tb))); else #endif textout_fast(MsgList[ta].message,xoff2,(yoff2+yyy-8)-(((MSG_LIST_SIZE-1)-tb)<<3),get_white_pen()); } } /* print speed profile (fps) */ switch(raine_cfg.show_fps_mode){ case 0x00: // Show nothing break; case 0x01: // Show Accurate FPS (changes rapidly) ta = read_ingame_timer(); if((UINT32)ta >= timer_next_update){ // we have done 60 frames if (display_cfg.limit_speed) sprintf(fps_buff,"%02d/%g",render_frame_count-render_start_count,fps); // make message string else sprintf(fps_buff,"%02d",render_frame_count-render_start_count); // printf("%s timer %d start_count %d\n",fps_buff,ta,render_start_count); render_start_count = render_frame_count; // render count at start timer_next_update = ta + fps; // set time of next update } #ifndef RAINE_DOS if (ogl) opengl_text(fps_buff,-strlen(fps_buff),-1); else #endif textout_fast(fps_buff,xoff2+xxx-(strlen(fps_buff)*6),yoff2,get_white_pen()); break; case 0x02: // Show Average FPS (takes a while to adapt to changes) ta = read_ingame_timer(); if((UINT32)ta >= timer_next_update){ // we have done 60 frames if (display_cfg.limit_speed) sprintf(fps_buff,"Avg:%02d/%g",round(((render_frame_count-render_start_count)*1.0/(ta-timer_start_count))*fps),fps); else sprintf(fps_buff,"Avg:%02d",round(((render_frame_count-render_start_count)*1.0/(ta-timer_start_count))*fps)); timer_next_update = ta + fps; // set time of next update } #ifndef RAINE_DOS if (ogl) opengl_text(fps_buff,-strlen(fps_buff),-1); else #endif textout_fast(fps_buff,xoff2+xxx-(strlen(fps_buff)*6),yoff2,get_white_pen()); break; case 0x03: // Show Profile results (percent) for(ta=0;ta<PRO_COUNT;ta++){ sprintf(fps_buff,"%s: %2d%%",profile_results[ta].name, profile_results[ta].percent); #ifndef RAINE_DOS if (ogl) opengl_text(fps_buff,-10,-1-ta); else #endif textout_fast(fps_buff,xoff2+xxx-(10*6),yoff2+(ta*8),get_white_pen()); } break; case 0x04: // Show Profile results (cycles) for(ta=0;ta<PRO_COUNT;ta++){ sprintf(fps_buff,"%s: %6x",profile_results[ta].name, profile_results[ta].cycles); #ifndef RAINE_DOS if (ogl) opengl_text(fps_buff,-13,-1-ta); else #endif textout_fast(fps_buff,xoff2+xxx-(13*6),yoff2+(ta*8),get_white_pen()); } break; default: // Show nothing break; } /* print <paused> */ if((raine_cfg.req_pause_game) && (!(pause_time & 0x20))) { #ifndef RAINE_DOS if (ogl) opengl_text("<Paused>",-1000,-1000); else #endif textout_fast("<Paused>",xoff2+((xxx-(6*8))>>1),yoff2+((yyy-8)>>1),get_white_pen()); } }