initialize_emu.c 1.11 KB
#include <R4300.h>
#include <rcp.h>
#include <ramrom.h>
#include "osint.h"
#include "piint.h"
#include "rdb.h"

typedef struct {
	unsigned int inst1;		/* lui	k0,XXXX */
	unsigned int inst2;		/* addiu k0,k0,XXXX */
	unsigned int inst3;		/* jr k0 */
	unsigned int inst4;		/* nop */
} __osExceptionVector;


extern u64 osClockRate ; 
extern int osViClock ;	/* Video clock rate (default is NTSC) */
extern s32 __osShutdown ;   /* 1 = pre-NMI interrupt has occured */
extern OSIntMask __OSGlobalIntMask ;
#ifdef _FINALROM
extern s32 __osFinalrom;
#else
extern s32 __kmc_pt_mode;
extern void *__printfunc;
#endif

extern void __createSpeedParam(void);

#ifndef _FINALROM
/* 機種依存のprint (callback) */
static void *proutSyncPrintf(void *str, const char *buf, size_t n)
{
    size_t  sent = 0;

    while(sent < n)
      {
        sent += __osRdbSend((u8*)&buf[sent],(u32)(n-sent),(size_t)RDB_TYPE_GtoH_PRINT);
    }
    return ((void *) 1);   /* return a fake pointer so that it's not NULL */
}
#endif


void
__osInitialize_emu(void)
{
#ifndef _FINALROM
	/* デバッガ機種依存の初期化 */
	__printfunc = (void*)&proutSyncPrintf;

#endif
}