snes-print messages from libsnes. now you can see which dsp/firmware dependency it detected for the game (it has its own heuristics, not necessarily any need for gamedb yet). still not loading the firmwares though
This commit is contained in:
parent
00f9e05d5e
commit
6c8177a08b
|
@ -112,6 +112,23 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES
|
||||||
[DllImport("libsneshawk.dll", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport("libsneshawk.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern bool snes_unserialize(IntPtr data, int size);
|
public static extern bool snes_unserialize(IntPtr data, int size);
|
||||||
|
|
||||||
|
[DllImport("libsneshawk.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern int snes_poll_message();
|
||||||
|
|
||||||
|
[DllImport("libsneshawk.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void snes_dequeue_message(IntPtr strBuffer);
|
||||||
|
|
||||||
|
public static bool HasMessage { get { return snes_poll_message() != -1; } }
|
||||||
|
|
||||||
|
public static string DequeueMessage()
|
||||||
|
{
|
||||||
|
int len = snes_poll_message();
|
||||||
|
sbyte* temp = stackalloc sbyte[len + 1];
|
||||||
|
temp[len] = 0;
|
||||||
|
snes_dequeue_message(new IntPtr(temp));
|
||||||
|
return new string(temp);
|
||||||
|
}
|
||||||
|
|
||||||
[DllImport("libsneshawk.dll", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport("libsneshawk.dll", CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void snes_set_layer_enable(int layer, int priority,
|
public static extern void snes_set_layer_enable(int layer, int priority,
|
||||||
[MarshalAs(UnmanagedType.U1)]
|
[MarshalAs(UnmanagedType.U1)]
|
||||||
|
@ -482,6 +499,9 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES
|
||||||
timeFrameCounter++;
|
timeFrameCounter++;
|
||||||
LibsnesDll.snes_run();
|
LibsnesDll.snes_run();
|
||||||
|
|
||||||
|
while (LibsnesDll.HasMessage)
|
||||||
|
Console.WriteLine(LibsnesDll.DequeueMessage());
|
||||||
|
|
||||||
if (IsLagFrame)
|
if (IsLagFrame)
|
||||||
LagCount++;
|
LagCount++;
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -1 +1,2 @@
|
||||||
rm bsnes/obj/*.o
|
rm -r bsnes/obj
|
||||||
|
rm -r bsnes/out
|
|
@ -1,6 +1,8 @@
|
||||||
cd bsnes
|
cd bsnes
|
||||||
|
mkdir obj
|
||||||
|
mkdir out
|
||||||
export BIZWINCFLAGS="-I. -O3 -masm=intel -DLIBCO_IMPORT -DLIBCO_MSVC -static-libgcc -static-libstdc++"
|
export BIZWINCFLAGS="-I. -O3 -masm=intel -DLIBCO_IMPORT -DLIBCO_MSVC -static-libgcc -static-libstdc++"
|
||||||
export TARGET_LIBSNES_LIBDEPS="-L ../libco_msvc_win32/release/ -llibco_msvc_win32 -static-libgcc -static-libstdc++"
|
export TARGET_LIBSNES_LIBDEPS="-L ../libco_msvc_win32/release/ -llibco_msvc_win32 -static-libgcc -static-libstdc++"
|
||||||
profile=compatibility platform=win target=libsnes make -e -j
|
profile=compatibility platform=win target=libsnes make -e
|
||||||
cd ..
|
cd ..
|
||||||
cp bsnes/out/snes.dll ../BizHawk.MultiClient/output/libsneshawk.dll
|
cp bsnes/out/snes.dll ../BizHawk.MultiClient/output/libsneshawk.dll
|
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
#include <nall/snes/cartridge.hpp>
|
#include <nall/snes/cartridge.hpp>
|
||||||
#include <nall/gameboy/cartridge.hpp>
|
#include <nall/gameboy/cartridge.hpp>
|
||||||
|
|
||||||
|
#include <queue>
|
||||||
|
|
||||||
using namespace nall;
|
using namespace nall;
|
||||||
|
|
||||||
struct Interface : public SNES::Interface {
|
struct Interface : public SNES::Interface {
|
||||||
|
@ -18,6 +21,9 @@ struct Interface : public SNES::Interface {
|
||||||
//zero 11-sep-2012
|
//zero 11-sep-2012
|
||||||
time_t randomSeed() { return 0; }
|
time_t randomSeed() { return 0; }
|
||||||
|
|
||||||
|
//zero 26-sep-2012
|
||||||
|
std::queue<nall::string> messages;
|
||||||
|
|
||||||
void videoRefresh(const uint32_t *data, bool hires, bool interlace, bool overscan) {
|
void videoRefresh(const uint32_t *data, bool hires, bool interlace, bool overscan) {
|
||||||
unsigned width = hires ? 512 : 256;
|
unsigned width = hires ? 512 : 256;
|
||||||
unsigned height = overscan ? 239 : 224;
|
unsigned height = overscan ? 239 : 224;
|
||||||
|
@ -58,7 +64,7 @@ struct Interface : public SNES::Interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
void message(const string &text) {
|
void message(const string &text) {
|
||||||
print(text, "\n");
|
messages.push(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
string path(SNES::Cartridge::Slot slot, const string &hint) {
|
string path(SNES::Cartridge::Slot slot, const string &hint) {
|
||||||
|
@ -510,3 +516,14 @@ unsigned snes_get_memory_size(unsigned id) {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int snes_poll_message()
|
||||||
|
{
|
||||||
|
if(interface.messages.size() == 0) return -1;
|
||||||
|
return interface.messages.front().length();
|
||||||
|
}
|
||||||
|
void snes_dequeue_message(char* buffer)
|
||||||
|
{
|
||||||
|
int len = interface.messages.front().length();
|
||||||
|
memcpy(buffer,(const char*)interface.messages.front(),len);
|
||||||
|
interface.messages.pop();
|
||||||
|
}
|
|
@ -135,6 +135,10 @@ bool snes_check_cartridge(const uint8_t *rom_data, unsigned rom_size);
|
||||||
void snes_set_layer_enable(int layer, int priority, bool enable);
|
void snes_set_layer_enable(int layer, int priority, bool enable);
|
||||||
typedef void (*snes_scanlineStart_t)(int);
|
typedef void (*snes_scanlineStart_t)(int);
|
||||||
void snes_set_scanlineStart(snes_scanlineStart_t);
|
void snes_set_scanlineStart(snes_scanlineStart_t);
|
||||||
|
//returns -1 if no messages, messagelength if there is one
|
||||||
|
int snes_poll_message();
|
||||||
|
//give us a buffer of messagelength and we'll dequeue a message into it. you better take care of the null pointer
|
||||||
|
void snes_dequeue_message(char* buffer);
|
||||||
|
|
||||||
//$2105
|
//$2105
|
||||||
#define SNES_REG_BG_MODE 0
|
#define SNES_REG_BG_MODE 0
|
||||||
|
|
Loading…
Reference in New Issue