Search
lxdream.org :: lxdream/src/cpu.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/cpu.h
changeset 10:c898b37506e0
prev9:2784c7660165
next11:0a82ef380c45
author nkeynes
date Sun Dec 11 05:15:36 2005 +0000 (16 years ago)
permissions -rw-r--r--
last change Add CPU disasembly options to mode dropdown
Split sh4/mem.c into core mem.c and sh4/mem.c
Start adding copyright comments to file headers
file annotate diff log raw
nkeynes@9
     1
nkeynes@9
     2
#ifndef dream_disasm_H
nkeynes@9
     3
#define dream_disasm_H 1
nkeynes@9
     4
nkeynes@9
     5
#include <stdlib.h>
nkeynes@9
     6
nkeynes@9
     7
#ifdef __cplusplus
nkeynes@9
     8
extern "C" {
nkeynes@9
     9
#endif
nkeynes@9
    10
nkeynes@9
    11
/**
nkeynes@9
    12
 * Disassembly function pointer typedef.
nkeynes@9
    13
 *
nkeynes@9
    14
 * @param pc Address to disassemble
nkeynes@9
    15
 * @param buffer String buffer to write disassembly into
nkeynes@9
    16
 * @param buflen Maximum length of buffer
nkeynes@9
    17
 * @return next address to disassemble
nkeynes@9
    18
 */
nkeynes@10
    19
typedef uint32_t (*disasm_func_t)(uint32_t pc, char *buffer, int buflen );
nkeynes@9
    20
nkeynes@9
    21
#define REG_INT 0
nkeynes@9
    22
#define REG_FLT 1
nkeynes@9
    23
#define REG_SPECIAL 2
nkeynes@9
    24
nkeynes@9
    25
/**
nkeynes@9
    26
 * Structure that defines a single register in a CPU for display purposes.
nkeynes@9
    27
 */
nkeynes@9
    28
typedef struct reg_desc_struct {
nkeynes@9
    29
    char *name;
nkeynes@9
    30
    int type;
nkeynes@9
    31
    void *value;
nkeynes@9
    32
} reg_desc_t;
nkeynes@9
    33
nkeynes@9
    34
typedef struct cpu_desc_struct {
nkeynes@9
    35
  char *name; /* CPU Name */
nkeynes@9
    36
  disasm_func_t disasm_func; /* Disassembly function */
nkeynes@9
    37
  size_t instr_size; /* Size of instruction */
nkeynes@9
    38
  char *regs; /* Pointer to start of registers */
nkeynes@9
    39
  size_t regs_size; /* Size of register structure in bytes */
nkeynes@9
    40
  struct reg_desc_struct *regs_info; /* Description of all registers */
nkeynes@9
    41
  uint32_t *pc; /* Pointer to PC register */
nkeynes@9
    42
  uint32_t *icount; /* Pointer to instruction counter */
nkeynes@9
    43
  /* Memory map? */
nkeynes@9
    44
} *cpu_desc_t;
nkeynes@9
    45
nkeynes@9
    46
#ifdef __cplusplus
nkeynes@9
    47
}
nkeynes@9
    48
#endif
nkeynes@9
    49
nkeynes@9
    50
#endif /* !dream_disasm_H */
.