FCflash

package module
v0.0.0-...-ca29d7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 6 Imported by: 0

README

ROM/EEPROM/Flash/SRAM reader/writer for FC/MD/GB/GBC/GBA

Arduino 5V

pins:

TBD

build:

$ arduino-cli compile -b arduino:avr:micro --build-cache-path ./build --build-path ./build ../FCflash

program:

$ avrdude.exe -p m32u4 -c avr109 -P COM5 -U flash:w:./build/FCflash.ino.hex:i

mbed 3.3V

pins:

TBD

cmd

tuna

Host tool of the reader/writer for FC/MD.

$ ./tuna -h
Usage of ./tuna:
  -baud int
        baud rate (default 115200)
  -chr int
        Size of CHR ROM in 8KB units (Value 0 means the board uses CHR RAM)
  -com int
        com port (default 5)
  -eeprom
        write NROM EEPROM
  -flash
        write Flash
  -mapper int
        mapper 0:NROM, 1:SxROM, 4:TxROM (default 1)
  -mirror int
        0:H, 1:V, 2:battery-backed PRG RAM (default 2)
  -prg int
        Size of PRG ROM in 16KB units (default 16)
  -raw
        raw access to ROM/RAM/EEPROM/Flash ICs
tunag

Host tool of the reader/writer for GB/GBC

$ ./tunag -h
Usage of ./tunag:
  -a    dump both ROM & RAM
  -baud int
        baud rate (default 115200)
  -com int
        com port (default 5)
  -flash
        write Flash
  -ram
        write RAM in cartridge
tunaa

Host tool of the reader/writer for GBA (and FC 3.3V cartridges)

$ ./tunaa -h
Usage of ./tunaa:
  -baud int
        baud rate (default 500000)
  -com int
        com port (default 7)
  -fc7
        dump FC mapper7 AxROM PRG
  -fc8bit
        dump FC 8BIT TxROM
  -flash
        write Flash
  -ram
        write RAM in cartridge
dlzss

LZSS decompressor.

title offset compressed length
Mr.SPLASH 713996 32KB+8KB (NOT compressed)
8BIT MUSIC POWER 430196 262626
8BIT MUSIC POWER FINAL 430212 289760-1
8BIT MUSIC POWER ENCORE 430212 175456

Documentation

Index

Constants

View Source
const (
	GBM_MENU_TITLE      = "NP M-MENU  MENU"
	GBM_ENTIRE_MBC      = 0x1B // as MBC5 + RAM + battery
	GBM_ENTIRE_ROM_SIZE = 5    // 2<<5 = 64banks -> 64*16 = 1024KB
	GBM_ENTIRE_RAM_SIZE = 3    //         4banks ->  4* 8 =   32KB
)
View Source
const (
	CMD_BANK = 0x99

	CMD_01h_UNKNOWN = 0x01 // ???

	CMD_0Ah_WRITE_ENABLE_STEP_1 = 0x0A
	CMD_02h_WRITE_ENABLE_STEP_2 = 0x02
	CMD_03h_UNDO_WRITE_STEP_2   = 0x03

	CMD_04h_MAP_ENTIRE_ROM = 0x04 // MBC4 mode
	CMD_05h_MAP_MENU       = 0x05 // MBC5 mode

	CMD_09h_WAKEUP_AND_RE_ENABLE_FLASH_REGS = 0x09 // regs at 0120h..013Fh
	CMD_08h_DISABLE_FLASH_REGS              = 0x08

	CMD_11h_RE_ENABLE_MBC_REGS = 0x11 // regs at 2100h
	CMD_10h_DISABLE_MBC_REGS   = 0x10

	CMD_0Fh_WRITE_TO_FLASH = 0x0f

	CMD_C0h_MAP_SELECTED_GAME_WITHOUT_RESET = 0xc0
)
View Source
const PACKET_SIZE = 0x400

Variables

This section is empty.

Functions

func ParseHeader

func ParseHeader(buf []byte) (title string, cgb, cartType, romSize, ramSize byte, ok bool)

Types

type GB

type GB struct {
	Buf []uint8
	// contains filtered or unexported fields
}

func NewGB

func NewGB(s io.ReadWriter) *GB

func (*GB) ClearRAM

func (g *GB) ClearRAM(cartType, ramSize byte) (size uint32, err error)

func (*GB) DetectGBM

func (g *GB) DetectGBM() error

func (*GB) DumpRAM

func (g *GB) DumpRAM(w io.Writer, cartType, ramSize byte) (size uint32, err error)

func (*GB) DumpROM

func (g *GB) DumpROM(w io.Writer, cartType, romSize byte) (checkSum uint32, err error)

func (*GB) IsSupportedFlash

func (g *GB) IsSupportedFlash() (device uint16, err error)

func (*GB) MapEntireROM

func (g *GB) MapEntireROM() error

func (*GB) Read128

func (g *GB) Read128(offset uint32) error

func (*GB) ReadFull

func (g *GB) ReadFull(offset uint32) error

func (*GB) ReadMappingGBM

func (g *GB) ReadMappingGBM(w io.Writer) ([]byte, error)

func (*GB) WriteFlash

func (g *GB) WriteFlash(device uint16, addr int, buf []byte) error

func (*GB) WriteRegByte

func (g *GB) WriteRegByte(addr uint32, data int) error

type Index

type Index uint16
const (
	INDEX_IMPLIED Index = iota
	INDEX_CPU
	INDEX_PPU
	INDEX_BOTH
)

type Message

type Message struct {
	Request Request
	Value   uint16

	Length uint16
	// contains filtered or unexported fields
}

type Request

type Request uint8
const (
	REQ_ECHO Request = iota + 0
	REQ_PHI2_INIT
	REQ_CPU_READ_6502
	REQ_CPU_READ
	REQ_CPU_WRITE_6502
	REQ_CPU_WRITE_6502_5BITS
	REQ_PPU_READ
	REQ_PPU_WRITE
)
const (
	REQ_CPU_WRITE_EEP Request = iota + 16
	REQ_PPU_WRITE_EEP
	REQ_CPU_WRITE_FLASH
)
const (
	REQ_RAW_READ Request = iota + 32
	REQ_RAW_READ_LO
	REQ_RAW_WRITE
	REQ_RAW_WRITE_LO
	REQ_RAW_READ_WO_CS
	REQ_RAW_WRITE_WO_CS
	REQ_RAW_WRITE_LO_WO_CS
)
const (
	REQ_RAW_ERASE_FLASH Request = iota + 48
	REQ_RAW_WRITE_FLASH
)
const (
	REQ_GBM_WRITE_REGS Request = iota + 64
)

Directories

Path Synopsis
cmd
dlzss command
gbheader command
hex2bin command
interleaveMD command
lsips command
mix8BITCHR command
mix8BITPRG command
snessum command
tuna command
tunaa command
tunag command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL