1 /*****************************************************************************/
5 /* Simulator data passed to the chip plugins */
9 /* (C) 2002-2003 Ullrich von Bassewitz */
10 /* Römerstrasse 52 */
11 /* D-70794 Filderstadt */
12 /* EMail: uz@cc65.org */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
41 /*****************************************************************************/
43 /*****************************************************************************/
47 /* SimData structure */
48 typedef struct SimData SimData;
50 unsigned MajorVersion;
51 unsigned MinorVersion;
53 /* -- Callback functions -- */
55 void* (*Malloc) (size_t Size);
56 /* Allocate a memory block of the given size */
58 void (*Free) (void* Block);
59 /* Free an allocated memory block */
61 void (*Warning) (const char* Format, ...);
64 void (*Error) (const char* Format, ...);
65 /* Print an error and terminate the program */
67 void (*Internal) (const char* Format, ...);
68 /* Print an internal program error and terminate */
70 int (*GetCfgId) (void* CfgInfo, const char* Name, char** Id);
71 /* Search CfgInfo for an attribute with the given name and type "id". If
72 * found, remove it from the configuration, pass a pointer to a dynamically
73 * allocated string containing the value to Id, and return true. If not
74 * found, return false. The memory passed in Id must be free by a call to
78 int (*GetCfgStr) (void* CfgInfo, const char* Name, char** S);
79 /* Search CfgInfo for an attribute with the given name and type "string".
80 * If found, remove it from the configuration, pass a pointer to a
81 * dynamically allocated string containing the value to S, and return
82 * true. If not found, return false. The memory passed in S must be free
83 * by a call to Free();
86 int (*GetCfgNum) (void* CfgInfo, const char* Name, long* Val);
87 /* Search CfgInfo for an attribute with the given name and type "number".
88 * If found, remove it from the configuration, copy it into Val and return
89 * true. If not found, return false.
92 void (*Break) (const char* Format, ...);
93 /* Stop the CPU and display the given message */
96 /* Issue an irq request */
99 /* Issue an nmi request */
107 /* End of simdata.h */