Serialize SDD1 decompressor
Major speedup to nall/serializer [Alcaro]
Removed fast PPU tile cache (major speedup for run-ahead mode)
This commit is contained in:
byuu
2019-10-16 16:12:28 +09:00
parent 53f8de6ac3
commit 6b7e6e01bb
30 changed files with 262 additions and 167 deletions

View File

@@ -59,6 +59,10 @@ static void co_init() {
#endif
}
const char* co_method() {
return "aarch64";
}
cothread_t co_active() {
if(!co_active_handle) co_active_handle = &co_active_buffer;
return co_active_handle;
@@ -73,7 +77,8 @@ cothread_t co_derive(void* memory, unsigned int size, void (*entrypoint)(void))
if(!co_active_handle) co_active_handle = &co_active_buffer;
if(handle = (unsigned long*)memory) {
unsigned long* p = (unsigned long*)((unsigned char*)handle + size);
unsigned int offset = (size & ~15);
unsigned long* p = (unsigned long*)((unsigned char*)handle + offset);
handle[19] = (unsigned long)p; /* x29 (frame pointer) */
handle[20] = (unsigned long)p; /* x30 (stack pointer) */
handle[21] = (unsigned long)entrypoint; /* x31 (link register) */
@@ -83,23 +88,9 @@ cothread_t co_derive(void* memory, unsigned int size, void (*entrypoint)(void))
}
cothread_t co_create(unsigned int size, void (*entrypoint)(void)) {
unsigned long* handle;
if(!co_swap) {
co_init();
co_swap = (void (*)(cothread_t, cothread_t))co_swap_function;
}
if(!co_active_handle) co_active_handle = &co_active_buffer;
size += 256;
size &= ~15;
if(handle = (unsigned long*)malloc(size)) {
unsigned long* p = (unsigned long*)((unsigned char*)handle + size);
handle[19] = (unsigned long)p; /* x29 (frame pointer) */
handle[20] = (unsigned long)p; /* x30 (stack pointer) */
handle[21] = (unsigned long)entrypoint; /* x31 (link register) */
}
return handle;
void* memory = malloc(size);
if(!memory) return (cothread_t)0;
return co_derive(memory, size, entrypoint);
}
void co_delete(cothread_t handle) {