Thriller · the program listingsThe card program

About the listingsTitle programCard programThe woodsThe graveyardThe mansionPictures, tunes and sounds

The card shown before every screen: the night, the screen, the score and the lives, with a short piece of music when a game opens. It became a program of its own when that piece was digitized sound, too big to share memory with the front screen.

Never compiled. These listings were written as the design of the game, in Action!, within what a 48K Atari 800 of 1984 could do. They have not been through the Action! cartridge or run on an Atari. What plays on the game page is a line-for-line translation into JavaScript, made by hand, PROC for PROC. Expect small mistakes a compiler would have caught, and note the parts marked NOT WRITTEN: loading one program from another off the disk.

THRILLERC.ACT · 161 lines · the file itself

Its 4 PROCs and FUNCs, in the order they appear:

1; **************************************2; *        T H R I L L E R             *3; *       the card program             *4; **************************************5; The title program runs this one6; before every screen. It shows the7; card (night, screen, score, lives)8; and then runs the screen `next`9; names. It became a program of its10; own when the piece it plays as a11; game opens was 6K of digitized12; sound, too big to share memory with13; the front screen. That piece is now14; B3POKEY.ACT, 1.5K of settings for15; the sound chip, which would fit;16; the card stays a separate program.17;18; NOT WRITTEN: Run(), which has to19; load the next program from the disk.20;21; In this listing {inv}...{/inv} marks22; text typed in inverse video.2324; the bytes the programs share25; wins: screens won so far this game26; (0: the game is just starting).27; lives, score: as they stand.28BYTE wins=$6F1,lives=$6F2,29  next=$6F6,   ; the screen to run30  bonus=$6FC   ; a life has been earned31CARD score=$6F332; places in the Atari itself: the33; clock that ticks every TV frame and34; the attract-mode timer35BYTE rtclok=20,atract=773637; The piece that opens a game: the38; table b3pokey and the procedures39; that play it (B3Start, B3Tick,40; B3Stop). It has procedures in it,41; so it comes in after the42; declarations above.43INCLUDE "D:B3POKEY.ACT"4445; wait for the next TV frame46PROC Frame()47  BYTE f48  f=rtclok49  DO UNTIL rtclok<>f OD50  atract=051RETURN5253; ------ the card before each screen ------5455; The card that opens a game (wins=0)56; plays B3POKEY.ACT, 3.2 seconds of57; music on the sound chip's four58; voices, once through; the button59; cuts it short. The cards60; between screens are silent: the61; screen just won has played its own62; piece.63PROC Card()64  BYTE i,night,n65  ; three screens make a night66  night=wins/3+167  ; interrupts and players off.68  ; GRAPHICS 18 is big letters, 2069  ; across and 12 down, here in the70  ; Atari's own character set (756)71  ; and four colours.72  Poke(54286,64) Poke(53277,0)73  Graphics(18) Poke(756,224)74  Poke(708,$36) Poke(709,$0E)75  Poke(710,$C8) Poke(711,$1A)76  Position(6,0) PrintD(6,"THRILLER")77  Position(6,2) PrintD(6,"night ")78  PrintBD(6,night)79  Position(6,3) PrintD(6,"screen ")80  PrintBD(6,next)81  ; what the next screen asks of you82  IF next=1 THEN83    Position(3,5)84    PrintD(6,"SAVE YOUR GIRL")85    Position(6,6)86    PrintD(6,"FROM THE")87    Position(3,7)88    PrintD(6,"HAUNTED HOUSE!")89  ELSEIF next=2 THEN90    Position(4,5)91    PrintD(6,"PROTECT YOUR")92    Position(2,6)93    PrintD(6,"GIRLFRIEND FROM")94    Position(3,7)95    PrintD(6,"GRISLY GHOULS!")96  ELSE97    Position(1,5)98    PrintD(6,"FIND YOUR GIRL IN")99    Position(1,6)100    PrintD(6,"THE MANSION BEFORE")101    Position(6,7)102    PrintD(6,"THEY DO!")103  FI104  Position(2,9) PrintD(6,"score ")105  PrintCD(6,score)106  Position(2,10) PrintD(6,"lives ")107  PrintBD(6,lives)108  IF bonus=1 THEN109    Position(4,11)110    PrintD(6,"BONUS LIFE!")111  FI112  ; A new game: play the piece. It is113  ; a table of 189 rows, one for each114  ; sixtieth of a second; B3Tick()115  ; pokes the next row into the sound116  ; registers and clears b3on after117  ; the last. n counts the frames:118  ; the button works after half a119  ; second.120  IF wins=0 THEN121    n=0122    B3Start()123    WHILE b3on<>0 DO124      Frame()125      B3Tick()126      n==+1127      IF n>30 AND Strig(0)=0 THEN128        EXIT FI129    OD130    B3Stop()131    SndRst()132    RETURN133  FI134  ; Between screens: wait two and a135  ; half seconds, or for the button136  ; once half a second has gone. On a137  ; bonus card the capital letters go138  ; from dim to bright, over and over.139  FOR i=0 TO 150 DO140    Frame()141    IF bonus=1 THEN142      Poke(708,$30+(i&14)) FI143    IF i>30 AND Strig(0)=0 THEN EXIT FI144  OD145  SndRst()146RETURN147148; NOT WRITTEN. Load the program that149; `next` names (D:THRILL1.OBJ,150; D:THRILL2.OBJ or D:THRILL3.OBJ) and151; jump to its start. Under DOS 2.0S152; that is a binary load through CIO.153PROC Run()154RETURN155156; Show the card, then run the screen157; (when Run is written).158PROC Main()159  Card()160  Run()161RETURN