Version: v0.0.0-...-1c8c545 Latest Latest

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 5 Imported by: 0



Package namco contains components for Namco systems.



View Source
const (
	W = int32(224)
	H = int32(288)


View Source
var ViewerPalette = []color.RGBA{
	color.RGBA{0, 0, 0, 0},
	color.RGBA{128, 128, 128, 255},
	color.RGBA{192, 192, 192, 255},
	color.RGBA{255, 255, 255, 255},


func ColorTable

func ColorTable(config Config, data []uint8) []color.RGBA

func NewTileSheet

func NewTileSheet(r *sdl.Renderer, d []byte, l SheetLayout, pal []color.RGBA) (rcs.TileSheet, error)

func PaletteTable

func PaletteTable(config Config, data []uint8, colors []color.RGBA) [][]color.RGBA


type Config

type Config struct {
	TileLayout     SheetLayout
	SpriteLayout   SheetLayout
	PaletteEntries int
	PaletteColors  int
	Hack           bool

type Data

type Data struct {
	Palettes []uint8
	Colors   []uint8
	Tiles    []uint8
	Sprites  []uint8

type N06XX

type N06XX struct {
	DeviceR [4]rcs.Load8
	DeviceW [4]rcs.Store8

	NMI func()

	WatchDataW bool
	WatchDataR bool
	WatchCtrlW bool
	WatchCtrlR bool
	WatchNMI   bool
	// contains filtered or unexported fields

func NewN06XX

func NewN06XX() *N06XX

func (*N06XX) Next

func (n *N06XX) Next()

func (*N06XX) ReadCtrl

func (n *N06XX) ReadCtrl(addr int) rcs.Load8

func (*N06XX) ReadData

func (n *N06XX) ReadData(addr int) rcs.Load8

func (*N06XX) WriteCtrl

func (n *N06XX) WriteCtrl(addr int) rcs.Store8

func (*N06XX) WriteData

func (n *N06XX) WriteData(addr int) rcs.Store8

type N51XX

type N51XX struct {
	WatchR bool
	WatchW bool

func NewN51XX

func NewN51XX() *N51XX

func (*N51XX) Read

func (n *N51XX) Read() uint8

func (*N51XX) Write

func (n *N51XX) Write(v uint8)

type N54XX

type N54XX struct {
	WatchR bool
	WatchW bool

func NewN54XX

func NewN54XX() *N54XX

func (*N54XX) Read

func (n *N54XX) Read() uint8

func (*N54XX) Write

func (n *N54XX) Write(v uint8)

type SheetLayout

type SheetLayout struct {
	TextureW     int32
	TextureH     int32
	TileW        int32
	TileH        int32
	BytesPerCell int32
	PixelLayout  [][]int
	PixelReader  func([]byte, int, int) uint8

type SpriteCoord

type SpriteCoord struct {
	X uint8
	Y uint8

type Video

type Video struct {
	SpriteCoords   []SpriteCoord
	SpriteInfo     []uint8
	SpritePalettes []uint8
	TileMemory     []uint8
	ColorMemory    []uint8

	Texture *sdl.Texture
	// contains filtered or unexported fields

func NewVideo

func NewVideo(r *sdl.Renderer, config Config, data Data) (*Video, error)

func (*Video) Draw

func (v *Video) Draw(r *sdl.Renderer) error

func (*Video) Load

func (v *Video) Load(enc *rcs.Decoder)

func (*Video) Save

func (v *Video) Save(enc *rcs.Encoder)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto