Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
Macros
macros.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define A   z80ex.af.b.h
 
#define F   z80ex.af.b.l
 
#define AF   z80ex.af.w
 
#define B   z80ex.bc.b.h
 
#define C   z80ex.bc.b.l
 
#define BC   z80ex.bc.w
 
#define D   z80ex.de.b.h
 
#define E   z80ex.de.b.l
 
#define DE   z80ex.de.w
 
#define H   z80ex.hl.b.h
 
#define L   z80ex.hl.b.l
 
#define HL   z80ex.hl.w
 
#define A_   z80ex.af_.b.h
 
#define F_   z80ex.af_.b.l
 
#define AF_   z80ex.af_.w
 
#define B_   z80ex.bc_.b.h
 
#define C_   z80ex.bc_.b.l
 
#define BC_   z80ex.bc_.w
 
#define D_   z80ex.de_.b.h
 
#define E_   z80ex.de_.b.l
 
#define DE_   z80ex.de_.w
 
#define H_   z80ex.hl_.b.h
 
#define L_   z80ex.hl_.b.l
 
#define HL_   z80ex.hl_.w
 
#define IXH   z80ex.ix.b.h
 
#define IXL   z80ex.ix.b.l
 
#define IX   z80ex.ix.w
 
#define IYH   z80ex.iy.b.h
 
#define IYL   z80ex.iy.b.l
 
#define IY   z80ex.iy.w
 
#define SPH   z80ex.sp.b.h
 
#define SPL   z80ex.sp.b.l
 
#define SP   z80ex.sp.w
 
#define PCH   z80ex.pc.b.h
 
#define PCL   z80ex.pc.b.l
 
#define PC   z80ex.pc.w
 
#define I   z80ex.i
 
#define R   z80ex.r
 
#define R7   z80ex.r7
 
#define IFF1   z80ex.iff1
 
#define IFF2   z80ex.iff2
 
#define IM   z80ex.im
 
#define MEMPTRh   z80ex.memptr.b.h
 
#define MEMPTRl   z80ex.memptr.b.l
 
#define MEMPTR   z80ex.memptr.w
 
#define FLAG_C   0x01
 
#define FLAG_N   0x02
 
#define FLAG_P   0x04
 
#define FLAG_V   FLAG_P
 
#define FLAG_3   0x08
 
#define FLAG_H   0x10
 
#define FLAG_5   0x20
 
#define FLAG_Z   0x40
 
#define FLAG_S   0x80
 
#define READ_OP_M1()   (z80ex.int_vector_req? z80ex_intread_cb() : z80ex_mread_cb(PC++, 1))
 
#define READ_OP()   (z80ex.int_vector_req? z80ex_intread_cb() : z80ex_mread_cb(PC++, 0))
 
#define T_WAIT_UNTIL(t_state)
 
#define TSTATES(amount)   z80ex.tstate += amount
 
#define READ_MEM(result, addr, t_state)
 
#define READ_PORT(result, port, t_state)
 
#define WRITE_MEM(addr, vbyte, t_state)
 
#define WRITE_PORT(port, vbyte, t_state)
 
#define AND(value)
 
#define ADC(a, value)
 
#define ADC16(hl, value)
 
#define ADD(a, value)
 
#define ADD16(value1, value2)
 
#define BIT(bit, value)
 
#define BIT_MPTR(bit, value)
 
#define CALL(addr, wr1, wr2)
 
#define CP(value)
 
#define DEC(value)
 
#define DEC16(value)
 
#define INC(value)
 
#define INC16(value)
 
#define LD(dst, src)
 
#define LD_A_TO_ADDR_MPTR(dst, src, addr)
 
#define LD_A_FROM_ADDR_MPTR(dst, src, addr)
 
#define LD16(dst, src)
 
#define LD_RP_TO_ADDR_MPTR_16(dst, src, addr)
 
#define LD_RP_FROM_ADDR_MPTR_16(dst, src, addr)
 
#define JP_NO_MPTR(addr)
 
#define JP(addr)
 
#define JR(offset)
 
#define OR(value)
 
#define OUT(port, reg, wr)
 
#define OUT_A(port, reg, wr)
 
#define IN(reg, port, rd)
 
#define IN_A(reg, port, rd)
 
#define IN_F(port, rd)
 
#define POP(rp, rd1, rd2)
 
#define PUSH(rp, wr1, wr2)
 
#define RET(rd1, rd2)
 
#define RL(value)
 
#define RLC(value)
 
#define RR(value)
 
#define RRC(value)
 
#define RST(value, w1, w2)
 
#define SBC(a, value)
 
#define SBC16(hl, value)
 
#define SLA(value)
 
#define SLL(value)
 
#define SRA(value)
 
#define SRL(value)
 
#define SUB(value)
 
#define XOR(value)
 
#define RRD(rd, wr)
 
#define RLD(rd, wr)
 
#define IM_(mode)
 
#define LD_A_R()
 
#define LD_R_A()
 
#define LD_A_I()
 
#define NEG()
 
#define RETI(rd1, rd2)
 
#define RETN(rd1, rd2)
 
#define LDI(rd, wr)
 
#define CPI(rd)
 
#define OUT_BL(pbyte)
 
#define IN_BL(pbyte, c_add)
 
#define INI(rd, wr)
 
#define OUTI(rd, wr)
 
#define LDD(rd, wr)
 
#define CPD(rd)
 
#define IND(rd, wr)
 
#define OUTD(rd, wr)
 
#define LDIR(t1, t2, rd, wr)
 
#define CPIR(t1, t2, rd)
 
#define INIR(t1, t2, rd, wr)
 
#define OTIR(t1, t2, rd, wr)
 
#define LDDR(t1, t2, rd, wr)
 
#define CPDR(t1, t2, rd)
 
#define INDR(t1, t2, rd, wr)
 
#define OTDR(t1, t2, rd, wr)
 
#define RLCA()
 
#define RRCA()
 
#define DJNZ(offset, t1, t2)
 
#define RLA()
 
