A.N.A.L.O.G. ISSUE 26 / JANUARY 1985 / PAGE 27

Popcorn!

16K Cassette or 24K Disk

by Mark and Cathy Sloatman

The story…You’re a concession worker at the local matinee. Since the day is-over, you are busy cleaning under the tables. Then the worst happens! The popcorn popper’s gone mad! Now, you must clean up (catch) all of the popcorn to make the boss happy. If you do well, he’ll congratulate you. If not — you guessed it — looks like you’re fired!

Instructions.

After Popcorn! is loaded, you can press START to begin in level 1, or press SELECT then START to begin in level 5. Levels 1 through 5 are for the little ones. The popcorn and the hand move more slowly, so the younger player won’t get discouraged. Only twenty-five popcorn kernels need to be caught to advance to the next level (compared with fifty for higher levels), and, if the child finishes level 3, a happy boss appears.

To play Popcorn!, move your little on-screen hand to catch the kernels. The amount of points for each piece caught depends on what level you’re in. There are nineteen levels of difficulty (if you finish level 19, let me know).

You start out with three chances. When you miss three kernels, the boss will pull you off the screen with his cane, and you’ll lose a chance. Remaining chances are indicated by the number of pieces of popcorn in the upper right side of the screen. If you lose all your chances, you’ll see the boss — and get fired.

There is good news, however. Making it through levels 3, 8, 12 or 16 will send you to the boss’s office, too, but this time hell thank you for a job well done.

Every 10,000 points earns you another life (up to five). To pause the game, hit the SPACE BAR. To resume play, hit the SPACE BAR again. After the game, is over, press START or the trigger button to play again. In the middle of a game, you may begin once more by pressing START.

Have some popcorn and play Popcorn!

BASIC listing.

10 REM *** POPCORN ***
20 TRAP 20:? "MAKE CASSETTE (0), OR DISK (1)";:INPUT DSK:IF DSK>1 THEN 20
30 TRAP 40000:DATA 0,1,2,3,4,5,6,7,8,9,0,0,0,0,0,0,0,10,11,12,13,14,15
40 DIM DAT$(91),HEX(22):FOR X=0 TO 22:READ N:HEX(X)=N:NEXT X:LINE=990:RESTORE 1000:TRAP 120:? "CHECKING DATA"
50 LINE=LINE+10:? "LINE:";LINE:READ DAT$:IF LEN(DAT$)<>90 THEN 220
60 DATLIN=PEEK(183)+PEEK(184)*256:IF DATLIN<>LINE THEN ? "LINE ";LINE;" MISSING!":END 
70 FOR X=1 TO 89 STEP 2:D1=ASC(DAT$(X,X))-48:D2=ASC(DAT$(X+1,X+1))-48:BYTE=HEX(D1)*16+HEX(D2)
80 IF PASS=2 THEN PUT #1,BYTE:NEXT X:READ CHKSUM:GOTO 50
90 TOTAL=TOTAL+BYTE:IF TOTAL>999 THEN TOTAL=TOTAL-1000
100 NEXT X:READ CHKSUM:IF TOTAL=CHKSUM THEN 50
110 GOTO 220
120 IF PEEK(195)<>6 THEN 220
130 IF PASS=0 THEN 170
140 IF  NOT DSK THEN 160
150 PUT #1,224:PUT #1,2:PUT #1,225:PUT #1,2:PUT #1,0:PUT #1,32:CLOSE #1:END 
160 FOR X=1 TO 117:PUT #1,0:NEXT X:CLOSE #1:END 
170 IF  NOT DSK THEN 200
180 ? "INSERT DISK WITH DOS, PRESS RETURN";:DIM IN$(1):INPUT IN$:OPEN #1,8,0,"D:AUTORUN.SYS"
190 PUT #1,255:PUT #1,255:PUT #1,0:PUT #1,32:PUT #1,226:PUT #1,45:GOTO 210
200 ? "READY CASSETTE AND PRESS RETURN";:OPEN #1,8,128,"C:":RESTORE 230:FOR X=1 TO 40:READ N:PUT #1,N:NEXT X
210 ? :? "WRITING FILE":PASS=2:LINE=990:RESTORE 1000:TRAP 120:GOTO 50
220 ? "BAD DATA: LINE ";LINE:END 
230 DATA 0,29,216,31,255,31,169,0,141,47,2,169,60,141,2,211,169,0,141,231,2,133,14,169,56,141,232,2
240 DATA 133,15,169,0,133,10,169,32,133,11,24,96
1000 DATA A9018509A900850CA920850DA90E8DC502A9328DC60220742CA9008D2F02859C8D08D28D01D28D03D2A2299580,441
1010 DATA CA10FB20B72420E023A9D68580A90F8581A20520A52DA200BDAD279D7810E8D0F7BDAD289D7811E8E018D0F5A2,285
1020 DATA 00BDC5289DFF12E8E01BD0F5A217BDDF289DD70FCAD0F7204324A9308DF402A9FE8D0002A9298D0102A9F78D30,22
1030 DATA 02A9288D3102A9C08D0ED4A93A8D2F0220F922A901859AA90285A1A9118DF10FA90385A28D0FD2203D23AD1FD0,763
1040 DATA C906F010C905D007859AA9158DF10FAD8402D0E9A91E209D24AD1FD0C906F0F920102420ED23A988859D8D0AD0,143
1050 DATA A9408D0ED4A9018D6F028D09D0A9038D1DD0A9008D07D4202424200424A977859C8D1ED0A49AB974248593A904,844
1060 DATA A212A00920C22CA906A214A00920C22CAD1FD0C906D00AAD1FD0C906F0F94C0020ADFC023015A9FF8DFC02A5A4,956
1070 DATA 450185A4F008ADFC0230FB4C3421206524207D2CA599D009AD0AD2C914901BB004C699D012A908A001A21220C2,649
1080 DATA 2CA90AA001A21420C22C4CDE21A90CA212A00120C22CA90EA214A00120C22CA9018584A59A0A1869048599A200,749
1090 DATA BD0006F009E8E8E00CF03E4C95218694A59A0A8596A201BD0006F004C5969029E8E8E00DF0F1A694A00AA90E20,362
1100 DATA AA24C9109004C91690F19D00068584A90CA00120AA24E89D000686A3AD05D0D0034CCB228582205D2DA49AC006,100
1110 DATA 9002A0052009238D1ED0E69BA49AA59BC005B007C919B0074CCB22C93290F9A908A001A21220C22CA90AA001A2,925
1120 DATA 1420C22CA9068594A9288593206524A9AF8596C694A594F01BA005200923C696A596C9A090E28D01D2A90C8D00,191
1130 DATA D22088244C3A22A900859B8D01D2A49AC013F069E69AA49AC004F00CC009F008C00DF004C011D03D8C762620B7,493
1140 DATA 2420CE24A93A8D2F02201024A904A212A00920C22CA906A214A00920C22CA908A001A21220C22CA90AA001A214,202
1150 DATA 20C22CA93C209D24AC7626C013F011C00AD00DA9108DF10FA9118DF00F4CC622EEF10FB974248593A59FC903B0,432
1160 DATA 034C1E21205223A900859FC6A2A5A2F00D203D23A977859C209D244C1E21A9018DD72620CE244C0020A910A200,486
1170 DATA 9DDF0FE8E006F0034CFD2260ADE00F8597A204BDDF0FC919D009A9109DDF0FCA4C1023FEDF0F88D0E8A597CDE0,499
1180 DATA 0FF00FA5A2C905F009E6A2203D23A9C0859D60A205A9009DF50FCA10FAA6A2A9419DF50FCAD0FA60A9A8859D20,433
1190 DATA B724A908A001A21220C22CA90AA001A21420C22CA914209D24A99F8597A9CF858BA227A000208824B9DF269DB0,250
1200 DATA 1EC68BA58B8D02D0A59C38E92AC697C597B00BC8C00490E0A000CA4C7C23E68BBDB01EF0174A4A9DB01E208824,911
1210 DATA E68BA58B8D02D038E906859C4CA423E8E02990DFA59C8596A596859CC9F5B00E1869068D02D0E6962088244CC9,849
1220 DATA 2360A9008580A9048581A2054CA52DBDB32D9DD204BDC22D9DCD05BDD12D9DD706E8E00FD0E9A207BD1D249DC0,382
1230 DATA 02CA10F760A9008580A9108581A20F4CA52D3A480F00280E00A9358D3002A9298D3102A99F8D0002A9298D0102,124
1240 DATA A901209D24A9C08D0ED460A200BD00E09D0030BD00E19D0031BD00E29D0032E8D0EBBD232A9D0032E8E0A1D0F5,583
1250 DATA A000A220C8C493D0FBA000CAD0F66000C89678645046413C37322D28231E1916120D0A9848A900A8186901C916,953
1260 DATA F006C8D0FD4C8D2468A8608594A9008514A514C594D0FA608598AD0AD22598849818659860A90F85A1207D2CA9,540
1270 DATA 00AA9D0006E8E00C90F8A90285A160A9408D0ED420E023A9008580A9108581A20520A52DA230A97E9D9E06CA10,515
1280 DATA FAA200BDBC2A9D0030E8E030D0F5A200BDEC2A9D0031E8E098D0F5A9018D6F02A9038D0AD0A9E48DC202A9888D,539
1290 DATA C502ADD726D011A90DA00120AA240A0A0A0A18690E8DC602A9148D3002A9298D3102A9138D0002A92A8D0102A9,131
1300 DATA C08D0ED4A9008594A9108595E69518A594695D85949002E695ADD726D013AD0AD2C906B0F9AABDD8268DD626A9,180
1310 DATA 254C8125A9008DD6268DC602A9298DDE26A200A000BD77269194E8C8BD7726919418A594691485949002E695E8,505
1320 DATA E00AD0E2A200A9019D5C11A9029D5F11188A6914AAE064D0EDA9038D49118D4A11A9048D4811A9058D4B11A970,163
1330 DATA 8D02D0209D24A9648D01D28D03D2A9188D00D2A9198D02D2A9718596208824A5968D02D0C987F00B208824E696,411
1340 DATA 2088244CE925A9008D01D28D03D2A91E209D24ADD726D004A98AD002A999859DACDE268C5D11C88C5E11C88C71,613
1350 DATA 11C88C7211AED626A000BD832699D011C981F005E8C84C3126A9FF209D24A9008D2F02A901209D24A9008D02D0,516
1360 DATA 8D0AD08DD726A9408D0ED420E02320ED23204324200424202424AE7526AC7626600000212223246D6E6F707172,335
1370 DATA 0101B9AFB587B2A580A6A9B2A5A48180A7B2A5A1B480AAAFA2818080B7A1B980B4AF80A7AF81808080B7AFB7A5,155
1380 DATA A5818080A6A1AEB4A1B3B4A9A381ACA9ABA58C80A1B7A5B3AFADA5818080A7AFAFA480B7AFB2AB8100000D1924,617
1390 DATA 2E3947000105155579046004A2049002800279046004A2049002800279046004790460046C048004A204900280,371
1400 DATA 0279046004A2049002800279046004A20490028002790460046C0460047908A2048004D904C102AD02A2048004,460
1410 DATA D904C102AD02A2048004A20480049004AD04D904C102AD02A2048004D904C102AD02A2048004D904C102AD02A2,503
1420 DATA 04800490048004A20800003C0235022F043C04350440043C08005102510651086C0460067910F31000F308D904,855
1430 DATA CC0CD90CF302FF02F302FF02F308D904F308000021022502210225020000000041414141004141414100414141,890
1440 DATA 410041414141004141414100414141410041000041004100000000410000410041000041004100004100410000,385
1450 DATA 000041000041004100004100410000410041000000004100004100410000410041000041004100000000410000,360
1460 DATA 410041000041004100004100410000000041414141004100004100414141410041000000004100004100414141,790
1470 DATA 000041410041004100000000410000000041000041004100000000410000000041000041004100004100410041,765
1480 DATA 410041000000004100000000410000410041000000004100000000410000410041000041004100004100000000,610
1490 DATA 000041000000004141414100410000000041414141004141414100410000410041000041004100002279002D61,142
1500 DATA 726B00616E6400236174687900336C6F61746D616E0033232F3225000000000000000000000000002C2536252C,378
1510 DATA 707042001002020202020202020202020282020202020202020241F72870707046001006060606060606060606,688
1520 DATA 06060606060606060606860606704114297070C2D60F4D00100D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D,132
1530 DATA 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D,717
1540 DATA 0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D8D0D0D0D0D8D0D0D8D41352948A9DA8D0AD48D18D0A9B48D,335
1550 DATA 0002A9298D0102684048A9E48D0AD48D13D0ADC2028D16D0A9CF8D0002A9298D0102684048A90A8D0AD48D12D0,821
1560 DATA A9048D1BD0A9E98D0002A9298D0102684048A9C88D0AD48D1AD0A99F8D0002A9298D0102684048A9E08D0AD48D,578
1570 DATA 09D4A90A8D17D0A9008D18D0684048A9E08D0AD48D09D4A9088D1AD06840000000000000000060F6FF7F3E7878,996
1580 DATA 0000000038EFEF2A0A2E2F0A000028AEFAE8C080000000AAAAAAAAAA55000000AA282800AA55000000AAAAAAAA,821
1590 DATA AA5500000000000000000000000000000000000055000000000000002855000000000000000055000000000000,371
1600 DATA 000000000055000000000000002855000000000000000055000000000000000000000000000000000000000000,666
1610 DATA 00000000F7F7F7007F7F7F38F8F8F8387878781C1F1F1F1C1F1F1FFFFF0000000000007FFFFCFC78787878FEFF,631
1620 DATA 3F3F1F1F1F1F000000000000000000070F193F3D7D7F00E0F098FCBCBEFE3F3C1F0F07030300FC3CF8F0E0C0C0,394
1630 DATA 0000070D1B373D7D7F00E0B0D8ECBCBEFE3B3C1F0F07030300DC3CF8F0E0C0C00000070F1B3D3E7D7D00E0F0D8,949
1640 DATA BC7CBEBE3F3C1B0F07030300FC3CD8F0E0C0C0003F7F7F6F6F6F6F6FFCFEFEF6F6F6F6F6606F0F6E6E0E0E0E06,547
1650 DATA F6F076767070700E0E0E0E0E0E1E3E707070707070787C8E098A0D86118215D8A58FF005C68F4CC62BA5904901,111
1660 DATA 8590D01BA69DBDE326F0218D04D2A9AA8D05D2E8BDE326858FE8869D4CC62BA9008D05D2A69DCABDE326858FAD,478
1670 DATA 7802C907F019C90BD02BA59CC9329021A49AC0059002C69CC69CC69C4CF82BA59CC9C3B00CA49AC0059002E69C,327
1680 DATA E69CE69CA900854DA59C8D01D01869058D00D0A584F02BE68EA58EC902D023A68DBD842B8D03D2E8BD842B8D02,101
1690 DATA D2A900858EE8868DE008D009A9008D03D2858D8584A582F037E685A585C901D02FA583D004A9F0858CA9AA8D01,152
1700 DATA D2A58C8D00D2F00F38E928858CA9008585A9018583D00CA9F0858CA9008582858385854C62E4A907A22BA08C4C,767
1710 DATA 5CE4A9008592A692BD0006D009E8E88692E00C90F160BD00068586E8BD0006859EC961900ECAA9009D0006E89D,279
1720 DATA 0006E69FD003FE0006E88692A5A1858720C82CA692E00C90C0608587849E8686A901858AA93285A8A58AD004E6,39
1730 DATA 86E687A900858985A085A68595A59E0A26950A26950A2695A69586A685A50A26950A26951865A585A5A59565A6,241
1740 DATA 85A6A5A518658685A59002E6A618A5A5690085A5A91065A685A6A9008595A5870A26890A26890A268918658785,176
1750 DATA A7A58965A885A8A4A0B1A7A00091A5A5A518692885A59002E6A6E6A0A5A0C909D0E5C68AA58AC9FFF0034CD02C,720
1760 DATA 60A59C38E9244A4A38E9048591A000A200BD0006F004C591F010E8E8E00CD0F1E691C8A200C006D0E860E8BD00,581
1770 DATA 06CAC94E90E7859EBD00068586A90F8587A9009D00069D01064CC82CA000989180C8D0FBE681CAD0F6602070F0,203
1780 DATA F2F2FE7E3E0F0F0F0F0F0F0FFFFFFF7E7E7E7E7E7E7E00000000000078F8808000000000000000000000000000,505
1790 REM * 3555 BYTES

