Mercurial > repos > blastem
comparison sms.c @ 2600:251cc75574af
Basic emscripten support
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 13 Feb 2025 02:18:30 -0800 |
parents | 99e59fdddbc3 |
children | c768bbd912f1 |
comparison
equal
deleted
inserted
replaced
2599:ca8141c2d6ba | 2600:251cc75574af |
---|---|
1097 | 1097 |
1098 static void run_sms(system_header *system) | 1098 static void run_sms(system_header *system) |
1099 { | 1099 { |
1100 sms_context *sms = (sms_context *)system; | 1100 sms_context *sms = (sms_context *)system; |
1101 uint32_t target_cycle = sms->z80->Z80_CYCLE + 3420*16; | 1101 uint32_t target_cycle = sms->z80->Z80_CYCLE + 3420*16; |
1102 //TODO: PAL support | |
1103 if (sms->vdp->type == VDP_GAMEGEAR) { | |
1104 render_set_video_standard(VID_GAMEGEAR); | |
1105 } else { | |
1106 render_set_video_standard(VID_NTSC); | |
1107 } | |
1108 while (!sms->should_return) | 1102 while (!sms->should_return) |
1109 { | 1103 { |
1110 if (system->delayed_load_slot) { | 1104 if (system->delayed_load_slot) { |
1111 load_state(system, system->delayed_load_slot - 1); | 1105 load_state(system, system->delayed_load_slot - 1); |
1112 system->delayed_load_slot = 0; | 1106 system->delayed_load_slot = 0; |
1212 static void resume_sms(system_header *system) | 1206 static void resume_sms(system_header *system) |
1213 { | 1207 { |
1214 sms_context *sms = (sms_context *)system; | 1208 sms_context *sms = (sms_context *)system; |
1215 if (sms->header.force_release || render_should_release_on_exit()) { | 1209 if (sms->header.force_release || render_should_release_on_exit()) { |
1216 sms->header.force_release = 0; | 1210 sms->header.force_release = 0; |
1211 //TODO: PAL support | |
1212 if (sms->vdp->type == VDP_GAMEGEAR) { | |
1213 render_set_video_standard(VID_GAMEGEAR); | |
1214 } else { | |
1215 render_set_video_standard(VID_NTSC); | |
1216 } | |
1217 bindings_reacquire_capture(); | 1217 bindings_reacquire_capture(); |
1218 vdp_reacquire_framebuffer(sms->vdp); | 1218 vdp_reacquire_framebuffer(sms->vdp); |
1219 render_resume_source(sms->psg->audio); | 1219 render_resume_source(sms->psg->audio); |
1220 } | 1220 } |
1221 run_sms(system); | 1221 run_sms(system); |
1237 #ifndef IS_LIB | 1237 #ifndef IS_LIB |
1238 zinsert_breakpoint(sms->z80, sms->z80->pc, (uint8_t *)zdebugger); | 1238 zinsert_breakpoint(sms->z80, sms->z80->pc, (uint8_t *)zdebugger); |
1239 #endif | 1239 #endif |
1240 } | 1240 } |
1241 | 1241 |
1242 //TODO: PAL support | |
1243 if (sms->vdp->type == VDP_GAMEGEAR) { | |
1244 render_set_video_standard(VID_GAMEGEAR); | |
1245 } else { | |
1246 render_set_video_standard(VID_NTSC); | |
1247 } | |
1242 run_sms(system); | 1248 run_sms(system); |
1243 } | 1249 } |
1244 | 1250 |
1245 static void soft_reset(system_header *system) | 1251 static void soft_reset(system_header *system) |
1246 { | 1252 { |