#define RRA()
 
#define DAA()
 
#define EX(rp1, rp2)
 
#define EX_MPTR(rp1, rp2)
 
#define CPL()
 
#define SCF()
 
#define CCF()
 
#define HALT()
 
#define EXX()
 
#define DI()
 
#define EI()
 
#define SET(bit, val)
 
#define RES(bit, val)
 

Macro Definition Documentation

◆ A

#define A   z80ex.af.b.h

Definition at line 17 of file macros.h.

◆ A_

#define A_   z80ex.af_.b.h

Definition at line 33 of file macros.h.

◆ ADC

#define ADC (   a,
  value 
)
Value:
{\
Z80EX_WORD adctemp = A + (value) + ( F & FLAG_C ); \
Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \
( ( (value) & 0x88 ) >> 2 ) | \
( ( adctemp & 0x88 ) >> 1 ); \
A=adctemp;\
F = ( adctemp & 0x100 ? FLAG_C : 0 ) |\
halfcarry_add_table[lookup & 0x07] | overflow_add_table[lookup >> 4] |\
sz53_table[A];\
}

Definition at line 217 of file macros.h.

◆ ADC16

#define ADC16 (   hl,
  value 
)
Value:
{\
Z80EX_DWORD add16temp= HL + (value) + ( F & FLAG_C ); \
Z80EX_BYTE lookup = ( ( HL & 0x8800 ) >> 11 ) | \
( ( (value) & 0x8800 ) >> 10 ) | \
( ( add16temp & 0x8800 ) >> 9 ); \
MEMPTR=hl+1;\
HL = add16temp;\
F = ( add16temp & 0x10000 ? FLAG_C : 0 )|\
overflow_add_table[lookup >> 4] |\
( H & ( FLAG_3 | FLAG_5 | FLAG_S ) ) |\
halfcarry_add_table[lookup&0x07]|\
( HL ? 0 : FLAG_Z );\
}

Definition at line 229 of file macros.h.

◆ ADD

#define ADD (   a,
  value 
)
Value:
{\
Z80EX_WORD addtemp = A + (value); \
Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \
( ( (value) & 0x88 ) >> 2 ) | \
( ( addtemp & 0x88 ) >> 1 ); \
A=addtemp;\
F = ( addtemp & 0x100 ? FLAG_C : 0 ) |\
halfcarry_add_table[lookup & 0x07] | overflow_add_table[lookup >> 4] |\
sz53_table[A];\
}

Definition at line 244 of file macros.h.

◆ ADD16

#define ADD16 (   value1,
  value2 
)
Value:
{\
Z80EX_DWORD add16temp = (value1) + (value2); \
Z80EX_BYTE lookup = ( ( (value1) & 0x0800 ) >> 11 ) | \
( ( (value2) & 0x0800 ) >> 10 ) | \
( ( add16temp & 0x0800 ) >> 9 ); \
MEMPTR=value1+1;\
(value1) = add16temp;\
F = ( F & ( FLAG_V | FLAG_Z | FLAG_S ) ) |\
( add16temp & 0x10000 ? FLAG_C : 0 )|\
( ( add16temp >> 8 ) & ( FLAG_3 | FLAG_5 ) ) |\
halfcarry_add_table[lookup];\
}

Definition at line 256 of file macros.h.

◆ AF

#define AF   z80ex.af.w

Definition at line 19 of file macros.h.

◆ AF_

#define AF_   z80ex.af_.w

Definition at line 35 of file macros.h.

◆ AND

#define AND (   value)
Value:
{\
A &= (value);\
F = FLAG_H | sz53p_table[A];\
}

Definition at line 211 of file macros.h.

◆ B

#define B   z80ex.bc.b.h

Definition at line 21 of file macros.h.

◆ B_

#define B_   z80ex.bc_.b.h

Definition at line 37 of file macros.h.

◆ BC

#define BC   z80ex.bc.w

Definition at line 23 of file macros.h.

◆ BC_

#define BC_   z80ex.bc_.w

Definition at line 39 of file macros.h.

◆ BIT

#define BIT (   bit,
  value 
)
Value:
{ \
F = ( F & FLAG_C ) | FLAG_H | sz53p_table[(value) & (0x01 << (bit))] | ((value) & 0x28); \
}

Definition at line 270 of file macros.h.

◆ BIT_MPTR

#define BIT_MPTR (   bit,
  value 
)
Value:
{ \
F = ( F & FLAG_C ) | FLAG_H | (sz53p_table[(value) & (0x01 << (bit))] & 0xD7) | ((MEMPTRh) & 0x28); \
}

Definition at line 276 of file macros.h.

◆ C

#define C   z80ex.bc.b.l

Definition at line 22 of file macros.h.

◆ C_

#define C_   z80ex.bc_.b.l

Definition at line 38 of file macros.h.

◆ CALL

#define CALL (   addr,
  wr1,
  wr2 
)
Value:
{\
PUSH(PC,wr1,wr2); \
PC=addr; \
MEMPTR=addr;\
}

Definition at line 281 of file macros.h.

◆ CCF

#define CCF ( )
Value:
{\
F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\
( ( F & FLAG_C ) ? FLAG_H : FLAG_C ) | ( A & ( FLAG_3 | FLAG_5 ) );\
}

Definition at line 1003 of file macros.h.

◆ CP

#define CP (   value)
Value:
{\
Z80EX_WORD cptemp = A - value; \
Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \
( ( (value) & 0x88 ) >> 2 ) | \
( ( cptemp & 0x88 ) >> 1 ); \
F = ( cptemp & 0x100 ? FLAG_C : ( cptemp ? 0 : FLAG_Z ) ) | FLAG_N |\
halfcarry_sub_table[lookup & 0x07] |\
overflow_sub_table[lookup >> 4] |\
( value & ( FLAG_3 | FLAG_5 ) ) |\
( cptemp & FLAG_S );\
}

Definition at line 288 of file macros.h.

◆ CPD

