Table of Contents

1 System memory usage

AMPARCADE loads at $8800…$9573

If you wish to reserve this memory in the ProDOS bitmap:

  • reference 5.1.4 of the P8 Tech Ref
  • ProDOS bitmap 10001($11):111(7)…10010($12):010(2)
  • $BF69 set all bits: poke 49001,255
  • $BF6A set 7,6,5,4,3,2: poke 49002, 252

2 VDP Graphics Routines

2.1 Sprites

Sprite numbers <S> range from 0 to 31 inclusive. Sprite patterns <P> range from 0 to 255 inclusive for 8x8 sprite, or from 0 to 63 inclusive for 16x16 sprites.

2.1.1 MAG,<N>

Set sprite size and magnification, where <N> is one of:

  • 0: 8x8 sprites, no magnification
  • 1: 8x8 sprites, 2x magnification
  • 2: 16x16 sprites, no magnification
  • 3: 16x16 sprites, 2x magnification

2.1.2 Sprite Attributes

  1. SSPR,<S>,<Y>,<X>,<P>,<C>

    Set attributes for sprite <S> to location <X>,<Y> pattern <P>, and color <C>.

  2. GSPR,<S>,<Y>,<X>,<P>,<C>

    Get the attributes for sprite <S> to variables <Y>,<X>,<P>, and <C>.

  3. SX,<S>,<X>

    Set the horizontal position for sprite <S> to <X>.

  4. SY,<S>,<Y>

    Set the vertical position for sprite <S> to <Y>. Set sprite Y

  5. GX,<S>,<V>

    Get the horizontal position for sprite <S> to variable <V>.

  6. GY,<S>,<V>

    Get the vertical position for sprite <S> to variable <V>

  7. SP,<S>,<P>

    Set the pattern for sprite <S> to <P>.

  8. SC,<S>,<C>

    Set color for sprite <S> to <C>.

  9. GP,<S>,<V>

    Get the pattern for sprite <S> to variable <V>.

  10. GC,<S>,<V>

    Get the color for sprite <S> to variable <V>.

2.1.3 Sprite Patterns

  1. DSPR,<P>,<P0>,<P1>,<P2>,<P3>,<P4>,<P5>,<P6>,<P7>

    Define the sprite pattern <P> to <P0>…<P7>.

  2. RSPR,<P>,<P0>,<P1>,<P2>,<P3>,<P4>,<P5>,<P6>,<P7>

    Read the sprite pattern <P> into variables <P0>…<P7>.

2.2 BCOL

Set backdop color

2.3 Mode selection

All mode selections preserve sprite size and magnification. All modes assume 16K VRAM. All modes start with video output enabled and interrupts disabled.

The mode selection commands do not take any parameters.

Some modes have multiple commands that initialize the same mode with different memory allocations. Unless you are accessing VRAM or registers directly, the library accounts for the selected memory allocation. Do not manually change the VREGs to select an alternative memory layout because the library's address calculations will then be incorrect.

2.3.1 Graphics I Mode

Command Name Table (R2) Color Table (R3) Pattern Table (R4) Sprite Attribute Table (R5) Sprite Pattern Table (R6)
GM1A $400 $780 $800 $700 $0
GM1B $1400 $1780 $1800 $1700 $1000
GM1C $2400 $2780 $2800 $2700 $2000
GM1D $3400 $3780 $3800 $3700 $3000

2.3.2 Graphics II Mode

Command Name Table (R2) Color Table (R3) Pattern Table (R4) Sprite Attribute Table (R5) Sprite Pattern Table (R6)
GM2 $1800 $2000 $0 $1B00 $3800

pattern table: $0000 - $17FF name table: $1800 - $1AFF sprite attribute table: $1B00 - $1BFF unused: $1C00 - $1FFF color table: $2000 - $27FF sprite pattern table: $3800 - $3FFF

2.3.3 Multicolor Mode

Command Name Table (R2) Color Table (R3) Pattern Table (R4) Sprite Attribute Table (R5) Sprite Pattern Table (R6)
GM3A $400 $0FC0 $800 $E00 $0
GM3B $1400 $1FC0 $1800 $1E00 $1000
GM3C $2400 $2FC0 $2800 $2E00 $2000
GM3D $3400 $3FC0 $3800 $3E00 $3000

