Chris Collins

Tools · retro

Copper and blitter playground

Write an Amiga copper list and watch it run against the PAL or NTSC beam — raster bars, split palettes, per-pixel colour changes, animated with expressions — and run real blits with shifts, masks, minterms, and area fill on bitmaps you draw.

Added

How to use it

Copper

Type a copper list on the left; the picture on the right is one frame of what the beam draws. The view covers colour clocks $24–$E2 and lines $14 to the bottom of the frame — more than a normal display, so overscan and the blanking area (shown darker) are visible.

  • MOVE reg,value — any register by name (COLOR00, BPLCON0, DIWSTRT …) or offset.

  • WAIT v,h[,vmask,hmask] — wait until the beam reaches line v (8 bits) and colour clock h. Bit 0 of h is ignored, as on the real chip. The optional masks decide which position bits are compared; the top vertical bit (V7) is always compared.

  • SKIP v,h — skip the next instruction if the beam is already past v,h.

  • END — WAIT $FF,$FE, the conventional end of a list (dc.w $FFFF,$FFFE).

  • dc.w — raw words, so you can paste an existing list. ; starts a comment.

Anything in {braces} is a JavaScript expression recalculated every frame: t is the frame number, and sin, cos, round, rgb(r,g,b) (each 0–15) and hsv(hue,sat,val) are available. Press Play to animate at 50 or 60 frames per second. The presets cover the classic effects: rainbow and sky gradients, bouncing bars, a palette split, "copper chunky" horizontal colour changes, and the WAIT $FF,$DF trick for lines past 255 on PAL.

Test bitplanes draws a two-plane checker pattern inside the display window using COLOR00–03, so palette changes in the middle of a screen are visible. Bitplane DMA itself is not emulated — only the registers that change colours and the display window. Move over the picture to read the beam position; click to copy the WAIT for that spot.

The trace lists every instruction the copper executed with the beam position at that moment and when each WAIT woke up. Warnings flag a missing END, a WAIT that was already passed, and `MOVE`s to protected registers: following the original (OCS) rules, the copper halts on a write below $80 unless CDANG is set in COPCON, and below $40 even then. ECS relaxed these rules; the playground keeps the stricter ones, which work on every Amiga.

Timing model: each MOVE takes 4 colour clocks (two word fetches on alternate cycles); each WAIT takes 4 to fetch and 2 more to wake. Bitplane DMA that would steal copper slots in high-resolution or 7–8 plane modes is not modelled, so effects that depend on cycle-exact timing in those modes will look slightly different on hardware. A line is 227 colour clocks; PAL frames have 312 lines, NTSC 262.

⛶ Full screen (or F) gives the Copper picture the whole screen at its own shape, with the beam readout above it and the copper list beside it on a wide screen — the browser’s full screen where it is allowed, otherwise a full-window layer (iPhone); it is redrawn as the window changes, and ◫ Panels hides the list. Escape leaves.

Blitter

Draw in sources A, B and C (click or drag), choose which channels are used, and D shows the result of the blit. Constants (BLTxDAT) stand in for channels that are switched off.

  • Minterm — type a function of A, B, C (AB + aC, A^C, A&~B; lower case means NOT) or an LF byte directly. The classic cookie-cut is AB + aC = $CA.

  • ASH / BSH — barrel shift of A and B (0–15 pixels). Shifted-out bits enter the next word, including from the last word of a row into the first of the next row, as on the real chip — which is why shifted blits use one extra word with ALWM = $0000.

  • AFWM / ALWM — masks applied to the first and last word of every row of A.

  • DESC — descending mode: shifts go left and the blit runs from the end. Area fill (inclusive or exclusive, with fill-carry-in) only works in descending mode, scanning each row right to left and toggling at every set bit.

The register setup shows the BLTCON0, BLTCON1, mask, and BLTSIZE values to write for the blit you see (BLTSIZE = height × 64 + width in words; writing it starts the blit). Line mode is not covered.

Export

The current frame’s copper list as dc.w source, a C UWORD __chip array, or hex words. Expressions are frozen at the values of the frame shown.

Sources: Amiga Hardware Reference Manual (3rd edition), chapters on the Copper and the Blitter.

Sharing

Share link copies a link to the open tab: the copper list with its display options (?src=, ?video=ntsc, ?cdang=, ?pattern=, ?overlay= — long lists are packed into ?s=), the blitter set-up, or the export settings (?exportName=, ?exportFmt=dcw|c|hex). For example ?video=ntsc.

Runs entirely in your browser; nothing you type leaves this page.