int EmuFrame() { char map[12]={0,1,2,3,8,9,10,4,11,12,13,14}; // Joypads, format is UDLR BCAS ZYXM int a=0,input=0; // Set Megadrive buttons: for (a=0;a<12;a++) { int m=map[a]; if (m>=0) if (Inp.button[m]>30) input|=1<<a; } PicoPad[0]=input; frame++; PsndOut=(short *)DSoundNext; PicoFrame(); PsndOut=NULL; // rendermode2 if(PicoOpt&0x10) { unsigned short *pd=EmuScreen; unsigned char *ps=(unsigned char*)framebuff+328*8; unsigned short palHigh[0x40]; for(int i = 0; i < 0x40; i++) palHigh[i]=(unsigned short)PicoCram(Pico.cram[i]); for(int y=0; y < 224; y++) { ps+=8; for(int x=0; x < 320; x++) *pd++=palHigh[*ps++]; } } return 0; }
void SkipFrame(int do_sound) { PicoSkipFrame=1; PicoFrame(); PicoSkipFrame=0; if(do_sound && PsndOut) { PsndOut = gameAudio->NextFrameL(); if(!PsndOut) { // sound output problems? strcpy(noticeMsg, "SOUND@OUTPUT@ERROR;@SOUND@DISABLED"); gettimeofday(¬iceMsgTime, 0); } } /* int total=0; // V-Blanking period: if (Pico.video.reg[1]&0x20) SekInterrupt(6); // Set IRQ Pico.video.status|=0x88; // V-Int happened / go into vblank total+=SekRun(18560); // Active Scan: if (Pico.video.reg[1]&0x40) Pico.video.status&=~8; // Come out of vblank if display is enabled SekInterrupt(0); // Clear IRQ total+=SekRun(127969-total); */ }
void retro_run(void) { bool updated = false; int pad, i; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) update_variables(); input_poll_cb(); PicoPad[0] = PicoPad[1] = 0; for (pad = 0; pad < 2; pad++) for (i = 0; i < RETRO_PICO_MAP_LEN; i++) if (input_state_cb(pad, RETRO_DEVICE_JOYPAD, 0, i)) PicoPad[pad] |= retro_pico_map[i]; PicoFrame(); video_cb((short *)vout_buf + vout_offset, vout_width, vout_height, vout_width * 2); }
static void SkipFrame(void) { PicoSkipFrame=1; PicoFrame(); PicoSkipFrame=0; }