pokey

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package pokey implements the audio generation of the POKEY. It is based on the work for TIA audio, implemented elsewhere in Test7800.

Unlike TIA audio it is not intended to be stepped directly from the main console loop. Rather, it piggybacks on the TIA and is ticked in lock-step with the TIA.

Information about POKEY specifically is taken from:

https://7800.8bitdev.org/index.php/POKEY_C012294_Documentation

This document will be referred to as "POKEY_C012294" in any code comments in this package. And quotations in the comments should be assumed to be from this document.

Also used as a reference is chapter 5 of the Altirra Hardware Reference Manual:

https://www.virtualdub.org/downloads/Altirra%20Hardware%20Reference%20Manual.pdf

References to this document in comments will be abbreviated to 'Altirra Reference'

Also used as a reference for POKEY is the relevant parts of the Altirra emulator (specifically v4.31)

https://www.virtualdub.org/altirra.html

And finally, the original POKEY document from Atari for additional clarity:

http://visual6502.org/images/C012294_Pokey/pokey.pdf

References in comments will be abbreviated to 'Atari POKEY'

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	Break(e error)
}

type Pokey

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

Pokey is the implementation of the TIA audio sub-system

func NewAudio

func NewAudio(ctx Context, origin uint16) (*Pokey, error)

NewAudio is the preferred method of initialisation for the Audio sub-system.

func (*Pokey) Access

func (pk *Pokey) Access(write bool, idx uint16, data uint8) (uint8, bool, error)

func (*Pokey) Label

func (pk *Pokey) Label() string

func (*Pokey) Snapshot

func (pk *Pokey) Snapshot() *Pokey

Snapshot creates a copy of the TIA Audio sub-system in its current state.

func (*Pokey) Step

func (pk *Pokey) Step()

func (*Pokey) String

func (pk *Pokey) String() string

func (*Pokey) Volume

func (pk *Pokey) Volume(yield func(int16))

Volume iterates the current volume levels for each channel

type Registers

type Registers struct {
	// noise and volume come from the PAUDCx registers. noise is the upper 4-bits and the volume is
	// the lower 4-bits
	Noise  uint8
	Volume uint8

	// frequency value comes from the PAUDFx registers
	Freq uint8
}

func (Registers) String

func (reg Registers) String() string

Jump to

Keyboard shortcuts

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