#define CPD (   rd)
Value:
{\
Z80EX_BYTE value,bytetemp,lookup;\
READ_MEM(value, HL, rd);\
bytetemp = A - value;\
lookup = ( ( A & 0x08 ) >> 3 ) |\
( ( (value) & 0x08 ) >> 2 ) |\
( ( bytetemp & 0x08 ) >> 1 );\
HL--; BC--;\
F = ( F & FLAG_C ) | ( BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) |\
halfcarry_sub_table[lookup] | ( bytetemp ? 0 : FLAG_Z ) |\
( bytetemp & FLAG_S );\
if(F & FLAG_H) bytetemp--;\
F |= ( bytetemp & FLAG_3 ) | ( (bytetemp&0x02) ? FLAG_5 : 0 );\
MEMPTR=MEMPTR-1;\
}

Definition at line 701 of file macros.h.

◆ CPDR

#define CPDR (   t1,
  t2,
  rd 
)
Value:
{\
Z80EX_BYTE value,bytetemp,lookup;\
READ_MEM(value, HL, rd);\
bytetemp = A - value;\
lookup = ( ( A & 0x08 ) >> 3 ) |\
( ( (value) & 0x08 ) >> 2 ) |\
( ( bytetemp & 0x08 ) >> 1 );\
HL--; BC--;\
F = ( F & FLAG_C ) | ( BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) |\
halfcarry_sub_table[lookup] | ( bytetemp ? 0 : FLAG_Z ) |\
( bytetemp & FLAG_S );\
if(F & FLAG_H) bytetemp--;\
F |= ( bytetemp & FLAG_3 ) | ( (bytetemp&0x02) ? FLAG_5 : 0 );\
if( ( F & ( FLAG_V | FLAG_Z ) ) == FLAG_V ) {\
PC-=2;\
MEMPTR=PC+1;\
T_WAIT_UNTIL(t2);\
}\
else\
{\
MEMPTR=MEMPTR-1;\
T_WAIT_UNTIL(t1);\
}\
}

Definition at line 846 of file macros.h.

◆ CPI

#define CPI (   rd)
Value:
{\
Z80EX_BYTE value,bytetemp,lookup;\
READ_MEM(value, HL, rd);\
bytetemp = A - value;\
lookup = ( ( A & 0x08 ) >> 3 ) |\
( ( (value) & 0x08 ) >> 2 ) |\
( ( bytetemp & 0x08 ) >> 1 );\
HL++; BC--;\
F = ( F & FLAG_C ) | ( BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) |\
halfcarry_sub_table[lookup] | ( bytetemp ? 0 : FLAG_Z ) |\
( bytetemp & FLAG_S );\
if(F & FLAG_H) bytetemp--;\
F |= ( bytetemp & FLAG_3 ) | ( (bytetemp&0x02) ? FLAG_5 : 0 );\
MEMPTR=MEMPTR+1;\
}

Definition at line 631 of file macros.h.

◆ CPIR

#define CPIR (   t1,
  t2,
  rd 
)
Value:
{\
Z80EX_BYTE value,bytetemp,lookup;\
READ_MEM(value, HL, rd);\
bytetemp = A - value;\
lookup = ( ( A & 0x08 ) >> 3 ) |\
( ( (value) & 0x08 ) >> 2 ) |\
( ( bytetemp & 0x08 ) >> 1 );\
HL++; BC--;\
F = ( F & FLAG_C ) | ( BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) |\
halfcarry_sub_table[lookup] | ( bytetemp ? 0 : FLAG_Z ) |\
( bytetemp & FLAG_S );\
if(F & FLAG_H) bytetemp--;\
F |= ( bytetemp & FLAG_3 ) | ( (bytetemp&0x02) ? FLAG_5 : 0 );\
if( ( F & ( FLAG_V | FLAG_Z ) ) == FLAG_V ) {\
PC-=2;\
MEMPTR=PC+1;\
T_WAIT_UNTIL(t2);\
}\
else\
{\
MEMPTR=MEMPTR+1;\
T_WAIT_UNTIL(t1);\
}\
}

Definition at line 761 of file macros.h.

◆ CPL

#define CPL ( )
Value:
{\
A ^= 0xff;\
F = ( F & ( FLAG_C | FLAG_P | FLAG_Z | FLAG_S ) ) |\
( A & ( FLAG_3 | FLAG_5 ) ) | ( FLAG_N | FLAG_H );\
}

Definition at line 989 of file macros.h.

◆ D

#define D   z80ex.de.b.h

Definition at line 25 of file macros.h.

◆ D_

#define D_   z80ex.de_.b.h

Definition at line 41 of file macros.h.

◆ DAA

#define DAA ( )
Value:
{\
const Z80EX_BYTE *tdaa = (daatab+(A+0x100*((F & 3) + ((F >> 2) & 4)))*2);\
F = *tdaa; A = *(tdaa + 1);\
}

Definition at line 955 of file macros.h.

◆ DE

#define DE   z80ex.de.w

Definition at line 27 of file macros.h.

◆ DE_

#define DE_   z80ex.de_.w

Definition at line 43 of file macros.h.

◆ DEC

#define DEC (   value)
Value:
{\
F = ( F & FLAG_C ) | ( (value)&0x0f ? 0 : FLAG_H ) | FLAG_N;\
(value)--;\
F |= ( (value)==0x7f ? FLAG_V : 0 ) | sz53_table[value];\
}

Definition at line 301 of file macros.h.

◆ DEC16

#define DEC16 (   value)
Value:
{\
(value)--;\
}

Definition at line 308 of file macros.h.

◆ DI

#define DI ( )
Value:
{\
IFF1=IFF2=0;\
}

Definition at line 1023 of file macros.h.

◆ DJNZ

#define DJNZ (   offset,
  t1,
  t2 
)
Value:
{\
B--;\
if(B) {\
PC += offset;\
MEMPTR=PC;\
T_WAIT_UNTIL(t2);\
}\
else\
{\
T_WAIT_UNTIL(t1);\
}\
}

Definition at line 925 of file macros.h.

◆ E

#define E   z80ex.de.b.l

Definition at line 26 of file macros.h.

◆ E_

#define E_   z80ex.de_.b.l

Definition at line 42 of file macros.h.

◆ EI

#define EI ( )
Value:
{\
IFF1 = IFF2 = 1;\
z80ex.noint_once=1;\
}

Definition at line 1028 of file macros.h.

◆ EX

#define EX (   rp1,
  rp2 
)
Value:
{\
Z80EX_WORD wordtemp=rp1; rp1=rp2; rp2=wordtemp;\
}

Definition at line 978 of file macros.h.

◆ EX_MPTR

#define EX_MPTR (   rp1,
  rp2 
)
Value:
{\
Z80EX_WORD wordtemp=rp1; rp1=rp2; rp2=wordtemp;\
MEMPTR=wordtemp;\
}

Definition at line 983 of file macros.h.

◆ EXX

#define EXX ( )
Value:
{\
Z80EX_WORD wordtemp;\
wordtemp = BC; BC = BC_; BC_ = wordtemp;\
wordtemp = DE; DE = DE_; DE_ = wordtemp;\
wordtemp = HL; HL = HL_; HL_ = wordtemp;\
}

Definition at line 1015 of file macros.h.

◆ F

#define F   z80ex.af.b.l

Definition at line 18 of file macros.h.

◆ F_

#define F_   z80ex.af_.b.l

Definition at line 34 of file macros.h.

◆ FLAG_3

#define FLAG_3   0x08

Definition at line 83 of file macros.h.

◆ FLAG_5

#define FLAG_5   0x20

Definition at line 85 of file macros.h.

◆ FLAG_C

#define FLAG_C   0x01

Definition at line 79 of file macros.h.

◆ FLAG_H

#define FLAG_H   0x10

Definition at line 84 of file macros.h.

◆ FLAG_N

#define FLAG_N   0x02

Definition at line 80 of file macros.h.

◆ FLAG_P

#define FLAG_P   0x04

Definition at line 81 of file macros.h.

◆ FLAG_S

#define FLAG_S   0x80

Definition at line 87 of file macros.h.

◆ FLAG_V

#define FLAG_V   FLAG_P

Definition at line 82 of file macros.h.

◆ FLAG_Z

#define FLAG_Z   0x40

Definition at line 86 of file macros.h.

◆ H

#define H   z80ex.hl.b.h

Definition at line 29 of file macros.h.

◆ H_

#define H_   z80ex.hl_.b.h

Definition at line 45 of file macros.h.

◆ HALT

#define HALT ( )
Value:
{\
z80ex.halted=1;\
PC--;\
}

Definition at line 1009 of file macros.h.

◆ HL

#define HL   z80ex.hl.w

Definition at line 31 of file macros.h.

◆ HL_

#define HL_   z80ex.hl_.w

Definition at line 47 of file macros.h.

◆ I

#define I   z80ex.i

Definition at line 65 of file macros.h.

◆ IFF1

#define IFF1   z80ex.iff1

Definition at line 69 of file macros.h.

◆ IFF2

#define IFF2   z80ex.iff2

Definition at line 70 of file macros.h.

◆ IM

#define IM   z80ex.im

Definition at line 71 of file macros.h.

◆ IM_

#define IM_ (   mode)
Value:
{\
IM=mode;\
}

Definition at line 574 of file macros.h.

◆ IN

#define IN (   reg,
  port,
  rd 
)
Value:
{\
READ_PORT(reg,port,rd); \
F = ( F & FLAG_C) | sz53p_table[(reg)];\
MEMPTR=port+1;\
}

Definition at line 401 of file macros.h.

◆ IN_A

#define IN_A (   reg,
  port,
  rd 
)
Value:
{\
READ_PORT(reg,port,rd); \
MEMPTR=port+1;\
}

Definition at line 409 of file macros.h.

◆ IN_BL

#define IN_BL (   pbyte,
  c_add 
)
Value:
{\
Z80EX_BYTE kval;\
kval=pbyte+((C+(c_add)) & 0xff);\
if((pbyte+((C+(c_add)) & 0xff)) > 255) F |= (FLAG_C | FLAG_H);\
F |= parity_table[((kval & 7) ^ B)];\
}

Definition at line 658 of file macros.h.

◆ IN_F

#define IN_F (   port,
  rd 
)
Value:
{\
Z80EX_BYTE val; \
READ_PORT(val, port, rd); \
F = ( F & FLAG_C) | sz53p_table[(val)];\
MEMPTR=port+1;\
}

Definition at line 415 of file macros.h.

◆ INC

#define INC (   value)
Value:
{\
(value)++;\
F = ( F & FLAG_C ) | ( (value)==0x80 ? FLAG_V : 0 ) |\
( (value)&0x0f ? 0 : FLAG_H ) | sz53_table[(value)];\
}

Definition at line 313 of file macros.h.

◆ INC16

#define INC16 (   value)
Value:
{\
(value)++;\
}

Definition at line 320 of file macros.h.

◆ IND

#define IND (   rd,
  wr 
)
Value:
{\
Z80EX_BYTE initemp;\
MEMPTR=BC-1;\
READ_PORT(initemp, BC, rd);\
WRITE_MEM( HL, initemp, wr );\
B--; HL--;\
F = ( initemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\
IN_BL(initemp,-1)\
}

Definition at line 718 of file macros.h.

◆ INDR

#define INDR (   t1,
  t2,
  rd,
  wr 
)
Value:
{\
Z80EX_BYTE initemp;\
READ_PORT(initemp, BC, rd);\
WRITE_MEM( HL, initemp, wr );\
MEMPTR=BC-1;\
B--; HL--;\
F = ( initemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\
if( B ) {\
PC -= 2;\
T_WAIT_UNTIL(t2);\
}\
else\
{\
T_WAIT_UNTIL(t1);\
}\
IN_BL(initemp,-1)\
}

Definition at line 872 of file macros.h.

◆ INI

#define INI (   rd,
  wr 
)
Value:
{\
Z80EX_BYTE initemp;\
MEMPTR=BC+1;\
READ_PORT(initemp, BC, rd);\
WRITE_MEM( HL, initemp, wr );\
B--; HL++;\
F = ( initemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\
IN_BL(initemp,1);\
}

Definition at line 666 of file macros.h.

◆ INIR

#define INIR (   t1,
  t2,
  rd,
  wr 
)
Value:
{\
Z80EX_BYTE initemp;\
READ_PORT(initemp, BC, rd);\
WRITE_MEM( HL, initemp, wr);\
MEMPTR=BC+1;\
B--; HL++;\
F = ( initemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\
if( B ) {\
PC -= 2;\
T_WAIT_UNTIL(t2);\
}\
else\
{\
T_WAIT_UNTIL(t1);\
}\
IN_BL(initemp,1)\
}

Definition at line 787 of file macros.h.

◆ IX

#define IX   z80ex.ix.w

Definition at line 51 of file macros.h.

◆ IXH

#define IXH   z80ex.ix.b.h

Definition at line 49 of file macros.h.

◆ IXL

#define IXL   z80ex.ix.b.l

Definition at line 50 of file macros.h.

◆ IY

#define IY   z80ex.iy.w

Definition at line 55 of file macros.h.

◆ IYH

#define IYH   z80ex.iy.b.h

Definition at line 53 of file macros.h.

◆ IYL

#define IYL   z80ex.iy.b.l

Definition at line 54 of file macros.h.

◆ JP

#define JP (   addr)
Value:
{ \
PC=addr; \
MEMPTR=addr;\
}

Definition at line 369 of file macros.h.

◆ JP_NO_MPTR

#define JP_NO_MPTR (   addr)
Value:
{ \
PC=addr; \
}

Definition at line 364 of file macros.h.

◆ JR

#define JR (   offset)
Value:
{\
PC+=offset; \
MEMPTR=PC;\
}

Definition at line 375 of file macros.h.

◆ L

#define L   z80ex.hl.b.l

Definition at line 30 of file macros.h.

◆ L_

#define L_   z80ex.hl_.b.l

Definition at line 46 of file macros.h.

◆ LD

#define LD (   dst,
  src 
)
Value:
{\
dst=src; \
}

Definition at line 325 of file macros.h.

◆ LD16

#define LD16 (   dst,
  src 
)
Value:
{\
dst=src; \
}

Definition at line 345 of file macros.h.

◆ LD_A_FROM_ADDR_MPTR

#define LD_A_FROM_ADDR_MPTR (   dst,
  src,
  addr 
)
Value:
{\
dst=src; \
MEMPTR=addr+1;\
}

Definition at line 339 of file macros.h.

◆ LD_A_I

#define LD_A_I ( )
Value:
{\
A=I;\
F = ( F & FLAG_C ) | sz53_table[A] | ( IFF2 ? FLAG_V : 0 );\
if (z80ex.nmos) z80ex.reset_PV_on_int=1;\
}

Definition at line 591 of file macros.h.

◆ LD_A_R

#define LD_A_R ( )
Value:
{\
A=(R&0x7f) | (R7&0x80);\
F = ( F & FLAG_C ) | sz53_table[A] | ( IFF2 ? FLAG_V : 0 );\
if (z80ex.nmos) z80ex.reset_PV_on_int=1;\
}

Definition at line 579 of file macros.h.

◆ LD_A_TO_ADDR_MPTR

#define LD_A_TO_ADDR_MPTR (   dst,
  src,
  addr 
)
Value:
{\
dst=src; \
MEMPTRh=A;\
MEMPTRl=((addr+1) & 0xFF);\
}

Definition at line 331 of file macros.h.

◆ LD_R_A

#define LD_R_A ( )
Value:
{\
R=R7=A;\
}

Definition at line 586 of file macros.h.

◆ LD_RP_FROM_ADDR_MPTR_16

#define LD_RP_FROM_ADDR_MPTR_16 (   dst,
  src,
  addr 
)
Value:
{\
dst=src; \
MEMPTR=addr+1;\
}

Definition at line 358 of file macros.h.

◆ LD_RP_TO_ADDR_MPTR_16

#define LD_RP_TO_ADDR_MPTR_16 (   dst,
  src,
  addr 
)
Value:
{\
dst=src; \
MEMPTR=addr+1;\
}

Definition at line 351 of file macros.h.

◆ LDD

