#include "log.h"
#include "version.h"
#include "memory.h"
-//#include "../star026c/starcpu.h"
-#include "m68k.h" // Musashi! Not StarCrap! (Why are you afraid to show us the source, Neill? :-)
+#include "m68k.h"
#include "tom.h"
#include "jerry.h"
#include "gpu.h"
#include "clock.h"
#include "anajoy.h"
#include "joystick.h"
-#include "pcm.h"
+#include "dac.h"
#include "jagdasm.h"
#include "dsnd.h"
#include "cdrom.h"
extern uint32 jaguar_mainRom_crc32;
extern char * jaguar_eeproms_path;
-#ifdef __PORT__
-void jaguar_init(const char * filename);
-#else
+//#ifdef __PORT__
+//void jaguar_init(const char * filename);
+//#else
void jaguar_init(void);
-#endif // #ifdef __PORT__
+//#endif // #ifdef __PORT__
void jaguar_reset(void);
void jaguar_reset_handler(void);
void jaguar_done(void);
-void jaguar_exec(int16 * backbuffer, uint8 render);
+void jaguar_exec(int16 * backbuffer, bool render);
unsigned jaguar_byte_read(unsigned int offset);
unsigned jaguar_word_read(unsigned int offset);
unsigned jaguar_long_read(unsigned int offset);
uint32 jaguar_interrupt_handler_is_valid(uint32 i);
void jaguar_dasm(uint32 offset, uint32 qt);
-//Temp debug stuff
+//New stuff...
+void JaguarExecute(int16 * backbuffer, bool render);
+
+// Some handy macros to help converting native endian to big endian (jaguar native)
+// & vice versa
+
+#define SET32(r, a, v) r[(a)] = ((v) & 0xFF000000) >> 24, r[(a)+1] = ((v) & 0x00FF0000) >> 16, \
+ r[(a)+2] = ((v) & 0x0000FF00) >> 8, r[(a)+3] = (v) & 0x000000FF
+#define GET32(r, a) ((r[(a)] << 24) | (r[(a)+1] << 16) | (r[(a)+2] << 8) | r[(a)+3])
+#define SET16(r, a, v) r[(a)] = ((v) & 0xFF00) >> 8, r[(a)+1] = (v) & 0xFF
+#define GET16(r, a) ((r[(a)] << 8) | r[(a)+1])
+
+// Various clock rates
+
+#define M68K_CLOCK_RATE_PAL 13296950
+#define M68K_CLOCK_RATE_NTSC 13295453
+#define RISC_CLOCK_RATE_PAL 26593900
+#define RISC_CLOCK_RATE_NTSC 26590906
+
+
+//Temp debug stuff (will go away soon, so don't use these)
void DumpMainMemory(void);
uint8 * GetRamPtr(void);
-#endif // #ifndef __JAGUAR_H__
+#endif // __JAGUAR_H__