LMMS
Loading...
Searching...
No Matches
Hes_Cpu.cpp File Reference
#include "Hes_Cpu.h"
#include "blargg_endian.h"
#include "hes_cpu_io.h"
#include "blargg_source.h"

Macros

#define FLUSH_TIME()
#define CACHE_TIME()
#define PAGE_OFFSET(addr)
#define TIME   (s_time + s.base)
#define READ(addr)
#define WRITE(addr, data)
#define READ_LOW(addr)
#define WRITE_LOW(addr, data)
#define READ_PROG(addr)
#define SET_SP(v)
#define GET_SP()
#define PUSH(v)
#define IS_NEG   (nz & 0x8080)
#define CALC_STATUS(out)
#define SET_STATUS(in)
#define GET_MSB()
#define ADD_PAGE(out)
#define GET_ADDR()
#define PAGE_CROSS_PENALTY(lsb)
#define BRANCH(cond)
#define ARITH_ADDR_MODES(op)
#define INC_DEC_AXY(reg, n)
#define SWAP_REGS(r1, r2)
#define POP()

Variables

int const ram_addr = 0x2000
int const st_n = 0x80
int const st_v = 0x40
int const st_t = 0x20
int const st_b = 0x10
int const st_d = 0x08
int const st_i = 0x04
int const st_z = 0x02
int const st_c = 0x01

Macro Definition Documentation

◆ ADD_PAGE

#define ADD_PAGE ( out)
Value:
(pc++, out = data + 0x100 * GET_MSB());
#define GET_MSB()
uint16_t pc
Definition Spc_Cpu.h:144
JSAMPIMAGE data
Definition jpeglib.h:945
float out
Definition lilv_test.c:1461

◆ ARITH_ADDR_MODES

#define ARITH_ADDR_MODES ( op)

◆ BRANCH

#define BRANCH ( cond)
Value:
{\
int16_t offset = (int8_t) data;\
pc++;\
if ( !(cond) ) goto branch_not_taken;\
pc = uint16_t (pc + offset);\
goto loop;\
}
goto loop
Definition Spc_Cpu.h:155
unsigned short uint16_t
Definition mid.cpp:99
short int16_t
Definition mid.cpp:96
signed char int8_t
Definition mid.cpp:95

◆ CACHE_TIME

#define CACHE_TIME ( )
Value:
(void) (s_time = s.time)
unsigned s
Definition inflate.c:1555
#define void
Definition unzip.h:396

◆ CALC_STATUS

#define CALC_STATUS ( out)
Value:
do {\
out = status & (st_v | st_d | st_i);\
out |= ((nz >> 8) | nz) & st_n;\
out |= c >> 8 & st_c;\
if ( !(nz & 0xFF) ) out |= st_z;\
} while ( 0 )
int const st_c
Definition Hes_Cpu.cpp:47
int const st_i
Definition Hes_Cpu.cpp:45
int const st_n
Definition Hes_Cpu.cpp:40
int const st_z
Definition Hes_Cpu.cpp:46
int const st_v
Definition Hes_Cpu.cpp:41
int const st_d
Definition Hes_Cpu.cpp:44
int nz
Definition Spc_Cpu.h:148
return c
Definition crypt.c:175

◆ FLUSH_TIME

#define FLUSH_TIME ( )
Value:
(void) (s.time = s_time)

◆ GET_ADDR

#define GET_ADDR ( )
Value:
GET_LE16( instr )
#define GET_LE16(addr)
Definition blargg_endian.h:154

◆ GET_MSB

#define GET_MSB ( )
Value:
(instr [1])

◆ GET_SP

#define GET_SP ( )
Value:
((sp - 1) & 0xFF)
uint8_t sp
Definition Spc_Cpu.h:145

◆ INC_DEC_AXY

#define INC_DEC_AXY ( reg,
n )
Value:
reg = uint8_t (nz = reg + n); goto loop;
unsigned char uint8_t
Definition mid.cpp:98
int n
Definition crypt.c:458

◆ IS_NEG

#define IS_NEG   (nz & 0x8080)

◆ PAGE_CROSS_PENALTY

#define PAGE_CROSS_PENALTY ( lsb)

◆ PAGE_OFFSET

#define PAGE_OFFSET ( addr)
Value:
((addr) & (page_size - 1))

◆ POP

#define POP ( )
Value:
READ_LOW( sp ); sp = (sp - 0xFF) | 0x100
#define READ_LOW(addr)
Definition Hes_Cpu.cpp:82

◆ PUSH

#define PUSH ( v)
Value:
((sp = (sp - 1) | 0x100), WRITE_LOW( sp, v ))
#define WRITE_LOW(addr, data)
Definition Hes_Cpu.cpp:83
unsigned v[N_MAX]
Definition inflate.c:1584

◆ READ

#define READ ( addr)
Value:
CPU_READ( this, (addr), TIME )
#define TIME
Definition Ay_Cpu.cpp:88
#define CPU_READ(cpu, addr, time)
Definition gb_cpu_io.h:68

◆ READ_LOW

#define READ_LOW ( addr)
Value:
(ram [int (addr)])
typedef int(UZ_EXP MsgFn)()

◆ READ_PROG

#define READ_PROG ( addr)
Value:
(s.code_map [(addr) >> page_shift] [PAGE_OFFSET( addr )])
#define PAGE_OFFSET(addr)
Definition Gb_Cpu.cpp:47

◆ SET_SP

#define SET_SP ( v)
Value:
(sp = ((v) + 1) | 0x100)

◆ SET_STATUS

#define SET_STATUS ( in)
Value:
do {\
status = in & (st_v | st_d | st_i);\
nz = in << 8;\
c = nz;\
nz |= ~in & st_z;\
} while ( 0 )
float in
Definition lilv_test.c:1460

◆ SWAP_REGS

#define SWAP_REGS ( r1,
r2 )
Value:
{\
uint8_t t = r1;\
r1 = r2;\
r2 = t;\
goto loop;\
}
struct huft * t
Definition inflate.c:943
static void r2(register WDL_FFT_REAL *a)
Definition fft.c:1089

◆ TIME

#define TIME   (s_time + s.base)

◆ WRITE

#define WRITE ( addr,
data )
Value:
{CPU_WRITE( this, (addr), (data), TIME );}
#define CPU_WRITE(cpu, addr, data, time)
Definition gb_cpu_io.h:71

◆ WRITE_LOW

#define WRITE_LOW ( addr,
data )
Value:
(void) (READ_LOW( addr ) = (data))

Variable Documentation

◆ ram_addr

int const ram_addr = 0x2000

◆ st_b

int const st_b = 0x10

◆ st_c

int const st_c = 0x01

◆ st_d

int const st_d = 0x08

◆ st_i

int const st_i = 0x04

◆ st_n

int const st_n = 0x80

◆ st_t

int const st_t = 0x20

◆ st_v

int const st_v = 0x40

◆ st_z

int const st_z = 0x02