#define LDD (   rd,
  wr 
)
Value:
{\
Z80EX_BYTE bytetemp;\
READ_MEM(bytetemp, HL, rd);\
BC--;\
WRITE_MEM(DE,bytetemp,wr);\
DE--; HL--;\
bytetemp += A;\
F = ( F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | ( BC ? FLAG_V : 0 ) |\
( bytetemp & FLAG_3 ) | ( (bytetemp & 0x02) ? FLAG_5 : 0 );\
}

Definition at line 689 of file macros.h.

◆ LDDR

#define LDDR (   t1,
  t2,
  rd,
  wr 
)
Value:
{\
Z80EX_BYTE bytetemp;\
READ_MEM(bytetemp, HL, rd);\
WRITE_MEM(DE,bytetemp,wr);\
HL--; DE--; BC--;\
bytetemp += A;\
F = ( F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | ( BC ? FLAG_V : 0 ) |\
( bytetemp & FLAG_3 ) | ( (bytetemp & 0x02) ? FLAG_5 : 0 );\
if(BC) {\
PC-=2;\
T_WAIT_UNTIL(t2);\
MEMPTR=PC+1;\
}\
else\
{\
T_WAIT_UNTIL(t1);\
}\
}

Definition at line 826 of file macros.h.

◆ LDI

#define LDI (   rd,
  wr 
)
Value:
{\
Z80EX_BYTE bytetemp;\
READ_MEM(bytetemp, HL, rd);\
BC--;\
WRITE_MEM(DE,bytetemp,wr);\
DE++; HL++;\
bytetemp += A;\
F = ( F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | ( BC ? FLAG_V : 0 ) |\
( bytetemp & FLAG_3 ) | ( (bytetemp & 0x02) ? FLAG_5 : 0 );\
}

Definition at line 619 of file macros.h.

◆ LDIR

#define LDIR (   t1,
  t2,
  rd,
  wr 
)
Value:
{\
Z80EX_BYTE bytetemp;\
READ_MEM(bytetemp, HL, rd);\
WRITE_MEM(DE,bytetemp,wr);\
HL++; DE++; BC--;\
bytetemp += A;\
F = ( F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | ( BC ? FLAG_V : 0 ) |\
( bytetemp & FLAG_3 ) | ( (bytetemp & 0x02) ? FLAG_5 : 0 );\
if(BC) {\
PC-=2;\
T_WAIT_UNTIL(t2);\
MEMPTR=PC+1;\
}\
else\
{\
T_WAIT_UNTIL(t1);\
}\
}

Definition at line 741 of file macros.h.

◆ MEMPTR

#define MEMPTR   z80ex.memptr.w

Definition at line 75 of file macros.h.

◆ MEMPTRh

#define MEMPTRh   z80ex.memptr.b.h

Definition at line 73 of file macros.h.

◆ MEMPTRl

#define MEMPTRl   z80ex.memptr.b.l

Definition at line 74 of file macros.h.

◆ NEG

#define NEG ( )
Value:
{\
Z80EX_BYTE bytetemp=A;\
A=0;\
SUB(bytetemp);\
}

Definition at line 598 of file macros.h.

◆ OR

#define OR (   value)
Value:
{\
A |= (value);\
F = sz53p_table[A];\
}

Definition at line 381 of file macros.h.

◆ OTDR

#define OTDR (   t1,
  t2,
  rd,
  wr 
)
Value:
{\
Z80EX_BYTE outitemp;\
READ_MEM(outitemp, HL, rd);\
B--;\
MEMPTR=BC-1;\
WRITE_PORT(BC,outitemp,wr);\
HL--;\
F = (outitemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\
if( B ) {\
PC -= 2;\
T_WAIT_UNTIL(t2);\
}\
else\
{\
T_WAIT_UNTIL(t1);\
}\
OUT_BL(outitemp);\
}

Definition at line 891 of file macros.h.

◆ OTIR

#define OTIR (   t1,
  t2,
  rd,
  wr 
)
Value:
{\
Z80EX_BYTE outitemp;\
READ_MEM(outitemp, HL, rd);\
B--;\
MEMPTR=BC+1;\
WRITE_PORT(BC, outitemp, wr);\
HL++;\
F = (outitemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\
if( B ) {\
PC -= 2;\
T_WAIT_UNTIL(t2);\
}\
else\
{\
T_WAIT_UNTIL(t1);\
}\
OUT_BL(outitemp);\
}

Definition at line 806 of file macros.h.

◆ OUT

#define OUT (   port,
  reg,
  wr 
)
Value:
{\
WRITE_PORT(port,reg,wr); \
MEMPTR=port+1;\
}

Definition at line 387 of file macros.h.

◆ OUT_A

#define OUT_A (   port,
  reg,
  wr 
)
Value:
{\
WRITE_PORT(port,reg,wr); \
MEMPTRl=((port+1) & 0xFF);\
MEMPTRh=A;\
}

Definition at line 394 of file macros.h.

◆ OUT_BL

#define OUT_BL (   pbyte)
Value:
{\
Z80EX_BYTE kval;\
kval=pbyte+L;\
if((pbyte+L) > 255) F |= (FLAG_C | FLAG_H);\
F |= parity_table[((kval & 7) ^ B)];\
}

Definition at line 649 of file macros.h.

◆ OUTD

#define OUTD (   rd,
  wr 
)
Value:
{\
Z80EX_BYTE outitemp;\
READ_MEM(outitemp, HL, rd);\
B--;\
MEMPTR=BC-1;\
WRITE_PORT(BC,outitemp,wr);\
HL--;\
F = (outitemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\
OUT_BL(outitemp);\
}

Definition at line 729 of file macros.h.

◆ OUTI

#define OUTI (   rd,
  wr 
)
Value:
{\
Z80EX_BYTE outitemp;\
READ_MEM(outitemp, HL, rd);\
B--; \
MEMPTR=BC+1;\
WRITE_PORT(BC,outitemp,wr);\
HL++;\
F = (outitemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\
OUT_BL(outitemp);\
}

Definition at line 677 of file macros.h.

◆ PC

#define PC   z80ex.pc.w

Definition at line 63 of file macros.h.

◆ PCH

#define PCH   z80ex.pc.b.h

Definition at line 61 of file macros.h.

◆ PCL

#define PCL   z80ex.pc.b.l

Definition at line 62 of file macros.h.

◆ POP

#define POP (   rp,
  rd1,
  rd2 
)
Value:
{\
Z80EX_REGPAIR_T tmp; \
READ_MEM(tmp.b.l,SP++,rd1);\
READ_MEM(tmp.b.h,SP++,rd2);\
rp=tmp.w;\
}

Definition at line 423 of file macros.h.

◆ PUSH

#define PUSH (   rp,
  wr1,
  wr2 
)
Value:
{\
Z80EX_REGPAIR_T tmp; \
tmp.w=rp; \
WRITE_MEM(--SP, tmp.b.h, wr1); \
WRITE_MEM(--SP, tmp.b.l, wr2); \
}

Definition at line 432 of file macros.h.

◆ R

#define R   z80ex.r

Definition at line 66 of file macros.h.

◆ R7

#define R7   z80ex.r7

Definition at line 67 of file macros.h.

◆ READ_MEM

#define READ_MEM (   result,
  addr,
  t_state 
)
Value:
{ \
T_WAIT_UNTIL(t_state); \
result=(z80ex_mread_cb((addr), 0)); \
}

Definition at line 147 of file macros.h.

◆ READ_OP

