kopia lustrzana https://github.com/Jean-MarcHarvengt/MCUME
updated SNES emu
rodzic
3d81535d1e
commit
bb3ec50b4b
|
@ -11,23 +11,23 @@ extern "C" {
|
|||
#include "tft_t_dma.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAS_USBKEY
|
||||
#ifdef HAS_USB
|
||||
#include "USBHost_t36.h" // Read this header first for key info
|
||||
USBHost myusb;
|
||||
USBHub hub1(myusb);
|
||||
#ifdef HAS_USBKEY
|
||||
KeyboardController keyboard1(myusb);
|
||||
USBHIDParser hid1(myusb);
|
||||
MouseController mouse1(myusb);
|
||||
#endif
|
||||
#ifdef HAS_USBMIDI
|
||||
MIDIDevice midi1(myusb);
|
||||
#endif
|
||||
#ifdef HAS_USBJOY
|
||||
#include "USBHost_t36.h" // Read this header first for key info
|
||||
USBHost myusb;
|
||||
USBHub hub1(myusb);
|
||||
USBHIDParser hid1(myusb);
|
||||
#define COUNT_JOYSTICKS 4
|
||||
JoystickController joysticks[COUNT_JOYSTICKS](myusb);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static bool emu_writeConfig(void);
|
||||
static bool emu_readConfig(void);
|
||||
|
@ -166,7 +166,7 @@ void emu_Free(void * pt)
|
|||
free(pt);
|
||||
}
|
||||
|
||||
#define SMEMPOOL (0x800000) //(0x400000+400000)
|
||||
#define SMEMPOOL (0x800000)
|
||||
EXTMEM static unsigned char slowmem[SMEMPOOL];
|
||||
static int slowmempt = 0;
|
||||
|
||||
|
@ -661,7 +661,6 @@ int emu_GetMouse(int *x, int *y, int *buts) {
|
|||
|
||||
int emu_GetJoystick(void) {
|
||||
#ifdef HAS_USBJOY
|
||||
//myusb.Task();
|
||||
for (int joystick_index = 0; joystick_index < COUNT_JOYSTICKS; joystick_index++) {
|
||||
if (joysticks[joystick_index].available()) {
|
||||
uint64_t axis_mask = joysticks[joystick_index].axisMask();
|
||||
|
@ -820,7 +819,7 @@ int emu_KeyboardDetected(void) {
|
|||
return (keyboardDetected?1:0);
|
||||
}
|
||||
|
||||
#ifdef HAS_USBKEY
|
||||
#ifdef HAS_USBMIDI
|
||||
static unsigned char midiBuffer[16];
|
||||
static unsigned char midiLastCmd=0;
|
||||
static int midiDataCnt=0;
|
||||
|
@ -828,8 +827,7 @@ static int midiCmdNbParam=0;
|
|||
#endif
|
||||
|
||||
void emu_MidiOnDataReceived(unsigned char value) {
|
||||
|
||||
#ifdef HAS_USBKEY
|
||||
#ifdef HAS_USBMIDI
|
||||
//Serial.println(value, HEX);
|
||||
//10000000 = 128 = note off
|
||||
//10010000 = 144 = note on
|
||||
|
@ -1736,13 +1734,12 @@ void emu_init(void)
|
|||
{
|
||||
Serial.begin(115200);
|
||||
|
||||
#ifdef HAS_USBKEY
|
||||
#ifdef HAS_USB
|
||||
myusb.begin();
|
||||
#ifdef HAS_USBKEY
|
||||
keyboard1.attachPress(OnPress);
|
||||
keyboard1.attachRelease(OnRelease);
|
||||
#endif
|
||||
#ifdef HAS_USBJOY
|
||||
myusb.begin();
|
||||
#endif
|
||||
|
||||
while (!SD.begin(SD_CS))
|
||||
|
|
|
@ -5,11 +5,13 @@
|
|||
|
||||
#ifdef TEECOMPUTER
|
||||
//#define ILI9341 1
|
||||
//#define ST7789 1
|
||||
//#define TFTSPI1 1
|
||||
#define HAS_T4_VGA 1
|
||||
#define ST7789 1
|
||||
#define TFTSPI1 1
|
||||
//#define HAS_T4_VGA 1
|
||||
#define HAS_SND 1
|
||||
#define HAS_USB 1
|
||||
//#define HAS_USBKEY 1
|
||||
//#define HAS_USBMIDI 1
|
||||
//#define HAS_USBJOY 1 // not working yet
|
||||
//#define INVX 1
|
||||
#define PT8211 1
|
||||
|
|
|
@ -59,7 +59,7 @@ void s9x_init(void) {
|
|||
|
||||
Settings.SixteenBitSound = true;
|
||||
Settings.ReverseStereo = false;
|
||||
Settings.PAL = false;
|
||||
Settings.PAL = true; //false;
|
||||
|
||||
if (!S9xMemoryInit())
|
||||
emu_printf("Memory init failed!");
|
||||
|
@ -67,7 +67,7 @@ void s9x_init(void) {
|
|||
if (!S9xInitAPU())
|
||||
emu_printf("APU init failed!");
|
||||
|
||||
if (!S9xInitSound(40,0))
|
||||
if (!S9xInitSound(40,2))
|
||||
emu_printf("Sound init failed!");
|
||||
|
||||
if (!S9xGraphicsInit())
|
||||
|
|
|
@ -161,7 +161,7 @@ void loop(void)
|
|||
tft.fillScreenNoDma( RGBVAL16(0x00,0x00,0x00) );
|
||||
tft.startDMA();
|
||||
emu_Init(filename);
|
||||
myTimer.begin(vblCount, 16666); //to run every 20ms
|
||||
myTimer.begin(vblCount, 20000); //to run every 20ms
|
||||
}
|
||||
delay(20);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue