mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-02 19:52:36 +02:00
v111.4
Serialization improvements.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -167,6 +168,20 @@ 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
|
||||
|
@@ -18,6 +18,9 @@ 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
|
||||
}
|
||||
|
Reference in New Issue
Block a user