CHECKSUM DATA.
(see page 10)

10 DATA 942,351,496,811,423,729,200,683,555,573,694,613,29,205,214,7438
160 DATA 145,198,962,633,491,38,155,116,169,732,978,213,858,980,814,7466
1060 DATA 882,705,576,947,748,766,671,763,513,975,716,378,96,768,982,18462
1210 DATA 31,185,613,89,595,879,794,115,703,73,759,845,643,925,743,7912
1360 DATA 461,993,111,4,96,527,33,169,555,458,538,467,437,685,88,5542
1510 DATA 762,547,124,117,696,854,724,798,486,403,128,808,95,541,866,7949
1660 DATA 260,967,160,923,982,793,964,588,692,74,883,840,684,663,9473

Assembly language listing.

; +-------------------------+
; |         POPCORN!        |
; |                         |
; | Mark and Cathy Sloatman |
; |                         |
; |    ANALOG  Computing    |
; +-------------------------+
;
;SYSTEM EQUATES
;
BOOT	=	$09
DOSINI	=	$0C
ATRACT	=	$4D
VDSLST	=	$0200
DMA	=	$022F
SDLSTL	=	$0230
GPRIOR	=	$026F
STICK0	=	$0278
STRIG	=	$0284
PCOLR0	=	$02C0
PCOLR2	=	$02C2
COLOR1	=	$02C5
COLOR2	=	$02C6
CHSET	=	$02F4
CH	=	$02FC
HPOSP0	=	$D000
HPOSP1	=	$D001
HPOSP2	=	$D002
P1PF	=	$D005
SIZEP1	=	$D009
SIZEP2	=	$D00A
COLPM0	=	$D012
COLPM1	=	$D013
COLPF0	=	$D016
COLPF1	=	$D017
COLPF2	=	$D018
COLBK	=	$D01A
PRIOR	=	$D01B
GRACTL	=	$D01D
HITCLR	=	$D01E
CONSOL	=	$D01F
AUDF1	=	$D200
AUDC1	=	$D201
AUDF2	=	$D202
AUDC2	=	$D203
AUDF3	=	$D204
AUDC3	=	$D205
AUDCTL	=	$D208
RAND	=	$D20A
SKCTL	=	$D20F
PMBASE	=	$D407
CHBASE	=	$D409
WSYNC	=	$D40A
NMIEN	=	$D40E
CHORG	=	$E000
XITVBV	=	$E462
SETVBV	=	$E45C
;
;P/M AND SCRN MEMORY USE
;
CHARORG	=	$3000
CHARORG2	=	CHARORG+$0100
CHARORG3	=	CHARORG+$0200
SCRN	=	$1000
SCORELN	=	SCRN-$2A
CANESCRN	=	SCRN+$0EB0
SHOWLEV	=	SCORELN+$1B
SHOWLIFE	=	SHOWLEV+$04
;
PM	=	$00
PM0	=	PM+1234
PM1	=	PM+1485
PM2	=	PM+1751
POSITION	=	$0600
;
;ZERO PAGE VARIABLES
;
	*=	$80
