void retro_run(void) { int i; bool updated = false; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) check_variables(); input_poll_cb(); for (i=0; i < 130; i++) KBD_RES(i); for (i=0; i < sizeof(keymap)/sizeof(keymap_t); i++) if (input_state_cb(0, RETRO_DEVICE_KEYBOARD, 0, keymap[i].retro)) KBD_SET(keymap[i].fmsx); joystate = 0; for (i = 0; i < sizeof(joymap) / sizeof(keymap_t); i++) { if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, joymap[i].retro)) { if (i < joy_keyboard_begin) JOY_SET(joymap[i].fmsx); else KBD_SET(joymap[i].fmsx); } } RETRO_PERFORMANCE_INIT(core_retro_run); RETRO_PERFORMANCE_START(core_retro_run); RunZ80(&CPU); RenderAndPlayAudio(SND_RATE / 60); RETRO_PERFORMANCE_STOP(core_retro_run); fflush(stdout); #ifdef PSP static unsigned int __attribute__((aligned(16))) d_list[32]; void* const texture_vram_p = (void*) (0x44200000 - (640 * 480)); // max VRAM address - frame size sceKernelDcacheWritebackRange(XBuf, 256*240 ); sceGuStart(GU_DIRECT, d_list); sceGuCopyImage(GU_PSM_5650, 0, 0, image_buffer_width, image_buffer_height, image_buffer_width, image_buffer, 0, 0, image_buffer_width, texture_vram_p); sceGuTexSync(); sceGuTexImage(0, 512, 256, image_buffer_width, texture_vram_p); sceGuTexMode(GU_PSM_5650, 0, 0, GU_FALSE); sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB); sceGuDisable(GU_BLEND); sceGuFinish(); video_cb(texture_vram_p, image_buffer_width, image_buffer_height, image_buffer_width * sizeof(uint16_t)); #else video_cb(image_buffer, image_buffer_width, image_buffer_height, image_buffer_width * sizeof(uint16_t)); #endif }
void cal_maratz80_run(cal_cpu cpu) { RunZ80(cpu->data.d_maratz80); }