This is a cache of https://vccplus.brianholman.com/manuals/inside-the-coco-3/beacon/. It is a snapshot of the page as it appeared on 2026-11-21T00:01:47.615+0000.
Find the missing beacon · Inside the CoCo 3 — Hardware and Debugging · VCC Plus
← Manual LibraryVCC Plus 3.7.1 · Reading on the web

Try the exercises in VCC Plus. Example links download files here; open them in the app to work beside the emulator.

The complete book · PDF editionBook 10: Inside the CoCo 3 — Hardware and Debugging

27 pages · VCC Plus 3.7.1 · Keep a copy to read or print.

Download PDF
Contents

Chapter 4 of 7

Find the missing beacon

The CoCo draws a house. Six lines later BASIC draws a dot inside a rectangular receiver, but you can still see the house. Did BASIC miss the dot, or are you looking at the wrong picture? Catch the program just before it draws the dot. You can answer both questions without letting it switch the monitor.

Stop on either side of PSET

Use a fresh Disk BASIC session with 512 KB of RAM and Settings → Video Signal → RGB Monitor. Open BEACON.bas from the Manual Library. In a browser, save the file and open it in Develop → BASIC Development. The program and its graphics pages will live in the practice machine's RAM.

10 WIDTH 32:PCLEAR 4:CLS
20 PMODE 1,1:PCLS 0:SCREEN 1,0
30 COLOR 1,0:LINE(32,80)-(96,112),PSET,B
40 LINE(32,80)-(64,48),PSET:LINE(64,48)-(96,80),PSET
50 PMODE 1,3:PCLS 0:COLOR 3,0
60 LINE(144,48)-(184,80),PSET,B
70 PSET(162,64,3)

Line 10 reserves four BASIC graphics pages. One PMODE 1 picture takes two of those pages. Line 20 picks page 1 as the start of the first picture and uses SCREEN to display it. Lines 30 and 40 draw the walls and roof. At line 50, BASIC starts drawing at page 3. Notice which command from line 20 is missing on line 50. The monitor carries on showing the house while BASIC clears the other picture and draws its receiver.

  1. In BASIC Development, click the breakpoint gutter beside 70 and 80, then Run. Accept the program load if asked. When line 70 is highlighted, the receiver outline already exists. The PSET on the highlighted line still lies ahead.
  2. Open Debug → Show Debugger → Graphics Preview. Current Video Page shows the house. The information beside the picture reports Physical RAM $070E00 in this setup.
  3. Choose At Address → Mapped CPU, enter 1A00, and choose Go. Select PMODE 1 and Set 0. Now you should see a rectangular outline. The address gives the debugger a starting byte. The mode tells it how to turn the following bytes into pixels.
  4. In Pixel Inspector, enter 81 for X and 32 for Y, then press Return. Write down the Address, Byte, and Bit mask. In BASIC Development choose Continue. At line 80, go back to the same preview and read those three fields again.
Current Video Page at line 80. A green house stands at the left.
At Address at the same stop. A blue rectangular receiver at the right contains one blue dot.

These are the two 128 × 96 preview buffers from a single pause. In the app, the pixel-selection outline can cover part of the dot. Use the Byte field to tell whether it changed.

Work back from the pixel to its byte

BASIC used coordinates (162,64). PMODE 1 represents its picture with 128 columns and 96 rows, half as many positions in each direction as BASIC's drawing grid. On this grid the dot lands at (81,32). The inspector's X and Y fields take these stored pixel coordinates in decimal.

Starting at the top left of the hidden picture Distance in bytes
One row contains 128 pixels. Four two-bit pixels fit in each byte. 128 ÷ 4 = 32 bytes per row
Skip the first 32 rows to reach Y = 32. 32 × 32 = 1,024 bytes, or $0400
Skip 20 whole groups of four pixels to reach the group containing X = 81. 20 bytes, or $14
Add the two offsets to the mapped start address. $1A00 + $0400 + $14 = $1E14

Read the pixels from the high pair of bits toward the low pair. Byte 20 holds X positions 80, 81, 82 and 83. The dot at 81 uses the second pair, bits 5 and 4. The inspector's mask $30, binary 00110000, picks out that pair.

Stop Mapped byte at $1E14 Four pixel codes, left to right
Before line 70 $FF 11 11 11 11
Before line 80 $EF 11 10 11 11

The pen number 3 in the BASIC source produced the stored two-bit code 10 in this run. Pen numbers, packed pixel codes and RGB colors describe different stages of drawing. You just measured the stored code directly. The other three pairs survived the write.

Find that byte in physical RAM

With the mapped preview selected, choose Show Byte in Memory. The Inspector opens to mapped RAM. Read row 1E10, column 04. Open MMU and look up the CPU window $0000–$1FFF. On this Disk BASIC machine, task 0 is active and the window uses bank $38. Its physical base is $38 × $2000 = $70000. The hidden picture therefore starts at $71A00, and its marked byte is $71E14.

Go back to Graphics Preview → At Address, choose Physical RAM, enter 71A00, and choose Go. Leave PMODE 1, Set 0 and the pixel coordinates as before. The receiver is still there. The inspector now names the marked byte by its physical address. Current Video Page still reads from $70E00. The CPU drew the dot, and the video hardware was reading a different region of RAM.

If you see the house in both previews, check the address space as well as the digits. If you see an unmarked rectangle at line 70, you have reached the intended first stop. Use Continue to reach 80 before looking for $EF. Leave the machine paused there for the one-byte experiment.

Original VCC Plus manuals © 2026 Brian K. Holman. Third-party references retain their authors’ copyrights and licenses. Artwork notices. Edition 3.7.1; source and export identity. Printable edition: PDF source and export identity.

A closer look

Open original