CLR	*=	*+2
CATCHSND	*=	*+1
CATCHSND1	*=	*+1
SNDFLAGPOP	*=	*+1
SNDDELAY	*=	*+1
HORIZ	*=	*+1
CHR	*=	*+1
CHAROFS	*=	*+2
CHECK	*=	*+1
HPOSCANE	*=	*+1
FREQ	*=	*+1
XFLAGPOP	*=	*+1
DELAYPOP	*=	*+1
LENGTH	*=	*+1
SNGFLAG	*=	*+1
HPOS1	*=	*+1
XREG	*=	*+1
SETDELAY	*=	*+1
TEMP	*=	*+2
TEMP1	*=	*+1
TEMP2	*=	*+1
TEMPA	*=	*+1
TIMER	*=	*+1
LEVEL	*=	*+1
NUMBER	*=	*+1
HPOS	*=	*+1
SONGXREG	*=	*+1
VERT	*=	*+1
MISSPOP	*=	*+1
PLUS	*=	*+1
LOADCHAR	*=	*+1
LIVES	*=	*+1
LASTPOP	*=	*+1
PAUSEON	*=	*+1
OFFSET	*=	*+2
CHAR	*=	*+2
;
;INITALIZE GAME
;
	*=	$2000	;RUN ADDRESS
;
START	LDA	#1	;TELL SYSTEM
	STA	BOOT	;DSK BOOT OCCURED
;
;FOR CASSETTE USERS
;
	LDA	# <START	;NOW, HAVE
	STA	DOSINI	;SYSTEM RESET
	LDA	# >START	;START THE
	STA	DOSINI+1	;GAME OVER!
	LDA	#14	;SET UP COVER
	STA	COLOR1	;COLORS
	LDA	#50
	STA	COLOR2
	JSR	INITVBLANK	;TURN ON VBI
	LDA	#0
	STA	DMA	;CLEANER SWITCHING
	STA	HPOS	;PLAYERS OFF SCRN
	STA	AUDCTL	;TURN OFF SOUND
	STA	AUDC1
	STA	AUDC2
	LDX	#41	;41 BYTES TO CLR
CLRZERO	STA	$80,X	;CLR
	DEX		;ZERO PAGE
	BPL	CLRZERO	;VARIABLES
	JSR	ERASEPOPCORN	;CLR SCRN
	JSR	CLRPM	;CLR PM GRAPHICS
;
;CLR TITLE PAGE
;
	LDA	# <SCORELN	;LOW BYTE
	STA	CLR
	LDA	# >SCORELN	;HIGH BYTE
	STA	CLR+1
	LDX	#5	;5 PAGES
	JSR	CLR0	;CLR IT!
	LDX	#0
PUTPOP	LDA	POPCORNSCRN,X	;PUTPOP
	STA	SCRN+$78,X	;AND PUTPOP1
	INX		;PUTS "POPCORN"
	BNE	PUTPOP	;TITLE
PUTPOP1	LDA	POPCORNSCRN+$0100,X
	STA	SCRN+$0178,X	;ON SCRN
	INX
	CPX	#24
	BNE	PUTPOP1
	LDX	#0
PUTCREDS	LDA	MESSAGE,X	;GIVES
	STA	SCRN+$02FF,X	;CATHY
	INX		;AND I
	CPX	#27	;THE GLORY!
	BNE	PUTCREDS
	LDX	#23
PUTSCORE	LDA	MESSAGE1,X	;PUTS "SCORE"
	STA	SCORELN+1,X	;AND "LEVEL"
	DEX		;ON SCRN
	BNE	PUTSCORE	;NOT DONE
	JSR	PUTCHAR	;REDEFINES CHAR. SET
	LDA	# >CHARORG	;TELL ANTIC
	STA	CHSET	;WHERE NEW CHAR. SET IS
	LDA	# <DLI	;STORE LOW
	STA	VDSLST	;AND HIGH
	LDA	# >DLI	;BYTES OF DISPLAY
	STA	VDSLST+1	;LIST INTERRUPT
	LDA	# <COVER	;DISPLAY LIST
	STA	SDLSTL	;OF TITLE SCRN
	LDA	# >COVER
	STA	SDLSTL+1
	LDA	#192	;ENABLE DISPLAY
	STA	NMIEN	;AND VB INTERRUPTS
	LDA	#58	;TURN SCRN
	STA	DMA	;BACK ON
	JSR	SETSCORE	;PUT ZEROS IN SCORE
	LDA	#1	;START AT
	STA	LEVEL	;LEVEL ONE
	LDA	#2	;FALLING POPCORN
	STA	LOADCHAR	;CHRS
	LDA	#17	;INTERNAL CODE
	STA	SHOWLEV	;FOR "0"
	LDA	#3	;3 LIVES
	STA	LIVES
	STA	SKCTL	;INIT SOUND
	JSR	SHOWLIVES	;PUT LIVES ON SCRN
;
;ALL SET, WANT TO PLAY A GAME?
;
WAIT	LDA	CONSOL	;START KEY
	CMP	#6	;PRESSED?
	BEQ	INIT	;YES!
	CMP	#5	;NO-HOW ABOUT SELECT?
	BNE	DFD	;NO,CHECK TRIGGER
	STA	LEVEL	;YES, START AT
	LDA	#21	;LEVEL 5
	STA	SHOWLEV	;SHOW IT!
DFD	LDA	STRIG	;TRIGGER PRESSED?
	BNE	WAIT	;NO DO IT AGAIN
INIT	LDA	#30	;DEBOUNCE
	JSR	LONGPAUSE
INIT1	LDA	CONSOL	;
	CMP	#6	;START KEY RELEASED?
	BEQ	INIT1	;NO!
;
;SET UP GAME
;
	JSR	CLRSCRN
	JSR	WRITEPM	;WRITE PLAYERS
	LDA	#136	;SHUT  OFF
	STA	SONGXREG	;SONG
	STA	SIZEP2
	LDA	#64	;DISABLE DLI'S
	STA	NMIEN
	LDA	#1	;PRIORITY
	STA	GPRIOR
	STA	SIZEP1
	LDA	#3	;ENABLE PM
	STA	GRACTL	;GRAPHICS
	LDA	# >PM	;GET PM ADDRESS
	STA	PMBASE	;AND TELL ANTIC
	JSR	SETDL	;SET UP GAME DLI'S
	JSR	WRITECOLORS	;SET UP COLORS
	LDA	#119	;CENTER OF SCRN
	STA	HPOS
	STA	HITCLR	;CLR COLLISIONS
	LDY	LEVEL	;GET LEVEL
	LDA	DELAYTABLE,Y	AND DELAY NO.
	STA	SETDELAY	;NEW SPEED OF GAME
;
;PRINT POT (BODY-LEFT SIDE)
;
	LDA	#4	;CHR VALUE
	LDX	#18	;X POSITION
	LDY	#9	;Y POSITION
	JSR	PRINTCHR	;PRINT IT!
	LDA	#6	;NOW THE RIGHT
	LDX	#20	;SIDE
	LDY	#9
	JSR	PRINTCHR	;DITTO!
;
;ACTUAL GAME LOOP
;
GAME	LDA	CONSOL	;START KEYPRESSED?
	CMP	#6
	BNE	RR1	;NO
ERT	LDA	CONSOL	;YES, NOW
	CMP	#6	;WAIT FOR
	BEQ	ERT	;RELEASE
	JMP	START	;GOTO TITLE PAGE
;
RR1	LDA	CH	;SPACE BAR PRESSED?
	BMI	CONT	;NOPE!
PAUSEING	LDA	#255	;YES , LETS PAUSE
	STA	CH	;CLR KEYBOARD
	LDA	PAUSEON	;GET FLAG
	EOR	$01	;AND SWICH IT
	STA	PAUSEON
	BEQ	CONT	;IF ZERO THEN CONT.
CHKPAUSE	LDA	CH	;PAUSE UNTIL
	BMI	CHKPAUSE	;TOUCHED AGAIN
	JMP	PAUSEING
CONT	JSR	DELAY	;CONT. WITH GAME
	JSR	CHARPOLL	;MOVE POPCORN
	LDA	TIMER	;LENGTH OF LID OPEN
	BNE	WWQ	;STILL COUNTING DOWN
	LDA	RAND	;MAYBE LETS POP SOME POPCORN
	CMP	#20
	BCC	AA	;<20
	BCS	WWA	;>=20
WWQ	DEC	TIMER
	BNE	OUT4	;STILL NOT READY TO POP
;
;PRINT LID DOWN  - LEFT SIDE
;
WWA	LDA	#8	;CHR VALUE
	LDY	#1	;Y POSISTION
	LDX	#18	;X POSITION
	JSR	PRINTCHR	;PRINT
	LDA	#10	;RIGHT SIDE
	LDY	#1
	LDX	#20
	JSR	PRINTCHR	;PRINT
