Rizin
unix-like reverse engineering framework and cli tools
vsf_specs.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2015 riq <ricardoquesada@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 #ifndef VSF_SPECS_H
4 #define VSF_SPECS_H
5 
6 #include <rz_types_base.h>
7 #include <rz_util.h>
8 #include <rz_lib.h>
9 #include <rz_bin.h>
10 
11 /* Snapshot format for VICE: http://vice-emu.sourceforge.net/ */
12 
14  struct vsf_hdr {
15  char id[19]; /* "VICE Snapshot File" */
16  char major;
17  char minor;
18  char machine[16]; /* "C64" or "C128" or... */
19  });
20 
22  struct vsf_module {
23  char module_name[16]; /* looking for "C64MEM", ... */
24  char major;
25  char minor;
26  ut32 length; /* little endian */
27  });
28 
30  struct vsf_maincpu {
31  ut32 clk; /* CPU clock value */
32  ut8 ac; /* A */
33  ut8 xr; /* X */
34  ut8 yr; /* Y */
35  ut8 sp; /* stack pointer */
36  ut16 pc; /* program counter */
37  ut8 st; /* Status register */
38  ut32 lastopcode; /* ? */
39  ut32 ba_low_flags; /* ? */
40  });
41 
43  struct vsf_c64mem {
44  ut8 cpudata; /* CPU port data byte */
45  ut8 cpudir; /* CPU port direction byte */
46  ut8 exrom; /* state of the EXROM line (?) */
47  ut8 game; /* state of the GAME line (?) */
48  ut8 ram[1024 * 64]; /* 64k RAM dump */
49  });
50 
52  struct vsf_c64rom {
53  ut8 kernal[1024 * 8]; /* Kernal ROM */
54  ut8 basic[1024 * 8]; /* BASIC ROM */
55  ut8 chargen[1024 * 4]; /* Charset */
56  });
57 
59  struct vsf_c128mem {
60  ut8 mmu[12]; /* dump of the 12 MMU registers */
61  ut8 ram[1024 * 128]; /* 128k RAM dump: banks 0 and 1 */
62  });
63 
65  struct vsf_c128rom {
66  ut8 kernal[1024 * 8]; /* Kernal ROM */
67  ut8 basic[1024 * 32]; /* BASIC ROM */
68  ut8 editor[1024 * 4]; /* Dump of the editor ROM */
69  ut8 chargen[1024 * 4]; /* Charset */
70  });
71 
72 /* Internal structure */
74  int machine_idx; /* 0=C64, 1=C128, ... see bin_vsf.c */
75  ut64 rom; /* ptr to C64/C128 rom */
76  ut64 mem; /* ptr to C64/C128 ram */
77  struct vsf_maincpu *maincpu;
78  Sdb *kv;
79 };
80 
81 #endif /* VSF_SPECS_H */
#define xr(subject)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
Definition: sflib.h:133
uint16_t ut16
uint32_t ut32
#define minor(dev)
Definition: fsmagic.c:57
#define major(dev)
Definition: fsmagic.c:56
uint8_t ut8
Definition: lh5801.h:11
struct vsf_maincpu * maincpu
Definition: vsf_specs.h:77
Definition: sdb.h:63
RZ_PACKED(struct vsf_hdr { char id[19];char major;char minor;char machine[16];})
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int sp
Definition: z80asm.c:91