mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-27 04:54:22 +02:00
v106.222
Added port filter panel list Renamed ProgramWindow to Program
This commit is contained in:
20
amd64.c
20
amd64.c
@@ -129,10 +129,11 @@ cothread_t co_derive(void* memory, unsigned int size, void (*entrypoint)(void))
|
|||||||
if(!co_active_handle) co_active_handle = &co_active_buffer;
|
if(!co_active_handle) co_active_handle = &co_active_buffer;
|
||||||
|
|
||||||
if(handle = (cothread_t)memory) {
|
if(handle = (cothread_t)memory) {
|
||||||
long long *p = (long long*)((char*)handle + size); /* seek to top of stack */
|
unsigned int offset = (size & ~15) - 32;
|
||||||
*--p = (long long)crash; /* crash if entrypoint returns */
|
long long *p = (long long*)((char*)handle + offset); /* seek to top of stack */
|
||||||
*--p = (long long)entrypoint; /* start of function */
|
*--p = (long long)crash; /* crash if entrypoint returns */
|
||||||
*(long long*)handle = (long long)p; /* stack pointer */
|
*--p = (long long)entrypoint; /* start of function */
|
||||||
|
*(long long*)handle = (long long)p; /* stack pointer */
|
||||||
}
|
}
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
@@ -145,14 +146,13 @@ cothread_t co_create(unsigned int size, void (*entrypoint)(void)) {
|
|||||||
co_swap = (void (*)(cothread_t, cothread_t))co_swap_function;
|
co_swap = (void (*)(cothread_t, cothread_t))co_swap_function;
|
||||||
}
|
}
|
||||||
if(!co_active_handle) co_active_handle = &co_active_buffer;
|
if(!co_active_handle) co_active_handle = &co_active_buffer;
|
||||||
size += 512; /* allocate additional space for storage */
|
|
||||||
size &= ~15; /* align stack to 16-byte boundary */
|
|
||||||
|
|
||||||
if(handle = (cothread_t)malloc(size)) {
|
if(handle = (cothread_t)malloc(size)) {
|
||||||
long long *p = (long long*)((char*)handle + size); /* seek to top of stack */
|
unsigned int offset = (size & ~15) - 32;
|
||||||
*--p = (long long)crash; /* crash if entrypoint returns */
|
long long *p = (long long*)((char*)handle + offset); /* seek to top of stack */
|
||||||
*--p = (long long)entrypoint; /* start of function */
|
*--p = (long long)crash; /* crash if entrypoint returns */
|
||||||
*(long long*)handle = (long long)p; /* stack pointer */
|
*--p = (long long)entrypoint; /* start of function */
|
||||||
|
*(long long*)handle = (long long)p; /* stack pointer */
|
||||||
}
|
}
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
|
2
libco.h
2
libco.h
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
libco v19 (2019-02-18)
|
libco v20 (2019-10-14)
|
||||||
author: byuu
|
author: byuu
|
||||||
license: ISC
|
license: ISC
|
||||||
*/
|
*/
|
||||||
|
20
x86.c
20
x86.c
@@ -83,10 +83,11 @@ cothread_t co_derive(void* memory, unsigned int size, void (*entrypoint)(void))
|
|||||||
if(!co_active_handle) co_active_handle = &co_active_buffer;
|
if(!co_active_handle) co_active_handle = &co_active_buffer;
|
||||||
|
|
||||||
if(handle = (cothread_t)memory) {
|
if(handle = (cothread_t)memory) {
|
||||||
long *p = (long*)((char*)handle + size); /* seek to top of stack */
|
unsigned int offset = (size & ~15) - 32;
|
||||||
*--p = (long)crash; /* crash if entrypoint returns */
|
long *p = (long*)((char*)handle + offset); /* seek to top of stack */
|
||||||
*--p = (long)entrypoint; /* start of function */
|
*--p = (long)crash; /* crash if entrypoint returns */
|
||||||
*(long*)handle = (long)p; /* stack pointer */
|
*--p = (long)entrypoint; /* start of function */
|
||||||
|
*(long*)handle = (long)p; /* stack pointer */
|
||||||
}
|
}
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
@@ -99,14 +100,13 @@ cothread_t co_create(unsigned int size, void (*entrypoint)(void)) {
|
|||||||
co_swap = (void (fastcall*)(cothread_t, cothread_t))co_swap_function;
|
co_swap = (void (fastcall*)(cothread_t, cothread_t))co_swap_function;
|
||||||
}
|
}
|
||||||
if(!co_active_handle) co_active_handle = &co_active_buffer;
|
if(!co_active_handle) co_active_handle = &co_active_buffer;
|
||||||
size += 256; /* allocate additional space for storage */
|
|
||||||
size &= ~15; /* align stack to 16-byte boundary */
|
|
||||||
|
|
||||||
if(handle = (cothread_t)malloc(size)) {
|
if(handle = (cothread_t)malloc(size)) {
|
||||||
long *p = (long*)((char*)handle + size); /* seek to top of stack */
|
unsigned int offset = (size & ~15) - 32;
|
||||||
*--p = (long)crash; /* crash if entrypoint returns */
|
long *p = (long*)((char*)handle + offset); /* seek to top of stack */
|
||||||
*--p = (long)entrypoint; /* start of function */
|
*--p = (long)crash; /* crash if entrypoint returns */
|
||||||
*(long*)handle = (long)p; /* stack pointer */
|
*--p = (long)entrypoint; /* start of function */
|
||||||
|
*(long*)handle = (long)p; /* stack pointer */
|
||||||
}
|
}
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
|
Reference in New Issue
Block a user