OUT4	JMP	OUT6
;
;PRINT  LID UP - RIGHT SIDE
;
AA	LDA	#12	;CHAR. VALUE
	LDX	#18	;X POS.
	LDY	#1	;Y POS.
	JSR	PRINTCHR
	LDA	#14	;LEFT SIDE
	LDX	#20
	LDY	#1
	JSR	PRINTCHR
	LDA	#1	;MAKE A VB
	STA	SNDFLAGPOP	;"POP" SOUND
	LDA	LEVEL	;RESETS TIMER
	ASL	A	;SO THAT LID
	CLC		;POPPING DOESN'T
	ADC	#4	;INCREASE TOO
	STA	TIMER	;MUCH IN SPEED
	LDX	#0
CKCHAR	LDA	POSITION,X	;ANY POPCORNS NEEDED?
	BEQ	NN4	;YES
	INX		;NOT YET
	INX
	CPX	#12	;DONE CHECKING
	BEQ	OUT6	;YES,NONE NEEDED
	JMP	CKCHAR	;NO, CHECK AGAIN
;
NN4	STX	TEMP	;SAVE X REG
	LDA	LEVEL	;GET LEVEL
	ASL	A	;MULT. BY 2
	STA	TEMP1	;STORE IT
	LDX	#1	;GET POSITION
NNX	LDA	POSITION,X
	BEQ	NEXTONE	;SKIP CHECK
	CMP	TEMP1	;LEVEL*2
	BCC	OUT6	;<LEVEL*2, DON'T POP
NEXTONE	INX		;CHECK ALL
	INX		;OTHER POPCORN
	CPX	#13	;DONE?
	BEQ	NNX	;YES!
	LDX	TEMP	;NO. POP SOME
NN5	LDY	#10
	LDA	#14
	JSR	RANDOM	;RND(0)*14+10
	CMP	#16	;MAKES SURE
	BCC	NNZ	;POP DOESN'T
	CMP	#22	;GET WIPED OUT
	BCC	NN5	;TRY AGAIN
;
NNZ	STA	POSITION,X	;HORIZ. POS.
	STA	SNDFLAGPOP	;"POP" SOUND
	LDA	#12
	LDY	#1
	JSR	RANDOM	;RND(0)*12+1
	INX
	STA	POSITION,X	;VERT. POS.
	STX	LASTPOP	;SAVE LAST POPCORN
OUT6	LDA	P1PF	;POPCORN CAUGHT?
	BNE	NN0	;YES!
	JMP	NN3	;NOPE.
;
NN0	STA	CATCHSND	;MAKE SOUND(VB)
	JSR	ERASECHR	;ERASE POPCORN
	LDY	LEVEL	;GET LEVEL
	CPY	#6	;6 OR HIGHER?
	BCC	XXXX	;NO
	LDY	#5	;YES,POINTS=50
XXXX	JSR	INCSCORE	;POINTS=LEVEL*10
	STA	HITCLR	;CLR COLL.
	INC	NUMBER	;NUMBER OF CAUGHT CORN
	LDY	LEVEL	;LEVEL
	LDA	NUMBER	;GET NO. CAUGHT
	CPY	#5	;LEVEL 5 OR HIGHER?
	BCS	FFFF	;YES
	CMP	#25	;NO ,25 CAUGHT?
	BCS	GGGG	;YES!(NEXT LEVEL)
MMX	JMP	NN3	;A LONG WAY TO GO
;
FFFF	CMP	#50	;50 CAUGHT?(NEXT LEVEL)
	BCC	MMX	;NO
;
;PRINT LID TO SCRN-DOWN
;
GGGG	LDA	#8	;LID DOWN
	LDY	#1	;Y POS
	LDX	#18	;X POS
	JSR	PRINTCHR
	LDA	#10	;2ND HALF OF LID
	LDY	#1	;SAME AS ABOVE
	LDX	#20
	JSR	PRINTCHR
	LDA	#6
	STA	TEMP	;TEMPORARY
BONUS	LDA	#40	;SLOW IT DOWN
	STA	SETDELAY
	JSR	DELAY	;BONUS GIVES
	LDA	#175	;250 POINTS
	STA	TEMP1	;IN 5 STEPS AND
	DEC	TEMP	;SOUNDS BELL
	LDA	TEMP	;EACH TIME
	BEQ	GG1
	LDY	#5	;50 POINTS
	JSR	INCSCORE	;ADDED EACH TIME
BELL	DEC	TEMP1	;RING BELL
	LDA	TEMP1
	CMP	#160
	BCC	BONUS
	STA	AUDC1	;MAKE BELL SOUND
	LDA	#12	;FREQUENCY
	STA	AUDF1
	JSR	PAUSE	;PAUSE A LITTLE
	JMP	BELL	;NEXT SOUND
;
GG1	LDA	#0
	STA	NUMBER	;0 POPCORNS
	STA	AUDC1	;NO SOUND
	LDY	LEVEL	;GET LEVEL
	CPY	#19	;IF 19 THEN DON'T
	BEQ	CHANGELEV	;INCREASE IT
	INC	LEVEL	;NEXT LEVEL
	LDY	LEVEL
	CPY	#4	;LEVEL 3?
	BEQ	GREETING	;SEE THE BOSS
	CPY	#9	;LEVEL 8
	BEQ	GREETING	;SEE THE BOSS
	CPY	#13	;LEVEL 12
	BEQ	GREETING	;SEE THE BOSS
	CPY	#17	;GUESS!
	BNE	NOBOSS
GREETING	STY	TEMPYREG	SAVE Y REG
	JSR	ERASEPOPCORN	;CLR SCRN
	JSR	SEEBOSS	;GET CONGRATULATED!
	LDA	#58	;TURN SCRN ON
	STA	DMA
	JSR	CLRSCRN
;
;PRINT POT BODY
;
	LDA	#4	;CHAR VALUE
	LDX	#18	;X POS
	LDY	#9	;Y POS
	JSR	PRINTCHR	;PRINT IT!
	LDA	#6	;SAME AS ABOVE,
	LDX	#20	;ONLY RIGHT
	LDY	#9	;SIDE OF POT
	JSR	PRINTCHR	;DITTO!
;
;PRINT LID DOWN  - LEFT SIDE
;
	LDA	#8	;CHR VALUE
	LDY	#1	;Y POSISTION
	LDX	#18	;X POSITION
	JSR	PRINTCHR	;PRINT
	LDA	#10	;RIGHT SIDE
	LDY	#1
	LDX	#20
	JSR	PRINTCHR	;PRINT
	LDA	#60
	JSR	LONGPAUSE	;PAUSE ONE SEC
	LDY	TEMPYREG
NOBOSS	CPY	#19	;LEVEL 19?
	BEQ	DS	;YES. NO MORE TESTS
	CPY	#10	;10?
	BNE	DS	;NO
	LDA	#16	;YES, NEED TO
	STA	SHOWLEV	;CHANGE 2ND DIGIT
	LDA	#17	;TO 0 AND
	STA	SHOWLEV-1	;PUT 1 IN FIRST
	JMP	CHANGELEV
;
DS	INC	SHOWLEV	;INCREASE LEVEL SHOWN
CHANGELEV	LDA	DELAYTABLE,Y	;GET NEW SPEED
	STA	SETDELAY	;OF GAME
NN3	LDA	MISSPOP	;MISSED THREE
	CMP	#3	;POPCORN
	BCS	TT1	;YEP. UH-OH!
	JMP	GAME	;NO GO ON PLAYING
TT1	JSR	LOSECHANCE	;GET PULLED OFF SCRN
	LDA	#0	;RESET HOW MANY
	STA	MISSPOP	;POPCORN MISSED
	DEC	LIVES	;ONE LESS CHANCE
	LDA	LIVES	;ANY LIVES LEFT?
	BEQ	TT2	;NO!
	JSR	SHOWLIVES	;SHOW THEM
	LDA	#119	;CENTER HAND
	STA	HPOS
	JSR	LONGPAUSE	;PAUSE
	JMP	GAME	;PLAY GAME
;
TT2	LDA	#1	;TELL SEEBOSS
	STA	BOSSFLAG	;THAT YOU LOST
	JSR	SEEBOSS	;SE HIM!
	JMP	START	;START GAME OVER
;
;GAME ROUTINES
;
SETSCORE	LDA	#16	;ZEROS SCORE
	LDX	#0
ZSCORE	STA	SCORELN+9,X	;PUT SIX
	INX		;ZERO'S
	CPX	#6	;IN SCORELN
	BEQ	GGG
	JMP	ZSCORE	;"0" IN NEXT POS.
;
GGG	RTS		;ALL DONE
;
;INCREASES SCORE
;
INCSCORE	LDA	SCORELN+10	;GET
	STA	TEMP2	;10000 AND STORE IT
INCSCOR1	LDX	#4	;5 POS.
LL	LDA	SCORELN+9,X	;GET NO.
	CMP	#25	;FOR EACH POS.
	BNE	FF	;AND CHECK FOR 9
	LDA	#16	;ZERO NUMBER
	STA	SCORELN+9,X
	DEX		;NEXT POSITION
	JMP	LL	;AGAIN
;
FF	INC	SCORELN+9,X	;ADD 1
	DEY		;POINTS ADDED?
	BNE	INCSCOR1	;NO!
	LDA	TEMP2	;PASSED 10000
	CMP	SCORELN+10	;POINTS?
	BEQ	QW	;NOPE. RETURN
