memory

package
v0.0.0-...-8f43889 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Basic

type Basic []byte

Basic is an in-memory implementation of the Space Invaders memory.

The Space Invaders memory is mapped as follows:

$0000-$1FFF -> 8K ROM $2000-$23FF -> 1K RAM $2400-$3FFF -> 7K Video RAM $4000 -> RAM mirror

For more details on the ROM structure see machine.LoadROM.

func (Basic) LoadROM

func (b Basic) LoadROM(dir string) error

LoadROM loads the Space Invaders ROM into memory.

The ROM itself is broken down into 4 parts with the following address ranges:

$0000-$07ff: invaders.h $0800-$0fff: invaders.g $1000-$17ff: invaders.f $1800-$1fff: invaders.e

func (Basic) Read

func (b Basic) Read(addr uint16) byte

Read returns the value from memory at the given address.

func (Basic) ReadAll

func (b Basic) ReadAll() []byte

ReadAll returns the full memory contents.

func (Basic) Write

func (b Basic) Write(addr uint16, v byte)

Write writes the value v into memory at the given address.

Jump to

Keyboard shortcuts

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