Search
lxdream.org :: lxdream/src/cpu.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cpu.h
changeset 30:89b30313d757
prev14:fc481a638848
next43:0cf3e339cc59
author nkeynes
date Sun Dec 25 05:57:00 2005 +0000 (15 years ago)
permissions -rw-r--r--
last change Change timeslice to nanoseconds (was microseconds)
Generize single step (now steps through active CPU)
Add lots of header blocks
file annotate diff log raw
1.1 --- a/src/cpu.h Mon Dec 12 10:37:41 2005 +0000
1.2 +++ b/src/cpu.h Sun Dec 25 05:57:00 2005 +0000
1.3 @@ -1,8 +1,27 @@
1.4 +/**
1.5 + * $Id: cpu.h,v 1.6 2005-12-25 05:56:55 nkeynes Exp $
1.6 + *
1.7 + * Generic CPU definitions, primarily for providing information to the GUI.
1.8 + *
1.9 + * Copyright (c) 2005 Nathan Keynes.
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or modify
1.12 + * it under the terms of the GNU General Public License as published by
1.13 + * the Free Software Foundation; either version 2 of the License, or
1.14 + * (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + */
1.21
1.22 -#ifndef dream_disasm_H
1.23 -#define dream_disasm_H 1
1.24 +#ifndef dream_cpu_H
1.25 +#define dream_cpu_H 1
1.26
1.27 +#include <stdint.h>
1.28 #include <stdlib.h>
1.29 +#include <glib/gtypes.h>
1.30
1.31 #ifdef __cplusplus
1.32 extern "C" {
1.33 @@ -19,6 +38,7 @@
1.34 typedef uint32_t (*disasm_func_t)(uint32_t pc, char *buffer, int buflen, char *opcode );
1.35
1.36 typedef int (*is_valid_page_t)(uint32_t pc);
1.37 +typedef gboolean (*step_func_t)();
1.38
1.39 #define REG_INT 0
1.40 #define REG_FLT 1
1.41 @@ -33,21 +53,24 @@
1.42 void *value;
1.43 } reg_desc_t;
1.44
1.45 +/**
1.46 + * CPU definition structure - basic information and support functions.
1.47 + */
1.48 typedef struct cpu_desc_struct {
1.49 char *name; /* CPU Name */
1.50 disasm_func_t disasm_func; /* Disassembly function */
1.51 + step_func_t step_func; /* Single step function */
1.52 + is_valid_page_t is_valid_page_func; /* Test for valid memory page */
1.53 size_t instr_size; /* Size of instruction */
1.54 char *regs; /* Pointer to start of registers */
1.55 size_t regs_size; /* Size of register structure in bytes */
1.56 const struct reg_desc_struct *regs_info; /* Description of all registers */
1.57 uint32_t *pc; /* Pointer to PC register */
1.58 uint32_t *icount; /* Pointer to instruction counter */
1.59 - /* Memory map? */
1.60 - is_valid_page_t is_valid_page_func; /* Test for valid memory page */
1.61 } *cpu_desc_t;
1.62
1.63 #ifdef __cplusplus
1.64 }
1.65 #endif
1.66
1.67 -#endif /* !dream_disasm_H */
1.68 +#endif /* !dream_cpu_H */
.