;
;GAIN A ANOTHER CHANCE!
;
	LDA	LIVES	;GET LIVES
	CMP	#5	;5 YET?
	BEQ	QW	;YES. NO MORE
	INC	LIVES	;GAIN A LIFE
	JSR	SHOWLIVES	;SHOW IT
	LDA	#192	;TELL PLAYER
	STA	SONGXREG	;BY PLAYING SONG
QW	RTS
;
SHOWLIVES	LDX	#5	;5 POSITIONS
	LDA	#0
CLRLIFE	STA	SHOWLIFE,X	;CLR
	DEX		;LIFES OUT FIRST
	BPL	CLRLIFE
	LDX	LIVES	;GET LIVES
	LDA	#65	;POPCORN CHAR.
NST	STA	SHOWLIFE,X	;SHOW THEM
	DEX
	BNE	NST	;DONE?
	RTS		;YES
;
;UH-OH! YOU BLEW IT!
;
LOSECHANCE	LDA	#168	;PLAY DEFEAT
	STA	SONGXREG	;SONG
	JSR	ERASEPOPCORN	;CLR SCRN
	LDA	#8	;LID DOWN
	LDY	#1
	LDX	#18
	JSR	PRINTCHR
	LDA	#10	;2ND HALF OF LID
	LDY	#1
	LDX	#20
	JSR	PRINTCHR
	LDA	#20
	JSR	LONGPAUSE	;PAUSE A LITTLE
	LDA	#159	;159 PIXELS
	STA	TEMP2	;STORE
	LDA	#207	;PLAYER STARTING
	STA	HPOSCANE	;POSITION
	LDX	#39	;40 BYTES
	LDY	#0
PUSHCANE	JSR	PAUSE	;SLOW IT DOWN
	LDA	VALUE,Y	;VALUES FOR CANE
	STA	CANESCRN,X	;POKE SCRN
	DEC	HPOSCANE
	LDA	HPOSCANE	;MOVE
	STA	HPOSP2	;PLAYER
	LDA	HPOS	;GET HAND POS.
	SEC
	SBC	#42	;SUBTRACT 42
	DEC	TEMP2	;AT LOCATION
	CMP	TEMP2	;OF MAN YET?
	BCS	PULLBACK	;YES!
	INY		;NO. DONE WITH
	CPY	#4	;BYTE?
	BCC	PUSHCANE	;NO!
	LDY	#0	;NEXT BYTE
	DEX
	JMP	PUSHCANE	;PUSH CANE
;
PULLBACK	INC	HPOSCANE	;MOVE HOOK
PULLING	LDA	CANESCRN,X
	BEQ	OFF	;IF DONE SHIFTING
	LSR	A	;MOVE CANE ONE POS.
	LSR	A
	STA	CANESCRN,X	;PUT ON SCRN
	JSR	PAUSE
	INC	HPOSCANE
	LDA	HPOSCANE
	STA	HPOSP2	;MOVE HOOK
	SEC
	SBC	#6	;THEN MOVE
	STA	HPOS	;HAND
	JMP	PULLING
;
OFF	INX
	CPX	#41	;40 BYTES PER SCRN
	BCC	PULLING	;NOT DONE YET
	LDA	HPOS	;SAVE HAND POS
	STA	TEMP1
OFFSCRN	LDA	TEMP1	;NOW WE
	STA	HPOS	;NEED TO
	CMP	#245	;PULL HAND & HOOK
	BCS	ER	;OFF OF SCRN
	CLC
	ADC	#6
	STA	HPOSP2	;HOOK HORIZ POS
	INC	TEMP1
	JSR	PAUSE
	JMP	OFFSCRN
;
ER	RTS
;
;CLR PLAYER MEMORY
;
CLRPM	LDA	# <PM+1024	;LOW
	STA	CLR
	LDA	# >PM+1024	;HIGH
	STA	CLR+1	;BYTES
	LDX	#5	;5 PAGES
	JMP	CLR0	;CLR THEM!
;
;PUT PLAYERS INTO MEMORY
;
WRITEPM	LDA	PMDATA0,X	;GET
	STA	PM0,X	;PLAYER
	LDA	PMDATA1,X	;DATA
	STA	PM1,X	;AND PUT
	LDA	PMDATA2,X	;INTO P/M
	STA	PM2,X	;MEMORY
	INX
	CPX	#15	;15 BYTES
	BNE	WRITEPM
;
;FILL COLOR REGS.
;
WRITECOLORS	LDX	#7	;SET UP
COLORS	LDA	COLORTABLE,X
	STA	PCOLR0,X	;COLORS
	DEX
	BPL	COLORS
	RTS
;
;CLR GAME SCRN
;
CLRSCRN	LDA	# <SCRN
	STA	CLR	;
	LDA	# >SCRN	;CLR
	STA	CLR+1	;SCRN FOR PLAY
	LDX	#15
	JMP	CLR0
;
COLORTABLE	.BYTE	58,72,15,0,40,14,0
;
;SET UP DL AND DLI'S
;
SETDL	LDA	# <DLIST	;TELL ANTIC
	STA	SDLSTL	;WHERE DISPLAY
	LDA	# >DLIST	;LIST IS
	STA	SDLSTL+1
	LDA	# <DLI1	;AND WHERE
	STA	VDSLST	;DISPLAY LIST
	LDA	# >DLI1	;INTERRUPT IS
	STA	VDSLST+1
	LDA	#1	;1/60 OF A SEC.
	JSR	LONGPAUSE	;WAIT UNTIL
	LDA	#192	;NEXT VBI TO
	STA	NMIEN	;ENABLE DLI
	RTS
;
;LOAD REDEFINED CHR SET
;
PUTCHAR	LDX	#0
PUTCHAR1	LDA	CHORG,X	;LOAD
	STA	CHARORG,X	;CHR
	LDA	CHORG+$0100,X	;DATA AND PUT
	STA	CHARORG2,X	;INTO
	LDA	CHORG+$0200,X	;REDEFINED
	STA	CHARORG3,X	;CHR SET
	INX
	BNE	PUTCHAR1
REDEFINE	LDA	CHARDATA,X	;NOW
	STA	CHARORG3,X	;CHANGE
	INX		;CHRS TO
	CPX	#161	;WHAT WE WANT
	BNE	REDEFINE
;
;
DELAY	LDY	#0
	LDX	#32	;SLIGHT DELAY
DELAY1	INY		;USED MAINLY
	CPY	SETDELAY	;TO TIME
	BNE	DELAY1	;FALLING POPCORN
	LDY	#0
	DEX
	BNE	DELAY1
	RTS
;
DELAYTABLE	.BYTE	0,200,150,120,100,80,70,65,60
	.BYTE	55,50,45,40,35,30,25,22,18,13,10
;
PAUSE	TYA		;A LONGER PAUSE
	PHA		;THAT SAVES THE
	LDA	#0	;Y REG
	TAY
PAUSE1	CLC
	ADC	#1
	CMP	#22
	BEQ	DONE7
PAUSE2	INY
	BNE	PAUSE2
	JMP	PAUSE1
;
DONE7	PLA
	TAY
	RTS
;
;JIFFY TIMER
;
LONGPAUSE	STA	TEMP	;A REG
	LDA	#0	;CONTAINS JIFFIES
	STA	20	;(1/60 SEC) FOR
WAIT1	LDA	20	;LENGTH OF PAUSE
	CMP	TEMP
	BNE	WAIT1
	RTS
;
;GET A RANDOM NUMBER
;
RANDOM	STA	TEMPA
	LDA	RAND	;RANDOM NUMBER
	AND	TEMPA	;KNOCK OFF
	STY	TEMPA	;THEN
	CLC		;THEN ADD
	ADC	TEMPA	;SPECIFIED NUMBER
	RTS
;
;TAKE POPCORN OFF OF SCRN
;
ERASEPOPCORN	LDA	#15	;BLANK CHAR
	STA	LOADCHAR
	JSR	CHARPOLL	;ALL OFF SCRN!
	LDA	#0
	TAX
LOOP9A	STA	POSITION,X	;NOW CLR
	INX		;POS. TABLE
	CPX	#12
	BCC	LOOP9A
	LDA	#2
	STA	LOADCHAR
	RTS		;ALL DONE
;
;YOU GET TO SEE THE BOSS!
;
SEEBOSS
	LDA	#64	;DISABLE DLI'S
	STA	NMIEN
	JSR	CLRPM
	LDA	# <SCRN	;CLR SCRN
	STA	CLR
	LDA	# >SCRN
	STA	CLR+1
	LDX	#5
	JSR	CLR0
	LDX	#48	;CHANGE PLAYER 2
	LDA	#126	;TO DOOR
WRITEDOOR	STA	PM+1694,X
	DEX
	BPL	WRITEDOOR
	LDX	#0
REDEFINE1	LDA	BOSSCHAR1,X	;ALTERNATE
	STA	CHARORG,X	;CHR
	INX		;SET
	CPX	#48
	BNE	REDEFINE1
	LDX	#0
REDEFINE2	LDA	BOSSCHAR2,X
	STA	CHARORG2,X
	INX
	CPX	#152
	BNE	REDEFINE2
	LDA	#1	;CHANGE PRIORITY
	STA	GPRIOR
	LDA	#3	;PLAYER 2 SIZE
	STA	SIZEP2
	LDA	#228	;PLAYER2 COLOR
	STA	PCOLR2
	LDA	#136
	STA	COLOR1
	LDA	BOSSFLAG
	BNE	DONTCHANGE
	LDA	#13	;RND(0)*13+1
	LDY	#1
	JSR	RANDOM
	ASL	A	;*16
	ASL	A
	ASL	A
	ASL	A
	CLC
	ADC	#14
	STA	COLOR2	;COLOR OF LETTERS
DONTCHANGE	LDA	# <BOSSDLIST
	STA	SDLSTL	;NEW DISPLAY
	LDA	# >BOSSDLIST	;LIST
	STA	SDLSTL+1
	LDA	# <BOSSDLI
	STA	VDSLST	;AND DLI
	LDA	# >BOSSDLI
	STA	VDSLST+1
	LDA	#192	;ENABLE INTERR.
	STA	NMIEN
	LDA	# <SCRN	;GET FIRST
	STA	TEMP	;BYTE OF SCRN
	LDA	# >SCRN
	STA	TEMP+1
	INC	TEMP+1	;ADD 255
	CLC
	LDA	TEMP
	ADC	#93	;+93 =
	STA	TEMP	;SCRN+348
	BCC	DC1
	INC	TEMP+1
DC1	LDA	BOSSFLAG
	BNE	LOSEFACE
FINDNUM	LDA	RAND	;GET MESSAGE
	CMP	#6	;RANDOM NO.
	BCS	FINDNUM
	TAX
	LDA	BOSSTABLE,X	;FIRST BYTE
	STA	BOSSXREG	;OF MESSAGE
	LDA	#37	;HAPPY FACE
	JMP	STOREFACE
;
LOSEFACE	LDA	#0	;SAD SONG
	STA	BOSSXREG
	STA	COLOR2	;BLACK MESSAGE
	LDA	#41	;SAD FACE
STOREFACE	STA	FACE
	LDX	#0
LOOPX	LDY	#0	;PUT CHRS
	LDA	BOSS1,X	;THAT MAKE
	STA	(TEMP),Y	;UP BOSS ON
	INX		;SCRN
	INY		;(2 WIDE*9 HIGH)
	LDA	BOSS1,X	;NEXT CHAR
	STA	(TEMP),Y	;PUT ON SCRN
	CLC
	LDA	TEMP
	ADC	#20	;20 BYTES PER LINE
	STA	TEMP	;(ADD TO OFFSET)
	BCC	LPX
	INC	TEMP+1
LPX	INX
	CPX	#10	;9 HIGH
	BNE	LOOPX
	LDX	#0
FRAMEDOOR	LDA	#1
	STA	SCRN+348,X	;LEFT SIDE
	LDA	#2
	STA	SCRN+351,X	;RIGHT SIDE
	CLC
	TXA
	ADC	#20	;20 BYTES PER LINE
	TAX
	CPX	#100	;DONE?
	BNE	FRAMEDOOR	;NO!
	LDA	#3	;NOW FRAME IN
	STA	SCRN+329	;TOP OF DOOR
	STA	SCRN+330
	LDA	#4
	STA	SCRN+328
	LDA	#5
	STA	SCRN+331
	LDA	#112
	STA	HPOSP2	;CENTER DOOR
	JSR	LONGPAUSE
	LDA	#100	;MAKE MECH.
	STA	AUDC1	;SOUND FOR DOOR
	STA	AUDC2	;BEAT VOICES
	LDA	#24	;ONE AND TWO
	STA	AUDF1	;TOGETHER
	LDA	#25
	STA	AUDF2
	LDA	#113
	STA	TEMP1
OPEN	JSR	PAUSE
	LDA	TEMP1
	STA	HPOSP2	;MOVE DOOR
	CMP	#135	;DONE?
	BEQ	DONEA	;YES!
	JSR	PAUSE
	INC	TEMP1
	JSR	PAUSE
	JMP	OPEN
;
DONEA	LDA	#0	;SHUT OFF SOUND
	STA	AUDC1
	STA	AUDC2
	LDA	#30
	JSR	LONGPAUSE
	LDA	BOSSFLAG
	BNE	PLAYSAD	;WHICH SONG?
	LDA	#138	;HAPPY!
	BNE	SONGSTART
;
PLAYSAD	LDA	#153	;SAD
SONGSTART	STA	SONGXREG	;NOW PLAY
	LDY	FACE	;SONG AND PUT
	STY	SCRN+349	;CORRECT
	INY		;FACE ON SCRN
	STY	SCRN+350
	INY		;EACH FACE MADE
	STY	SCRN+369	;UP OF FOUR
	INY		;CHRS
	STY	SCRN+370
	LDX	BOSSXREG	;WHICH MESSAGE?
	LDY	#0
PRINT1	LDA	MESSAGE8,X
	STA	SCRN+464,Y	;PUT ON SCRN
	CMP	#129	;INVERSE !
	BEQ	GOBACK	;NOT DONE!
	INX
	INY
	JMP	PRINT1
;
GOBACK	LDA	#255
	JSR	LONGPAUSE
	LDA	#0
	STA	DMA	;SHUT OFF DMA
	LDA	#1	;(CLEANER SWICHING)
	JSR	LONGPAUSE	;PAUSE 1 JIFFY
;
;RESET TO ORIGINAL
;
	LDA	#0	;CLR VARIABLES
	STA	HPOSP2	;DOOR HORIZ
	STA	SIZEP2
	STA	BOSSFLAG
	LDA	#64	;DISABLE
	STA	NMIEN	;DLI'S
	JSR	CLRPM	;PUT PROPER
	JSR	WRITEPM	;PLAYERS BACK
	JSR	PUTCHAR	;AND CHAR SET
	JSR	WRITECOLORS
	JSR	SETDL	;SET DISPLAY LIST
	LDX	TEMPXREG	;GET BACK X AND
	LDY	TEMPYREG	;Y REGS
	RTS
;
TEMPXREG	.BYTE	0
TEMPYREG	.BYTE	0
BOSS1	.BYTE	33,34,35,36,109,110
	.BYTE	111,112,113,114,1,1
;
;MESSAGES WHEN SEEING THE BOSS
;
MESSAGE8	.SBYTE	+$80,"YOU'RE FIRED!"
	.SBYTE	+$80," GREAT JOB! "
	.SBYTE	+$80," WAY TO GO!"
	.SBYTE	+$80,"   WOWEE! "
	.SBYTE	+$80," FANTASTIC!"
	.SBYTE	+$80,"LIKE, AWESOME!"
	.SBYTE	+$80,"  GOOD WORK!"
;
;
BOSSXREG	.BYTE	0
BOSSFLAG	.BYTE	0	;HAPPY OR SAD BOSS
BOSSTABLE	.BYTE	13,25,36,46,57,71
FACE	.BYTE	0	;HAPPY OR SAD
VALUE	.BYTE	1,5,21,85
;
;THEME SONG DATA
;
SONG	.BYTE	121,4,96,4,162,4,144,2
	.BYTE	128,2,121,4,96,4,162,4
	.BYTE	144,2,128,2,121,4,96,4
	.BYTE	121,4,96,4,108,4,128,4
	.BYTE	162,4,144,2,128,2,121,4
	.BYTE	96,4,162,4,144,2,128,2
	.BYTE	121,4,96,4,162,4,144,2
	.BYTE	128,2,121,4,96,4,108,4
	.BYTE	96,4,121,8
	.BYTE	162,4,128,4,217,4,193
	.BYTE	2,173,2,162,4,128,4
	.BYTE	217,4,193,2,173,2,162,4
	.BYTE	128,4,162,4,128,4,144,4
	.BYTE	173,4,217,4,193,2,173,2
	.BYTE	162,4,128,4,217,4,193,2
	.BYTE	173,2,162,4,128,4,217,4
	.BYTE	193,2,173,2,162,4,128,4
	.BYTE	144,4,128,4,162,8,0,0
;
;SONG VALUES WHEN CONGRADULATED!
;
	.BYTE	60,2,53,2,47,4,60,4,53
	.BYTE	4,64,4,60,8,0
;
;SONG  WHEN YOU LOST THE GAME!
;
	.BYTE	81,2,81,6,81,8,108,4
	.BYTE	96,6,121,16,243,16,0
;
;SONG WHEN YOU LOSE 3 CHANCES
;
	.BYTE	243,8,217,4,204,12,217
	.BYTE	12,243,2,255,2,243,2,255,2
	.BYTE	243,8,217,4,243,8,0,0
;
;DIDDLE WHEN A CHANCE IS GAINED
;
	.BYTE	33,2,37,2,33,2,37,2,0,0
;POPCORN! IN BIG LETTERS
;
POPCORNSCRN
	.BYTE	0,0,65,65,65,65,0,65
	.BYTE	65,65,65,0,65,65,65,65
	.BYTE	0,65,65,65,65,0,65,65
	.BYTE	65,65,0,65,65,65,65,0
	.BYTE	65,0,0,65,0,65,0,0
	.BYTE	0,0,65,0,0,65,0,65
	.BYTE	0,0,65,0,65,0,0,65
	.BYTE	0,65,0,0,0,0,65,0
	.BYTE	0,65,0,65,0,0,65,0
	.BYTE	65,0,0,65,0,65,0,0
	.BYTE	0,0,65,0,0,65,0,65
	.BYTE	0,0,65,0,65,0,0,65
	.BYTE	0,65,0,0,0,0,65,0
	.BYTE	0,65,0,65,0,0,65,0
	.BYTE	65,0,0,65,0,65,0,0
	.BYTE	0,0,65,65,65,65,0,65
	.BYTE	0,0,65,0,65,65,65,65
	.BYTE	0,65,0,0,0,0,65,0
	.BYTE	0,65,0,65,65,65,0,0
	.BYTE	65,65,0,65,0,65,0,0
	.BYTE	0,0,65,0,0,0,0,65
	.BYTE	0,0,65,0,65,0,0,0
	.BYTE	0,65,0,0,0,0,65,0
	.BYTE	0,65,0,65,0,0,65,0
	.BYTE	65,0,65,65,0,65,0,0
	.BYTE	0,0,65,0,0,0,0,65
	.BYTE	0,0,65,0,65,0,0,0
	.BYTE	0,65,0,0,0,0,65,0
	.BYTE	0,65,0,65,0,0,65,0
	.BYTE	65,0,0,65,0,0,0,0
	.BYTE	0,0,65,0,0,0,0,65
	.BYTE	65,65,65,0,65,0,0,0
	.BYTE	0,65,65,65,65,0,65,65
	.BYTE	65,65,0,65,0,0,65,0
	.BYTE	65,0,0,65,0,65,0,0
