The romreader Reference Manual

This is the romreader Reference Manual, version 0.5, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:36:52 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 romreader

A library for reading various ROM formats.

Author

Brit Butler <>

License

BSD

Version

0.5

Source

romreader.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 romreader/romreader.asd

Source

romreader.asd.

Parent Component

romreader (system).

ASDF Systems

romreader.


3.1.2 romreader/package.lisp

Source

romreader.asd.

Parent Component

romreader (system).

Packages

romreader.


3.1.3 romreader/conditions.lisp

Dependency

package.lisp (file).

Source

romreader.asd.

Parent Component

romreader (system).

Public Interface
Internals

3.1.4 romreader/romreader.lisp

Dependency

conditions.lisp (file).

Source

romreader.asd.

Parent Component

romreader (system).

Public Interface
Internals

3.1.5 romreader/nes.lisp

Dependency

romreader.lisp (file).

Source

romreader.asd.

Parent Component

romreader (system).

Packages

romreader-nes.

Public Interface

initialize-instance (method).

Internals

4 Packages

Packages are listed by definition order.


4.1 romreader-nes

Source

nes.lisp.

Use List
Internals

4.2 romreader

Homepage: <a href="http://github.com/redline6561/romreader">Github</a>

Source

package.lisp.

Use List

common-lisp.

Used By List

romreader-nes.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *valid-formats*

A list of ROM formats with implemented readers. Do not manually modify this.

Package

romreader.

Source

romreader.lisp.


5.1.2 Macros

Macro: defreader (format &body body)

Define a reader for FORMAT. FORMAT should be a pathname-type
(i.e. file extension). FORMAT will be added to *valid-formats* if needed. BODY executes inside a WITH-OPEN-FILE binding ’in’ to a binary-stream of the ROM. The BODY should return a list like so: (rom-metadata rom-binary).

Package

romreader.

Source

romreader.lisp.


5.1.3 Ordinary functions

Function: load-rom (path)

Check to see if PATH exists and is a supported ROM format. If so, call the appropriate reader and return a ROM instance, otherwise error.

Package

romreader.

Source

romreader.lisp.


5.1.4 Generic functions

Generic Reader: rom-binary (rom)

Return a bytevector of the ROM data.

Package

romreader.

Source

romreader.lisp.

Methods
Reader Method: rom-binary ((rom rom))

automatically generated reader method

Target Slot

binary.

Generic Reader: rom-chr (rom)

Return the character/sprite data from the ROM.

Package

romreader.

Source

romreader.lisp.

Methods
Reader Method: rom-chr ((rom rom))

automatically generated reader method

Target Slot

chr.

Generic Writer: (setf rom-chr) (object)
Package

romreader.

Methods
Writer Method: (setf rom-chr) ((rom rom))

automatically generated writer method

Source

romreader.lisp.

Target Slot

chr.

Generic Reader: rom-format (rom)

Return the file extension of the ROM as a symbol.

Package

romreader.

Source

romreader.lisp.

Methods
Reader Method: rom-format ((rom rom))

automatically generated reader method

Target Slot

format.

Generic Reader: rom-metadata (rom)

Return a plist of the ROM metadata.

Package

romreader.

Source

romreader.lisp.

Methods
Reader Method: rom-metadata ((rom rom))

automatically generated reader method

Target Slot

metadata.

Generic Reader: rom-prg (rom)

Return the program data from the ROM.

Package

romreader.

Source

romreader.lisp.

Methods
Reader Method: rom-prg ((rom rom))

automatically generated reader method

Target Slot

prg.

Generic Writer: (setf rom-prg) (object)
Package

romreader.

Methods
Writer Method: (setf rom-prg) ((rom rom))

automatically generated writer method

Source

romreader.lisp.

Target Slot

prg.


5.1.5 Standalone methods

Method: initialize-instance :after ((rom nes) &key)
Source

nes.lisp.


5.1.6 Conditions

Condition: malformed-header

Signalled when a corrupted or invalid header is encountered.

Package

romreader.

Source

conditions.lisp.

Direct superclasses

romreader-error.

Direct methods

message.

Direct slots
Slot: message
Initargs

:message

Readers

message.

Writers

This slot is read-only.

Condition: romreader-error

The base condition for all errors in ROMREADER.

Package

romreader.

Source

conditions.lisp.

Direct superclasses

error.

Direct subclasses

5.1.7 Classes

Class: rom
Package

romreader.

Source

