Rizin
unix-like reverse engineering framework and cli tools
spc_specs.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: maijin
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef _SPC_H
5 #define _SPC_H
6 
7 #define SPC_MAGIC "SNES-SPC700 Sound File Data"
8 #define SPC_HDR_SIZE sizeof(spc_hdr)
9 
10 #define RAM_START_ADDRESS 0x100
11 #define RAM_SIZE 0x10000
12 
13 #define DSP_REG_START_ADDRESS 0x10100
14 #define DSP_REG_SIZE 0x80
15 
16 #define EXTRA_RAM_START_ADDRESS 0x101C0
17 #define EXTRA_RAM_SIZE 0x40
18 
19 #define EXTENDED_ID666_START_ADDRESS 0x10200
20 
21 typedef enum {
26 
28  typedef struct { // SNES9x
29  char song_title[32];
30  char game_title[32];
31  char name_of_dumper[16];
32  char comments[32];
33  ut8 date[11];
34  ut8 num_sec_bef_fade_out[3];
35  ut8 len_fade_out[5];
36  char artist_song[32];
37  bool default_channel_disabled;
39  ut8 reserved[1];
40  })
41 id666_tag_text;
42 
44  typedef struct { // ZSNES
45  char song_title[32];
46  char game_title[32];
47  char name_of_dumper[16];
48  char comments[32];
49  ut8 date[4];
50  ut8 unused[8];
51  ut8 num_sec_bef_fade_out[3];
52  ut8 len_fade_out[4];
53  char artist_song[32];
54  bool default_channel_disabled;
55  ut8 reserved[1];
56  })
57 id666_tag_binary;
58 
60  typedef struct {
61  char signature[33];
62  ut8 signature2[2];
63  ut8 has_id666;
64  ut8 version;
65  })
66 spc_hdr;
67 
69  typedef struct {
70  ut8 pcl;
71  ut8 pch;
72  ut8 a;
73  ut8 x;
74  ut8 y;
75  ut8 psw;
76  ut8 sp;
77  ut8 reserved_1;
78  ut8 reserved_2;
79  })
80 spc_reg;
81 
83  typedef struct {
84  ut8 ram[0x10000];
85  ut8 dsp[128];
86  ut8 unused[0x40];
87  ut8 ipl_rom[0x40];
88  })
89 spc_data;
90 
91 #endif // _SPC_H
static char * version
Definition: acr.h:4
static char * signature(RzBinFile *bf, bool json)
Definition: bin_pe.c:117
uint8_t ut8
Definition: lh5801.h:11
@ reserved
Definition: lm32_isa.h:94
int x
Definition: mipsasm.c:20
#define a(i)
Definition: sha256.c:41
RZ_PACKED(typedef struct { char song_title[32];char game_title[32];char name_of_dumper[16];char comments[32];ut8 date[11];ut8 num_sec_bef_fade_out[3];ut8 len_fade_out[5];char artist_song[32];bool default_channel_disabled;emulator_used emulator_used[1];ut8 reserved[1];}) id666_tag_text
emulator_used
Definition: spc_specs.h:21
@ UNKNOWN
Definition: spc_specs.h:22
@ ZSNES
Definition: spc_specs.h:23
@ SNES9X
Definition: spc_specs.h:24
static int sp
Definition: z80asm.c:91