mirror of
https://github.com/holub/mame
synced 2025-05-24 23:05:32 +03:00
Pointer-ified the V810 core.
Added OG's z8000 fix.
This commit is contained in:
parent
5b64c00674
commit
c33c60485b
File diff suppressed because it is too large
Load Diff
@ -7,47 +7,6 @@
|
||||
|
||||
void v810_get_info(UINT32, cpuinfo*);
|
||||
|
||||
#define R_B(addr) (memory_read_byte_32le(v810.program, addr))
|
||||
#define R_H(addr) (memory_read_word_32le(v810.program, addr))
|
||||
#define R_W(addr) (memory_read_dword_32le(v810.program, addr))
|
||||
|
||||
|
||||
#define W_B(addr, val) (memory_write_byte_32le(v810.program, addr,val))
|
||||
#define W_H(addr, val) (memory_write_word_32le(v810.program, addr,val))
|
||||
#define W_W(addr, val) (memory_write_dword_32le(v810.program, addr,val))
|
||||
|
||||
|
||||
#define RIO_B(addr) (memory_read_byte_32le(v810.io, addr))
|
||||
#define RIO_H(addr) (memory_read_word_32le(v810.io, addr))
|
||||
#define RIO_W(addr) (memory_read_dword_32le(v810.io, addr))
|
||||
|
||||
|
||||
#define WIO_B(addr, val) (memory_write_byte_32le(v810.io, addr,val))
|
||||
#define WIO_H(addr, val) (memory_write_word_32le(v810.io, addr,val))
|
||||
#define WIO_W(addr, val) (memory_write_dword_32le(v810.io, addr,val))
|
||||
|
||||
#define R_OP(addr) (R_H(addr))
|
||||
|
||||
#define GET1 (OP&0x1f)
|
||||
#define GET2 ((OP>>5)&0x1f)
|
||||
#define I5(x) (((x)&0x1f)|(((x)&0x10)?0xffffffe0:0))
|
||||
#define UI5(x) ((x)&0x1f)
|
||||
#define I16(x) (((x)&0xffff)|(((x)&0x8000)?0xffff0000:0))
|
||||
#define UI16(x) ((x)&0xffff)
|
||||
#define D16(x) (((x)&0xffff)|(((x)&0x8000)?0xffff0000:0))
|
||||
#define D26(x,y) ((y)|((x&0x3ff)<<16 )|((x&0x200)?0xfc000000:0))
|
||||
#define D9(x) ((x&0x1ff)|((x&0x100)?0xfffffe00:0))
|
||||
#define SO(opcode) ((opcode)&0xfc00)>>10)
|
||||
|
||||
#define CHECK_CY(x) PSW=(PSW & ~8)|(((x) & (((UINT64)1) << 32)) ? 8 : 0)
|
||||
#define CHECK_OVADD(x,y,z) PSW=(PSW & ~0x00000004) |(( ((x) ^ (z)) & ((y) ^ (z)) & 0x80000000) ? 4: 0)
|
||||
#define CHECK_OVSUB(x,y,z) PSW=(PSW & ~0x00000004) |(( ((y) ^ (z)) & ((x) ^ (y)) & 0x80000000) ? 4: 0)
|
||||
#define CHECK_ZS(x) PSW=(PSW & ~3)|((UINT32)(x)==0)|(((x)&0x80000000) ? 2: 0)
|
||||
|
||||
|
||||
#define ADD(dst, src) { UINT64 res=(UINT64)(dst)+(UINT64)(src); SetCF(res); SetOF_Add(res,src,dst); SetSZPF(res); dst=(UINT32)res; }
|
||||
#define SUB(dst, src) { UINT64 res=(UINT64)(dst)-(INT64)(src); SetCF(res); SetOF_Sub(res,src,dst); SetSZPF(res); dst=(UINT32)res; }
|
||||
|
||||
CPU_DISASSEMBLE( v810 );
|
||||
|
||||
enum
|
||||
|
@ -45,10 +45,8 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#include "z8000.h"
|
||||
#include "cpuintrf.h"
|
||||
|
||||
typedef void z8000_state;
|
||||
#include "z8000cpu.h"
|
||||
#include "cpuintrf.h"
|
||||
|
||||
static int n[12]; /* opcode nibbles */
|
||||
static int b[6]; /* opcode bytes */
|
||||
|
@ -61,7 +61,7 @@ union _z8000_reg_file
|
||||
UINT64 Q[4]; /* RQ0,RQ4,..RQ12 */
|
||||
};
|
||||
|
||||
typedef struct _z8000_state z8000_state;
|
||||
/* In z8000cpu.h: typedef struct _z8000_state z8000_state; */
|
||||
struct _z8000_state
|
||||
{
|
||||
UINT16 op[4]; /* opcodes/data of current instruction */
|
||||
|
@ -193,6 +193,8 @@
|
||||
#define GET_DSP16 UINT16 dsp16 = cpustate->pc + (INT16)cpustate->op[1]
|
||||
#define GET_ADDR(o) UINT16 addr = (UINT16)cpustate->op[o]
|
||||
|
||||
typedef struct _z8000_state z8000_state;
|
||||
|
||||
/* structure for the opcode definition table */
|
||||
typedef struct {
|
||||
int beg, end, step;
|
||||
|
Loading…
Reference in New Issue
Block a user