Save state improvements.
This commit is contained in:
byuu 2019-10-09 00:48:59 +09:00
parent d8bc2050be
commit 3fb7ff6bfe
5 changed files with 3 additions and 29 deletions

View File

@ -48,10 +48,7 @@ namespace SameBoy {
}
auto ICD::synchronizeCPU() -> void {
if(clock >= 0) {
scheduler.desynchronize();
co_switch(cpu.thread);
}
if(clock >= 0) scheduler.resume(cpu.thread);
}
auto ICD::Enter() -> void {

View File

@ -12,10 +12,7 @@ namespace SuperFamicom {
SA1 sa1;
auto SA1::synchronizeCPU() -> void {
if(clock >= 0) {
scheduler.desynchronize();
co_switch(cpu.thread);
}
if(clock >= 0) scheduler.resume(cpu.thread);
}
auto SA1::Enter() -> void {

View File

@ -9,10 +9,7 @@ SMP smp;
#include "serialization.cpp"
auto SMP::synchronizeCPU() -> void {
if(clock >= 0) {
scheduler.desynchronize();
co_switch(cpu.thread);
}
if(clock >= 0) scheduler.resume(cpu.thread);
}
auto SMP::synchronizeDSP() -> void {

View File

@ -168,20 +168,6 @@ void co_switch(cothread_t handle) {
co_swap(co_active_handle = handle, co_previous_handle);
}
unsigned int co_size(unsigned int size) {
size += 512;
size &= ~15;
return size;
}
void co_save(cothread_t handle, void* memory, unsigned int size) {
memcpy(memory, handle, size);
}
void co_load(cothread_t handle, const void* memory, unsigned int size) {
memcpy(handle, memory, size);
}
#ifdef __cplusplus
}
#endif

View File

@ -18,9 +18,6 @@ cothread_t co_derive(void*, unsigned int, void (*)(void));
cothread_t co_create(unsigned int, void (*)(void));
void co_delete(cothread_t);
void co_switch(cothread_t);
unsigned int co_size(unsigned int);
void co_save(cothread_t, void*, unsigned int);
void co_load(cothread_t, const void*, unsigned int);
#ifdef __cplusplus
}