|
1 | | -#ifndef EMUAPI_H |
2 | | -#define EMUAPI_H |
| 1 | +#pragma once |
3 | 2 |
|
4 | | -#include "platform_config.h" |
5 | | -#include "emucfg.h" |
| 3 | +#define PALETTE_SIZE 32 |
| 4 | +#define VID_FRAME_SKIP 0x0 |
6 | 5 |
|
7 | 6 | #define ACTION_NONE 0 |
8 | 7 | #define ACTION_RUN1 1 |
|
30 | 29 |
|
31 | 30 | #ifdef __cplusplus |
32 | 31 | extern "C" { |
33 | | -extern void emu_init(int hires=0); |
34 | | -extern void emu_start(int vblms, void * callback, int forcetimervsync=0); |
| 32 | +void sms_emu_init(); |
| 33 | +void emu_start(int vblms, void * callback, int forcetimervsync=0); |
35 | 34 | #endif |
36 | | -extern void emu_printf(const char * text); |
37 | | -extern void emu_printi(int val); |
38 | | -extern void emu_printh(int val); |
39 | 35 | void * emu_Malloc(unsigned int size); |
40 | | -extern void * emu_MallocI(unsigned int size); |
| 36 | +void * emu_MallocI(unsigned int size); |
41 | 37 | void emu_Free(void * pt); |
42 | | -extern void * emu_SMalloc(unsigned int size); |
43 | | -extern void emu_SFree(void * pt); |
44 | | - |
45 | | -extern int emu_FileOpen(const char * filepath, const char * mode); |
46 | | -extern int emu_FileRead(void * buf, int size, int handler); |
47 | | -extern int emu_FileWrite(void * buf, int size, int handler); |
48 | | -extern int emu_FileGetc(int handler); |
49 | | -extern int emu_FileSeek(int handler, int seek, int origin); |
50 | | -extern int emu_FileTell(int handler); |
51 | | -extern void emu_FileClose(int handler); |
52 | | - |
53 | | -extern unsigned int emu_FileSize(const char * filepath); |
54 | | -extern unsigned int emu_LoadFile(const char * filepath, void * buf, int size); |
55 | | -extern unsigned int emu_LoadFileSeek(const char * filepath, void * buf, int size, int seek); |
56 | | - |
57 | | -extern void emu_SetPaletteEntry(unsigned char r, unsigned char g, unsigned char b, int index); |
58 | | -extern void emu_DrawLinePal16(unsigned char * VBuf, int width, int height, int line); |
59 | | -extern void emu_DrawLine16(unsigned short * VBuf, int width, int height, int line); |
60 | | -extern void emu_DrawScreenPal16(unsigned char * VBuf, int width, int height, int stride); |
61 | | -extern void emu_DrawLine8(unsigned char * VBuf, int width, int height, int line); |
62 | | -extern void emu_DrawVsync(void); |
63 | | -extern int emu_FrameSkip(void); |
64 | | -extern int emu_IsVga(void); |
65 | | -extern int emu_IsVgaHires(void); |
66 | | - |
67 | | -extern int menuActive(void); |
68 | | -extern char * menuSelection(void); |
69 | | -extern char * menuSecondSelection(void); |
70 | | -extern void toggleMenu(int on); |
71 | | -extern int handleMenu(unsigned short bClick); |
72 | | - |
73 | | -extern int handleOSKB(void); |
74 | | -extern void toggleOSKB(int forceon); |
75 | | - |
76 | | -extern void emu_InitJoysticks(void); |
77 | | -extern int emu_SwapJoysticks(int statusOnly); |
78 | | -extern unsigned short emu_DebounceLocalKeys(void); |
79 | | -extern int emu_ReadKeys(void); |
80 | | -extern int emu_GetPad(void); |
81 | | -extern int emu_GetMouse(int *x, int *y, int *buts); |
82 | | -extern int emu_MouseDetected(void); |
83 | | -extern int emu_GetJoystick(void); |
84 | | -extern int emu_KeyboardDetected(void); |
85 | | -extern int emu_ReadAnalogJoyX(int min, int max); |
86 | | -extern int emu_ReadAnalogJoyY(int min, int max); |
87 | | -extern int emu_ReadI2CKeyboard(void); |
88 | | -extern unsigned char emu_ReadI2CKeyboard2(int row); |
89 | | -extern void emu_KeyboardOnUp(int keymodifer, int key); |
90 | | -extern void emu_KeyboardOnDown(int keymodifer, int key); |
91 | | -extern void emu_MidiOnDataReceived(unsigned char data); |
92 | | - |
93 | | -extern void emu_sndPlaySound(int chan, int volume, int freq); |
94 | | -extern void emu_sndPlayBuzz(int size, int val); |
95 | | -extern void emu_sndInit(); |
96 | | -extern void emu_resetus(void); |
97 | | -extern int emu_us(void); |
98 | | - |
99 | | -extern int emu_setKeymap(int index); |
| 38 | +void * emu_SMalloc(unsigned int size); |
| 39 | +void emu_SFree(void * pt); |
| 40 | + |
| 41 | +int emu_FileOpen(const char * filepath, const char * mode); |
| 42 | +int emu_FileRead(void * buf, int size, int handler); |
| 43 | +int emu_FileWrite(void * buf, int size, int handler); |
| 44 | +int emu_FileGetc(int handler); |
| 45 | +int emu_FileSeek(int handler, int seek, int origin); |
| 46 | +int emu_FileTell(int handler); |
| 47 | +void emu_FileClose(int handler); |
| 48 | + |
| 49 | +unsigned int emu_FileSize(const char * filepath); |
| 50 | +unsigned int emu_LoadFile(const char * filepath, void * buf, int size); |
| 51 | +unsigned int emu_LoadFileSeek(const char * filepath, void * buf, int size, int seek); |
| 52 | + |
| 53 | +void emu_SetPaletteEntry(unsigned char r, unsigned char g, unsigned char b, int index); |
| 54 | +void emu_DrawLinePal16(unsigned char * VBuf, int width, int height, int line); |
| 55 | +void emu_DrawLine16(unsigned short * VBuf, int width, int height, int line); |
| 56 | +void emu_DrawScreenPal16(unsigned char * VBuf, int width, int height, int stride); |
| 57 | +void emu_DrawLine8(unsigned char * VBuf, int width, int height, int line); |
| 58 | +void emu_DrawVsync(void); |
| 59 | +int emu_FrameSkip(void); |
| 60 | +int emu_IsVga(void); |
| 61 | +int emu_IsVgaHires(void); |
| 62 | + |
| 63 | +int menuActive(void); |
| 64 | +char * menuSelection(void); |
| 65 | +char * menuSecondSelection(void); |
| 66 | +void toggleMenu(int on); |
| 67 | +int handleMenu(unsigned short bClick); |
| 68 | + |
| 69 | +int handleOSKB(void); |
| 70 | +void toggleOSKB(int forceon); |
| 71 | + |
| 72 | +void emu_InitJoysticks(void); |
| 73 | +int emu_SwapJoysticks(int statusOnly); |
| 74 | +unsigned short emu_DebounceLocalKeys(void); |
| 75 | +int emu_ReadKeys(void); |
| 76 | +int emu_GetPad(void); |
| 77 | +int emu_GetMouse(int *x, int *y, int *buts); |
| 78 | +int emu_MouseDetected(void); |
| 79 | +int emu_GetJoystick(void); |
| 80 | +int emu_KeyboardDetected(void); |
| 81 | +int emu_ReadAnalogJoyX(int min, int max); |
| 82 | +int emu_ReadAnalogJoyY(int min, int max); |
| 83 | +int emu_ReadI2CKeyboard(void); |
| 84 | +unsigned char emu_ReadI2CKeyboard2(int row); |
| 85 | +void emu_KeyboardOnUp(int keymodifer, int key); |
| 86 | +void emu_KeyboardOnDown(int keymodifer, int key); |
| 87 | +void emu_MidiOnDataReceived(unsigned char data); |
| 88 | + |
| 89 | +void emu_sndPlaySound(int chan, int volume, int freq); |
| 90 | +void emu_sndPlayBuzz(int size, int val); |
| 91 | +void emu_sndInit(); |
| 92 | +void emu_resetus(void); |
| 93 | +int emu_us(void); |
| 94 | + |
| 95 | +int emu_setKeymap(int index); |
100 | 96 |
|
101 | 97 | #ifdef __cplusplus |
102 | 98 | } |
103 | 99 | #endif |
104 | 100 |
|
105 | | -#endif |
0 commit comments