spicy

package module
Version: v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2018 License: MIT Imports: 15 Imported by: 0

README

spicy

An open-source version of Nintendo64 sdk's mild.exe. Assembles segments into an n64-compatible rom. This binary should eventually be a drop in, multiplatform replacement for mild.exe.

Usage

For information about how to use, see http://github.com/trhodeos/modern-n64sdk.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinarizeObject

func BinarizeObject(obj io.Reader, objcopy Runner) (io.Reader, error)

func CreateEntryBinary

func CreateEntryBinary(w *Wave, as Runner) (io.Reader, error)

func CreateRawObjectWrapper added in v0.5.0

func CreateRawObjectWrapper(r io.Reader, outputName string, ld Runner) (io.Reader, error)

func LinkSpec

func LinkSpec(w *Wave, ld Runner, entry io.Reader) (io.Reader, error)

func PreprocessSpec added in v0.2.0

func PreprocessSpec(file io.Reader, gcc Runner, includeFlags []string, defineFlags []string, undefineFlags []string) (io.Reader, error)

func SignExtend added in v0.5.0

func SignExtend(in uint64) uint64

func TempFileName added in v0.4.0

func TempFileName(suffix string) string

Types

type Constant

type Constant struct {
	Symbol string `  @Ident`
	Int    uint64 `| @Int`
}

type ExecRunner added in v0.4.0

type ExecRunner struct {
	// contains filtered or unexported fields
}

func NewRunner added in v0.4.0

func NewRunner(cmd string) ExecRunner

func (ExecRunner) Run added in v0.4.0

func (e ExecRunner) Run(r io.Reader, args []string) (io.Reader, error)

type FlagAst

type FlagAst struct {
	Boot   bool `  @"BOOT"`
	Object bool `| @"OBJECT"`
	Raw    bool `| @"RAW"`
}

type Flags

type Flags struct {
	Object bool
	Boot   bool
	Raw    bool
}

type MappedFileRunner added in v0.4.0

type MappedFileRunner struct {
	// contains filtered or unexported fields
}

func NewMappedFileRunner added in v0.4.0

func NewMappedFileRunner(r Runner, inputFileArgs map[string]io.Reader, outputFileArg string) MappedFileRunner

func (MappedFileRunner) Run added in v0.4.0

func (e MappedFileRunner) Run(r io.Reader, args []string) (io.Reader, error)

type MaxSegment

type MaxSegment struct {
	First  string `"max[" @String ","`
	Second string `    @String "]"`
}

type MinSegment

type MinSegment struct {
	First  string `"min[" @String ","`
	Second string `       @String "]"`
}

type OutputFileRunner added in v0.4.0

type OutputFileRunner struct {
	// contains filtered or unexported fields
}

func NewOutputFileRunner added in v0.4.0

func NewOutputFileRunner(r Runner, outputFile string) OutputFileRunner

func (OutputFileRunner) Run added in v0.4.0

func (e OutputFileRunner) Run(r io.Reader, args []string) (io.Reader, error)

type Positioning

type Positioning struct {
	AfterSegment    string
	AfterMinSegment [2]string
	AfterMaxSegment [2]string
	Address         uint64
}

type Runner added in v0.4.0

type Runner interface {
	Run(r io.Reader, args []string) (io.Reader, error)
}

type Segment

type Segment struct {
	Name        string
	Includes    []string
	StackInfo   *StackInfo
	Positioning Positioning
	Entry       *string
	MaxSize     uint64
	Align       uint64
	Flags       Flags
}

type SegmentAst

type SegmentAst struct {
	Statements []*StatementAst `"beginseg" { @@ } "endseg"`
}

type Spec

type Spec struct {
	Waves []*Wave
}

func ParseSpec

func ParseSpec(r io.Reader) (*Spec, error)

type SpecAst

type SpecAst struct {
	Segments []*SegmentAst `{ @@ }`
	Waves    []*WaveAst    `{ @@ }`
}

type StackInfo

type StackInfo struct {
	Start  string
	Offset uint64
}

type StatementAst

type StatementAst struct {
	/*
	   :name <segmentName>
	   |address <constant>
	   |after <segmentName>
	   |after max[<segmentName>,<segmentName>]
	   |after min[<segmentName>,<segmentName>]
	   |include <filename>
	   |maxsize <constant>
	   |align <constant>
	   |flags <flagList>
	   |number <constant>
	   |entry <symbol>
	   |stack <stackValue>
	*/
	// I tried using @Ident here, but the parser was greedily taking 'endseg' as name.
	// By explicitly listing all known names here, we limit the search space.
	Name  string `@("name" | "address" | "after" | "include" | "maxsize" | "align" | "flags" | "number" | "entry" | "stack")`
	Value Value  `@@`
}

type Summand

type Summand struct {
	Lhs *Constant ` @@`
	Op  string    `[ @("+" | "-")`
	Rhs *Constant ` @@ ]`
}

type Value

type Value struct {
	String        string      `  @String`
	Int           uint64      `| @Int`
	Flags         []*FlagAst  `| @@ { @@ }`
	ConstantValue *Summand    `| @@`
	MaxSegment    *MaxSegment `| @@`
	MinSegment    *MinSegment `| @@`
}

Only one of these values will be set.

type Wave

type Wave struct {
	Name           string
	ObjectSegments []*Segment
	RawSegments    []*Segment
}

func (*Wave) GetBootSegment

func (w *Wave) GetBootSegment() *Segment

type WaveAst

type WaveAst struct {
	Statements []*StatementAst `"beginwave" { @@ } "endwave"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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