cartridgeloader

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: GPL-3.0, GPL-3.0 Imports: 5 Imported by: 4

Documentation

Overview

Package cartridgeloader represents cartridge data when not attached to the VCS. When a reference to a cartridge is required functions expect an instance of cartridgeloader.Loader.

cl := cartridgeloader.Loader{
	Filename: "roms/Pitfall.bin",
}

When the cartridge is ready to be loaded the emulator calls the Load() function. This function currently handles files (specified with Filename) that are stored locally and also over http. Other protocols could easily be added. A good improvement would be to allow loading from zip or tar files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

type Loader struct {
	Filename string

	// empty string or "AUTO" indicates automatic fingerprinting
	Format string

	// expected hash of the loaded cartridge. empty string indicates that the
	// hash is unknown and need not be validated
	Hash string
	// contains filtered or unexported fields
}

Loader is used to specify the cartridge to use when Attach()ing to the VCS. it also permits the called to specify the format of the cartridge (if necessary. fingerprinting is pretty good)

func (Loader) HasLoaded

func (cl Loader) HasLoaded() bool

HasLoaded returns true if Load() has been successfully called

func (Loader) Load

func (cl Loader) Load() ([]byte, error)

Load the cartridge

func (Loader) ShortName

func (cl Loader) ShortName() string

ShortName returns a shortened version of the CartridgeLoader filename

Jump to

Keyboard shortcuts

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