; Bingo Firmware ; Version 2.0 By: Isabella Lindquist ; (C) 1998,1999,2000,2001 FunTronics ; last update 3-2001 ; With national gaming labs suggested corrections ; And other stuff $MOD51 $NOPAGING keyreg data 20h ;keyboard register strt bit 20h.0 ; stop bit 20h.1 ; left bit 20h.2 right bit 20h.3 fcrdsw bit 20h.4 motion bit 20h.5 ;motion detector input slot2 bit 20h.6 ;Used to differentiate between coin mechs proreg data 21h ;misc program bits bitusd bit 21h.1 ;used to chkpos to indicate a match clkrun bit 21h.2 ;turns on /off delay clock mclk=delay fpriz bit 21h.4 ;if set to 1, flashes prize lamps d16bdp bit 21h.5 ;puts a decimal place in dsp16b a16bsn bit 21h.7 ;signed number mask off high bit for abs value proreg2 data 22h ;Misc bits #2 nomorev bit 22h.0 ;tells voice to hold off untill reset freeze bit 22h.1 ;If set to 1 will stop update of display billhld bit 22h.2 ;wait before processing bill interrupt opage bit 22h.3 ;tells display routine what page to use mext bit 22h.4 ;if 1 strout uses external memory curson bit 22h.5 ;if 1 cursor is displayed on screen wover bit 22h.6 ;if enabled, will now erase previous chr exs bit 22h.7 ;sends sound from external memory ;!!!!!!!23h is avalible now after a little housecleaning!!!!!!!!!! dpage equ p1.7 ;what page is currently displayed testk equ p3.4 ;test switch input solgo equ p3.5 ;when clear, soloniod output is enable cts equ p3.0 ;serial in (used as clear to send)) mislat data 24h ;sent to solat2 every 1/300 second ctlmp bit 24h.0 rdlmp bit 24h.1 ; splmp bit 24h.2 ;start lamp stlmp bit 24h.3 ;stop lamp prize9 bit 24h.4 ;prize9 relay proreg3 data 25h shwcrd bit 25h.0 ;displays credits if set to 1 endofs bit 25h.1 ;flags end of sequence newbil bit 25h.2 ;Set when bill interrupt is activated sppix bit 25h.3 ;does the special pix thing spbit1 bit 25h.4 ;set/reset by updani prizeout bit 25h.5 ;if 1 payout has been detected if 0 failure coinhld bit 25h.6 ;Wait before processing another coin GotTwo bit 25h.7 ;Got at least two squares out of a pattern nvreg1c data 26h ;copy of NVram's nvreg1. reloaded at startup shwuspg bit 26h.0 ;if set to 1 will show user page dynaen bit 26h.1 ;dynamic difficulty enabled if 1 clkrun2 bit 26h.2 ;Secondary clockrun (put here cause no place else) gomodo bit 26h.3 ;Enable motion detector xgtry bit 26h.5 ;is x>Y? sqani bit 26h.7 ;if set will not display "continue needs cred" port4out data 27h ;sent to port4 4 times a second cntbit1 bit 27h.0 ;1 bits used to toggle counter calcdone bit 27h.1 ;indicates game calculation complete atmode bit 27h.2 ;Set when running attract mode winner bit 27h.3 ;used to chkpat to indicate winner Expired bit 27h.4 ;Flag indicates if last game timed out BonusG bit 27h.5 ;Flag to see if it's a bonus game gameg bit 27h.6 ;game going bit fbit bit 27h.7 ;Heartbeat, used to flash buttons ;External Memory Addresses exmemp equ 02000h ;external rom select prizsw equ 02001h ;prize detector switches keylat equ 02002h ;switch latch input3 equ 02003h ;input latch3 solat1 equ 02004h ;solonoid latch1 solat2 equ 02005h ;solonoid latch2 matneg equ 02006h ;neg matrix latch port4a equ 02007h ;Port 4 daclat equ 04000h ;dac latch ;old value f400 = 300hz t0rldh equ 0fah ;timer 0 reload value should be about 600hz t0rldl equ 000h ;giving the display a 100hz per line refresh sclkh equ 0ffh sclkl equ 0a0h ;sample clock set to 14400hz (was A0) ckrld equ 05 ;300 / 5 =60! clkrat equ 02 ;divide main clock by..... biltim equ 25 ;time before new credit will be recognized cointim equ 50 ;time before new coin will be recognized rlystl equ 80 ;relay settle time solstl equ 180 ;solonoid on time in 300th of seconds sertim equ 250 ;interval before serial loop resets ;to prevent it from endlessly waiting for ;data that is not being sent ;NVRAM addresses chksum equ 0001h ;chksum byte nvcred equ 0002h ;credits up to 99 nvreg1 equ 0003h ;misc program bits stored in nvram billval equ 0004h ;Value of bill ($x.xx) nvstc equ 0005h ;seconds to continue nvsts equ 0006h ;seconds to autostart coinval1 equ 0007h ;Value of coin Slot 1 ($x.xx) modohld equ 0008h ;Specifies how often motion detector will trip coinval2 equ 0009h ;Value of coin Slot 2 ($x.xx) $0.25-$2.50 CrdHld equ 000ah ;Holder for credit (used by addvalu only) CrdValu equ 000bh ;How much a game costs ($x.xx) speeds equ 0010h ;8 bytes for speed storage ColVal equ 0020h ;16 bytes for column value ColBal equ 0030h ;16 bytes for column balence (col index) tcredh equ 0040h ;total credit 2 bytes tbillh equ 0042h ;total bills inserted 2 bytes tfcred equ 0044h ;total free credits 2 bytes tcoins1 equ 0046h ;total coins (Slot 1) inserted 2 bytes tcoins2 equ 0048h ;total coins (Slot 2) inserted TCash equ 004ah ;Total Dollar Figure Collected tcolw equ 0050h ;16 bytes for col wins tcolp equ 0060h ;16bytes for col plays tpayo equ 0070h ;total payout for each column 16 bytes mspeeds equ 0080h ;Default col Speed adden1 equ 008ah ;2 bytes for misc addition operations rlevtab equ 0090h ;defines what pattern each runs at rmintab equ 00a0h ;defines minimum level dlydif equ 00b0h ;delay register bprzcnt equ 00c0h ;14 bytes for counting bonus prizes bnusdiv equ 00d0h ;bonus prize divider bnusmax equ 00d8h ;at what point does it reset? ColCntr equ 00e0h ;Bonus Counter For Each Column ;Addresses 2 - ff are checked with checksum userpg1 equ 0400h ;user page pointer $include(RomTable.asm) DSEG org 10h sercnt: ds 1h ;used to time out serial commands cnt1: ds 1h ;counter 1 count ssh: ds 1h ;the following bytes are used for serial ssl: ds 1h sah: ds 1h sal: ds 1h simod: ds 1h somod: ds 1h r1stor: ds 1h bcstr: ds 1h ;rnd2 was here! ORG 28h ;as low as possible running outta room dlycnt: ds 1h ;used internally by pdelay dlycn2: ds 1h ;value for pdelay rowcnt: ds 1h ;counts what row we're on row: ds 1h ;used to decode matrix row1: ds 1h ;display matrix storage row2: ds 1h ;area row3: ds 1h row4: ds 1h row5: ds 1h row6: ds 1h ;last three are for chaser lamps row7: ds 1h row8: ds 1h prize: ds 1h ;prize lamp indicator thingy ColEMkr: ds 1h ;No Longer used credit: ds 1h ;how many credits redlev: ds 1h ;redeem level patp: ds 1h ;pattern pointer dsh: ds 1h dsl: ds 1h bct: ds 1h ;bingo count for lamps btim: ds 1h ;attract mode timing irstr: ds 1h ;to store r1 in interrupt loop speed: ds 1h ;game speed tries: ds 1h ;number of tries remaining hit1: ds 1h hit2: ds 1h hit3: ds 1h hit4: ds 1h hit5: ds 1h ;used to store winning ## fdiv: ds 1h ;flash divider high byte clkdiv: ds 1h ;counter to divide main clock bilcnt: ds 1h ;bill holdoff counter coicnt: ds 1h ;coin holdoff counter coct: ds 1h ;used in chrout routines coct2: ds 1h ;used in chrout dxpos: ds 1h ;used to draw on display by dotdraw and chrout dypos: ds 1h ;x and y positions chr: ds 1h ;chr value to be displayed dotval: ds 1h ;value to pixel sptre: ds 1h ;sample pointer extended sptrh: ds 1h ;sample pointer high sptrl: ds 1h ;sample pointer low mclk: ds 1h ;clock l reps: ds 1h ;number of reps pattern has repeated miscl: ds 1h ;added for misc operations (used during attract!) misch: ds 1h ; messtim: ds 1h ;message timer bitpl: ds 1h ;points to bit pattern bitph: ds 1h ; nptr: ds 1h ;used only to make noise what a waste lastsq: ds 1h ;Last square used in game fmptrl: ds 1h ;Frame pointer low fmptrh: ds 1h ;Frame pointer high fmptre: ds 1h ;frame pointer extended fposl: ds 1h ;frame position low fposh: ds 1h ;frame position high fpose: ds 1h ;frame position extended clptrh: ds 1h ;pointer for coolled (chaser lamps) clptrl: ds 1h ;second lrnd: ds 1h ;last random number hcreds: ds 1h ;counts partial credits mclk2: ds 1h ;Secondary counter PatDPH: ds 1h PatDPL: ds 1h ;Pointer to start of pattern BonusCol: ds 1h ;Award a bonus play on column NCumCol: ds 1h nstp: ds 1h ;This should always be at the end ;it is the start of the stack CSEG ORG 0000h start: jmp init ;jump to main program org 0003h jmp billint ;for bill interrupt org 000bh ;Vector address of 600hz timer (display) jmp timer ;go to timer service routine org 0013h jmp coinint ;coin interrupt org 001bh ;vector for 9600hz clock (audio) jmp psmpl ;play sample org 0023h ;serial interrupt jmp sout softid: db 'Version 2.0 ',07h,0ffh ;Master program init: mov sp,#nstp ;set new stack pointer mov p3,#0ffh ;f0 init value mov p1,#074h ; mov a,#000h ;reset solonoids mov dptr,#port4a movx @dptr,a ;Counters all off! mov dptr,#solat1 movx @dptr,a mov dptr,#solat2 movx @dptr,a ;reset all solonoids clr prize9 setb solgo ;make shure that relay is open! clr curson ;turn off cursor mov port4out,#00 ;send nothing to port4 clr atmode mov cnt1,#00 mov simod,#00 mov somod,#00 mov ie,#00 ;clear interrupt enable register mov tmod,#11h ;set up t1 counter 16bit, t0 timer 16bit setb et0 ;enable timer0 display setb et1 ;enable timer1 sound clr ren ;disable recieve setb es ;enable serial interrupt ; setb px0 ;Give bill accecptor high priority ; setb pt0 ;Give display high priority setb pt1 ;Give Audio Highest priority setb ea ;master enable setb it0 ;make bill edge triggered setb it1 mov t2con,#34h ;enable timer2 as baud rate generator mov scon,#040h ;set to n,8,1 mov th0,#t0rldh ;set timer for ? mov tl0,#t0rldl mov th1,#sclkh mov tl1,#sclkl ;set up sample clock for 9600hz mov rcap2h,#0ffh mov rcap2l,#0dch ;baud rate generator reload value mov clkdiv,#clkrat setb tr0 ;start timer clr tr1 ;stop any sample from playing clr freeze ; clr d16bdp clr a16bsn clr mext clr wover ;no write over clr dpage clr opage clr bonusg clr expired clr calcdone clr gameg clr shwcrd ;don't show credits clr endofs ;not end of sequence mov ColEMkr,#00 ;No Columns are Empty! mov hcreds,#00 ;Begin system tests mov dptr,#prizsw movx a,@dptr anl a,#080h jnz BeginTests jmp skiptests BeginTests: mov dptr,#mess1 ;Say Bingovault blah, Blah call strout ;output to display mov dlycn2,#255 ;set up a short delay call pdelay mov dlycn2,#255 ;set up a short delay call pdelay mov dlycn2,#255 ;set up a short delay call pdelay mov dptr,#tststm call strout mov dxpos,#00 mov dypos,#00 setb stlmp setb splmp setb ctlmp setb rdlmp mov row1,#0 mov row2,#0 mov row3,#0 mov row4,#0 mov row5,#0 mov row6,#0 ;all lamps on! mov row7,#0 mov row8,#0 mov dlycn2,#255 ;set up a short delay call pdelay mov dlycn2,#255 ;set up a short delay call pdelay clr opage clr dpage dretest: mov patp,#14 ;Now REALLY Test Display (write-readback test) DispTSL1: ;Jumps here after each test CHR mov dptr,#dsptsda mov a,patp movc a,@a+dptr mov b,a mov dptr,#06000h ;Dptr To start of Display Ram disptsl3: ;First Fill Display Ram With Test Byte mov a,b movx @dptr,a ;write test byte to ram inc dptr mov a,dpl jnz dtskk1 mov a,dph cjne a,#068h,dtskk1 ;Check All of Display ram 6000-67ff jmp dtskk2 dsptsda: db 0ffh,0aah,055h,0a0h,050h,00ah,005h,003h,030h,0c0h,00ch,000h,0ffh dtskk1: jmp disptsl3 dtskk2: ;Now Read It Back mov dptr,#06000h ;Dptr To start of Display Ram disptsl31: movx a,@dptr ;read it back cjne a,b,JDisplayBAD ;If it wont read back its bad! inc dptr mov a,dpl jnz dtskk11 mov a,dph cjne a,#068h,dtskk11 ;Check All of Display ram 6000-67ff jmp dtskk21 dtskk11: ;not at end do next byte jmp disptsl31 Jdisplaybad: jmp displaybad DBADMSG: db 27,64,27,81,00,27,82,00 db 'Display Ram Failure',10,13,10 db 'Address - ',0ffh DOKAYMSG: db 27,64,26,81,00,27,82,00 db 'System Tests:',10,13 db 'Display RAM - OKAY',13,10,0ffh RTSTMSG: db 'PGMROM CHKSUM - ',0ffh PGFAIL: db 'Program Rom Failure',10,13 db ' SYSTEM HALTED',0ffh RBADMSG: db 'FAIL',0ffh ROKAYMSG: db 'OKAY',0ffh MROMMSG1: db 13,10,'MMROM CHKSUM - ',0ffh MROMMSG2: db 13,10,'MMROM2 CHKSUM - ',0ffh COLSWMSG: db 13,10,'SWITCH TEST - ',0ffh NVRAMMSG: db 13,10,'NVRAM TEST - ',0ffh NVRAMMS2: db 13,10,'NVRAM BACKUP - ',0ffh ADTSTMSG: db 13,10,'AUDIO TEST - ',0ffh LFCR: db 13,10,0ffh drejmp: jmp dretest DisplayBAD: ;Jumps Here if Display is Bad push dph push dpl mov dptr,#dbadmsg call strout pop dpl pop dph call dsp16bhex ;at what address did it fail? dbadlp: jnb strt,drejmp ;If start is pressed, retest Display RAM jmp dbadlp disptsl16: jmp disptsl1 dtskk21: ;at end of page, move to next test byte mov dlycn2,#2 call pdelay ;Let 'em see it do'in sumpin djnz patp,DispTSL16 ;test all pages, then it's okay! ;Display OKAY! ;Now Show Visual Test Patterns setb dpage clr opage mov dptr,#TESTPIX call updisp clr dpage setb opage mov dptr,#TESTPIX call updisp clr opage mov dlycn2,#255 ;Show Test Pattern on page 1(visual test) call pdelay setb dpage mov dlycn2,#255 ;Show Test Pattern on page 2(Visual test) call pdelay clr opage clr dpage call clrdisp ; mov dptr,#dokaymsg call strout mov dlycn2,#0ffh call pdelay ;Now Check Program Rom CheckSUM mov dptr,#rtstmsg call strout ;Now check Program ROM mov dsh,#00 mov dsl,#00 mov dptr,#0000h ;all but the last two bytes PGMromlp: clr a movc a,@a+dptr clr cy addc a,dsl mov dsl,a clr a addc a,dsh mov dsh,a ;add byte inc dptr mov a,dph cjne a,#romchksum/256,PGMromlp mov a,dpl cjne a,#romchksum,pgmromlp mov dptr,#ROMCHKSUM clr a movc a,@a+dptr cjne a,dsh,ROMBAD mov a,#1 movc a,@a+dptr cjne a,dsl,ROMBAD jmp ROMOKAY ROMBAD: ;JUMPS HERE IF ROM IS BAD AND STAYS mov dph,dsh mov dpl,dsl call dsp16bhex mov dptr,#lfcr call strout mov dptr,#PGFAIL call strout RBADLP: jmp RBADLP MMB1MSG: db 10,13,' MMROM FAILURE',10,13 db ' SYSTEM HALTED',0ffh ROMOKAY: mov dph,dsh mov dpl,dsl call dsp16bhex ;Test MMROM1 mov miscl,#00 mov dptr,#MromMSG1 call strout ;Check MMROM mov dsh,#00 mov dsl,#00 mov fmptre,#00 ; maddlp22: call spinny mov dptr,#exmemp mov a,fmptre mov r7,a movx @dptr,a ;Set External Memory Page mov dptr,#08000h ;reset dptr maddlp12: movx a,@dptr ;get byte from rom clr cy addc a,dsl mov dsl,a clr a addc a,dsh mov dsh,a mov a,fmptre cjne a,#01fh,madam2 mov a,dph cjne a,#0ffh,madam2 mov a,dpl cjne a,#0fdh,madam2 jmp madam3 madam2: inc dptr mov a,dph ;add to dsl,dsl jnz maddlp12 ;inc dptr untill it pages inc fmptre mov a,fmptre cjne a,#020h,maddlp22 ;inc fmptre untill the end of the first rom madam3: mov dph,dsh mov dpl,dsl call dsp16bhex ;display checksum mov a,#01fh mov dptr,#exmemp mov r7,a movx @dptr,a ;First, set External Memory Page mov dptr,#0fffeh movx a,@dptr cjne a,dsh,mmrom2bad inc dptr movx a,@dptr cjne a,dsl,mmrom2bad jmp chknvram MMROM2BAD: mov dptr,#mmb1msg call strout jmp rbadlp ;check the NVRAM chknvram: mov dptr,#NVRAMMSG call strout mov dlycn2,#0ffh call pdelay mov dlycn2,#0ffh call pdelay mov dptr,#0002 mov b,#0 chkmeml: movx a,@dptr add a,b mov b,a inc dptr mov a,dph jz chkmeml mov dptr,#chksum movx a,@dptr cjne a,b,membad9 mov dptr,#rokaymsg call strout jmp memok mesbad: db 27,64,27,81,00,27,82,00 db 'Reconfiguring memory ' db ' to factory default ' db ' settings',0ffh membad9: membad2: ;chksum1 Failure mov dptr,#mfail call strout membd2l: jb testk,membd2l ;only if test is pressed continue membad: mov dptr,#mesbad call strout clr shwuspg ;if set to 1 will show user page setb dynaen ;dynamic difficulty enabled if 1 setb gomodo ;Enable attract Sounds clr xgtry ;is x>Y? clr sqani ;if set will not display "continue needs cred" mov dptr,#nvreg1 mov a,nvreg1c ;get the settings above call wrionly mov credit,#00 mov dptr,#modohld mov a,#4 call wrionly ;motion detector holdoff mov dptr,#nvcred clr a call wrionly mov dptr,#billval mov a,#100 call wrionly ;make bill worth $1.00 mov dptr,#coinval1 mov a,#025 call wrionly ;make coin slot 1 = 25 Cents mov dptr,#coinval2 mov a,#025 call wrionly ;make coin slot 2 = 25 cents mov dptr,#crdhld clr a call wrionly ;zero this out! mov dptr,#crdvalu mov a,#100 call wrionly ;make credit cost $1.00 mov patp,#7 mov dptr,#nvstc mov a,#15 ;30 seconds to continue game call wrionly mov dptr,#nvsts ;1 second to start mov a,#1 call wrionly ;setup speeds according to table mov patp,#7 mov dptr,#speeds mov tries,#0 dtfm2: mov dsh,dph ;reset speed bytes mov dsl,dpl mov dptr,#spdef mov a,tries movc a,@a+dptr mov dph,dsh mov dpl,dsl call wrionly inc dptr inc tries djnz patp,dtfm2 ;setup mspeeds to same as speeds mov patp,#7 mov dptr,#mspeeds ;reset minimum speeds mov tries,#0 dtfm21: mov dsh,dph mov dsl,dpl mov dptr,#spdef mov a,tries movc a,@a+dptr mov dph,dsh mov dpl,dsl call wrionly inc dptr inc tries djnz patp,dtfm21 mov patp,#7 mov dptr,#rlevtab ;reset pattern difficulty levels mov tries,#00 dtmm1: push dph push dpl mov dptr,#rlevdef mov a,tries movc a,@a+dptr pop dpl pop dph call wrionly inc dptr inc tries djnz patp,dtmm1 mov patp,#7 mov dptr,#rmintab ;reset mpatterns to same a pattern mov tries,#00 dtmm0: push dph push dpl mov dptr,#rlevdef mov a,tries movc a,@a+dptr pop dpl pop dph call wrionly inc dptr inc tries djnz patp,dtmm0 mov patp,#7 ;Reset Bonus Counters Per Column mov dptr,#ColCntr dplrjp: mov a,#3 ;reset to 3 call wrionly inc dptr djnz patp,dplrjp mov patp,#14 mov dptr,#colval mov tries,#0 dtfm3: mov dsh,dph ;reset column values mov dsl,dpl mov dptr,#colvaldef mov a,tries movc a,@a+dptr mov dph,dsh mov dpl,dsl call wrionly inc dptr inc tries djnz patp,dtfm3 call lookupdiff ;now set speeds and patterns according to it mov patp,#14 mov dptr,#colbal mov tries,#00 dtfm4: ;reset column balences clr a call wrionly ;reset all to zero inc dptr djnz patp,dtfm4 mov patp,#7 mov dptr,#dlydif ;reset delay difficulty leave: clr a call wrionly inc dptr djnz patp,leave mov dptr,#bnusdiv mov patp,#9 bnnrst: mov a,#3 call wriram inc dptr djnz patp,bnnrst mov dptr,#userpg1 ;start of user display page dtfm8: clr a call wrionly ;erase picture inc dptr mov a,dph cjne a,#08,dtfm8 ;ram ends at 0800h as soon as dph is 8,end call zaptot ;erase totals mov dptr,#rebtmsg call strout mov dlycn2,#0ffh call pdelay mov dlycn2,#0ffh call pdelay jmp init ;RAM HAS BEEN REST REBOOT! rebtmsg: db 27,64,27,81,00,27,82,00 db ' Memory has been ' db ' restored to factory ' db ' default settings ' db ' REBOOTING SYSTEM',0ffh memok: mov dlycn2,#0ffh call pdelay ;Now Check Column and player Switches.... mov dptr,#colswmsg call strout mov row1,#0feh mov row2,#0fdh mov row3,#0fbh mov row4,#0f7h mov row5,#0efh mov row6,#0ffh mov row7,#0ffh mov row8,#0ffh chkpsw: ;check for stuck prize detection switches mov dlycn2,#7 mov dptr,#prizsw ;get prize switches movx a,@dptr ;read prize switches rl a rl a ;set it up swchkl: jnb acc.0,notstuck ;is this switch stuck on? mov a,dlycn2 push acc mov dptr,#imstuk ;get string ptr call strout ;say it's stuck pop acc call dsp2b ;tell what switch is stuck stuckwaiting: jb testk,stuckwaiting ;only if test is pressed continue jmp init ;reboot notstuck: rl a ;go to next switch djnz dlycn2,swchkl ;checked all switches? ;Check player buttons jb stop,stopok mov dptr,#stopstuck call strout stkl1: jnb stop,stkl1 stopok: jb strt,strtok mov dptr,#strtstuck call strout stkl2: jnb strt,stkl2 strtok: jb right,contok mov dptr,#contstuck call strout stkl3: jnb right,stkl3 contok: jb left,redeemok mov dptr,#redeemstuck call strout stkl4: jnb left,stkl4 redeemok: mov dlycn2,#255 ;set up a short delay call pdelay mov dptr,#rokaymsg call strout ;Audio Test mov dptr,#adtstmsg call strout mov sptrh,#startv/256 mov sptrl,#startv clr exs setb tr1 ;play voice at startup for test AUDWAIT: jb tr1,audwait mov dptr,#ROKAYMSG call strout ;audio okay SkipTests: ;Final Enables and stuff before attract ;Now enable Bill and coin interrupts clr dpage clr opage setb ex0 ;enable Bill Slot interrupt setb ex1 ;enable coin slot interrupt mov BonusCol,#00 ;For Gods Sake Disable Bonuses! atsetp: ;jump here to enter attract mode mov lastsq,#00 mov row1,#0ffh mov row2,#0ffh mov row3,#0ffh mov row4,#0ffh mov row5,#0ffh mov row6,#0ffh mov keyreg,#0ffh mov hit1,#00 mov hit2,#00 mov hit3,#00 mov hit4,#00 mov hit5,#00 mov dptr,#nvcred movx a,@dptr mov credit,a ;Load credits from nvram mov patp,#00 mov dptr,#nvreg1 movx a,@dptr mov nvreg1c,a ;load nvreg1c setb ren ;enable recieve clr prize9 clr spbit1 clr endofs ;clear flag mov clptrl,#coolled ;reset chaser start position mov clptrh,#coolled/256 mov a,#CRDSPG ;Credits page start call setExfmptr mov dptr,#bits0 ;beginning of playfield animation sequence mov bitpl,dpl mov bitph,dph mov messtim,#0 mov dptr,#modohld movx a,@dptr dec a mov miscl,a ;set up motion detector mov btim,#04 mov bct,#00 ;bingo counter mov mclk,#20 setb clkrun attract: ;attract loop setup setb atmode ;tell us we are in attract mode clr winner ;reset wins clr fpriz ;stop flashing prize clr splmp clr stlmp clr rdlmp clr ctlmp clr gameg clr endofs atwlp: mov a,credit ;Attract LoopPoint! jz tree mov c,fbit mov stlmp,c tree: jb fcrdsw,NoFreeCD call AFreeCD NoFreeCD: jb strt,NoStrt ;is start button pressed? setb strt ;reset keypress jnb stop,NoStrt ;is stop pressed? if so abort mission! mov a,credit ;any credits? jz nostrt ; jmp plygam NoStrt: jnb left,calldemogame jnb right,calldemogame jb testk,notest mov misch,#00 ;reset to 00 jmp test CallDemoGame: call DemoGame jb strt,atwlp2 mov a,credit jz atwlp2 jmp PlyGamSkp ;Jump Into Game with level preselected atwlp2: jmp atsetp atwlp4: jmp atwlp notest: inc lrnd jb clkrun,atwlp4 mov mclk,#22 ;was 20, but I slowed down timing setb clkrun ;here every 15Hz mov dpl,clptrl ;chaser sequence mov dph,clptrh clr a movc a,@a+dptr mov row6,a inc dptr clr a movc a,@a+dptr mov row7,a inc dptr clr a movc a,@a+dptr mov row8,a inc dptr mov a,dpl cjne a,#endcool,coolsk1 mov a,dph cjne a,#endcool/256,coolsk1 mov dpl,#coolled mov dph,#coolled/256 coolsk1: mov clptrh,dph mov clptrl,dpl ;done with chaser sequence rncds: call updani ;update animated display jnb endofs,sksbr2 ;end of attract sequence? mov a,bonuscol jz ccde1 ;Should we mention a bonus column? call BonusGameNotify clr fpriz ;Stop Flahing the prize lamps ccde1: mov a,#CrdsPG call SetExFmptr mov bitpl,#bits0 ;reset bit pattern mov bitph,#bits0/256 clr nomorev clr endofs inc miscl jmp skspbr nmtim2: jmp nmtim ;longjump sksbr2: jnb newbil,sksbr3 ;new bill? clr newbil mov a,#CrdsPG call SetExFmptr mov bitpl,#bits0 ;reset bit pattern mov bitph,#bits0/256 sksbr3: skspbr: inc messtim mov a,messtim cjne a,#3,nmtim2 ;Divide 15hz clock by 3 mov messtim,#00 mov dpl,bitpl mov dph,bitph mov r1,#row1 mov r2,#05 mtnr: clr a movc a,@a+dptr cjne a,#0ffh,mtnra mtnr2: mov dptr,#bits0 inc miscl jmp mtnr mtnra: cpl a inc dptr ;move to next row mov b,a ;remember that for a while mov a,@r1 orl a,#01fh anl a,b mov @r1,a inc r1 djnz r2,mtnr clr a movc a,@a+dptr mov r1,a inc dptr mov bitpl,dpl mov bitph,dph mov a,mislat ;get old mislat anl a,#080h orl a,r1 mov mislat,a ;put new mislat in place nmtim: inc btim mov a,btim jnb acc.1,bcn3 ;bypass bingo thing every other turn inc bct ;move bingo lamp position mov r1,bct cjne r1,#07,bcn4 ;if >3 clear it mov bct,#0 orl row1,#020h orl row2,#020h orl row3,#020h orl row4,#020h orl row5,#020h ;clear all bingo bits jmp bcn3 bcn4: cjne r1,#2,bcn1 ;light b + o anl row1,#0dfh anl row5,#0dfh jmp bcn3 bcn1: cjne r1,#4,bcn2 ;light i + g anl row2,#0dfh anl row4,#0dfh jmp bcn3 bcn2: cjne r1,#6,bcn3 ;light n anl row3,#0dfh bcn3: jmp atwlp ;jmp to attract loop point ;SHALL WE PLAY A GAME? ;sets up a new round if started form this point ;first select a column to play in (show column pattern and speed) plygam: redemo: clr atmode ;at mode call demogame setb gameg jnb stop,redemo ;If moron(customer) hits stop, then restart PlyGamSkp: ;Jumps here if player allready selected col mov prize,redlev ;Redeem Level set by user mov sptrh,#startv/256 mov sptrl,#startv clr shwcrd ;stop showing credits clr exs setb tr1 ;start sample for test clr opage clr dpage call clrdisp clr atmode ;at mode call usecred ;take away a credit setb calcdone call PlayGame jb winner,WeWin ;on a winner jump here ;ulose call onloss ;On A Loss call EndOfGame ;Do this at end of game mov a,bonuscol jnz ulose2 ;Skip animation if there is a bonus game call loseranim ;display loseranim after bonus check ulose2: jmp atsetp ;done playing ;uwin WeWin: clr gameg ;Clear gameg mov dptr,#tcolw call inccntr ;Increment Total Column Wins clr dpage clr opage mov a,#UWinpage call SetExFpos call updispe mov a,#TestTone call SetExSptr setb exs ;external sample setb tr1 mov b,#8 flashlp2: mov patp,#5 mov r1,#row1 flashlp: mov a,@r1 cpl a mov @r1,a inc r1 djnz patp,flashlp mov mclk,#75 setb clkrun flashlp3: inc lrnd jb clkrun,flashlp3 djnz b,flashlp2 clr exs clr tr1 winlp1: call gredeem ;first pay out the prize! call OnWin ;on a win do these things call EndOfGame ;add value of credit to column call winanim ;show the win animation jmp atsetp ;return to attract mode ;TEST SCREEN!!!!!!!!!!!!!! ;HEY IT's HERE! test: clr tr1 ;stop the sounds! mov row1,#00 mov row2,#00 mov row3,#00 mov row4,#00 mov row5,#00 mov row6,#00 mov row7,#00 mov row8,#00 setb stlmp setb splmp setb ctlmp setb rdlmp clr dpage clr opage ;so we will be insync clr mext mov redlev,#7 chk4empty: call CheckColEmpty jnb cy,Chk4Esk1 mov dptr,#ColEmptyMess call strout mov a,redlev call dsp2b mov dlycn2,#50 call pdelay chk4empsk2: jb strt,Chk4empsk2 Chk4Esk1: djnz redlev,chk4empty call clrdisp mov ColEMkr,#00 ;Reset Column Empty Flags mov dptr,#mpage ;test page call strout mov patp,hit4 jmp utdsp tstlp: jb right,ntst1 inc patp mov a,patp cjne a,#011,ertu1 mov patp,#00 jmp utdsp ertu1: jmp utdsp ntst1: jb left,ntst2 dec patp mov a,patp cjne a,#0ffh,ertu1 mov patp,#010 jmp utdsp ntst2: jb strt,ntst3 mov a,patp mov hit4,patp jnz nottp0 jmp totp ;show col totals nottp0: cjne a,#1,nottp1 jmp credtot ;Show credit totals nottp1: cjne a,#2,nottp2 jmp credpbp ;Credits per bill nottp2: cjne a,#3,nottp3 jmp costpg ;Cost Per Column nottp3: cjne a,#4,nottp4 jmp modet ;Attract Sounds nottp4: cjne a,#5,nottp5 jmp paytst ;test payouts nottp5: cjne a,#6,nottp6 jmp tstaud ;audio test nottp6: cjne a,#7,nottp7 jmp tstinp ;test switch nottp7: cjne a,#8,nottp8 jmp tstalev ;test level nottp8: cjne a,#9,nottp9 jmp clrtot ;Clear totals nottp9: cjne a,#10,nottp10 jmp clrmem ;Clear memory nottp10: cjne a,#11,nottp11 nottp11: cjne a,#12,nottp12 nottp12: cjne a,#13,nottp13 nottp13: cjne a,#14,nottp14 nottp14: cjne a,#15,nottp15 nottp15: cjne a,#16,nottp16 nottp16: cjne a,#17,nottp17 nottp17: ntst3: jb stop,ntst4 ntst4: jnb testk,tstlpj ;if test switch is not sill closed jmp atsetp ;Enter attract mode tstlpj: jmp tstlp utdsp: mov dptr,#erln1 call strout ;erase line,show selection mov dptr,#optt mov a,patp mov b,#2 mul ab mov r1,a movc a,@a+dptr mov dsh,a inc dptr mov a,r1 movc a,@a+dptr mov dpl,a mov dph,dsh call strout mov dlycn2,#060h call pdelay jmp ntst4 totp: mov dptr,#colp ;totals page call strout mov patp,#00 jmp udtpg totpl: jb right,totp1 inc patp jmp udtpg totp1: jb left,totp2 dec patp jmp udtpg totp2: jb stop,totp3 mov hit4,#00 jmp test totp3: ;no key pressed jmp totpl udtpg: mov a,patp cjne a,#0ffh,tpgn0 mov patp,#06 jmp tpgn1 tpgn0: cjne a,#7,tpgn1 mov patp,#00 tpgn1: mov dptr,#poss1 ;totals page loop call strout mov a,patp inc a call dsp2b mov dptr,#poss2 call strout mov dptr,#tcolw mov a,patp call fndwrd call dsp16b ;dptr points to 16 bit # in ram mov dptr,#poss3 call strout mov dptr,#tcolp mov a,patp call fndwrd call dsp16b ;show 16bit address mov dptr,#poss4 call strout mov dptr,#tpayo mov a,patp call fndwrd call dsp16b mov dlycn2,#060h ;a key was pressed to get here.... call pdelay jmp totp3 ;return to totals page loop credtot: ;show credit totals jnb strt,credtot mov dptr,#credpg0 call strout mov dptr,#tbillh call dsp16b mov dptr,#credpg3 call strout mov dptr,#tcoins1 call dsp16b mov dptr,#credpg5 call strout mov dptr,#tcoins2 call dsp16b mov dptr,#credpg6 call strout credtl: mov dlycn2,#04fh call pdelay jnb strt,credxtra jb stop,credtl cdexpex: mov hit4,#1 jmp test cdxtrapg: db 27,64,27,81,8,27,82,00 db 'Total Credits - ',0ffh credxtra: jnb strt,credxtra mov dptr,#cdxtrapg call strout mov dptr,#tcredh call dsp16b mov dptr,#credpg2 call strout mov dptr,#tfcred call dsp16b mov dptr,#credpg6 call strout mov dptr,#credpg7 call strout mov dptr,#TCash call dsp16bill cdxtlp: jnb stop,cdexpex jb strt,cdxtlp jmp credtot tstinp: ;test inputs mov dptr,#swtstpg call strout cpl opage mov dptr,#swtstpg call strout cpl opage tstinpl: cpl dpage mov dypos,#08 mov dxpos,#12 mov dptr,#2001h ;first input port address movx a,@dptr call binasc mov dptr,#2002h ;second input port movx a,@dptr mov dxpos,#78 call binasc mov dypos,#24 mov dxpos,#12 mov dptr,#2003h ;third input port movx a,@dptr call binasc mov dxpos,#78 mov a,p3 call binasc ;fourth port cpl opage jb stop,tstinpl jmp test Binasc: rl a ;rotate acc push acc ;store mov dlycn2,#008 ;set up bit count binout: pop acc ;retrive rr a ;move to next bit push acc ;store it again anl a,#031h ;set upper 7 bits of a to 30(ascii 0) orl a,#030h ;leaving the lsb of a to make 1 or 0 mov chr,a ;set up data lines call chrout ;output it! djnz dlycn2,binout ;send out all bits pop acc ;maintain stack integerity ret credpbp: ;credits per bill/coin page cpl opage call clrdisp ;First Erase The Screen cpl opage call clrdisp ;both pages need to be erased mov tries,#00 call credpbup credpbl: jnb strt,crdst jnb right,crcont jnb left,crred jb stop,credpbl jmp test crcont: mov a,tries jnz crcont1 mov dptr,#billval jmp crcont4 crcont1: cjne a,#1,crcont2 mov dptr,#coinval1 jmp crcont4 crcont2: cjne a,#2,crcont3 mov dptr,#coinval2 jmp crcont4 crcont3: mov dptr,#crdvalu crcont4: movx a,@dptr clr cy addc a,#25 jnb cy,crcont5 mov a,#25 crcont5: call wriram call credpbup mov dlycn2,#20 call pdelay jmp credpbl crred: mov a,tries jnz crred1 mov dptr,#billval jmp crred4 crred1: cjne a,#1,crred2 mov dptr,#coinval1 jmp crred4 crred2: cjne a,#2,crred3 mov dptr,#coinval2 jmp crred4 crred3: mov dptr,#crdvalu crred4: movx a,@dptr clr cy subb a,#25 jz crred8 jnb cy,crred5 crred8: mov a,#250 crred5: call wriram call credpbup mov dlycn2,#20 call pdelay jmp credpbl crdst: inc tries mov a,tries cjne a,#4,crdst1 mov tries,#00 crdst1: call credpbup mov dlycn2,#20 call pdelay jmp credpbl credpbup: cpl opage mov dptr,#credpb1 call strout mov dptr,#billval mov a,tries jnz crn01 setb curson crn01: movx a,@dptr call dsp2bill clr curson mov dptr,#credpb2 call strout mov dptr,#coinval1 mov a,tries cjne a,#1,crn02 setb curson crn02: movx a,@dptr call dsp2bill clr curson mov dptr,#credpb3 call strout mov dptr,#coinval2 mov a,tries cjne a,#2,crn03 setb curson crn03: movx a,@dptr call dsp2bill clr curson mov dptr,#credpb4 call strout mov dptr,#crdvalu mov a,tries cjne a,#3,crn04 setb curson crn04: movx a,@dptr call dsp2bill clr curson cpl dpage ret fndwrd: ;dptr should be @ start of 16bit table ;ACC should point to word to find jz ttp3 ttp1: inc dptr inc dptr djnz acc,ttp1 ttp3: ret warn1: db 27,64,27,81,00,27,82,00 db ' You are about to ' db ' erase all totals! ' db ' Press continue to ' db ' proceed',0ffh clrtot: mov dptr,#warn1 call strout clrttl1: jb stop,clrtss1 jmp test clrtss1: jb right,clrttl1 call zaptot mov credit,#00 mov dptr,#memclrd call strout mov dlycn2,#0ffh call pdelay mov dlycn2,#0ffh call pdelay jmp test Costpg1: db 27,81,00,27,82,00,'Column Number - ',0ffh costpg2: db 27,81,08,27,82,00,'PZ Return = ',0ffh Costpg3: db 27,81,16,27,82,00,'Col. Index =',0ffh CostPg: ;Sets Retail Value of columns call clrdisp mov patp,#00 ;what column 0-6 mov redlev,#00 ;What Param call costpgup ;update page costpglp: mov a,redlev cjne a,#1,fukk1 mov dsh,#027h mov dsl,#010h jmp fukk5 fukk1: cjne a,#2,fukk2 mov dsh,#03h mov dsl,#0e8h jmp fukk5 fukk2: cjne a,#3,fukk3 mov dsh,#0 mov dsl,#0100 jmp fukk5 fukk3: cjne a,#4,fukk4 mov dsh,#0 mov dsl,#010 jmp fukk5 fukk4: cjne a,#5,fukk5 mov dsh,#0 mov dsl,#01 fukk5: costpglp2: jb strt,costpgst ;start pressed? inc redlev mov a,redlev cjne a,#6,redn6 clr a mov redlev,#00 ;reset it redn6: jz redn10 jb stop,redn10 ;is stop also pressed? mov dptr,#colbal mov a,patp call fndwrd clr a call wrionly inc dptr clr a call wriram ; redn10: call costpgup jmp costpglp costpgst: jb left,costpgre ;redeem maby??? mov a,redlev jnz costre1 dec patp mov a,patp cjne a,#0ffh,costre2 mov patp,#6 costre2: call costpgup jmp costpglp costre1: mov dptr,#colval mov a,patp call fndwrd movx a,@dptr mov b,a inc dptr movx a,@dptr clr cy subb a,dsl mov dsl,a mov a,b subb a,dsh mov dsh,a jnb acc.7,costre3 jmp coool1 costre3: jmp costpglp ; coool1: mov a,dsl call wriram dec dpl mov a,dsh call wriram call costpgup jmp costpglp costpgre: jb right,costpgco ;continue? mov a,redlev jnz costco1 inc patp mov a,patp cjne a,#7,costco2 mov patp,#00 costco2: call costpgup jmp costpglp costco1: mov dptr,#colval mov a,patp call fndwrd movx a,@dptr mov b,a inc dptr movx a,@dptr clr cy addc a,dsl mov dsl,a mov a,b addc a,dsh mov dsh,a jnb acc.7,costco6 jmp coool1 costco6: jmp costpglp costpgco: jnb stop,costpgco2 jmp costpglp costpgco2: call lookupdiff mov hit4,#3 jmp test CostPgUp: mov dptr,#costpg1 call strout mov a,redlev jnz costpgup1 setb curson costpgup1: mov a,patp inc a call dsp2b clr curson ;update retail cost mov dptr,#costpg2 call strout mov dptr,#colval mov a,patp call fndwrd call dsp16besin ;without the negitive sign mov dypos,#8 mov a,redlev jz fuked cjne a,#1,fuk1 ;all this to set cursor position mov dxpos,#84 jmp fuk5 fuk1: cjne a,#2,fuk2 mov dxpos,#90 jmp fuk5 fuk2: cjne a,#3,fuk3 mov dxpos,#96 jmp fuk5 fuk3: cjne a,#4,fuk4 mov dxpos,#108 jmp fuk5 fuk4: cjne a,#5,fuk5 mov dxpos,#114 fuk5: mov chr,#32 setb wover setb curson call chrout clr curson clr wover fuked: clr curson ;update col index mov dptr,#costpg3 call strout mov dptr,#colbal mov a,patp call fndwrd call dsp16billsin ret modet: ;motion detector mov dptr,#modtt call strout jmp updmodo medll1: jb stop,medls3 clr curson jmp test medls3: jb right,medls4 cpl gomodo jmp medllu medls4: jb left,medls5 cpl gomodo medllu: mov dptr,#nvreg1 mov a,nvreg1c call wriram jmp updmodo medls5: updmodo: setb curson ytriw: jb gomodo,medls1 mov dptr,#disabledm jmp medls2 medls1: mov dptr,#enabledm medls2: call strout clr curson mov dlycn2,#04fh call pdelay jmp medll1 gtest2: jmp test paytst: mov dptr,#paypg ;test payouts call strout mov patp,#1 paytl: mov prize,patp ;test loop mov redlev,prize call payout jnb stop,gtest2 jb testk,gtest2 ;be sure switch is on! inc patp mov a,patp cjne a,#10,paytl mov patp,#1 jmp paytl tstaud: mov dptr,#paypg call strout mov a,#TestTone call SetExSptr setb exs ;external sample setb tr1 audtl1: jnb tr1,iiwejh ;after sample stops abort jb stop,audtl1 iiwejh: clr exs clr tr1 jmp test tgamp: db 27,64,27,81,00,27,82,00 db ' What level do you ' db ' wish to play?',0ffh tgpos: db 27,81,24,27,82,66,0ffh tstalev: ;jumps to and plays a level jnb strt,tstalev ;wait for release of start button mov dptr,#tgamp call strout mov prize,#1 mov redlev,#1 jmp tstkup tstgl: jb stop,tstkk1 mov patp,#15 jmp test tstkk1: jb right,tstkk2 inc prize inc redlev mov a,redlev cjne a,#8,tskks1 mov prize,#1 mov redlev,#1 tskks1: jmp tstkup tstkk2: jb left,tstkk3 dec prize dec redlev mov a,redlev jnz tstkup mov prize,#7 mov redlev,#7 jmp tstkup tstkk3: jb strt,tstgl call playgame ;Play a game, it's that easy jmp tstgl ; tstkup: mov dptr,#tgpos call strout mov a,redlev call dsp2b mov mclk,#75 setb clkrun tstkk5: jb clkrun,tstkk5 jmp tstgl clrmem: mov dptr,#rstp1 call strout clrml1: jnb stop,gtest3 jnb right,clrml2 jmp clrml1 gtest3: jmp test clrml2: mov dptr,#rstp2 call strout clrml3: jnb stop,gtest3 jb strt,clrml3 mov credit,#00 jmp membad ;Only interrupt vectors and subroutines lie beyond this point ;beware! spinny: ;spins at location mov a,dxpos push acc push dph push dpl mov dptr,#spinnypat inc miscl mov a,miscl cjne a,#4,spinny1 spinny1: jb cy,spinny2 mov miscl,#0 clr a spinny2: movc a,@a+dptr mov chr,a call chrout pop dpl pop dph pop acc mov dxpos,a ret spinnypat: db 'l','/','-','\' SetEX: ;Sets dptr and exmemp to the first byte of the address of the ;MMObject (Sounds, Frames, Animations, etc...) A=ObjectID push acc mov dptr,#exmemp clr a mov r7,a movx @dptr,a ;First, set External Memory Page to zero pop acc mov b,#3 mul ab ;next multiply acc by 3 mov dpl,a mov a,#080h ;start of MMROM add a,b mov dph,a ;dptr set ret SetExFpos: ;a=MMROM Table # call SetEx ;Find me the first one... movx a,@dptr mov fpose,a inc dptr movx a,@dptr mov fposh,a inc dptr movx a,@dptr mov fposl,a ret SetExFmptr: call SetEx movx a,@dptr mov fmptre,a inc dptr movx a,@dptr mov fmptrh,a inc dptr movx a,@dptr mov fmptrl,a ret SetEXDptr: call SetEx movx a,@dptr push dph push dpl mov dptr,#exmemp mov r7,a movx @dptr,a ;Set External Memory Page pop dpl pop dph inc dptr movx a,@dptr mov b,a inc dptr movx a,@dptr mov dpl,a mov dph,b ;That should do it! ret SetExSptr: call SetEx movx a,@dptr mov sptre,a inc dptr movx a,@dptr mov sptrh,a inc dptr movx a,@dptr mov sptrl,a ret ;serial interrupt sout: mov sercnt,#sertim push acc push dph push dpl push psw mov r1stor,r1 jnb ti,notti clr ti jmp xmitint notti: clr ri mov a,simod jnz simodn0 ;mode 0 - Waiting for ESC mov a,sbuf cjne a,#27,soutrtrrr ;If not 27 on mode 0, abort mov simod,#1 mov somod,#0 soutrtrrr: jmp soutrt ;Move to mode 1 simodn0: cjne a,#1,simodn1 ;are we on 2nd byte? mov a,sbuf mov somod,a ;set serial output mode mov simod,#2 ;move to mode 2 cjne a,#6,simodn01 ;DisplayOperatorPix mov simod,#0 ;done mov somod,#0 ;set output command to 00 or NOP mov fpose,#00 mov fposh,#04 mov fposl,#00 call updispe mov simod,#00 call sendESCEOT jmp soutrt ;return simodn01: cjne a,#7,simodn02 ;07 - PingReturnPong (just send esceot) mov simod,#0 mov somod,#0 call sendESCEOT jmp soutrt simodn02: jmp soutrt simodn1: cjne a,#2,simodn2 ;The following bytes vary depending on command mov a,somod jnz simodn10 ;00 - ReturnExtByte mov sah,sbuf ; jmp simodn1e simodn10: cjne a,#1,simodn11 ;01 - PutExtByte mov sah,sbuf ;this byte an address jmp simodn1e simodn11: cjne a,#2,simodn12 ;02 - ReturnExtString mov ssh,sbuf jmp simodn1e simodn12: cjne a,#3,simodn13 ;03 - PutExtString mov ssh,sbuf jmp simodn1e simodn13: cjne a,#4,simodn14 ;04 - ClearTotals mov a,sbuf jnz simodn130 jmp simodn1e simodn130: mov simod,#00 jmp soutrtr ;abort! simodn14: cjne a,#5,simodn15 ;05 - GetPROM mov sah,sbuf jmp simodn1e simodn15: cjne a,#8,simodn18 ;08 - WriteNVRAM mov sah,sbuf ;this byte an address jmp simodn1e simodn18: cjne a,#9,simodn19 ;09 - ShowImage mov ssl,sbuf ;use ssl for first byte of sequence jmp simodn1e simodn19: cjne a,#0ah,simodn1a ;0a - ReturnIntByte mov r1,sbuf ; mov a,@r1 mov sbuf,a mov simod,#00 call StartESCEOT ;Tell it to next send ESC/EOT sequence jmp soutrtr simodn1a: cjne a,#0bh,simodn1b ;0b - PutIntByte mov sah,sbuf ;this byte an address jmp simodn1e simodn1b: ;unknown command jmp simodn2 simodn1e: ;exit simodn1 inc simod soutrtr: jmp soutrt ;done and exiting interrupt simodn2: ;check for mode 3 cjne a,#3,simodn3 mov a,somod jnz simodn20 ;00 - RetExtByte mov dpl,sbuf ;this byte an address mov dph,sah movx a,@dptr mov sbuf,a ;return byte mov simod,#00 ;reset receive mode call StartESCEOT ;Tell it to next send ESC/EOT sequence jmp soutrtr ;exit safe simodn20: cjne a,#1,simodn21 ;01 - PutExtByte mov sal,sbuf ;this byte an address jmp simodn1e simodn21: cjne a,#2,simodn22 ;02 - ReturnExtString mov ssl,sbuf jmp simodn1e ; simodn22: cjne a,#3,simodn23 ;03 - PutExtString mov ssl,sbuf jmp simodn1e simodn23: cjne a,#4,simodn24 ;04 - Clear Totals mov a,sbuf cjne a,#0ffh,simodn230 call zaptot ;clear totals call SendESCEOT ; simodn230: mov simod,#00 ;abort! jmp soutrtr simodn24: cjne a,#5,simodn25 ;05 - GetPROM mov dpl,sbuf ;this byte an address mov dph,sah clr a movc a,@a+dptr ;getByteFromPROM (64k Program ROM) mov sbuf,a ;return byte mov simod,#00 ;reset receive mode call StartESCEOT ;Tell it to next send ESC/EOT sequence jmp soutrtr ;exit safe simodn25: cjne a,#8,simodn28 ;08 - WriteNVRAM mov sal,sbuf jmp simodn1e simodn28: cjne a,#9,simodn29 ;09 - ShowImage mov sah,sbuf jmp simodn1e simodn29: cjne a,#0bh,simodn2b ;0b - PutIntByte mov a,sbuf mov r1,sah mov @r1,a ;write byte to internal memory mov simod,#00 call SendESCEOT ;Start Sending ESCEOT Sequence jmp soutrtr ;unknown action simodn2b: mov simod,#00 jmp soutrtr ;unknown action simodn3: cjne a,#4,simodn4 mov a,somod cjne a,#1,simodn31 ;01 - PutExtByte mov a,sbuf mov dph,sah mov dpl,sal movx @dptr,a mov simod,#00 call SendESCEOT jmp soutrtr simodn31: cjne a,#2,simodn32 ;02 - ReturnExtString mov sah,sbuf jmp simodn1e simodn32: cjne a,#3,simodn33 ;03 - PutExtString mov sah,sbuf jmp simodn1e simodn33: cjne a,#8,simodn38 ;08 - WriteNVRAM mov a,sbuf mov dph,sah mov dpl,sal call wriram mov simod,#00 ;reset receive mode call SendESCEOT ;StartESCEOT Sequence jmp soutrtr ;exit safe simodn38: cjne a,#9,simodn39 ;ShowImage mov fposl,sbuf mov fposh,sah mov fpose,ssl clr dpage clr opage call updispe ;update from external rom mov simod,#00 call sendesceot jmp soutrtr simodn39: mov simod,#00 jmp soutrtr simodn4: cjne a,#5,simodn5 mov a,somod cjne a,#2,simodn42 ;02 - ReturnExtString mov sal,sbuf mov dph,ssh mov dpl,ssl movx a,@dptr mov sbuf,a ;send 1st byte inc dptr mov ssh,dph mov ssl,dpl mov simod,#00 jmp soutrtr simodn42: cjne a,#3,simodn43 ;03 - PutExternalString mov sal,sbuf jmp simodn1e simodn43: mov simod,#00 jmp soutrtr simodn5: mov a,somod cjne a,#3,simodn6 ;03 PutExternalString mov dph,ssh mov dpl,ssl mov a,sbuf movx @dptr,a mov a,ssl cjne a,sal,simodn5s mov a,ssh cjne a,sah,simodn5s call sendesceot ;Okay Recieved Last Byte DONE! jmp simodn6 ;recieved last byte by here simodn5s: inc dptr mov ssl,dpl mov ssh,dph jmp soutrtr ;dont increment simodn6: mov simod,#00 jmp soutrtr xmitint: ;transmit interrupt mov a,somod cjne a,#2,xmitnon2 ;02 - ReturnExternalString mov dph,ssh mov dpl,ssl movx a,@dptr mov sbuf,a mov a,ssh cjne a,sah,xmit1sk mov a,ssl cjne a,sal,xmit1sk mov simod,#00 call startesceot jmp soutrtr xmit1sk: inc dptr mov ssl,dpl mov ssh,dph jmp soutrt xmitnon2: cjne a,#7,xmitnoton7 mov a,simod jnz xmito7n0 jmp soutrt xmito7n0: cjne a,#1,xmito7n1 mov sah,#0 ;used as counter in next part jmp soutrt xmito7n1: ;if here on string mov dptr,#softid ;send out version string mov a,sah inc sah movc a,@a+dptr ;get next byte of version string cjne a,#0ffh,cms7s1 ; mov simod,#00 jmp xmiterr cms7s1: mov sbuf,a jmp soutrt ;send next byte xmitnoton7: cjne a,#0feh,XmitNotOn0feh mov sbuf,#027 mov somod,#0ffh ;Next time send 04 jmp soutrt XmitNotOn0feh: cjne a,#0ffh,xmiterr mov sbuf,#04 ;send 04 xmiterr: mov somod,#00 soutrt: ;return from sout mov r1,r1stor pop psw pop dpl pop dph pop acc jnb ti,nati jmp sout nati: jnb ri,nari jmp sout nari: ;if not another ti,or ri then exit reti StartESCEOT: ;For when a byte in allready being xmited! mov somod,#0feh ret SendESCEOT: ;End of command send ESC/EOT sequence mov somod,#0ffh mov sbuf,#27 ret BonusGameNotify: ;Display Bonus Game Information on Display mov redlev,bonuscol call setprizelamps clr opage clr dpage call clrdisp mov dxpos,#34 mov dypos,#12 mov dptr,#BonusPlay call strout call SirenInvert cpl opage call clrdisp mov dptr,#BGNText call strout mov a,bonusCol call dsp1b cpl dpage mov patp,#12 ;give em 6 seconds to read it all BGNl0: mov mclk,#150 setb clkrun call invertdisplay BGNL1: jb clkrun,BGNL1 djnz patp,BGNL0 ret BGNtext: db 27,81,00,27,82,00 db ' Match 2 squares in ' db ' any winning pattern ' db ' and win a FREE game ' db ' in COLUMN - ',0ffh BonusPlay: db 'BONUS PLAY',0ffh PlayGame: ;Routine that plays a game ;Sets winner bit to 1 if game wins, gottwo to 1 if she got 2 clr expired ;This Game Has Not Timed out mov lastsq,#00 mov dptr,#tcolp ;increment total col plays call inccntr clr GotTwo setb gameg ;a game is running! stop flashing bill clr ctlmp clr rdlmp mov tries,#5 ;set up # of tries mov row1,#0dfh mov row2,#0dfh mov row3,#0dbh ;set free space lamp on! mov row4,#0dfh mov row5,#0dfh ;set up bingo lamps for a real game! call SetChasers mov hit1,#0 mov hit2,#0 mov hit3,#0 mov hit4,#0 mov hit5,#0 ;reset hits stn3: jb tr1,stn3 ;wait untill "cum-on bingo has stoped" ;start game rolling, jumps here after each stop stgam: mov lastsq,#00 jnb stop,stgam mov nptr,#1 setb dpage ;flip display page clr opage mov dptr,#nvsts movx a,@dptr clr dpage call selectspeed call SelectPattern ;find an suitable pattern ;put random offset on patp call randomizelrnd mov patp,a anl patp,#00fh ;prepare to show pattern ;remember---- Tl0 no longer random now...... use lrnd (from another event) mov reps,#0 ;reset number of pattern repeats mov dptr,#nvsts movx a,@dptr rl a ;mul by 2 mov dlycn2,a ;counts off half seconds mov mclk,#150 ;a half second setb clkrun ;start clock running mov a,tries cjne a,#1,trn1 orl row2,#020h jmp stlp3 trn1: cjne a,#2,trn2 orl row3,#020h jmp stlp3 trn2: cjne a,#3,trn3 orl row4,#020h jmp stlp3 trn3: cjne a,#4,stlp3 orl row5,#020h stlp3: jnb strt,stlp5 ;check for keypress mov a,dlycn2 jz stlp5 mov a,tries cjne a,#5,notoft ;is it on the first try?? notoft: mov c,fbit mov stlmp,c inc lrnd jb clkrun,stlp3 ;has the clock timed out? mov mclk,#150 ;if so reset to half second setb clkrun ;start clock running djnz dlycn2,stlp3 ;has player stayed in standby too long? stlp5: setb strt ;start the round going setb stop ;clear any previous keyhits mov coct,#120 ;120 half seconds untill timeout = 60 seconds clr stlmp Call SetPlayScreen stlp6: call GameMove ;move to next Square in pattern mov a,coct ;if in last 10 seconds dont flip pix cjne a,#33,stlsk10 stlsk10: jb cy,stlsk11 jnb sppix,njkld mov a,patp anl a,#6 cjne a,#6,onp1ui ;For 'blinking' pictures setb dpage jmp stlp7 onp1ui: clr dpage jmp stlp7 njkld: cpl dpage ;flip to next picture stlsk11: stlp7: mov a,reps jz stlp71 ;if first time around, do nothing cjne a,#1,modspd ;if not second time around, inc speed jmp stlp71 ;else skip this stuff modspd: mov a,speed mov b,#16 div ab ;speed/16 mov b,reps mul ab ;(speed/16)*reps mov dlycnt,a mov a,speed subb a,dlycnt ;speed-((speed/16)*reps) mov mclk,a ;set up increased speed setb clkrun jmp stlpp7 ;should speed up after each rep by 1/16 stlp71: mov mclk,speed setb clkrun stlpp7: ;Main Game Idle Loop mov c,fbit mov splmp,c fd4: jb stop,gmstpsk ;time to stop? jmp gmstp ;too far to jump gmstpsk: jb clkrun2,ihasnto mov mclk2,#150 setb clkrun2 mov a,coct cjne a,#20,NotAt10 ;10 seconds left? Less then 20 =1 NotAt10: jnb cy,NotLessThan10 ; call invertdisplay call showtimer jmp notlt33 NotLessThan10: cjne a,#33,notask1 ;if a<34 then c=1 clr opage clr dpage call clrdisp mov dxpos,#25 mov dypos,#12 jmp notlt33 notask1: jnb cy,notlt33 mov a,coct push acc mov dptr,#timeexpiring clr c mov b,#32 xch a,b subb a,b movc a,@a+dptr mov chr,a call chrout pop acc mov coct,a notlt33: djnz coct,ihasnto ;has player waited too long to press stop? mov dxpos,#22 mov dypos,#12 mov dptr,#TimeExpired call strout setb expired mov dlycn2,#200 call pdelay jmp victory ;if so stop game and return a loser!!! ihasnto: inc lrnd jb clkrun,stlpp7 ;wait here for a bit call GoBuampBuamp ;Make Game move sound jmp stlp6 gmstp: setb stop ;stop was pressed!!!! call randomizelrnd ;Puts random number for start of pattern clr opage clr dpage clr clkrun ;for randomizing animations clr splmp mov sptrh,#keys/256 mov sptrl,#keys clr exs setb tr1 ;Play Keyspress Sound orl row3,#080h call StoreHit clr GotTwo ;Clear GotTwo call check4win jb winner,Victory djnz tries,rsrt2 ;if more tries left,restart pattern ;if it gets to here u used up all your tries and u didnt win, hahahaha, loser! Victory: clr gameg ret rsrt2: jmp stgam ;too far to jump! SetPlayScreen: mov a,#PlaySe ;Show PlayScreens call SetExDptr mov a,tl0 anl a,#07h push acc inc a clr sppix jb acc.2,sppixs setb sppix sppixs: pop acc mov b,#6 mul ab addc a,dpl mov dpl,a mov a,dph addc a,#00 ;find start address mov dph,a movx a,@dptr mov fpose,a inc dptr movx a,@dptr mov fposh,a inc dptr movx a,@dptr mov fposl,a inc dptr clr dpage clr opage push dph push dpl call updispe setb opage mov dptr,#exmemp mov a,#00 mov r7,a movx @dptr,a pop dpl pop dph movx a,@dptr mov fpose,a inc dptr movx a,@dptr mov fposh,a inc dptr movx a,@dptr mov fposl,a call updispe ret GoBuampBuamp: ;Make buamp-buamp sound mov a,nptr inc a cjne a,#5,nptrn5 mov a,#1 nptrn5: mov nptr,a cjne a,#1,nptrn1 mov sptrh,#note1/256 mov sptrl,#note1 jmp nptrdn nptrn1: cjne a,#2,nptrn2 mov sptrh,#note2/256 mov sptrl,#note2 jmp nptrdn nptrn2: cjne a,#3,nptrn3 mov sptrh,#note3/256 mov sptrl,#note3 jmp nptrdn nptrn3: cjne a,#4,nptrn4 mov sptrh,#note2/256 mov sptrl,#note2 nptrdn: clr exs setb tr1 nptrn4: ret uwin2: jmp uwin ;target exceedes relitive range! Check4Win: mov dptr,#bigsq ;check for winner call chkpat jb winner,uwin2 mov dptr,#litsq call chkpat jb winner,uwin2 mov dptr,#bigd call chkpat jb winner,uwin2 mov dptr,#litd call chkpat jb winner,uwin2 mov dptr,#diag1 call chkpat jb winner,uwin2 mov dptr,#diag2 call chkpat jb winner,uwin2 mov dptr,#stmp1 call chkpat jb winner,uwin2 mov dptr,#stmp2 call chkpat jb winner,uwin2 mov dptr,#stmp3 call chkpat jb winner,uwin3 mov dptr,#stmp4 call chkpat jb winner,uwin3 mov dptr,#hor1 call chkpat jmp uwinbp uwin3: jmp uwin ;damn 256 byte jump range!!! uwinbp: jb winner,uwin3 mov dptr,#hor2 call chkpat jb winner,uwin3 mov dptr,#hor3 call chkpat jb winner,uwin3 mov dptr,#hor4 call chkpat jb winner,uwin3 mov dptr,#hor5 call chkpat jb winner,uwin3 mov dptr,#vert1 call chkpat jb winner,uwin3 mov dptr,#vert2 call chkpat jb winner,uwin3 mov dptr,#vert3 call chkpat jb winner,uwin3 mov dptr,#vert4 call chkpat jb winner,uwin3 mov dptr,#vert5 call chkpat jb winner,uwin3 clr winner ret uwin: ;Jumps here if pattern matches up setb winner ret ShowTimer: ;Display Time out Counter on bottom of screen mov a,coct push acc clr c rrc a mov dypos,#24 mov dxpos,#61 call dsp1b pop acc mov coct,a ret TimeExpiring: db 'Time Expiring',0ffh TimeExpired: db ' Time Expired ',0ffh SirenInvert: ;plays siren and inverts screen for 2 seconds setb exs ;external sample mov a,#testtone call SetExSptr jnb atmode,SiInvNatmode ;if in attract mode jnb gomodo,SiInvNoSound ;and attract sounds are disabled no sound! SiInvNatmode: setb tr1 SiInvNoSound: mov patp,#8 eogl0: mov mclk,#75 setb clkrun eogl1: jb clkrun,eogl1 ;wait a bit for sample to play call Invertdisplay ;This should be interesting! djnz patp,eogl0 clr tr1 ;stop siren ret EndOfGame: ;Do these things after each game regardless of outcome mov a,BonusCol ;is there a bonus column avalible? jz EndGame2 ; ; jnb GotTwo,EndGame2 ;Got a Bonus, how about at least 2 squares? clr calcdone ;play siren and write #Free Game on screen clr opage clr dpage call clrdisp mov dxpos,#28 mov dypos,#12 mov dptr,#FreeGam call strout call SirenInvert ;Plays siren sound and inverts screen mov a,redlev mov redlev,BonusCol ; mov prize,BonusCol ;Need to kill one or the other damit! mov BonusCol,#00 ;reset it push acc setb BonusG setb calcdone call PlayGame ;Play a game in the Bonus Column clr BonusG pop acc jnb winner,eogs1 ;here if the won bonus round mov dptr,#tcolw call inccntr ;Increment Total Column Wins call gredeem ;pay out the prize then clr calcdone ret eogs1: ;Here if Bonus game a bust push acc call CheckColValu ;c=1 if Colbal less than 4 times ColVal pop acc jnb cy,eogs2 mov redlev,a call addvalu ;Add Credit value to col player selected, not bonus column clr calcdone ret ;ColValNotLessThan4timesColValWereDone! eogs2: call FindLowestIndex ;Get col with lowest index call AddValu ;Add Credit Value to Column clr calcdone ret ; EndGame2: mov BonusCol,#00 ;reset it call CheckColValu jnb cy,eog2s1 call addvalu ;add credit value to col player selected clr calcdone ret ;and exit eog2s1: mov dptr,#ColCntr call get8addr ;find column counter movx a,@dptr djnz acc,eog2s2 mov a,#3 ;1 out of three times!!!! call wriram ;store new column count call FindLowestPlays ;Find Lowest Column Plays (1-5!) call addvalu mov BonusCol,redlev ;set BonusCol call BonusGameNotify ;Inform Customer that a Bonus Game is ready clr calcdone ret eog2s2: ;Those other 2 times out of three call wriram ;Store new Column Count call FindLowestIndex call addvalu clr calcdone ret CheckColValu: ;c=1 if Colbal less than 2 times ColVal or colbal is neg ;Important to note that because it multiplies the colval by 4 and there ;is no overflow protection and the max comparable range is 32768 we can ;only have a maximum column value of $163.84!!!!!!! Remember, mov dptr,#colbal call get16addr ;find colbal address movx a,@dptr jnb acc.7,ccvs1 setb c ret ;if the colbal is neg then c=1 and return ccvs1: mov dsh,a inc dptr movx a,@dptr mov dsl,a ;put colbal into dsh,dsl mov dptr,#colval ;get colval call get16addr movx a,@dptr mov b,a inc dptr movx a,@dptr ;now b and a contain the colval clr c rlc a push acc mov a,b ;b=high byte rlc a ;Multiply by 2 mov b,a ;move a back into b bitch pop acc xch a,b ;a=high byte,b=low byte cjne a,dsh,ccvs2 ;(colval*4)colbal c=1 ret FindLowestPlays: ;Find Col with Lowest Plays ,return to redlev mov patp,#03 mov redlev,#05 mov dsh,#0ffh mov dsl,#0ffh ;The highest ! flps1: ;check each column mov dptr,#tcolp call get16addr ;find address movx a,@dptr ;get high byte mov b,a ;store this in case it's needed cjne a,dsh,flps2 ;newDefaultSpd then Decrease speed ONLExit: ret CountColIndex: ;Counts # of Bits used by colindex mov dptr,#colbal call get16addr movx a,@dptr clr acc.7 ;set sign bit to nothing mov b,a inc dptr movx a,@dptr ;get Old ColBal b=hi,a=lo mov patp,#11 CountCl1: clr c rlc a push acc ;do high byte second mov a,b rlc a mov b,a pop acc jb cy,countcs1 ;what we got here? djnz patp,CountCl1 CountCS1: ret Debug1: ;Show contense of Acc and wait for strt to be pressed call dsp2b debugl1: jb strt,debugl1 ret IncreaseSpeed: ;Increase speed according to table call countcolindex ;find out how many bits we are off by mov dptr,#mspeeds call get8addr movx a,@dptr clr c subb a,patp ;add count to speed to speed it up mov dptr,#speeds call get8addr call wriram ;write speed back to ram for next game ret DecreaseSpeed: ;Decrease Speed According to table call countcolindex ;find out how many bits we are off by mov dptr,#mspeeds call get8addr movx a,@dptr add a,patp mov dptr,#speeds call get8addr call wriram ;write speed back to ram for next game ret IncreasePattern: ;Increase Pattern According to table call countcolindex mov a,patp cjne a,#8,incps1 ;if a<8 then c=1 incps1: jb cy,incps2 mov patp,#7 ;if >7 then patp=7 incps2: mov dptr,#rmintab ;get center pattern address call get8addr ;offset to current col. movx a,@dptr ;get center pattern value add a,patp cjne a,#8,incps3 ;if a<8 then c=1 (check for overflow) incps3: jb cy,incps4 mov a,#7 ;if =>8 then =7 incps4: mov dptr,#rlevtab call get8addr call wriram ;write new pattern ret DecreasePattern: ;Decrease Pattern According to table call countcolindex mov a,patp cjne a,#8,decps1 ;if a<8 then c=1 decps1: jb cy,decps2 ;if a=>8 then decps2 mov patp,#7 ;if >7 then patp=7 decps2: mov dptr,#rmintab ;get center pattern address call get8addr ;offset to current col. movx a,@dptr ;get center pattern value clr c subb a,patp ;a-patp jnb cy,decps4 ;if less than zero then needs to be 0 decps3: mov a,#0 ;set to 0 decps4: mov dptr,#rlevtab call get8addr call wriram ;write new pattern value ret MarkColEmpty: ;Marks column specified by redlev as empty mov a,#080h mov patp,redlev MCEL1: rl a djnz patp,MCEL1 orl a,ColEMkr ; mov ColEMkr,a ;Mark column as empty ret CheckColEmpty: ;Checks to see if a column has been marked empty c=1 if empty mov a,ColEMkr mov patp,redlev rl a CCEL1: rr a djnz patp,CCEL1 mov c,acc.0 ; ret afreecd: ;All this for a free credit mov mclk,#12 setb clkrun afreecdl1: jb fcrdsw,XFreeCD ;if switch hasnt been down for a while abort jb clkrun,afreecdl1 ; Give it a second clr tr1 ;stop any playing sample mov sptrh,#billin/256 ;play something for credit mov sptrl,#billin clr exs setb tr1 ;start sample for test setb newbil ;more credits mov dptr,#tfcred mov redlev,#01 call inccntr mov dptr,#tcredh ;update total credits mov redlev,#1 call inccntr inc credit ;Increment credits mov a,credit cjne a,#100,cnet100 mov credit,#99 cnet100: jnb fcrdsw,cnet100 mov dptr,#nvcred mov a,credit call wriram XFreeCD: ret DemoGameText: db 'Column - ',0ffh DemoGame: ;This loop will allow the player to preview any level by ;using the left/right buttons to select a level. ;The Start button will exit loop, other wise will exit after ;No Activity for 20 seconds if not in game play mode mov bitpl,#40 ;20Seconds*2 clr stlmp clr rdlmp clr ctlmp clr splmp clr dpage clr opage call clrdisp clr nomorev mov redlev,#1 mov tries,#5 LevelChange: ;After level is changed go here mov mclk2,#150 setb clkrun2 setb nomorev call CheckColEmpty jnb cy,levchok ;Check if column has been flagged as empty inc redlev mov a,redlev cjne a,#8,levelChange mov redlev,#01 ;if out of levels then roll around jmp levelchange levchok: mov dxpos,#031 mov dypos,#012 mov dptr,#DemoGameText call strout mov a,redlev call dsp1b Call SetChasers call selectspeed ;Get us a speed call selectpattern ;get us a pattern mov lastsq,#0 call randomizelrnd ;now randomize pattern pointer a bit mov a,lrnd anl a,#0fh mov patp,a mov row1,#0ffh mov row2,#0ffh mov row3,#0fbh mov row4,#0ffh mov row5,#0ffh call GameMove ;Update Playfield that first time mov mclk,speed setb clkrun DemoGmLp1: ;Watch for keypresses while looping jb clkrun2,DGS0 ;1/2 second counter mov mclk2,#150 setb clkrun2 clr nomorev ;key holdoff jnb atmode,DGS0 ;if routine is started for a game then skip djnz bitpl,DGS0 ;Has it stayed in routine for 20 seconds? ret DGS0: mov c,fbit mov rdlmp,c ;Flash Redeem and Continue lamps mov ctlmp,c mov a,credit jz DGS01 mov stlmp,c ;if there are credits flash start lamp DGS01: jb nomorev,DGS3 jb right,DGS1 ;Left, or increment level inc redlev mov a,redlev cjne a,#8,LevelChange mov redlev,#1 jmp LevelChange DGS1: jb left,DGS2 ;Right, or decrement level dec redlev mov a,redlev jnz DGS15 mov redlev,#7 DGS15: jmp LevelChange DGS2: jb strt,DGS21 ;start exits, caller should check 4 start!! ret ;Start Exits DGS21: jb stop,DGS3 ret ;Stop Exits DGS3: jb clkrun,DemoGmLp1 mov mclk,speed setb clkrun call GameMove ;Update Playfield jmp DemoGmLp1 ;Reset Clock and Reloop SetChasers: ;Set up chaser lights for column specified in redlev mov row6,#0ffh mov row7,#0ffh mov a,#03fh ;show prize lamps mov r1,redlev rl a levlop: rr a djnz r1,levlop ;set up prize lamp mov row8,a setb fpriz ;fprize starts chaser sequence ret StoreHit: ;Stores Current pattern position into Hit(1-5) mov dpl,PatDPL mov dph,PatDPH mov r1,#hit1 ;find start of hit register mov a,tries add a,r1 dec a mov r1,a mov a,patp movc a,@a+dptr mov @r1,a ;store current hit into buffer ret GameMove: ;Moves to the next square of the pattern, if @ end of pattern ;will select a new pattern of the same set randomly ;will not move to a square allready occupied by #hit1 ;First reset Last Square and Move pointer to next one call clrpos inc patp ;Now get Pattern (selectpattern should be called first) MoveL1: mov dpl,PatDPL mov dph,PatDPH jmhere: ;retry new square mov a,patp ; movc a,@a+dptr ;get next pattern position jnz stlp61 ;Check for end of pattern call selectpattern mov patp,#00 mov a,reps cjne a,#7,inreps ;maximum # of increases in speed -1 jmp MoveL1 inreps: inc reps ;increase number of reps jmp MoveL1 stlp61: mov dlycn2,a cjne a,lastsq,notlastsq notlastsq: call chkpos ;check to see if square is occupied jnb bitusd,notusedok rethi: inc patp mov a,patp jmp jmhere notusedok: mov a,dlycn2 ;return it unharmed mov lastsq,a call setpos ;light square ret winanim: rndw2: call randomizelrnd anl a,#03h cjne a,#03,rnds1 jmp rndw2 ;a should only = 0,1,2 not 3! rnds1: add a,#win1 call SetExFmptr ;Should be set! rnds5: mov mclk,#22 clr endofs setb clkrun jmp winloseloop loseranim: ;shows loser animation clr endofs rndl2: call randomizelrnd anl a,#03h cjne a,#3,rndw1 jmp rndl2 rndw1: add a,#lose1 call SetExFmptr ;Should be set! rndw5: mov mclk,#22 setb clkrun clr endofs winloseloop: mov patp,#14 clr rdlmp clr ctlmp losal: ;loose animation loop mov a,patp jnz alamo2 ;skip this jnb strt,losad ;if start jnb stop,losad ;or stop is pressed alamo2: jb clkrun,losal mov mclk,#22 setb clkrun mov a,patp jz alamo dec patp alamo: call updani jb endofs,losad ;end of animation sequence? jmp losal losad: clr tr1 ;stop sounds from playing ret lookupdiff: ;look up pattern difficulty and speed for all columns ;based on prizeval mov prize,#7 lookupdiffnext: mov dptr,#colval ; mov a,prize dec a call fndwrd movx a,@dptr anl a,#07fh mov dsh,a inc dptr movx a,@dptr mov dsl,a ;dsh,dsl=colval mov patp,#025 ;first speed mov dptr,#setuptab ;setuptab= [mlev1,mlev2,pattern] findnext: clr a movc a,@a+dptr xch a,b inc dptr clr a movc a,@a+dptr ;a=low b=high table xch a,b inc dptr cjne a,dsh,plus1 ;check high byte xch a,b cjne a,dsl,plus1 ;check low byte clr c ;if table(=max)y so it's x-y outcome neg call xminusy jb acc.7,xgtyns setb acc.7 call wriram ret xgtyns: mov a,#0ffh call wrionly inc dptr mov a,#0ffh call wriram ret ;y>x so it's y-x outcome positive a16flst: call yminusx jb acc.7,xyonof2 call wrionly ;write high byte inc dptr mov a,r1 call wriram ;write low byte ret xyonof2: ;oflow mov a,#07fh call wrionly dec dpl mov a,#0ffh call wriram ret ;x>y so it's x-y outcome negitive call xminusy jmp finaneg A16FSnn: ;Both #'s negitive push dph push dpl mov dph,dsh mov dpl,dsl movx a,@dptr anl a,#07fh ;mask off sign mov b,a inc dptr movx a,@dptr mov r1,a ;r1=low,b=high pop dpl pop dph inc dptr movx a,@dptr clr cy addc a,r1 call wrionly ;write low byte dec dpl movx a,@dptr anl a,#07fh ;mask off sign addc a,b finaneg: jb acc.7,ad16fsnov setb acc.7 call wriram ;write high byte ret ;bytes added correctly ad16fsnov: mov a,#0ffh call wrionly inc dptr mov a,#0ffh call wriram ;negoflow ret a16bht: db '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' DSP16BHEX: ;Displays a 16bit # in HEX as XXXX contained in dptr mov a,dph swap a anl a,#0fh push dph push dpl mov dptr,#a16bht movc a,@a+dptr mov chr,a call chrout pop dpl pop dph mov a,dph anl a,#0fh push dpl mov dptr,#a16bht movc a,@a+dptr mov chr,a call chrout pop dpl mov a,dpl swap a anl a,#0fh push dpl mov dptr,#a16bht movc a,@a+dptr mov chr,a call chrout pop dpl mov a,dpl anl a,#0fh mov dptr,#a16bht movc a,@a+dptr mov chr,a call chrout ret dsp2bill: ;displays a dollar figure $x.xx push acc mov chr,#'$' ;First Write $ call chrout pop acc push b push acc mov b,#100 clr cy div ab add a,#'0' mov chr,a call chrout ;write dollars place mov chr,#'.' call chrout ;write decimal point pop acc push acc mov b,#100 clr cy div ab clr cy mov b,#100 mul ab mov b,a pop acc clr cy subb a,b ;subtract 100's place away and do 10's and 1's pop b dsp2b: ;Output 2 digits 00-99 mov b,#10 div ab push b add a,#'0' ;add ascii for 0 to number mov chr,a call chrout ;Output chr pop b mov a,b dsp1b: ;Output 1 digit 0-9 add a,#'0' ;add ascii for 0 to number mov chr,a ;mov it chr call chrout ;output chr ret pyconv: mov dptr,#solat1 mov a,#00 movx @dptr,a clr solgo mov mclk,#160 setb clkrun py1: jb clkrun,py1 movx @dptr,a mov mclk,#100 setb clkrun py2: jb clkrun,py2 mov mclk,#255 setb clkrun py3: jb clkrun,py3 setb solgo ret chkpat: ;See if they match winning combination @ dptr (up to 5 squares) mov patp,#00 ;set pattern pointer mov dsl,#00 setb winner ;winner untill proven false clr a chplp1: movc a,@a+dptr ;get byte of pattern jz chdc ;dont check if 0 mov dlycn2,a ;get ready to check it call chkpos jb bitusd,chdc ;Check to see if they got this square clr winner ;Well, they did not get this one so sorry :( inc dsl chdc: inc patp mov a,patp cjne a,#5,chplp1 mov a,dsl cjne a,#2,chdc3 ;if a<2 then c=1 and u didnt even get 2 of em! chdc3: cpl c ;invert c so when u get >1 GotTwo = 1 mov GotTwo,c ret chkpos: mov dlycnt,#05 ;dlycn2=suspect chkpol: mov r1,#hit1 mov a,dlycnt add a,r1 ;find offset clr c subb a,#1 ;subtract1 to get offset mov r1,a mov a,@r1 ;find hit cjne a,dlycn2,dajne setb bitusd ; ret ;found a match! dajne: djnz dlycnt,chkpol clr bitusd ;no match found ret clrpos: mov a,lastsq jz clrposabort cjne a,#026,clrposok ;if a<26 then it's a valid square ret clrposok: push acc dec a ;subtract 1 from a mov b,#5 div ab ;find row in a mov row,a ;store it mov b,#5 ;reset it! mov a,row mul ab ;0 mov r1,a pop acc ;change all this to: clr c ; mov a,#07fh subb a,r1 ;not0: rr a cjne a,#01,nt0 ; djnz r3,not0: ;start here!!! mov a,#1 ; jmp nt4 nt0: cjne a,#02,nt1 ; mov a,#2 jmp nt4 nt1: cjne a,#03,nt2 mov a,#4 jmp nt4 nt2: cjne a,#04,nt3 mov a,#8 jmp nt4 nt3: cjne a,#05,nt4 mov a,#16 jmp nt4 nt4: push acc mov a,#row1 ;find first byte add a,row ;find right spot mov r1,a pop acc orl a,@r1 ;mask a with whats there now mov @r1,a ;done!!! clrposabort: ret setpos: mov r4,a dec a ;subtract 1 from a mov b,#5 div ab ;find row in a mov row,a ;store it mov b,#5 ;reset it! mov a,row mul ab ;0 mov r1,a mov a,r4 clr c subb a,r1 ;find spot cjne a,#01,no0 ;is a 0? mov a,#0feh ;use a case like statement for speed jmp no4 no0: cjne a,#02,no1 mov a,#0fdh jmp no4 no1: cjne a,#03,no2 mov a,#0fbh jmp no4 no2: cjne a,#04,no3 mov a,#0f7h jmp no4 no3: cjne a,#05,no4 mov a,#0efh jmp no4 no4: mov r4,a ;r4 = byte mask mov a,#row1 ;find first byte add a,row ;find right spot mov r1,a mov a,r4 ;put byte mask into a anl a,@r1 ;mask a with whats there now mov @r1,a ;done!!! ret ;timer interrupt handler jumps here every @ 300hz timer: push psw push acc push dph push dpl mov tl0,#t0rldl mov th0,#t0rldh ;reset timer inc lrnd mov dptr,#matneg clr a movx @dptr,a ;turn off all lamps inc rowcnt mov a,rowcnt cjne a,#08,ntover ;are you beyond the last row mov rowcnt,#00 ;reset clr a ntover: anl p1,#0f8h ;and p3 to xxxxx000 orl p1,a ; mov a,#row1 ;get start location of rows add a,rowcnt ;add offset mov r0,a mov a,@r0 ;get data at location a cpl a movx @dptr,a ;put data on screen ;lamps set at this point! djnz clkdiv,extim ;divide clock by clkrat mov clkdiv,#clkrat mov dptr,#keylat movx a,@dptr ;key input from key latch mov keyreg,a ;you should and this data with new djnz fdiv,nfsh mov fdiv,#075 ;set flash rate to 4hz cpl fbit ;Counter Counting Done Here mov a,cnt1 jz nocnt1 cpl cntbit1 jb cntbit1,nocnt1 dec cnt1 nocnt1: jnb fpriz,nofpl ;if not flashing prize lamps, skip this crap mov a,row8 mov row8,row7 mov row7,row6 mov row6,a ;chase lites if prize is on nofpl: mov dptr,#port4a mov a,port4out movx @dptr,a ;write to counters nfsh: jnb clkrun,nck1 ;is the clock running? djnz mclk,nck1 ;if so, delay to value in mclk, then clr clr clkrun ;remember jumps here at 300 hz! nck1: jnb clkrun2,nck2 ;is the secondary clock running? djnz mclk2,nck2 clr clkrun2 nck2: jnb billhld,nbh ;timer to hold off bill interrupt djnz bilcnt,nbh clr billhld nbh: jnb coinhld,nch ;timer to hold off coin interrupt djnz coicnt,nch clr coinhld nch: mov dptr,#solat2 ;send out to second output latch mov a,mislat movx @dptr,a ;output mislat to second latch djnz sercnt,nscnt ;check to see if the serial timer has expired mov somod,#00 mov simod,#00 ;if it hits zero then the serial command is ;taking too much time to execute nscnt: extim: pop dpl ;jump here if no sample is playing pop dph pop acc pop psw reti ;done! psmpl: ;plays back a sample @ 9600hz ;if exs=1 then playes sample from external memory mov th1,#sclkh mov tl1,#sclkl ;reload sample counter push acc push dph push dpl push psw ;if things fuck up put thee back in inc lrnd jb exs,stupid2 jmp psmpl1 sdone2: clr tr1 ;stop sample clock clr exs mov dptr,#daclat mov a,#128 movx @dptr,a ;reset to 0v mov dptr,#exmemp mov a,r7 movx @dptr,a jmp nopb stupid2: mov dptr,#exmemp mov a,sptre movx @dptr,a ;point to right page mov dpl,sptrl mov dph,sptrh movx a,@dptr ;read sample byte inc dptr mov sptrh,dph mov sptrl,dpl ;save new value push acc mov a,dph jnz jj004 ;if dptr not rolled over goto jj004 inc sptre mov sptrh,#080h ;reset pointer for next interrupt jj004: pop acc jz sdone2 cjne a,#0ffh,psmpl2 ;is it a loop? mov a,dph movx a,@dptr ;get extended address mov sptre,a inc dptr mov a,dph movx a,@dptr ;get extended address mov sptrh,a inc dptr mov a,dph movx a,@dptr ;get extended address mov sptrl,a ;new sample address has been set jmp stupid2 psmpl2: mov dptr,#daclat movx @dptr,a ;send it out to spkr mov dptr,#exmemp mov a,r7 movx @dptr,a pop psw pop dpl pop dph pop acc reti psmpl1: mov dpl,sptrl ;sptrl=sample pointer l mov dph,sptrh ;sptrh=sample pointer h clr a movc a,@a+dptr jz sdone inc dptr mov sptrl,dpl mov sptrh,dph mov dptr,#daclat movx @dptr,a nopb: pop psw pop dpl pop dph pop acc reti sdone: clr tr1 ;stop sample clock mov dptr,#daclat mov a,#128 movx @dptr,a ;reset to 0v jmp nopb skipbil2: jmp skpbill ; Bill interrupt billint: jb billhld,skipbil2 setb pt0 ;Give display higher priority over bill setb newbil ;tell us to show a bill has been recieved push psw push acc push dph push dpl push b mov bilcnt,#biltim setb billhld mov sptrh,#billin/256 ;play something for bill! mov sptrl,#billin clr exs setb tr1 ;start sample for test mov dptr,#tbillh movx a,@dptr mov b,a inc dptr movx a,@dptr mov dpl,a mov dph,b inc dptr mov a,dph mov b,dpl mov dptr,#tbillh ; call wrionly ; inc dptr mov a,b call wrionly ;increment total # of bills inserted mov dptr,#billval ;what dollar value does a bill have? billcoinend: movx a,@dptr ; mov bcstr,a add a,hcreds ;add bill value to temporary holder mov hcreds,a ;store new value mov dptr,#TCash movx a,@dptr mov b,a inc dptr movx a,@dptr ;b=h,a=l clr cy addc a,bcstr push acc mov a,b addc a,#0 mov dptr,#TCash call wrionly pop acc ;add hcred value to tcash inc dptr call wriram checkforcr: ;jumps here after subtracting a credit in case there are more mov dptr,#crdvalu movx a,@dptr ;acc=How much a credit costs dec a ;subtract 1 mov b,a mov a,hcreds clr cy subb a,b ; jb cy,notenough ;if no carry not enough for a full credit clr cy movx a,@dptr ;acc=How much a credit costs mov b,a mov a,hcreds subb a,b ;subtract a credits worth mov hcreds,a mov dptr,#nvcred ;go ahead a set dptr inc cnt1 ;count credits inc credit ;to see what happens.... mov a,#156 addc a,credit ;overflow protection jnb cy,bili2 mov credit,#99 bili2: mov a,credit call wriram ;store new credits value mov dptr,#tcredh movx a,@dptr mov b,a inc dptr movx a,@dptr mov dpl,a mov dph,b inc dptr mov a,dph mov b,dpl mov dptr,#tcredh call wrionly inc dptr mov a,b call wriram ;increment total credits jmp checkforcr notenough: pop b pop dpl pop dph pop acc pop psw skpbill: clr pt0 reti ; Coin interrupt coinint: jb coinhld,skpbill setb newbil ;tell us to show credits on screen push psw push acc push dph push dpl push b mov dptr,#keylat movx a,@dptr ;Read Key Latch mov keyreg,a ;to determine what coin slot was used setb pt0 ;Give display higher priority over coin mov coicnt,#cointim setb coinhld mov sptrh,#billin/256 ;play something for coin! mov sptrl,#billin clr exs setb tr1 ;start sample for test jnb slot2,GoSlot2 ;is it in slot 2? mov dptr,#tcoins1 movx a,@dptr mov b,a inc dptr movx a,@dptr mov dpl,a mov dph,b inc dptr mov a,dph mov b,dpl mov dptr,#tcoins1 call wrionly inc dptr mov a,b call wriram ;Increment total # of coins inserted mov dptr,#coinval1 ;what value does a coin have? jmp billcoinend ;From here out it is the same GoSlot2: mov dptr,#tcoins2 movx a,@dptr mov b,a inc dptr movx a,@dptr mov dpl,a mov dph,b inc dptr mov a,dph mov b,dpl mov dptr,#tcoins2 call wrionly inc dptr mov a,b call wriram ;Increment total # of coins inserted mov dptr,#coinval2 ;what value does a coin have? jmp billcoinend ;From here out it is the same ; routines pdelay: mov dlycnt,#0ffh ;programed delay dlycn2=delay time pdely2: nop nop nop nop nop nop nop nop djnz dlycnt,pdely2 djnz dlycn2,pdelay ret mess1: db 27,64,27,81,00,27,82,00 db ' Bingo Vault Ver 1.0' db ' (c) 1998,1999,2000 ' db ' FunTronics',0ffh tststm: db 27,64,27,81,00,27,82,00,'Starting System Tests ',0ffh mfail: db 27,64,27,81,00,27,82,00 db ' Memory Check failure' db ' Press test switch ' db ' to restore factory ' db ' default settings',0ffh payouterr: db 27,64,27,81,00,27,82,00 db ' PAYOUT DETECTION ' DB ' ERROR ' db ' ' db ' PLEASE SEE ATTENDANT',0ffh imstuk: db 27,64,27,81,00,27,82,00 db 'Stuck switch ' db 'column - ',0ffh stopstuck: db 27,64,27,81,00,27,82,00 db ' Please release ' db ' Stop Button',10,13,0ffh strtstuck: db 27,64,27,81,00,27,82,00 db ' Please release ' db ' start button ',10,13,0ffh contstuck: db 27,64,27,81,00,27,82,00 db ' Please release ' db ' continue button',10,13,0ffh redeemstuck: db 27,64,27,81,00,27,82,00 db ' Please release ' db ' redeem button ',10,13,0ffh triesm: db 27,81,24,27,82,0,'Tries-',0ffh timem: db 27,81,24,27,82,13,0ffh acrpos: db 27,81,5,27,82,84,0ffh mbdte: db 10,27,72,99,97,108 ;buffer data!!!! severe problems if altered ntab0: db '0',0ffh ntab1: db '1',0ffh ntab2: db '2',0ffh ntab3: db '3',0ffh ntab4: db '4',0ffh ntab5: db '5',0ffh ntab6: db '6',0ffh ntab7: db '7',0ffh ntab8: db '8',0ffh ntab9: db '9',0ffh testpix: $include (testpix.asm) ;table that defines at what price to set speed and pattern setuptab: db 00,0c7h,01 ;25 db 00,0f9h,01 ;26 db 01,02bh,01 ;27 db 01,05dh,02 ;28 db 01,0c1h,02 ;29 db 02,025h,02 ;30 db 02,089h,02 ;31 db 02,0edh,02 ;32 db 03,051h,02 ;33 db 04,019h,02 ;34 db 04,0e1h,02 ;35 db 05,0a9h,02 ;36 db 06,071h,03 ;37 db 07,039h,03 ;38 db 08,001h,03 ;39 db 09,091h,03 ;40 db 0bh,021h,03 ;41 db 0ch,0b1h,03 ;42 db 0eh,041h,03 ;43 db 0fh,0d1h,03 ;44 db 011h,061h,03 ;45 db 014h,081h,04 ;46 db 017h,0a1h,04 ;47 db 01ah,0c1h,04 ;48 db 01dh,0e1h,04 ;49 db 021h,001h,04 ;50 db 080h,000h,04 ;50 ;Speeds - All values are (spd-99) spd1 equ 34 ;speed values spd2 equ 36 spd3 equ 41 spd4 equ 43 spd5 equ 46 spd6 equ 48 spd7 equ 53 spdef: db 99-spd1 ;speed definitions db 99-spd2 db 99-spd3 db 99-spd4 db 99-spd5 db 99-spd6 db 99-spd7 cval1 equ 225 cval2 equ 275 cval3 equ 350 cval4 equ 725 cval5 equ 1025 cval6 equ 1150 cval7 equ 2850 colvaldef: db (cval1/256)+80h,cval1 and 0ffh ;Colval1 db (cval2/256)+80h,cval2 and 0ffh ;Colval2 db (cval3/256)+80h,cval3 and 0ffh ;Colval3 db (cval4/256)+80h,cval4 and 0ffh ;Colval4 db (cval5/256)+80h,cval5 and 0ffh ;Colval5 db (cval6/256)+80h,cval6 and 0ffh ;Colval6 db (cval7/256)+80h,cval7 and 0ffh ;Colval7 ;redeem levels(all values are +1) rlevdef: db 3,3,4,4,5,6,7 erln1: db 27,81,24,27,82,0,27,68,' ' db 27,81,24,27,82,0,0ffh bkspc: db 08,0ffh fwdspc: db 09,00ffh curhom: db 27,81,0,27,82,0,0ffh curoff: db 27,71,00,0ffh curon: db 27,71,01,0ffh optt: dw opt1,opt15,opt16,opt3 dw opt36,opt5,opt6,opt63,opt64,opt65,opt7 opt1: db 'Column Totals',0ffh opt15: db 'Credit Totals',0ffh opt16: db 'Slot Value/Credits',0ffh opt17: db 'Auto-Adjust enable',0ffh opt3: db 'Column Value',0ffh opt33: db 'Seconds To Continue',0ffh opt36: db 'Attract Mode Sound',0ffh opt5: db 'Test Payouts',0ffh opt6: db 'Audio Test ',0ffh opt63: db 'Switch test',0ffh opt64: db 'Test Level',0ffh opt65: db 'Clear Totals',0ffh opt7: db 'Reset Memory',0ffh credpb1: db 27,82,0,27,81,0 db 'Bill slot = ',0ffh credpb2: db 27,82,0,27,81,8 db 'Coin Slot 1 = ',0ffh credpb3: db 27,82,0,27,81,16 db 'Coin Slot 2 = ',0ffh credpb4: db 27,82,0,27,81,24 db 'Credit Costs = ',0ffh paypg: db 27,64,27,81,0,27,82,0 db ' Press and hold ' db ' stop to exit',0ffh colp: db 27,81,00,27,82,0 db 'Column number - ' db 'Total wins - ' db 'Total plays - ' db 'Payout totals - ',0ffh poss1: db 27,81,0,27,82,96,0ffh poss2: db 27,81,8,27,82,96,0ffh poss3: db 27,81,16,27,82,96,0ffh poss4: db 27,81,24,27,82,96,0ffh memclrd: db 27,64,27,82,0,'Totals Cleared!!',0ffh MyMess: db ' This program was ' db ' written entirely in ' db 'assembly by Isabella ' db ' the nurotic geek :) ',0ffh dynap0: db 27,64,27,82,0,27,81,0 db ' Dynamic Difficulty ' db ' ' db 'Automatically adjusts' db ' speeds and patterns ',0ffh enabledm: db 27,81,8,27,82,34,' Enabled ',0ffh disabledm: db 27,81,8,27,82,37,'Disabled',0ffh mpage: db 27,81,0,27,82,0,27,64 db ' left - Right + ' db 'Stop=Back Start=FWD',0ffh credpg0: db 27,64,27,81,0,27,82,0 db 'Total Bills - ',0ffh credpg2: db 27,82,0,27,81,0 db 'Total Service - ',0ffh credpg3: db 27,82,0,27,81,8 db 'Coins Slot 1 - ',0ffh credpg5: db 27,82,0,27,81,16 db 'Coins Slot 2 - ',0ffh credpg6: db 27,82,0,27,81,24 db 'Press START for more',0ffh credpg7: db 27,82,0,27,81,16 db 'Total Income ',0ffh swtstpg: db 27,81,0,27,82,0,27,64 db ' Switch diagnostics ' db '0-00000000 1-00000000' db ' ' db '2-00000000 3-00000000',0ffh ratps1: db 27,81,0,27,82,96,0ffh ratps2: db 27,81,8,27,82,48,0ffh ratps3: db 27,81,16,27,82,48,0ffh ratps4: db 27,81,24,27,82,36,0ffh ratps5: db 27,81,24,27,82,108,0ffh spdpg: db 27,81,0,27,82,0,27,64 db 'Column - ' db 'Center Speed - ' db 'Speed Range - ',0ffh complpg: db 27,81,0,27,82,0,27,64 db 'Column - ' db 'Current level - ' db 'Minimum level - ',0ffh spdps1: db 27,81,0,27,82,54,0ffh spdps2: db 27,81,8,27,82,92,0ffh spdps3: db 27,81,16,27,82,92,0ffh rspdps1: db 27,81,0,27,82,54,0ffh rspdps2: db 27,81,8,27,82,94,0ffh rspdps3: db 27,81,16,27,82,94,0ffh rated1: db 27,81,00,27,82,102,0ffh rated2: db 27,81,8,27,82,54,0ffh rated3: db 27,81,24,27,82,120,0ffh bncrpg: db 27,64,27,81,00,27,82,00 db ' Bonus Credits ' db ' ' db ' Every Games Lost ' db 'Starting at Column ',0ffh bncrps: db 27,81,16,27,82,42,0ffh bncrps2: db 27,81,24,27,82,114,0ffh hmstct: db 27,64,27,81,00,27,82,00 db ' How many seconds ' db ' avalible to continue' db ' game',0ffh hmstps: db 27,81,24,27,82,24,0ffh hmscsp: db ' - seconds',0ffh rllpt: db 27,64,27,81,00,27,82,00 db ' Consolation Prize ' db ' ' db ' Every Games Lost ' db 'Starting at column ',0ffh modtt: db 27,64,27,81,00,27,82,00 db ' Attract Mode Sounds ',0ffh modttps1: db 27,81,24,27,82,96,0ffh rstp1: db 27,81,0,27,82,0 db ' You are about to ' db ' erase all settings ' db 'Press stop to go back' db 'left button to erase ',0ffh rstp2: db 27,81,00,27,82,00 db ' I am not asking you ' db 'again.. Press stop to' db ' abort or start to ' db ' erase memory ',0ffh m6ltab: db 8,6,7,2,3 db 4,8,3,6,1 db 2,9,1,8,0 db 6,9,0,4,0 db 8,4,0,2,0 db 4,2,0,1,0 db 2,1,5,0,0 db 6,5,2,0,0 db 8,2,1,0,0 db 4,6,0,0,0 db 2,3,0,0,0 db 6,1,0,0,0 db 8,0,0,0,0 db 4,0,0,0,0 db 2,0,0,0,0 db 1,0,0,0,0 newpats: $include(lindex.asm) ;contains new pattern index and patterns ;winning pattern definition bigsq: db 1,5,21,25,0 litsq: db 7,9,17,19,0 bigd: db 3,11,23,15,0 litd: db 8,12,14,18,0 diag1: db 1,7,19,25,0 diag2: db 21,17,9,5,0 stmp1: db 1,6,2,7,0 stmp2: db 5,10,4,9,0 stmp3: db 16,21,17,22,0 stmp4: db 20,25,19,24,0 hor1: db 1,2,3,4,5,0 hor2: db 6,7,8,9,10,0 hor3: db 11,12,14,15,0 hor4: db 16,17,18,19,20,0 hor5: db 21,22,23,24,25,0 vert1: db 1,6,11,16,21,0 vert2: db 2,7,12,17,22,0 vert3: db 3,8,18,23,0 vert4: db 4,9,14,19,24,0 vert5: db 5,10,15,20,25,0 lastp: db 00,00 bits0: $include(bits1.asm) ;Audio parts startv: $include(start.asm) db 0 , 0 keys: $include(choo.asm) db 0 , 0 note1: $include(note1.asm) db 0 note2: $include(note2.asm) db 0 note3: $include(note3.asm) db 00 billin: $include(cregsnd.asm) db 00 $include(coolled.asm) numbers: $include(number.asm) font1: $include(generic.asm) org 0fffah ;MMROM1 CHKSUM MMROM1CHK: db 016h db 091h org 0fffch ;MMROM2 CHKSUM MMROM2CHK: db 0d3h db 009h org 0fffeh ;Rom CheckSUm address ROMCHKSUM: db 00 db 00 END