#define READ_OP ( )    (z80ex.int_vector_req? z80ex_intread_cb() : z80ex_mread_cb(PC++, 0))

Definition at line 93 of file macros.h.

◆ READ_OP_M1

#define READ_OP_M1 ( )    (z80ex.int_vector_req? z80ex_intread_cb() : z80ex_mread_cb(PC++, 1))

Definition at line 90 of file macros.h.

◆ READ_PORT

#define READ_PORT (   result,
  port,
  t_state 
)
Value:
{ \
T_WAIT_UNTIL(t_state); \
result=(z80ex_pread_cb((port))); \
}

Definition at line 154 of file macros.h.

◆ RES

#define RES (   bit,
  val 
)
Value:
{\
val &= ~(1 << bit);\
}

Definition at line 1039 of file macros.h.

◆ RET

#define RET (   rd1,
  rd2 
)
Value:
{\
POP(PC, rd1, rd2);\
MEMPTR=PC;\
}

Definition at line 440 of file macros.h.

◆ RETI

#define RETI (   rd1,
  rd2 
)
Value:
{\
IFF1=IFF2;\
RET(rd1, rd2);\
z80ex_reti_cb(); \
}

Definition at line 605 of file macros.h.

◆ RETN

#define RETN (   rd1,
  rd2 
)
Value:
{\
IFF1=IFF2;\
RET(rd1, rd2);\
}

Definition at line 613 of file macros.h.

◆ RL

#define RL (   value)
Value:
{\
Z80EX_BYTE rltemp = (value); \
(value) = ( (value)<<1 ) | ( F & FLAG_C );\
F = ( rltemp >> 7 ) | sz53p_table[(value)];\
}

Definition at line 446 of file macros.h.

◆ RLA

#define RLA ( )
Value:
{\
Z80EX_BYTE bytetemp = A;\
A = ( A << 1 ) | ( F & FLAG_C );\
F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\
( A & ( FLAG_3 | FLAG_5 ) ) | ( bytetemp >> 7 );\
}

Definition at line 939 of file macros.h.

◆ RLC

#define RLC (   value)
Value:
{\
(value) = ( (value)<<1 ) | ( (value)>>7 );\
F = ( (value) & FLAG_C ) | sz53p_table[(value)];\
}

Definition at line 453 of file macros.h.

◆ RLCA

#define RLCA ( )
Value:
{\
A = ( A << 1 ) | ( A >> 7 );\
F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\
( A & ( FLAG_C | FLAG_3 | FLAG_5 ) );\
}

Definition at line 911 of file macros.h.

◆ RLD

#define RLD (   rd,
  wr 
)
Value:
{\
Z80EX_BYTE bytetemp;\
READ_MEM(bytetemp, HL, rd);\
WRITE_MEM(HL, (bytetemp << 4 ) | ( A & 0x0f ) ,wr);\
A = ( A & 0xf0 ) | ( bytetemp >> 4 );\
F = ( F & FLAG_C ) | sz53p_table[A];\
MEMPTR=HL+1;\
}

Definition at line 563 of file macros.h.

◆ RR

#define RR (   value)
Value:
{\
Z80EX_BYTE rrtemp = (value); \
(value) = ( (value)>>1 ) | ( F << 7 );\
F = ( rrtemp & FLAG_C ) | sz53p_table[(value)];\
}

Definition at line 459 of file macros.h.

◆ RRA

#define RRA ( )
Value:
{\
Z80EX_BYTE bytetemp = A;\
A = ( A >> 1 ) | ( F << 7 );\
F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\
( A & ( FLAG_3 | FLAG_5 ) ) | ( bytetemp & FLAG_C ) ;\
}

Definition at line 947 of file macros.h.

◆ RRC

#define RRC (   value)
Value:
{\
F = (value) & FLAG_C;\
(value) = ( (value)>>1 ) | ( (value)<<7 );\
F |= sz53p_table[(value)];\
}

Definition at line 466 of file macros.h.

◆ RRCA

#define RRCA ( )
Value:
{\
F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) | ( A & FLAG_C );\
A = ( A >> 1) | ( A << 7 );\
F |= ( A & ( FLAG_3 | FLAG_5 ) );\
}

Definition at line 918 of file macros.h.

◆ RRD

#define RRD (   rd,
  wr 
)
Value:
{\
Z80EX_BYTE bytetemp;\
READ_MEM(bytetemp, HL, rd);\
WRITE_MEM(HL, ( A << 4 ) | ( bytetemp >> 4 ) ,wr);\
A = ( A & 0xf0 ) | ( bytetemp & 0x0f );\
F = ( F & FLAG_C ) | sz53p_table[A];\
MEMPTR=HL+1;\
}

Definition at line 553 of file macros.h.

◆ RST

#define RST (   value,
  w1,
  w2 
)
Value:
{\
PUSH(PC, w1, w2);\
PC=(value);\
MEMPTR=PC;\
}

Definition at line 473 of file macros.h.

◆ SBC

#define SBC (   a,
  value 
)
Value:
{\
Z80EX_WORD sbctemp = A - (value) - ( F & FLAG_C ); \
Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \
( ( (value) & 0x88 ) >> 2 ) | \
( ( sbctemp & 0x88 ) >> 1 ); \
A=sbctemp;\
F = ( sbctemp & 0x100 ? FLAG_C : 0 ) | FLAG_N |\
halfcarry_sub_table[lookup & 0x07] | overflow_sub_table[lookup >> 4] |\
sz53_table[A];\
}

Definition at line 480 of file macros.h.

◆ SBC16

#define SBC16 (   hl,
  value 
)
Value:
{\
Z80EX_DWORD sub16temp = HL - (value) - (F & FLAG_C); \
Z80EX_BYTE lookup = ( ( HL & 0x8800 ) >> 11 ) | \
( ( (value) & 0x8800 ) >> 10 ) | \
( ( sub16temp & 0x8800 ) >> 9 ); \
MEMPTR=hl+1;\
HL = sub16temp;\
F = ( sub16temp & 0x10000 ? FLAG_C : 0 ) |\
FLAG_N | overflow_sub_table[lookup >> 4] |\
( H & ( FLAG_3 | FLAG_5 | FLAG_S ) ) |\
halfcarry_sub_table[lookup&0x07] |\
( HL ? 0 : FLAG_Z) ;\
}

