]> git.sur5r.net Git - cc65/blobdiff - src/sim65/chip.h
New module strstack
[cc65] / src / sim65 / chip.h
index dbdbcaf3b73a3a4016a3a3f4b3ed45ad064547ad..f614c0ced045bfe72ba4047c566b8c293850f600 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2002      Ullrich von Bassewitz                                       */
-/*               Wacholderweg 14                                             */
-/*               D-70597 Stuttgart                                           */
-/* EMail:        uz@musoftware.de                                            */
+/* (C) 2002-2003 Ullrich von Bassewitz                                       */
+/*               Römerstrasse 52                                             */
+/*               D-70794 Filderstadt                                         */
+/* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 
 
 /* Forwards */
+struct AddressSpace;
 struct CfgData;
-struct ChipLibrary;
-typedef struct Chip Chip;
 typedef struct ChipInstance ChipInstance;
+typedef struct Chip Chip;
+typedef struct ChipLibrary ChipLibrary;
 
 /* One instance of a chip */
 struct ChipInstance {
-    Chip*           C;                  /* Pointer to corresponding chip */
-    unsigned long   Addr;               /* Start address of range */
-    unsigned        Size;               /* Size of range */
-    void*           InstanceData;       /* Chip instance data */
+    Chip*                   C;          /* Pointer to corresponding chip */
+    struct AddressSpace*    AS;         /* Pointer to address space */
+    unsigned                Addr;       /* Start address of range */
+    unsigned                Size;       /* Size of range */
+    void*                   Data;       /* Chip instance data */
 };
 
 /* Chip structure */
 struct Chip {
-    struct ChipLibrary* Library;        /* Pointer to library data structure */
-    const ChipData*     Data;           /* Chip data as given by the library */
-    Collection          Instances;      /* Pointer to chip instances */
+    struct ChipLibrary*     Lib;        /* Pointer to library data structure */
+    const ChipData*         Data;       /* Chip data as given by the library */
+    Collection              Instances;  /* Pointer to chip instances */
+};
+
+/* ChipLibrary structure */
+struct ChipLibrary {
+    char*                   LibName;    /* Name of the library as given */
+    char*                   PathName;   /* Name of library including path */
+    void*                   Handle;     /* Pointer to libary handle */
+    Collection              Chips;      /* Chips in this library */
 };
 
 
@@ -82,21 +92,22 @@ struct Chip {
 
 
 
-Chip* NewChip (struct ChipLibrary* Library, const ChipData* Data);
-/* Allocate a new chip structure, initialize and return it */
-
-ChipInstance* NewChipInstance (unsigned long Addr, unsigned Size);
+ChipInstance* NewChipInstance (const char* ChipName, unsigned Addr,
+                               unsigned Size, Collection* Attributes);
 /* Allocate a new chip instance for the chip. */
 
-void InitChipInstance (ChipInstance* CI, const char* ChipName,
-                       const struct CfgData** Data, unsigned Count);
-/* Initialize the given chip instance. Assign it to the chip named ChipName,
- * and call the init function of the chip passing the given config data.
- */
+ChipInstance* MirrorChipInstance (const ChipInstance* Orig, unsigned Addr);
+/* Generate a chip instance mirror and return it. */
 
 void SortChips (void);
 /* Sort all chips by name. Called after loading */
 
+void LoadChipLibrary (const char* LibName);
+/* Load a chip library. This includes loading the shared libary, allocating
+ * and initializing the data structure, and loading all chip data from the
+ * library.
+ */
+
 
 
 /* End of chip.h */
@@ -105,4 +116,3 @@ void SortChips (void);
 
 
 
-