-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
96 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule musyx
updated
5 files
+6 −1 | include/musyx/assert.h | |
+1 −0 | include/musyx/hardware.h | |
+4 −4 | include/musyx/stream.h | |
+7 −6 | src/musyx/runtime/stream.c | |
+79 −23 | src/musyx/runtime/synthmacros.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef _MODWRAPPER_H_ | ||
#define _MODWRAPPER_H_ | ||
|
||
#include "types.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
void _prolog(); | ||
void _epilog(); | ||
void _unresolved(); | ||
|
||
// User functions | ||
void ksNesInitModule(void); | ||
|
||
#ifdef __MWERKS__ | ||
#define REL_EXPORT __declspec(export) | ||
#else | ||
#define REL_EXPORT | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // _MODWRAPPER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include "NESemu/modwrapper.h" | ||
#include "dolphin/os.h" | ||
|
||
typedef void (*voidfunctionptr)(void); // pointer to function returning void | ||
__declspec(section ".init") extern voidfunctionptr _ctors[]; | ||
__declspec(section ".init") extern voidfunctionptr _dtors[]; | ||
|
||
REL_EXPORT asm void _prolog(void) { | ||
fralloc | ||
lis r3, _ctors@ha | ||
addi r0, r3, _ctors@l | ||
mr r31, r0 | ||
b @2 | ||
@1: | ||
mtctr r12 | ||
bctrl | ||
addi r31, r31, 0x4 | ||
@2: | ||
lwz r12, 0x0(r31) | ||
cmplwi r12, 0x0 | ||
bne+ @1 | ||
|
||
bl ksNesInitModule | ||
|
||
frfree | ||
blr | ||
} | ||
|
||
REL_EXPORT asm void _epilog(void) { | ||
fralloc | ||
lis r3, _dtors@ha | ||
addi r0, r3, _dtors@l | ||
mr r31, r0 | ||
b @2 | ||
@1: | ||
mtctr r12 | ||
bctrl | ||
addi r31, r31, sizeof(voidfunctionptr) | ||
@2: | ||
lwz r12, 0x0(r31) | ||
cmplwi r12, 0x0 | ||
bne+ @1 | ||
|
||
frfree | ||
blr | ||
} | ||
|
||
REL_EXPORT void _unresolved(void) { OSPanic("modwrapper.c\0\0\0", 0x3d, "ksNesEmulator unresolved"); } |