Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Doubutsu no Mori Famicom Emulator Controls & Scripting]
- .: Known Emulator Controls :.
- Note: presumes Features[] below are enabled!
- quit emulator
- L + R + Z
- reset emulator
- hold Z: L + R
- pause emulator
- L + R
- toggle 8-sprite limit
- hold C-right: C-left
- Rapid Fire
- hold L: press any NES button
- Default mask is buttons only (F0), two levels.
- Reset All Rapid Fire
- L + R + Start (Recenter)
- speed control
- faster hold L: C-up
- slower hold L: C-down
- reset hold L: C-left
- save state
- hold R: any C button (C-up: #1, C-left: #2, C-right: #3, C-down: #4)
- load state
- hold C button: R
- load auto-savestate (~5 seconds back)
- hold all C buttons: R
- .: Controller Pak Notes, Scripting, Features :.
- Controller Pak notes must not set an extension or use Doubutsu no Mori's normal save names.
- Only the first "game" is used. The remaining are ignored.
- NESINFO Controller Pak header
- +0 8 NESINFO\x1A
- +8 1 [0; unknown]
- +9 1 [0; unknown]
- +A 2 size of scripts, if present
- +C 4 size of info section, must be non-zero
- +10 var scripts, if present
- +var var info section; iNES ROM, optionally Yay compressed
- script format:
- +0 3 cmd
- +3 1 length
- First command is eaten (skipped). Runs until END found.
- Menu cmds:
- VEQ, VNE, GID, GNM, IFM, ISZ, ICS, TCS, FIL, ROM, ESZ, CPN, REM, END
- Game cmds:
- VEQ, VNE, DIF, NHD, HSC, MOV, PAT, END
- VEQ execute if =0
- +4 1 if 0, processes next command else skips it
- VNE execute if !0
- +4 1 if !0, processes next command else skips it
- GID game ID
- str; value ignored
- GNM game name
- str; value ignored
- CPN Controller Pak name
- +4 0x10 name used for Controller Pak save data, mempak-encoded
- HSC High Scores
- Watches for changes in range of data at offset, exporting modifications to Controller Pak.
- The intention is to replace default high scores with saved ones, then update the saved copies when changed. That said, you could use it for any number of things.
- Data is saved to f"{CPN}.S" and automatically reloaded at boot if HSC commands are used.
- If savestates are in use, writeback only occurs if feature[8] is set to prevent corruption (or cheating).
- Watching starts when WRAM is equal to the given data, triggers writeback on mismatch.
- +4 2 address
- 07FF address in CPU WRAM
- 8000 if True, will not reset to "waiting" step once watch activated
- +6 var array copied to location; total length of all cmds cannot exceeed 0x80! (ignored beyond that)
- REM remark (comment)
- END terminates script
- ISZ info section size
- value ignored
- IFM info section format
- value ignored
- ICS info section checkum; HW sum of data
- +4 2 checksum; should match
- TCS test checksum of script region; HW sum of whole thing, should be 0
- likely contains inverse sum as data
- FIL set buffer fill value; used when feature[E] set
- +4 1 overrides default value FF stored to 803B7B58[0]
- ROM loads built-in ROM in hardcoded list from cartridge
- +4 1 index of ROM; 0 is external (Controller Pak)
- ESZ expanded size; if set, this value is used as decompressed size for ROM cmds instead of difference in codeword start & end
- +4 2 size of decompressed data allocation
- MOV copy A2 QWs f/ ROM QW A0 to A1
- +4 2 ROM src (<<4 for actual)
- +6 2 ROM target (<<4 for actual)
- +8 2 length (<<4 for actual)
- NHD new header: copy cmd[3] bytes f/ cmd data to iNES header
- +4 var data
- DIF a sort of IFF file? directory info? deinterlace file? Disk to iNES format? Purposefully corrupt ROM w/ compressed data as source pattern?
- Reads original file, writing "strings" over uncompressed ROM
- Pairs of "advance ** bytes" and copy "str" until NULL. Continues until size of uncompressed ROM.
- PAT patch; writes data to one of various address ranges
- patch entries:
- +0 1 target type; note the codeword types aren't rectified, will trigger TLB miss
- 1:features [803D67C8]; actual size 0x10, mostly booleans; debug pattern is 01 01 01 01 01 F0 01 01 01 01 01 01 01 01 01
- 00 if True, enables Reset (hold Z, press R + L)
- 01 if True, enables pausing emulation (R + L)
- 02 if True, enables speed up/slow down (set levels w/ C&D below)
- 03 if True, allows removing the 8 sprites-per-scanline limit {forces a conditional in the microcode}
- 04 if True, offers savestates
- 05 rapid fire button mask; by default set via word at osAppNMIBuffer+34
- 06 if True, enables writing RAM (f"{CPN}.R") to Controller Pak when preset (iNES RAM flag set; byte 6, |2)
- 07 maximum rapid fire level (or something)
- 08 if True, enables writing f"{CPN}.S" to Controller Pak even when savestates are in use. (see HSC cmd)
- 09 if True, allows {toggling 803B7B54[0]; some effect on speed-up behavior, possible clock hack}
- 0A if True, enables writing savestate 1 (C-Up) as f"{CPN}.W" to Controller Pak
- 0B frame threshold out of 100; not terribly sure but affects auto-savestates, may simply be a frameskip
- 0C maximum speedup levels
- 0D maximum slowdown levels
- 0E fill RSP buffer with 0x800 bytes of fill value {set on built-in games 1 (Clu Clu Land), 2 (Balloon Fight)}
- 0F unused?
- 2:ROM (including iNES header)
- 3:osAppNMIBuffer; actual size 0x40
- 4:word f/ 8082A070 in famicom_emu overlay code [007492E0]
- 5:word f/ 80835DA0 in famicom_emu overlay data
- 6:word f/ 80852690 in famicom_emu overlay stack
- +1 1 length
- +2 2 offset at target
- +4 var data
- *Note that these addresses are exploitable!
- These Controller Pak Notes are optionally used with Controller Pak imported games (not built-ins).
- Will attempt to write to port 1, then port 2.
- {CPN}.R 32 pages (0x2000) RAM. Only one bank supported and must have RAM flag set in iNES header.
- If matching filename found at boot, will load it automatically.
- Set feature[6] to write back to Controller Pak.
- {CPN}.W 83 pages (0x5300) WORKRAM, aka savestate 1 (C-up)
- If matching filename found at boot, will load it automatically.
- Set feature[A] to write back to Controller Pak, set feature[4] to enable loading/saving savestates during play.
- {CPN}.S 1 page (0x100) High Scores
- Only output if HSC cmds in use and data was modified during runtime. Two 0x80 banks; updated if savestates not in use or if features[8] set.
- Effectively a list of modifications to watched addresses vs. expected data, so could be used creatively for other purposes.
- -Zoinkity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement