diff --git a/core/hw/aica/sgc_if.cpp b/core/hw/aica/sgc_if.cpp old mode 100644 new mode 100755 index c3d827214..db8587cd8 --- a/core/hw/aica/sgc_if.cpp +++ b/core/hw/aica/sgc_if.cpp @@ -17,6 +17,7 @@ #endif //Sound generation, mixin, and channel regs emulation +bool NoSound = false; // global switch to kill sound (and some of the cpu part of it) //x.15 s32 volume_lut[16]; @@ -1180,7 +1181,6 @@ void AICA_Sample32() { return; } - memset(mxlr,0,sizeof(mxlr)); //Generate 32 samples for each channel, before moving to next channel @@ -1288,8 +1288,7 @@ void AICA_Sample32() pl=mixl; pr=mixr; - - WriteSample(mixr,mixl); + if (!NoSound) WriteSample(mixr,mixl); } } @@ -1334,6 +1333,11 @@ void AICA_Sample() VOLPAN( (*(s16*)&DSPData->EFREG[i]) ,dsp_out_vol[i].EFSDL,dsp_out_vol[i].EFPAN,mixl,mixr); } } + + if (NoSound) + { + return; + } //Mono ! if (CommonData->Mono) diff --git a/core/hw/pvr/Renderer_if.cpp b/core/hw/pvr/Renderer_if.cpp index 4a00485c1..5213052f3 100755 --- a/core/hw/pvr/Renderer_if.cpp +++ b/core/hw/pvr/Renderer_if.cpp @@ -14,20 +14,14 @@ int max_idx,max_mvo,max_op,max_pt,max_tr,max_vtx,max_modt, ovrn; TA_context* _pvrrc; void SetREP(TA_context* cntx); -int frameskip; +int frameskip=0; +bool FrameSkipping=false; // global switch to enable/disable frameskip bool rend_single_frame() { //wait render start only if no frame pending _pvrrc = DequeueRender(); -/* if (_pvrrc) { - if (!pvrrc.isRTT) { - frameskip++; - if (frameskip>4) frameskip = 0; - } - } else frameskip = 0;*/ - while (!_pvrrc) { rs.Wait(); @@ -36,10 +30,10 @@ bool rend_single_frame() bool do_swp=false; - if (!pvrrc.isRTT) { - frameskip=1-frameskip; - //frameskip=(frameskip+1)%3; - } +/* if (FrameSkipping) + if (!pvrrc.isRTT) { + frameskip=1-frameskip; + } else frameskip=0;*/ if (!frameskip || pvrrc.isRTT) @@ -116,6 +110,10 @@ void rend_start_render() if (ctx) { + if (FrameSkipping && frameskip) { + frameskip=1-frameskip; + tactx_Recycle(ctx); + } else if (!ctx->rend.Overrun) { //printf("REP: %.2f ms\n",render_end_pending_cycles/200000.0); diff --git a/core/hw/pvr/spg.cpp b/core/hw/pvr/spg.cpp old mode 100644 new mode 100755 index 0301fe6a6..6ef69e927 --- a/core/hw/pvr/spg.cpp +++ b/core/hw/pvr/spg.cpp @@ -179,12 +179,18 @@ int spg_line_sched(int tag, int cycl, int jit) full_rps=(spd_fps+fskip/ts); + #ifdef TARGET_PANDORA + sprintf(fpsStr,"CPU: %4.2f V: %4.2f (%s%s%4.2f) R: %4.2f+%4.2f", + spd_cpu*100/200,spd_vbs, + mode,res,fullvbs, + spd_fps,fskip/ts); + #else sprintf(fpsStr,"%s/%c - %4.2f (%4.2f) - %4.2f - V: %4.2f (%.2f, %s%s%4.2f) R: %4.2f+%4.2f VTX: %4.2f%c", VER_SHORTNAME,'n',mspdf,speed_load_mspdf,spd_cpu*100/200,spd_vbs, spd_vbs/full_rps,mode,res,fullvbs, spd_fps,fskip/ts ,mv,mv_c); - + #endif fskip=0; os_SetWindowText(fpsStr); diff --git a/core/oslib/audiostream.cpp b/core/oslib/audiostream.cpp old mode 100644 new mode 100755 diff --git a/core/oslib/oslib.h b/core/oslib/oslib.h old mode 100644 new mode 100755 diff --git a/core/rend/gles/gldraw.cpp b/core/rend/gles/gldraw.cpp old mode 100644 new mode 100755 index 1294e1346..ae90fb646 --- a/core/rend/gles/gldraw.cpp +++ b/core/rend/gles/gldraw.cpp @@ -747,7 +747,9 @@ void GenSorted() glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gl.vbo.idxs2); glCheck(); glBufferData(GL_ELEMENT_ARRAY_BUFFER,vidx_sort.size()*2,&vidx_sort[0],GL_STREAM_DRAW); +#if PRINT_SORT_STATS if (tess_gen) printf("Generated %.2fK Triangles !\n",tess_gen/1000.0); +#endif } } diff --git a/core/rend/gles/gles.cpp b/core/rend/gles/gles.cpp index 23d86d7c8..809d1589d 100755 --- a/core/rend/gles/gles.cpp +++ b/core/rend/gles/gles.cpp @@ -610,6 +610,9 @@ bool CompilePipelineShader( PipelineShader* s) } GLuint osd_tex; +#ifdef TARGET_PANDORA +GLuint osd_font; +#endif bool gl_create_resources() { @@ -686,6 +689,9 @@ bool gl_create_resources() int w, h; osd_tex=loadPNG(GetPath("/data/buttons.png"),w,h); + #ifdef TARGET_PANDORA + osd_font=loadPNG(GetPath("/font2.png"),w,h); + #endif return true; } @@ -898,11 +904,120 @@ static void ClearBG() void DrawButton2(float* xy, bool state) { DrawButton(xy,state?0:255); } +#ifdef TARGET_PANDORA +static void DrawCenteredText(float yy, float scale, int transparency, const char* text) +// Draw a centered text. Font is loaded from font2.png file. Each char is 16*16 size, so scale it down so it's not too big +// Transparency 255=opaque, 0=not visible +{ + Vertex vtx; + + vtx.z=1; + + float w=float(strlen(text)*14)*scale; + + float x=320-w/2.0f; + float y=yy; + float h=16.0f*scale; + w=14.0f*scale; + float step=32.0f/512.0f; + float step2=4.0f/512.0f; + + if (transparency<0) transparency=0; + if (transparency>255) transparency=255; + + for (int i=0; i255) transparency=255; + + for (int i=0; i127) j=127; + JSensitivity[128-i]=-j; + JSensitivity[128+i]=j; + } + #endif SDL_ShowCursor( 0 ); if (SDL_WM_GrabInput( SDL_GRAB_ON ) != SDL_GRAB_ON) @@ -167,6 +186,11 @@ void SetupInput() } +extern char OSD_Info[128]; +extern int OSD_Delay; +extern char OSD_Counters[256]; +extern int OSD_Counter; + bool HandleEvents(u32 port) { static int keys[13]; @@ -174,6 +198,7 @@ bool HandleEvents(u32 port) { SDL_Event event; int k, value; int xx, yy; + char *num_mode[] = {"Off", "Up/Down => RT/LT", "Left/Right => LT/RT", "U/D/L/R => A/B/X/Y"}; while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_QUIT: @@ -201,8 +226,11 @@ bool HandleEvents(u32 port) { case SDLK_RCTRL: keys[10]=value; break; case SDLK_LALT: keys[12]=value; break; case SDLK_k: if (value) KillTex=true; break; - case SDLK_n: if (value) mouse_use=(mouse_use+1)%4; printf("Nub mode %i\n", mouse_use); break; //*TODO* Do some feedback on OSD - #else + case SDLK_n: if (value) {mouse_use=(mouse_use+1)%4; snprintf(OSD_Info, 128, "Right Nub mode: %s\n", num_mode[mouse_use]); OSD_Delay=300;}; break; + case SDLK_f: if (value) {FrameSkipping=!FrameSkipping; snprintf(OSD_Info, 128, "FrameSkipping %s\n", (FrameSkipping)?"On":"Off"); OSD_Delay=300;};break; + case SDLK_s: if (value) {NoSound=!NoSound; snprintf(OSD_Info, 128, "Sound %s\n", (NoSound)?"Off":"On"); OSD_Delay=300;};break; + case SDLK_c: if (value) {OSD_Counter=1-OSD_Counter;};break; + #else #error *TODO* #endif } @@ -245,6 +273,9 @@ bool HandleEvents(u32 port) { //printf("AXIS %d,%d\n",JE.number,JE.value); s8 v=(s8)(value/256); //-127 ... + 127 range + #ifdef TARGET_PANDORA + v=JSensitivity[128+v]; + #endif if (mt==0) { @@ -358,7 +389,12 @@ void os_DoEvents() void os_SetWindowText(const char * text) { + #ifndef TARGET_PANDORA SDL_WM_SetCaption(text, NULL); // *TODO* Set Icon also... + #endif + #ifdef TARGET_PANDORA + strncpy(OSD_Counters, text, 256); + #endif } @@ -461,6 +497,7 @@ int main(int argc, wchar* argv[]) printf("common linux setup done\n"); settings.profile.run_counts=0; + FrameSkipping=true; dc_init(argc,argv); diff --git a/shell/pandora/Makefile b/shell/pandora/Makefile index f2de26a01..a64403cd2 100755 --- a/shell/pandora/Makefile +++ b/shell/pandora/Makefile @@ -6,12 +6,21 @@ FOR_PANDORA :=1 USE_SDL :=1 USE_OSS :=1 +USE_CCACHE :=1 + +#PGO_MAKE :=1 +PGO_USE :=1 + RZDCY_SRC_DIR = ../../core include $(RZDCY_SRC_DIR)/core.mk CC_PREFIX ?= +ifdef USE_CCACHE + CC_PREFIX =ccache ${CC_PREFIX} +endif + CXX=${CC_PREFIX}g++ CC=${CC_PREFIX}gcc AS=${CC_PREFIX}as diff --git a/shell/pandora/font2.png b/shell/pandora/font2.png new file mode 100755 index 000000000..09c8bef60 Binary files /dev/null and b/shell/pandora/font2.png differ