B>type factory.asm .title "Robot Factory & MaMa Otto" .sbttl "FRENZY" .ident FACTORY .insert equs .extern RtoAx,PLOT,V.ZERO ; MACROS RD=8 ;room drop XX=120+RD ;x of left edge YY=48+RD ;y of top corner .define START[Pat,Xoff,Yoff]=[ lxi h,Pat# lxi d,((Yoff+YY)<8)!(Xoff+XX) call %START ] .define DRAW[Pat,Xoff,Yoff]=[ lxi d,Pat# lxi h,((Yoff+YY)<8)!(Xoff+XX) call %DRAW ] .define COLOR[Ctable]=[ lxi h,Ctable call %Color ] ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; ROBOT FACTORY ;_______________________________ FACTORY:: lda RoomCnt bit 3,a jz ..8 bit 2,a jz Plant ;do mama otto 1 jmp Compu ;2 ..8: bit 2,a jnz MaMa ;2 ; 4-factory is farthest COLOR FCOLS DRAW PTA,3,3 DRAW PTB,4,18 DRAW PTC,12,16 ; 4 vectored parts (Conveyor,Handle,WhirlCCW,WhirlCW) START C.IDLE,8,8 START H.IDLE,28,32 START W.CCW,14,29 mvi TPRIME(x),1 START W.CW,19,36 mvi TPRIME(x),1 pop B ;wcw save vector pointers pop B ;wccw pop D ;handle pop X ;conveyor ..n: call NEXT.J# lda Robots ora a jm ..go cpi 13 jrnc ..n ; start one up ..go: lxi h,C.PART# ;go conveyor call ChangePat WAIT 50 push d ;ex ix,iy xtix pop d lxi h,H.GO# call ChangePat WAIT 60 FORK FROBOT# WAIT 90 lxi h,H.IDLE# Call ChangePat push d ;ex ix,iy xtix pop d WAIT 30 ;idle jmpr ..n ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Mother Otto ;_______________________________ MaMa: call M.TALK# COLOR MCOLS DRAW MAL,4,4 DRAW MAR,20,4 call Sleep ..sl: call NEXT.J lda CACKLE+1 ;ottos hit ora a jrnz ..xsl ;stay asleep lda Vectors ;check on man bit INEPT,a jrz ..sl call UnM jmpr ..xdl ..xsl: call Sleep ;erase old call Angry lxi d,(82<8)!110 FORK MSUPER# lxi d,(82<8)!170 FORK MSUPER lxi d,(40<8)!148 FORK MSUPER lxi d,(90<8)!148 FORK MSUPER ..dl: call NEXT.J lda Vectors ;check on man bit INEPT,a jrz ..dl call AngryM ;erase old mouth ..xdl: call Smile jmp JobDEL# ;no need for me any more ;draw smile Smile: DRAW MASML,4,30 DRAW MASMR,20,30 RET ;draw eyes and mouth angry Angry: DRAW MAEL,11,9 DRAW MAER,21,9 COLOR ECOLS AngryM: DRAW MAFL,4,30 DRAW MAFR,20,30 ret ;draw eyes and mouth sleep Sleep: DRAW MASL,4,13 DRAW MASR,20,13 UnM: DRAW MAM,12,30 ret ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Electric Plant ;_______________________________ Plant: COLOR PLCOLS call UnReflect DRAW BULB,8,4 DRAW BULB,8,20 DRAW BULB,28,12 DRAW STALK,28,28 DRAW RFILL,3,36 DRAW FILL,16,36 DRAW RFILL,28,36 ; 4 vectored parts (W.CW,W.CCW,TL,BL) START TL,12,7 mvi TPRIME(x),1 START BL,12,16 mvi TPRIME(x),1 START W.CCW,8,38 mvi TPRIME(x),1 START W.CW,28,38 mvi TPRIME(x),1 ; save vector pointers pop b pop d pop h pop x ..loop: call NEXT.J call HitChk jrz ..loop ..Hit: di ldax b ;stop the whirlies res MOVE,a stax b ldax d res MOVE,a stax d mov a,m ani #((1