romreader.lisp.

Direct subclasses

nes.

Direct methods
Direct slots
Slot: metadata
Initargs

:metadata

Readers

rom-metadata.

Writers

This slot is read-only.

Slot: binary
Initargs

:binary

Readers

rom-binary.

Writers

This slot is read-only.

Slot: format
Package

common-lisp.

Initargs

:format

Readers

rom-format.

Writers

This slot is read-only.

Slot: prg
Initargs

:prg

Readers

rom-prg.

Writers

(setf rom-prg).

Slot: chr
Initargs

:prg

Readers

rom-chr.

Writers

(setf rom-chr).


5.2 Internals


5.2.1 Special variables

Special Variable: *mapper-table*

A list of known NES Memory Mappers of the form (Number . Name).

Package

romreader-nes.

Source

nes.lisp.


5.2.2 Ordinary functions

Function: ksymb (&rest args)
Package

romreader.

Source

romreader.lisp.

Function: mkstr (&rest args)
Package

romreader.

Source

romreader.lisp.

Function: parse-header (byte-vector)
Package

romreader-nes.

Source

nes.lisp.


5.2.3 Generic functions

Generic Reader: filename (condition)
Package

romreader.

Methods
Reader Method: filename ((condition unknown-format))
Source

conditions.lisp.

Target Slot

filename.

Generic Reader: message (condition)
Package

romreader.

Methods
Reader Method: message ((condition malformed-header))
Source

conditions.lisp.

Target Slot

message.

Generic Function: parse-rom (format pathname)

Parse the file located at PATHNAME as a ROM of the given
FORMAT. FORMAT should be a symbol denoting a file extension. Returns a ROM instance.

Package

romreader.

Source

romreader.lisp.

Methods
Method: parse-rom ((rom (eql :nes)) pathname)
Source

nes.lisp.


5.2.4 Conditions

Condition: unknown-format

Signalled when an appropriate parser method could not be found for the extension of the given ROM pathname.

Package

romreader.

Source

conditions.lisp.

Direct superclasses

romreader-error.

Direct methods

filename.

Direct slots
Slot: filename
Initargs

:filename

Readers

filename.

Writers

This slot is read-only.


5.2.5 Classes

Class: nes
Package

romreader-nes.

Source

nes.lisp.

Direct superclasses

rom.

Direct methods

initialize-instance.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
D   F   G   I   K   L   M   P   R  
Index Entry  Section

(
(setf rom-chr): Public generic functions
(setf rom-chr): Public generic functions
(setf rom-prg): Public generic functions
(setf rom-prg): Public generic functions

D
defreader: Public macros

F
filename: Private generic functions
filename: Private generic functions
Function, ksymb: Private ordinary functions
Function, load-rom: Public ordinary functions
Function, mkstr: Private ordinary functions
Function, parse-header: Private ordinary functions

G
Generic Function, (setf rom-chr): Public generic functions
Generic Function, (setf rom-prg): Public generic functions
Generic Function, filename: Private generic functions
Generic Function, message: Private generic functions
Generic Function, parse-rom: Private generic functions
Generic Function, rom-binary: Public generic functions
Generic Function, rom-chr: Public generic functions
Generic Function, rom-format: Public generic functions
Generic Function, rom-metadata: Public generic functions
Generic Function, rom-prg: Public generic functions

I
initialize-instance: Public standalone methods

K
ksymb: Private ordinary functions

L
load-rom: Public ordinary functions

M
Macro, defreader: Public macros
message: Private generic functions
message: Private generic functions
Method, (setf rom-chr): Public generic functions
Method, (setf rom-prg): Public generic functions
Method, filename: Private generic functions
Method, initialize-instance: Public standalone methods
Method, message: Private generic functions
Method, parse-rom: Private generic functions
Method, rom-binary: Public generic functions
Method, rom-chr: Public generic functions
Method, rom-format: Public generic functions
Method, rom-metadata: Public generic functions
Method, rom-prg: Public generic functions
mkstr: Private ordinary functions

P
parse-header: Private ordinary functions
parse-rom: Private generic functions
parse-rom: Private generic functions

R
rom-binary: Public generic functions
rom-binary: Public generic functions
rom-chr: Public generic functions
rom-chr: Public generic functions
rom-format: Public generic functions
rom-format: Public generic functions
rom-metadata: Public generic functions
rom-metadata: Public generic functions
rom-prg: Public generic functions
rom-prg: Public generic functions