Additionally, the multicolor modes commands the screen to transparent (e.g., sets the name table and pattern tables to color 0)

2.4 Tile Layer

2.4.1 Name tables

  1. STIL,<X>,<Y>,<N>

    Set tile location <X>,<Y> to pattern <N>

  2. VTIL,<X>,<Y>,<N1>{,<N?>}

    Set tiles in a column beginning at location <X>,<Y> to patterns <N1>…<N?>

  3. HTIL,<X>,<Y>,<N1>{,<N?>}

    Set tiles in a row beginning at location <X>,<Y> to patterns <N1>…<N?>

  4. GTIL,<X>,<Y>

    Get the pattern number at location <X>,<Y>

  5. HROW,<X>,<Y>,<N>,<REP>

    Set <REP> number of tiles in a row beginning at location <X>,<Y> to pattern <N>

  6. VCOL,<X>,<Y>,<N>,<REP>

    Set <REP> number of tiles in a column beginning at location <X>,<Y> to pattern <N>

  7. FILL,<N>

    Fill all location with pattern <N>

2.4.2 Color tables

  1. GM2 Mode
    1. TCOL,<N>,<COLOR0>,<COLOR1>,<COLOR2>,<COLOR3>,<COLOR4>,<COLOR5>,<COLOR6>,<COLOR7>

      Only in GM2 mode, set the colors for pattern <N> to <COLOR0>…<COLOR7>, where <COLOR?> in the color data for row ? of the pattern.

    2. RTCL,<N>

      Only in GM2 mode, read the colors for pattern <N>.

  2. GM1 Mode
    1. CSET,<S>,<COLOR>

      Only in GM1 mode, set the color for pattern set <S> to <COLOR>. In this mode, colors are changed for sets of 8 consecutive patterns.

    2. RCST,<S>

      Only in GM1 mode, read the color for pattern set <S>.

2.4.3 Pattern tables

  1. DTIL,<N>,<P0>,<P1>,<P2>,<P3>,<P4>,<P5>,<P6>,<P7>

    Define data for pattern <N> to bytes <P0>…<P7>.

  2. RTIL,<N>,<P0>,<P1>,<P2>,<P3>,<P4>,<P5>,<P6>,<P7>

    Read data for pattrn <N> into variables <P0>…<P7>.

  3. Multicolor Mode
    1. PLT,<X>,<Y>

      Only in MCM mode, set point <X>,<Y> to the current color.

    2. SCN
    3. HLN,<X1>,<X2>,<Y>

      Only in MCM mode, draw a horizontal line from <X1>,<Y> to <X2>,<Y>

    4. VLN,<Y1>,<Y2>,<X>

      Only in MCM mode, draw a vertical line from <X>,<Y1> to <X>,<Y2>

    5. COL,<COLOR>

      Only in MCM mode, set the current color to <COLOR> for future PLT, HLN, and VLN commands.

2.5 VRAM

2.5.1 LD,<SRC>,<DEST>,<LEN>

Copy <LEN> bytes from host RAM address <SRC> to VDP VRAM address <DEST>.

2.5.2 ULD,<SRC>,<DEST>,<LEN>

Copy <LEN> bytes from VDP VRAM address <SRC> to host RAM address <DEST>.

2.6 VREG

2.7 RSTA

Read status

3 Video Switch Routines

3.1 APVD

Show Apple video

4 Sound

4.1 SOFF

Turn sound off

4.2 MXR

Set mixer

4.3 Tone and Volume

4.3.1 TNA

Set tone A frequency and volume

4.3.2 VOLA

4.3.3 TNB

Set tone B frequency and volume

4.3.4 VOLB

4.3.5 TNC

Set tone C frequency and volume

4.3.6 VOLC

4.4 Noise

4.4.1 NSA

Set channel A noise and volume

4.4.2 NSB

Set channel B noise and volume

4.4.3 NSC

Set channel C noise and volume

4.5 Envelopes

4.5.1 ENVT

Set envelope type

4.5.2 ENVP

Set envelope period

4.5.3 ETNA

Set automatic envelope control tone

4.5.4 ETNB

4.5.5 ETNC

4.5.6 ENSA

4.5.7 ENSB

4.5.8 ENSC

4.6 FILT

Set filter

Created: 2016-08-05 Fri 16:17

Validate