lsnes rr0-β2
[lsnes.git] / manual.text
blob1c54d687e04c2e6b7d0bfb9357e51a851543ce8e
1 Memory map:
2 ===========
3 (all addresses in hex)
5 Address range           Size            SRAM id         Word    Description
6 00000000-0000FFFF       64K             (volatile)      1       APURAM (Sound processor RAM).
7 00010000-0001FFFF       64K             (volatile)      1       VRAM (Video RAM).
8 00020000-0002021F       544             (volatile)      1       OAM (Video Object Attribute Memory).
9 00021000-000211FF       512             (volatile)      1       CGRAM (Video Palette).
10 00022000-00022013       20              rtc             1       RTC (If present on cart).
11 00023000-00023FFF       4K              nec             2       DSP RAM (if present on cart).
12 007E0000-007FFFFF       128K            (volatile)      1       WRAM (Main system RAM).
13 10000000-1XXXXXXX       (variable)      srm             1       SRAM.
14 20000000-2XXXXXXX       (variable)      bss/slota.sts   1       BSX RAM / Sufami Turbo slot A SRAM.
15 30000000-3XXXXXXX       (variable)      bsp/slotb.sts   1       BSX PRAM / Sufami Turbo slot B SRAM.
16 80000000-8XXXXXXX       (variable)      (rom)           1       Main ROM.
17 90000000-9XXXXXXX       (variable)      (rom)           1       BSX Flash / Sufami Turbo slot A ROM / Gameboy ROM
18 A0000000-AXXXXXXX       (variable)      (rom)           1       Sufami Turbo slot B ROM (amount depends on cart).
19 F0000000-F000FFFF       64K             (rom)           4       DSP program ROM (if present on cart).
20 F0010000-F0010FFF       4K              (rom)           2       DSP data ROM (if present on cart).
23 Framerate:
24 ==========
25 NTSC: 10738636/178683 fps (60.09881186234840471673fps)
26 PAL: 322445/6448 fps (50.00697890818858560794fps)
29 Savestate/Movie format (.lsmv):
30 ===============================
31 Movies/Savestates are ZIP archives. All members must either be stored or deflated. Encryption nor patching is
32 not allowed. Max version to decompress can be at most 20 (PKZIP 2.0).
34 Member 'systemid' (required):
35 -----------------------------
36 One line containing "lsnes-rr"<rr_version> (e.g. "lsnes-rr1").
38 Member 'controlsversion' (required):
39 ------------------------------------
40 One line containing controls version.
42 This version is "0". WARNING: Don't try to decode movies with unknown controls version, you can encounter who knows
43 what.
45 Member 'coreversion' (required):
46 --------------------------------
47 One line containing raw bsnes version string (e.g. "bsnes v079").
49 On movie/savestate load, this is checked against the core emulator is using. If these mismatch, warning is issued.
51 Member 'port1' (optional):
52 --------------------------
53 One line containg type of port #1.
55 The valid values are:
56 * "none"
57 * "joypad" (the default if member is absent)
58 * "multitap"
59 * "mouse"
61 Member 'port2' (optional):
62 --------------------------
63 One line containg type of port #2.
65 The valid values are:
66 * "none" (the default if member is absent)
67 * "joypad"
68 * "multitap"
69 * "mouse"
70 * "superscope"
71 * "justifier"
72 * "justifiers"
74 Member 'project' (required):
75 ----------------------------
76 One line containing project ID. Opaque string.
78 Member 'rerecords' (required):
79 ------------------------------
80 One line containing rerecord count.
82 The rerecord count is given as ASCII base-10 nonnegative integer.
84 Note: Leading zeroes are not allowed (but 0 rerecords is still stored as "0").
86 Member 'authors' (required):
87 ----------------------------
88 Authors of the run, one per line (empty lines are skipped). 
90 * If only full name is available, line is of form <full_name>  (e.g. "John Doe").
91 * If only nickname is available, line is of form "|"<nickname> (e.g. "|Ilari")
92 * If both full name and nickname are available, line is of form <full_name>"|"<nickname> (e.g. "Jane Doe|jdoe").
94 Member 'gametype' (required):
95 -----------------------------
96 One line, giving ROM type.
98 Valid values are:
99 * "snes_ntsc" (NTSC SNES)
100 * "snes_pal" (PAL SNES)
101 * "bsxslotted" (BS-X slotted; NTSC)
102 * "bsx" (BS-X; NTSC)
103 * "sufamiturbo" (Sufami Turbo; NTSC)
104 * "sgb_ntsc" (NTSC SGB)
105 * "sgb_pal" (PAL SGB)
107 Member 'gamename' (optional):
108 -----------------------------
109 One line giving the game name.
111 Member 'rom.sha256' (optional):
112 -------------------------------
113 One line, giving SHA-256 of ROM as hex string (lowercase a-f). 
115 If there is no ROM, this member is absent.
117 Member 'romxml.sha256' (optional):
118 ----------------------------------
119 One line, giving SHA-256 of ROM XML as hex string (lowercase a-f). 
121 If there is no ROM XML (use emulator defaults), this member is absent.
123 Member 'slota.sha256' (optional):
124 ----------------------------------
125 One line, giving SHA-256 of SLOT A ROM as hex string (lowercase a-f). 
127 If there is no SLOT A ROM, this member is absent.
129 SNES games do not have slot A, and thus shouldn't have this member.
131 Member 'slotaxml.sha256' (optional):
132 ------------------------------------
133 One line, giving SHA-256 of SLOT A XML as hex string (lowercase a-f). 
135 If there is no SLOT A XML (use emulator defaults), this member is absent.
137 SNES games do not have slot A, and thus shouldn't have this member.
139 Member 'slotb.sha256' (optional):
140 ---------------------------------
141 One line, giving SHA-256 of SLOT B ROM as hex string (lowercase a-f). 
143 If there is no SLOT B ROM, this member is absent.
145 SNES, BS-X (slotted or not) and SGB games do not have slot B, and thus shouldn't have this member.
147 Member 'slotbxml.sha256' (optional):
148 ------------------------------------
149 One line, giving SHA-256 of SLOT B XML as hex string (lowercase a-f). 
151 If there is no SLOT B XML (use emulator defaults), this member is absent.
153 SNES, BS-X (slotted or not) and SGB games do not have slot B, and thus shouldn't have this member.
155 Member 'sram.<id>' (optional, only present in savestates):
156 ----------------------------------------------------------
157 Raw binary contents of SRAM with identifier '<id>'.
159 Current SRAM identifiers (based on bsnes v079 core):
160 * 'srm': Main cart SRAM.
161 * 'nec': DSP RAM on the cart (some DSP versions only).
162 * 'rtc': Cart Realtime Clock (if present on cart).
163 * 'bss': BS-X SRAM.
164 * 'bsp': BS-X PSRAM.
165 * 'slota.sts': Sufami Turbo Slot A Cart SRAM.
166 * 'slotb.sts': Sufami Turbo Slot B Cart SRAM.
168 Member 'moviesram.<id>' (required for SRAM start, otherwise must be absent):
169 ----------------------------------------------------------------------------
170 Raw binary contents of SRAM with identifier '<id>'. To be loaded at start of movie.
173 Member 'savestate' (required for savestate, must be absent otherwise):
174 ----------------------------------------------------------------------
175 Raw binary bsnes savestate.
177 Member 'moviestate' (required for savestate, must be absent otherwise):
178 -----------------------------------------------------------------------
179 Raw binary movie subsystem savestate.
181 Member 'hostmemory' (optional for savestate, must be absent otherwise):
182 -----------------------------------------------------------------------
183 Raw binary host memory contents.
185 Member 'input' (required):
186 --------------------------
187 Input track. One subframe per line (empty lines are skipped).
189 Each line consists of fields, split by '|' (no '|' at start of line unless first field is empty!).
191 The fields are in following order:
192 * Zero or more system fields
193 * Zero or more fields for port #1
194 * Zero or more fields for port #2
196 Inside each field, each button appears first in order. Then axis values appear, again in order. Each axis value must be
197 preceeded by at least one space/tab character. If reading button or axis value would go outside field, then the value
198 reads as released (for buttons) or as 0 (for axis).
200 For buttons, ' ', <tab> or '.' reads as released, anything else reads as pressed. Axis values are presented as signed
201 base-10 ASCII values (e.g. "-55" or "126"). If last encoded button/axis ends before field, the rest is ignored.
203 Note that axis values are after all button values regardless of ordering according to normal numeric order. E.g.
204 justifier, which has values 0 and 1 of type axis and values 2 and 3 of type button encodes the input in order 2, 3,
205 0, 1.
207 Fields for system:
208 ------------------
209 One field:
210 * Button #0: Frame sync flag. Indicates that this is first subframe of frame. The length of movie in frames is the
211 number of subframes with frame sync flag set.
212 * Button #1: Reset flag. Ignored if frame sync flag is not set.
213 * Axis #2: Reset counter major: This value is multiplied by 10000 and added to reset counter.
214 * Axis #3: Reset counter minor: This value is added to reset counter.
216 If both reset and frame sync flags are set, then emulator starts a counter from reset counter value. While the
217 counter is nonzero and new frame hasn't started, CPU instruction is stepped and counter is decremented by 1. If
218 the counter reaches zero, RESET is issued.
220 Examples:
221 "..|"           (subframe)
222 "F.|"           (No reset, new frame)
223 "FR|"           (reset instantly)
224 "FR 5 -1000|"   (reset after 49000 cycles)
226 Fields for port of type 'none':
227 -------------------------------
228 No fields.
230 Example:
233 Fields for port of type 'gamepad':
234 ----------------------------------
235 One field:
236 * Button #0: B
237 * Button #1: Y
238 * Button #2: Select
239 * Button #3: Start
240 * Button #4: Up
241 * Button #5: Down
242 * Button #6: Left
243 * Button #7: Right
244 * Button #8: A
245 * Button #9: X
246 * Button #10: L
247 * Button #11: R
249 Example:
250 "......lrA.LR|" (left+right, A, L+R).
252 Fields for port of type 'multitap':
253 -----------------------------------
254 Four fields, each field like gamepad field.
256 Example:
257 "........A|B|.........X|.Y|" (A on first controller, B on second, X on third and Y on fourth).
260 Fields for port of type 'mouse':
261 --------------------------------
262 One field:
263 * Axis #0: Relative X motion
264 * Axis #1: Relative Y motion
265 * Button #2: Left button
266 * Button #3: Right button
268 Example:
269 "L. -14|" (Mouse delta (-14,0), clicking left button).
271 Fields for port of type 'superscope':
272 -------------------------------------
273 One field:
274 * Axis #0: Absolute X position
275 * Axis #1: Absolute Y position
276 * Button #2: Trigger
277 * Button #3: Cursor
278 * Button #4: Turbo
279 * Button #5: Pause
281 Example:
282 "T... 32 54|" (firing at 32,54).
284 Fields for port of type 'justifier':
285 ------------------------------------
286 One field:
287 * Axis #0: Absolute X position
288 * Axis #1: Absolute Y position
289 * Button #2: Trigger
290 * Button #3: Start
292 Example:
293 "T.. 64 125|" (firing at 64, 125).
296 Fields for port of type 'justfiers':
297 ------------------------------------
298 Two fields of same type as in justifier.
300 Example:
301 "T. 64 125|.. 220 140" (firing at 64, 125 with first justifier and the second one is at 220, 140).