Git Product home page Git Product logo

spcdra's Introduction

SPCdra: SPC700 loader for Ghidra

Very experimental! No compatibility guarantees.

Features

  • Sony/Nintendo SPC700 APU support for Sleigh
  • SPC file loader
  • Symbols for hardware registers
  • Processor manual index (manual available from The Internet Archive)

How to install

  1. Start Ghidra
  2. File -> Install Extensions
  3. Press the '+' icon ("Add extension")
  4. Choose the built or downloaded SPCdra zip file
  5. Restart Ghidra when prompted to load the extension properly

Loading files

  1. Start Ghidra
  2. Create a new project
  3. File -> Import File
  4. Select the .spc file you want to load
  5. Click Options...
  6. Type the main entrypoint address for the SPC engine (see below for details)
  7. Click OK

Finding the SPC engine entrypoint address

Finding the actual entrypoint for a given .spc file is important, because without it, it will be difficult to determine where to begin disassembly and analysis. By default, the loader will use the PC address stored in the .spc file metadata, but this is typically not going to be the actual entrypoint, but rather, whatever instruction the SPC was executing when the file was dumped. To find the actual entrypoint, you will need bsnes+ as well as the game ROM that the .spc file was dumped from.

  1. Start bsnes+
  2. Tools -> Debugger
  3. (In the Debugger window) Click "Break"
  4. (In the Main window) System -> Load Cartridge . . . -> Select game ROM
  5. (In the Debugger window) Tools -> Breakpoint Editor
  6. (In the Breakpoint window) Click "Add"
  7. Double-click the empty cell under "End (optional)" and type "fbff"
  8. Check the box under 'X'
  9. Under "Source", select "S-SMP bus"

Breakpoint Window

  1. (In the Debugger window) Click "Run"
  2. Once the breakpoint is hit, the address of the current instruction is the entrypoint address

Debugger Window

License

Licensed under the Apache License, Version 2.0

spcdra's People

Contributors

qwertymodo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kungfufurby

spcdra's Issues

JMP [!a+X] seems to be off by about three bytes or so on disassembly

I decided to use SPCdra in order to deal with a complicated situation with regards to over a hundred fragments of data (specifically, Mario Paint's beta SPC700 build, though the final build of Mario Paint could also qualify.). I discovered while fixing up the switch statements that JMP [!a+X] was grabbing a pointer from the array correctly, but then it offsets the pointer by about three bytes, messing up the disassembly.

Example SPC700 build: Mario Paint Beta SPC700 Build.zip

All code is located between $0500 and $2639. I modified the memory map to have all other locations not be declared as initialized to avoid trying to interpret data that shouldn't be interpreted, as I knew some of them would never be valid under normal circumstances.

I was using Ghidra 1.0.1.2.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.