sc68fordevelopers  2.2.1
struct68.h
Go to the documentation of this file.
1 
10 /* Copyright (C) 1998-2001 Ben(jamin) Gerard */
11 
12 #ifndef _STRUCT68_H_
13 #define _STRUCT68_H_
14 
15 #include "emu68/type68.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
26 #define IO68_NO_INT (0x80000000)
27 
28 #ifndef NULL
29 # define NULL 0L
30 #endif
31 
34 #define MEM68MSK ((1<<19)-1) /* 512 Kb memory */
35 /* #define MEM68MSK (reg68.memmsk) */
36 
42 typedef u32 (*memrfunc68_t)(u32 addr, cycle68_t cycle);
43 
45 typedef void (*memwfunc68_t)(u32 addr, u32 value, cycle68_t cycle);
46 
50 typedef void (linefunc68_t)(int, int );
51 
54 typedef struct
55 {
56  int vector;
57  int level;
58 } int68_t;
59 
66 typedef struct _io68_t
67 {
68  struct _io68_t * next;
69  char name[32];
74  int68_t *(*interrupt)(cycle68_t);
77  int (*reset)(void);
80 } io68_t;
81 
84 typedef struct
85 {
86  /* Registers. */
87  s32 d[8];
88  s32 a[8];
89  s32 usp;
90  s32 pc;
91  u32 sr;
94  int status;
96  /* Memory. */
97  u8 *mem;
99  unsigned int memsz;
101  /* Debug mode only. */
102  u8 *chk;
103  int framechk;
105  /* IO chips. */
106  int nio;
109 } reg68_t;
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif /* #ifndef _STRUCT68_H_ */
int status
Unused !!!
Definition: struct68.h:94
int nio
IO plug in IO-list.
Definition: struct68.h:106
u32 addr_low
IO mapping area start address.
Definition: struct68.h:70
unsigned int u32
Must be an unsigned 32 bit integer.
Definition: type68.h:37
void( linefunc68_t)(int, int)
First level (16 lines) decoder function.
Definition: struct68.h:50
unsigned int memsz
Memory size in byte.
Definition: struct68.h:99
u32 memmsk
Memory address mask.
Definition: struct68.h:98
int framechk
ORed chk change for current frame.
Definition: struct68.h:103
memwfunc68_t Wfunc[3]
IO write functions (B,W,L).
Definition: struct68.h:73
char name[32]
IO identifier name.
Definition: struct68.h:69
cycle68_t(* next_int)(cycle68_t)
IO get next interruption cycle.
Definition: struct68.h:75
struct _io68_t io68_t
IO emulator pluggin structure.
u8 * mem
Memory buffer.
Definition: struct68.h:97
cycle68_t rcycle_penalty
Read cycle penalty .
Definition: struct68.h:78
void(* adjust_cycle)(cycle68_t)
IO adjust cycle function.
Definition: struct68.h:76
unsigned char u8
Must be an unsigned 8 bit integer.
Definition: type68.h:31
memrfunc68_t Rfunc[3]
IO read functions (B,W,L).
Definition: struct68.h:72
u8 * chk
Access-Control-Memory buffer.
Definition: struct68.h:102
cycle68_t wcycle_penalty
Write cycle penalty.
Definition: struct68.h:79
u32(* memrfunc68_t)(u32 addr, cycle68_t cycle)
Read memory function.
Definition: struct68.h:42
int vector
Interrupt vector.
Definition: struct68.h:56
s32 usp
68000 User Stack Pointers.
Definition: struct68.h:89
io68_t * iohead
Head of IO-list.
Definition: struct68.h:107
int level
Interrupt level [0..7].
Definition: struct68.h:57
struct _io68_t * next
IO list; pointer to next.
Definition: struct68.h:68
cycle68_t cycle
Internal cycle counter.
Definition: struct68.h:93
signed int s32
Must be an signed 32 bit integer.
Definition: type68.h:38
void(* memwfunc68_t)(u32 addr, u32 value, cycle68_t cycle)
Write memory function.
Definition: struct68.h:45
int(* reset)(void)
IO reset function.
Definition: struct68.h:77
68K interruption exception structure.
Definition: struct68.h:54
68K emulator registers, memory and IO.
Definition: struct68.h:84
Type definitions.
u32 addr_high
IO mapping area end address.
Definition: struct68.h:71
u32 sr
68000 Status Register.
Definition: struct68.h:91
s32 pc
68000 Program Counter.
Definition: struct68.h:90
unsigned int cycle68_t
At least 32 bit integer.
Definition: type68.h:58
IO emulator pluggin structure.
Definition: struct68.h:66