;
MESSAGE	.SBYTE	"By Mark and "
	.SBYTE	"Cathy Sloatman"
;
MESSAGE1	.SBYTE	" SCORE             LEVEL"
;
;DISPLAY LISTS
;
;TITLE PAGE
;
COVER	.BYTE	112,112,66
	.WORD	SCRN
	.BYTE	2,2,2,2,2,2,2,2
	.BYTE	2,2,2,2,130,2,2,2
	.BYTE	2,2,2,2,2,65
	.WORD	COVER
;
;SCRN WHEN SEEING BOSS
;
BOSSDLIST	.BYTE	112,112,112,70
	.WORD	SCRN
	.BYTE	6,6,6,6,6,6,6,6
	.BYTE	6,6,6,6,6,6,6,6
	.BYTE	6,6,6,6,134,6
	.BYTE	6,112,65
	.WORD	BOSSDLIST
;
;GAME SCRN
;
DLIST	.BYTE	112,112,194
	.WORD	SCORELN
	.BYTE	77
	.WORD	SCRN
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,13,13
	.BYTE	13,13,13,13,13,13,141,13
	.BYTE	13,13,13,141,13,13,141,65
	.WORD	DLIST
;
;DISPLAY LIST INTERRUPTS
;
;CHANGE SCORELINE COLOR
;
DLI1	PHA
	LDA	#218
	STA	WSYNC	;CLEAN BREAK
	STA	COLPF2	;NEW COLOR
	LDA	# <DLI2	;NEXT DLI
	STA	VDSLST
	LDA	# >DLI2
	STA	VDSLST+1
	PLA
	RTI
;
;CHANGE POT COLOR
;
DLI2	PHA
	LDA	#228
	STA	WSYNC	;CLEAN BREAK
	STA	COLPM1	;POT
	LDA	PCOLR2	;CANEHEAD COLOR
	STA	COLPF0	;PUT IN CANE
	LDA	# <DLI3	;NEW DLI
	STA	VDSLST
	LDA	# >DLI3
	STA	VDSLST+1
	PLA
	RTI
;
;PUT A CUFF ON THE ARM
;
DLI3	PHA
	LDA	#10
	STA	WSYNC
	STA	COLPM0	;CUFF WHITE
	LDA	#4	;MAKE CANE PASS
	STA	PRIOR	;BEFORE PLAYER
	LDA	# <DLI4	;NEW DLI
	STA	VDSLST
	LDA	# >DLI4
	STA	VDSLST+1
	PLA
	RTI
;
;MAKE GREEN TABLE
;
DLI4	PHA
	LDA	#200
	STA	WSYNC
	STA	COLBK	;BACKGRND
	LDA	# <DLI1	;NEW DLI
	STA	VDSLST
	LDA	# >DLI1
	STA	VDSLST+1
	PLA
	RTI
;
;DLI FOR TITLE SCRN
;
DLI	PHA
	LDA	#224	;DEFAULT CHARSET
	STA	WSYNC	;CLEAN BREAK
	STA	CHBASE	;SWITCH CHAR SET
	LDA	#10	;NEW CHAR. COLOR
	STA	COLPF1
	LDA	#0	;BACKGRND
	STA	COLPF2
	PLA
	RTI
;
;FOR BOSS'S SCRN
;
BOSSDLI	PHA
	LDA	#224
	STA	WSYNC
	STA	CHBASE	;CHBAS HARDWARE
	LDA	#8	;GREY FLOOR
	STA	COLBK
	PLA
	RTI
;
;DATA FOR NEW CHAR. SET
;
CHARDATA	.BYTE	0,0,0,0,0,0,0,0
	.BYTE	96,246,255,127,62,120,120,0,0,0
	.BYTE	0,56,239,239,42,10,46,47,10
	.BYTE	0,0,40,174,250,232,192,128,0
	.BYTE	0,0,170,170,170,170,170,85,0
	.BYTE	0,0,170,40,40,0,170,85,0
	.BYTE	0,0,170,170,170,170,170,85,0
	.BYTE	0,0,0,0,0,0,0,0,0
	.BYTE	0,0,0,0,0,0,0,0,85
	.BYTE	0,0,0,0,0,0,0,40,85
	.BYTE	0,0,0,0,0,0,0,0,85
	.BYTE	0,0,0,0,0,0,0,0,0
	.BYTE	0,0,85,0,0,0,0,0,0
	.BYTE	0,40,85,0,0,0,0,0,0
	.BYTE	0,0,85,0,0,0,0,0,0
	.BYTE	0,0,0,0,0,0,0,0,0
;
;FOR BOSS'S CHAR. SET
;
	.BYTE	0,0,0,0,0,0,0,0,0
BOSSCHAR1	.BYTE	0,247,247,247,0,127,127,127
	.BYTE	56,248,248,248,56,120,120,120
	.BYTE	28,31,31,31,28,31,31,31
	.BYTE	255,255,0,0,0,0,0,0
	.BYTE	127,255,252,252,120,120,120,120
	.BYTE	254,255,63,63,31,31,31,31
BOSSCHAR2	.BYTE	0,0,0,0,0,0,0,0
	.BYTE	0,7,15,25,63,61,125,127
	.BYTE	0,224,240,152,252,188,190,254
	.BYTE	63,60,31,15,7,3,3,0
	.BYTE	252,60,248,240,224,192,192,0
	.BYTE	0,7,13,27,55,61,125,127
	.BYTE	0,224,176,216,236,188,190,254
	.BYTE	59,60,31,15,7,3,3,0
	.BYTE	220,60,248,240,224,192,192,0
	.BYTE	0,7,15,27,61,62,125,125
	.BYTE	0,224,240,216,188,124,190,190
	.BYTE	63,60,27,15,7,3,3,0
	.BYTE	252,60,216,240,224,192,192,0
	.BYTE	63,127,127,111,111,111,111,111
	.BYTE	252,254,254,246,246,246,246,246
	.BYTE	96,111,15,110,110,14,14,14
	.BYTE	6,246,240,118,118,112,112,112
	.BYTE	14,14,14,14,14,14,30,62
	.BYTE	112,112,112,112,112,112,120,124
;
;VERTICAL BLANK INTERRUPT ROUTINE
;
SNDVALUE	.BYTE	142,9,138,13,134,17,130,21
;
VBROUTINE	CLD
	LDA	LENGTH	;LENGTH OF NOTE
	BEQ	NEXTNOTE	;TIME TO PLAY NEXT NOTE
	DEC	LENGTH	;DEC. TIMER
	JMP	END1	;SKIP THE REST
;
NEXTNOTE	LDA	SNGFLAG	;NOTE OR SILENCE
	EOR	#1	;FLIP IT
	STA	SNGFLAG
	BNE	SNDOFF	;SILENCE
	LDX	SONGXREG	;GET NOTE P
	LDA	SONG,X	;THEN NOTE
	BEQ	END1	;IF 0 DON'T PLAY
	STA	AUDF3	;AND SOUND OFF
	LDA	#170	;PURE TONE
	STA	AUDC3	;IN CONTROL
	INX		;GET LENGTH
	LDA	SONG,X	;OF NOTE
	STA	LENGTH	;AND STORE IT!
	INX
	STX	SONGXREG	;UPDATE NOTE POS.
	JMP	END1	;DONE
;
SNDOFF	LDA	#0	;SHUT OFF SOUND
	STA	AUDC3	;( REST)
	LDX	SONGXREG	;POS. IN TABLE
	DEX		;GET LENGTH
	LDA	SONG,X	;( SAME AS PREVIOUS
	STA	LENGTH	;NOTE)
END1	LDA	STICK0	;STICK POS.?
	CMP	#7	;RIGHT!
	BEQ	FORWARD
	CMP	#11	;YOU GUESSED IT!
	BNE	DONEX	;IF NOT-DON'T MOVE
	LDA	HPOS	;POS. OF HAND
	CMP	#50	;TOO FAR LEFT?
	BCC	DONE	;YES!
	LDY	LEVEL	;GET LEVEL
	CPY	#5	;IF UNDER 5,
	BCC	SLOWER	;NEED TO SLOW IT
	DEC	HPOS	;DOWN
SLOWER	DEC	HPOS	;MOVE TWICE
	DEC	HPOS
	JMP	DONE
;
FORWARD	LDA	HPOS
	CMP	#195	;TOO FAR RIGHT?
	BCS	DONE	;YES!
	LDY	LEVEL	;SAME AS ABOVE
	CPY	#5
	BCC	SLOWER1
	INC	HPOS
SLOWER1	INC	HPOS
	INC	HPOS
DONE	LDA	#0
	STA	ATRACT	;KILL ATTRACT MODE
DONEX	LDA	HPOS
	STA	HPOSP1	;POT
	CLC
	ADC	#5
	STA	HPOSP0	;HAND PART TWO
	LDA	SNDFLAGPOP	;POPCORN POPING?
	BEQ	DONE9	;NO!
	INC	DELAYPOP	;YES, INC. COUNTER
	LDA	DELAYPOP	;NEXT SOUND
	CMP	#2	;EVERY 2 VBI'S
	BNE	DONE9	;READY
	LDX	XFLAGPOP	;GET NEXT VALUE
	LDA	SNDVALUE,X
	STA	AUDC2	;SOUND 2
	INX		;GET NEXT
	LDA	SNDVALUE,X	;FREQUENCY
	STA	AUDF2	;VALUE
	LDA	#0	;RESET TIMER
	STA	DELAYPOP
	INX
	STX	XFLAGPOP	;NEXT VALUE
	CPX	#8	;DONE WITH POP?
	BNE	DONE9	;NOPE.
	LDA	#0	;RESET
	STA	AUDC2	;SOUND
	STA	XFLAGPOP	;NEXT VALUE
	STA	SNDFLAGPOP	;'POP' FLAG
DONE9	LDA	CATCHSND	;ANY CAUGHT?
	BEQ	NOTCAUGHT	;NOPE!
	INC	SNDDELAY	;YES!
	LDA	SNDDELAY	;EVERY TWO VBI'S
	CMP	#1
	BNE	NOTCAUGHT
	LDA	CATCHSND1	;IF IN MIDDLE OF
	BNE	RR	;POP, START
	LDA	#240	;ONE
	STA	FREQ
RR	LDA	#170	;PURE TONE
	STA	AUDC1
	LDA	FREQ	;NEXT VALUE
	STA	AUDF1
	BEQ	DONE2	;DONE? YES.
	SEC		;NEXT NOTE
	SBC	#40
	STA	FREQ
	LDA	#0	;RESET DELAY
	STA	SNDDELAY
	LDA	#1	;SHOW SOUND IS
	STA	CATCHSND1	;IN PROGRESS
	BNE	NOTCAUGHT	;ALL DONE!
;
DONE2	LDA	#240	;GET SOUND
	STA	FREQ	;READY FOR NEXT
	LDA	#0	;CATCH
	STA	CATCHSND
	STA	CATCHSND1
	STA	SNDDELAY
NOTCAUGHT	JMP	XITVBV
;
INITVBLANK
	LDA	#7	;DEFFERRED VBI
	LDX	# >VBROUTINE	;ADDRESS OF
	LDY	# <VBROUTINE	;VBI PROGRAM
	JMP	SETVBV	;SET IT UP
;
;PLOT CHRS IN GR. 7
;
CHARPOLL	LDA	#0
	STA	XREG	;KEEPS TRACK OF
CHKPOS	LDX	XREG	;CURRENT POPCORN
	LDA	POSITION,X	;CHECKS
	BNE	CHKMOVE	;TO SEE
	INX		;IF POPCORN
	INX		;IS ON SCRN
	STX	XREG	;IF SO, MOVE
	CPX	#12	;IT DOWN
	BCC	CHKPOS
	RTS
;
CHKMOVE	LDA	POSITION,X	;TABLE
	STA	HORIZ	;DRIVEN HORIZ
	INX		;AND VERT VALUES
	LDA	POSITION,X
	STA	VERT
	CMP	#97	;FALLEN OFFSCRN?
	BCC	MOVEIT	;NO!
	DEX		;YES. PUT OUT OF PLAY
	LDA	#0
	STA	POSITION,X
	INX
	STA	POSITION,X
	INC	MISSPOP	;ONE MORE MISSED
	BNE	MOVED	;DON'T PUT BACK IN PLAY
MOVEIT	INC	POSITION,X	:NEXT POS
MOVED	INX
	STX	XREG	;SAVE POPCORN POS
	LDA	LOADCHAR	;POPCORN CHAR.
	STA	CHR
	JSR	PRINTCHAR
	LDX	XREG	;CHECK NEXT
	CPX	#12	;POSITION
	BCC	CHKPOS
	RTS
;
;USED TO PRINT TO GR.7 SCRN
;
PRINTCHR	STA	CHR	;VARIABLES
	STY	VERT
	STX	HORIZ
PRINTCHAR	LDA	#1	;1ST OR 2ND PART?
	STA	CHECK	;2 CHAR. PER POPCORN
	LDA	# >CHARORG3	;CTRL CHAR
	STA	CHAR+1
PRINT	LDA	CHECK
	BNE	AAA
	INC	HORIZ	;2ND PART
	INC	CHR
AAA	LDA	#0
	STA	CHAROFS+1	:RESET
	STA	PLUS	;VARIABLES
	STA	OFFSET+1
	STA	TEMP+1
	LDA	VERT	;VERTICAL VALUE
	ASL	A	;*2
	ROL	TEMP+1	;SAVE CARRY
	ASL	A	;*4
	ROL	TEMP+1
	ASL	A	;*8
	ROL	TEMP+1
	LDX	TEMP+1
	STX	OFFSET+1	;SAVE HIGH&LOW
	STA	OFFSET	;BYTES
	ASL	A	;*16
	ROL	TEMP+1
	ASL	A	;*32
	ROL	TEMP+1
	CLC
	ADC	OFFSET	;ADD VERT*8
	STA	OFFSET
	LDA	TEMP+1	;TO GET VERT*40
	ADC	OFFSET+1
	STA	OFFSET+1
	LDA	OFFSET
	CLC
	ADC	HORIZ	;SIMPLY ADD
	STA	OFFSET	;HORIZ. VALUE
	BCC	BBB	;OVERFLOW? NO.
	INC	OFFSET+1
BBB	CLC
	LDA	OFFSET
	ADC	# <SCRN	;ADD IN
	STA	OFFSET	;MEMORY LOC OF
	LDA	# >SCRN	;FIRST BYTE
	ADC	OFFSET+1	;ON SCRN
	STA	OFFSET+1
	LDA	#0
	STA	TEMP+1
	LDA	CHR	;CHAR TO PRINT
	ASL	A	;OFFSET= CHAR*9
	ROL	CHAROFS+1
	ASL	A
	ROL	CHAROFS+1
	ASL	A
	ROL	CHAROFS+1
	CLC
	ADC	CHR
	STA	CHAR
	LDA	CHAROFS+1	;ADD IN LOC
	ADC	CHAR+1	;OF CHR SET
	STA	CHAR+1
LOOP2	LDY	PLUS	;BYTE OF CHAR.
	LDA	(CHAR),Y	;NUMBER FOR BYTE
	LDY	#0
	STA	(OFFSET),Y	;PUT ON SCRN
	LDA	OFFSET
	CLC
	ADC	#40	;40 BYTES PER LINE
	STA	OFFSET
	BCC	CCC	;OVERFLOW? NO.
	INC	OFFSET+1
CCC	INC	PLUS	;9 BYTES PER
	LDA	PLUS	;CHR
	CMP	#9
	BNE	LOOP2
	DEC	CHECK	;NEXT CHR
	LDA	CHECK
	CMP	#255	;WOULD BE THIRD
	BEQ	MMM	;CHR
	JMP	PRINT	;(TWO PER POPCORN)
;
MMM	RTS
;
;ROUTINE TO ERASE POPCORN
;THAT TOUCHED POT
;
ERASECHR	LDA	HPOS	;PLAYER HORIZ POS
	SEC
;
;ROUTINE FINDS CHAR POSITION
;BY HORIZ LOCATION OF PLAYER
;
	SBC	#36
	LSR	A	;DIVIDE BY FOUR
	LSR	A
	SEC
	SBC	#4
	STA	HPOS1
	LDY	#0
	LDX	#0
CHKPLAYER	LDA	POSITION,X
	BEQ	CHECKED	;IF O SKIP CHECK
	CMP	HPOS1
	BEQ	ERASE	;ERASE POPCORN
CHECKED	INX
	INX
	CPX	#12	;COMP. ALL POPCORN
	BNE	CHKPLAYER
	INC	HPOS1	;CHECK AROUND PLAYER
	INY
	LDX	#0
	CPY	#6	;ALL DONE?
	BNE	CHKPLAYER	;NO!
	RTS
;
ERASE	INX
	LDA	POSITION,X	;VERT POS OF POPCORN
	DEX
	CMP	#78	;AT LOC OF POT (VERT)?
	BCC	CHECKED	;TO HIGH UP ON SCRN
	STA	VERT	;STORE IT
	LDA	POSITION,X	;STORE
	STA	HORIZ	;HORIZ POS
	LDA	#15	;BLANK CHR
	STA	CHR
	LDA	#0
	STA	POSITION,X	;PUT THAT POPCORN
	STA	POSITION+1,X	;OUT OF PLAY
	JMP	PRINTCHAR	;ERASE CHR
;
;CLR MEMORY ROUTINE
;
CLR0	LDY	#0
	TYA
CLR1	STA	(CLR),Y
	INY		;LOW BYTE OF
	BNE	CLR1	;BEG. MEM IN CLR
	INC	CLR+1	;HIGH BYTE IN
	DEX
	BNE	CLR1	;CLR+1
	RTS
;
;PLAYER DATA
;
PMDATA0	.BYTE	32,112,240,242,242,254,126
	.BYTE	62,15,15,15,15,15,15,15
PMDATA1	.BYTE	255,255,255,126,126,126
	.BYTE	126,126,126,126,0,0,0,0,0
PMDATA2	.BYTE	0,120,248,128,128,0,0,0
	.BYTE	0,0,0,0,0,0,0
;
;RUN ADDRESS
;
	*=	$02E0
	.WORD	START
	.END