Books > Mastering the VIC-20
Mastering the VIC-20 (GB)
A.J. Jones, E.A. Coley & D.G.J. Cole
Ellis Horwood, 1983
Download all programs from this book on one disk:
![]() Mastering VIC-20 JCC.d64 |
28 programs
Chapter 1: VIC BASIC
Program | Author | Requirements | Files | Info |
Bit Patterns![]() Page 19. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | bit patterns.prg Screenshot |
Displays the contents of any memory location in decimal and binary. Controls: Enter a memory address (0-65535). Press Space to run again, or Return to exit. |
Minisyn![]() Pages 20-24. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | minisyn.prg Screenshot |
Two octive music keyboard. Coloured bars are displayed as each note is played. Controls: The program is used with the keyboard upside down, i.e. the number keys are nearest to you and the space bar is furthest away. The first row (ArrowLeft to Home) corresponds to the white keys, and the next row (ArrowUp to Q) are the black keys. |
Chapter 2: Longer programs
Program | Author | Requirements | Files | Info |
Shuffles![]() Page 29. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | shuffles.prg Screenshot |
Shuffles a deck of cards using an array, and again using PEEK and POKE commands, to find out which approach is quicker. Controls: None. |
Test Card Display![]() Pages 31-34. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | test card disp.prg Screenshot |
Displays 52 playing cards on the screen, one at a time. Controls: Press any key (display next card). |
Pontoon![]() Pages 34-37. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | pontoon.prg Screenshot |
Card game. The player & computer are both dealt two cards (one of the computers cards is hidden). You must then decide whether to hit (take another card) or stick. The player whose total is closest to 21 wins. Controls: Decide whether to hit (take another card). If asked for the value of the ace, enter either 1 or 11. |
Play UFO Tune![]() Page 38. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | play ufo tune.prg Screenshot |
Music program. Plays the iconic UFO tune from the film 'Close Encounters of the Third Kind'. Controls: None. |
Asdic![]() Page 38. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | asdic.prg Screenshot |
Sound effect, similar to a radar ping. Controls: None. |
Control Room Hit![]() Page 39. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | controlroom hit.prg Screenshot |
Sound effect, the screen shakes as the control room is hit by an explosion. Controls: None. |
Decimal to Hex![]() Pages 39-41. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | decimal to hex.prg Screenshot |
Convert decimal numbers into hexadecimal, and also display the decimal hi/lo values. Controls: Enter a decimal number (0-65535). |
Chapter 3: VIC structure
Program | Author | Requirements | Files | Info |
Renumber![]() Page 48. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | renumber.prg Screenshot |
Renumber a BASIC program. This only changes the line numbers, it does not renumber GOTO or GOSUB statements. Controls: (1) Type or LOAD the program that needs renumbering. (2) Move the start of BASIC to a different location, e.g. by typing POKE44,28: POKE7168,0 (moves BASIC to 7168). (3) LOAD this program, and follow on-screen prompts. (4) Move the start of BASIC to its original location, e.g. POKE44,16 (moves BASIC to 4096), and LIST the renumbered program. |
Chapter 4: Graphics
Program | Author | Requirements | Files | Info |
Upside Down![]() Pages 59-60. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | upside down.prg Screenshot |
Redefines the character set to turn six characters upside down. Controls: None. |
Graphics Demo![]() Pages 61-63. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | graphics demo.prg Screenshot |
Redefines the character set to display a multicolour object. Controls: None. |
Sine Curve![]() Pages 63-66. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | sine curve.prg Screenshot |
Draws a hi-res sine curve. Controls: None. |
Hi-Res![]() Pages 66-69. |
Antonia Jones, Elizabeth Coley & David Cole | 3K expansion | hi-res 3k.prg Screenshot |
Draws the following in hi-res: three sine curves, a damped sine curve, and a spiral. Plotsub (chapter 8) is a machine code version of this program. Controls: None. |
Chapter 5: Peripheral devices
Program | Author | Requirements | Files | Info |
Data Files on Tape![]() Pages 73-77. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | cass data files.prg Screenshot |
Create a data file by typing some text that will be saved onto cassette tape. Read the file to display it on the screen, and optionally print it out. Controls: Follow on-screen prompts. |
SEQ Files![]() Pages 81-83. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | seq files.prg Screenshot |
Create a data file by typing some text that will be saved onto disk. Read the file to display it on the screen, and optionally print it out. Controls: Follow on-screen prompts. |
Lo-Dump![]() Page 87. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded & printer | lo-dump.prg Screenshot |
Subroutine to make a lo-res printout of the screen. Controls: None. |
Printer Dot Addressing![]() Pages 88-89. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded & printer | printer dot add.prg Screenshot |
Demonstrates individual dot addressing on the printer by printing a saw tooth wave. Controls: None. |
Chapter 6: Accessories
Program | Author | Requirements | Files | Info |
Pictures![]() Pages 91-92. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | pictures.prg Screenshot |
Lo-res drawing program. Draw your own pictures on the screen. Controls: Joystick (move), Fire (clear screen), 1-8 (choose colour), Return (end program). |
Light Pen Demo![]() Pages 93-94. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | light pen demo.prg Screenshot |
Programming demo showing how to read a light pen. It displays a red block on screen at the current light pen coordinates. Four values are also shown on screen: the current X,Y screen coordinates of the light pen, and the current PEEK values of memory locations 36870, 36871. Some tweaking might be needed in lines 30-40 to calculate the X,Y coordinates more accurately. Controls: None. |
Chapter 7: System architecture
Program | Author | Requirements | Files | Info |
10-Second Counter![]() Pages 104-105. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | mc counter.prg Screenshot |
Machine code IRQ routine, that loads at address $1D00. It displays a 10-second counter at the top-left corner of the screen. Controls: Start the routine with SYS7424. Stop it with SYS7488. |
Teststop Wedge![]() Page 106. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | mc teststop.prg Screenshot |
Machine code IRQ routine, that loads at address $1D00. It disables the Run/Stop key. Note: Many input/output routines reset these vectors, which may render the wedge ineffective unless it is re-run. Controls: Start the routine with SYS7424. Stop it with SYS7450. |
Teststop Loader![]() Page 107. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | teststop loader.prg Screenshot |
BASIC loader for the above m/c routine. It uses DATA statements to POKE the routine into memory, disabling the Run/Stop key. Controls: Start the routine with SYS7424. Stop it with SYS7450. |
Chapter 8: Introduction to machine code programming
Program | Author | Requirements | Files | Info |
Tinycopy![]() Pages 118-120. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | mc tinycopy.prg Screenshot |
Machine code routine, that loads at address $1819. It copies a block of memory (max 256 bytes) from $1600 to $1700. Controls: POKE 6144 with the number of bytes that you want to copy, then type SYS6169. |
Copy![]() Pages 122-124. |
Antonia Jones, Elizabeth Coley & David Cole | Unexpanded | mc copy.prg Screenshot |
Machine code routine, that loads at address $1868. It copies a block of memory from one location to another. Controls: Set the copy-from-start address with POKE6153,lo POKE6154,hi. Set the copy-from-end address with POKE6155,lo POKE 6156,hi. Set the copy-to-dest address with POKE6165,lo POKE 6166,hi. Then type SYS6250 to execute the routine. |
Plotsub![]() Pages 126-131. |
Antonia Jones, Elizabeth Coley & David Cole | 3K expansion | plotsub 3k.t64 Screenshot |
Machine code routine, that loads at address $0E00. This is a machine code version of Hi-Res (chapter 4), that provides three routines for using hi-res graphics. The demo program draws a damped sine curve. Controls: SYS3584 (initilise hi-res screen), POKE4087,X: POKE4086,Y: SYS3706 (plot X,Y coordinates), SYS3683 (restore screen). |
Appendix 1: Starship
Program | Author | Requirements | Files | Info |
Starship![]() Pages 139-150. |
Antonia Jones, Elizabeth Coley & David Cole (enhanced version by John Longworth) | 3K expansion (8K for enhanced version) | starship 3k-8k.t64 Screenshot |
Star Trek-style game. You must explore the galaxy and destroy the enemy ships. Planets are green blobs, stars are yellow dots, enemy ships are red diamonds, and starbases are blue squares. System status is shown via coloured bars: green is normal, amber will repair itself over time, red is a total failure that can only be repaired at a starbase. To dock at a starbase, set course straight for it at low speed. On the report screen, the sensor scan shows three numbers for each sector: the number of planets, the number of stars or starbases, and the number of enemy ships. Use warp engines to travel to another sector, using the XY coordinates from the sensor scan. (See the book for a more detailed explanation of the game.) Note: The T64 file also includes an enhanced version of the game by John Longworth, which includes bug fixes, improvements and a secret weapon. Controls: S (shield, enter value from 1-9999), C (set course, 0=east, 90=north, 180=west, -90=south), D (stop engines), P (fire phasers, enter angle), W (warp drive, enter X and Y sector coordinates), R (view status report). In the enhanced version, press X to use the secret weapon. |
Appendix 2: Hi-resolution routines
Program | Author | Requirements | Files | Info |
Hi-Res Draw![]() Pages 151-162. |
Antonia Jones, Elizabeth Coley & David Cole | 3K expansion | hi-draw 3k.d64 Screenshot |
Hi-res drawing program. Hi-Draw lets you draw hi-res pictures, and Hi-Dump prints them on a VIC1515 printer. Controls: Joystick (move), Fire (clear screen), D (draw), E (erase), L (load picture), S (save picture), Return (end program). When loading or saving pictures, you will be asked to enter a numeric filename from 0-255. |
With thanks to DLH's Commodore Archive and Internet Archive for making this book available in PDF format.