Definition at line 492 of file macros.h.

◆ SCF

#define SCF ( )
Value:
{\
F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\
( A & ( FLAG_3 | FLAG_5 ) ) |\
FLAG_C;\
}

Definition at line 996 of file macros.h.

◆ SET

#define SET (   bit,
  val 
)
Value:
{\
val |= (1 << bit);\
}

Definition at line 1034 of file macros.h.

◆ SLA

#define SLA (   value)
Value:
{\
F = (value) >> 7;\
(value) <<= 1;\
F |= sz53p_table[(value)];\
}

Definition at line 507 of file macros.h.

◆ SLL

#define SLL (   value)
Value:
{\
F = (value) >> 7;\
(value) = ( (value) << 1 ) | 0x01;\
F |= sz53p_table[(value)];\
}

Definition at line 514 of file macros.h.

◆ SP

#define SP   z80ex.sp.w

Definition at line 59 of file macros.h.

◆ SPH

#define SPH   z80ex.sp.b.h

Definition at line 57 of file macros.h.

◆ SPL

#define SPL   z80ex.sp.b.l

Definition at line 58 of file macros.h.

◆ SRA

#define SRA (   value)
Value:
{\
F = (value) & FLAG_C;\
(value) = ( (value) & 0x80 ) | ( (value) >> 1 );\
F |= sz53p_table[(value)];\
}

Definition at line 521 of file macros.h.

◆ SRL

#define SRL (   value)
Value:
{\
F = (value) & FLAG_C;\
(value) >>= 1;\
F |= sz53p_table[(value)];\
}

Definition at line 528 of file macros.h.

◆ SUB

#define SUB (   value)
Value:
{\
Z80EX_WORD subtemp = A - (value); \
Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \
( ( (value) & 0x88 ) >> 2 ) | \
( (subtemp & 0x88 ) >> 1 ); \
A=subtemp;\
F = ( subtemp & 0x100 ? FLAG_C : 0 ) | FLAG_N |\
halfcarry_sub_table[lookup & 0x07] | overflow_sub_table[lookup >> 4] |\
sz53_table[A];\
}

Definition at line 535 of file macros.h.

◆ T_WAIT_UNTIL

#define T_WAIT_UNTIL (   t_state)
Value:
if (t_state > z80ex.op_tstate) { \
z80ex.tstate += t_state - z80ex.op_tstate; \
z80ex.op_tstate = t_state; \
}

Definition at line 119 of file macros.h.

◆ TSTATES

#define TSTATES (   amount)    z80ex.tstate += amount

Definition at line 143 of file macros.h.

◆ WRITE_MEM

#define WRITE_MEM (   addr,
  vbyte,
  t_state 
)
Value:
{ \
T_WAIT_UNTIL(t_state); \
z80ex_mwrite_cb(addr, vbyte); \
}

Definition at line 161 of file macros.h.

◆ WRITE_PORT

#define WRITE_PORT (   port,
  vbyte,
  t_state 
)
Value:
{ \
T_WAIT_UNTIL(t_state); \
z80ex_pwrite_cb((port), vbyte); \
}

Definition at line 168 of file macros.h.

◆ XOR

#define XOR (   value)
Value:
{\
A ^= (value);\
F = sz53p_table[A];\
}

Definition at line 547 of file macros.h.

FLAG_3
#define FLAG_3
Definition: macros.h:83
FLAG_P
#define FLAG_P
Definition: macros.h:81
BC_
#define BC_
Definition: macros.h:39
_z80_cpu_context::nmos
int nmos
Definition: z80ex.h:175
R
#define R
Definition: macros.h:66
BC
#define BC
Definition: macros.h:23
B
#define B
Definition: macros.h:21
FLAG_5
#define FLAG_5
Definition: macros.h:85
F
#define F
Definition: macros.h:18
FLAG_C
#define FLAG_C
Definition: macros.h:79
z80ex_pread_cb
Z80EX_BYTE z80ex_pread_cb(Z80EX_WORD port16)
Definition: cpu.c:302
FLAG_V
#define FLAG_V
Definition: macros.h:82
addr
int addr
Definition: dma65.c:81
MEMPTRh
#define MEMPTRh
Definition: macros.h:73
FLAG_H
#define FLAG_H
Definition: macros.h:84
HL_
#define HL_
Definition: macros.h:47
HL
#define HL
Definition: macros.h:31
SP
#define SP
Definition: macros.h:59
DE_
#define DE_
Definition: macros.h:43
Z80EX_BYTE
unsigned char Z80EX_BYTE
Definition: z80ex.h:49
mode
int mode
Definition: vera.c:61
H
#define H
Definition: macros.h:29
C
#define C
Definition: macros.h:22
MEMPTR
#define MEMPTR
Definition: macros.h:75
FLAG_S
#define FLAG_S
Definition: macros.h:87
FLAG_N
#define FLAG_N
Definition: macros.h:80
R7
#define R7
Definition: macros.h:67
I
#define I
Definition: macros.h:65
DE
#define DE
Definition: macros.h:27
L
#define L
Definition: macros.h:30
A
#define A
Definition: macros.h:17
value
int value
Definition: dma65.c:90
PC
#define PC
Definition: macros.h:63
_z80_cpu_context::op_tstate
unsigned char op_tstate
Definition: z80ex.h:157
z80ex
Z80EX_CONTEXT z80ex
Definition: primo.c:37
FLAG_Z
#define FLAG_Z
Definition: macros.h:86
z80ex_mread_cb
Z80EX_BYTE z80ex_mread_cb(Z80EX_WORD addr, int m1_state)
Definition: cpu.c:240
IFF2
#define IFF2
Definition: macros.h:70