**************************************************************************** **************************************************************************** ** ** Monster for TI-89 / TI-92 Plus - bonuses ** ** Copyright 2002 by Patrick Davidson. This software may be freely ** modified and/or copied with no restrictions. There is no warranty. ** ** by Patrick Davidson (pad@calc.org, http://pad.calc.org/) ** ** Last updated March 6, 2002 ** **************************************************************************** **************************************************************************** Deploy_Bonus: tst.w bonus_type(a5) bne.s \q move.w d4,bonus_x(a5) add.w d5,d5 move.w d5,bonus_y(a5) lea map+11*18(a5),a0 lsr.w #4,d4 tst.b 0(a0,d4.w) bne.s \q moveq #70,d4 tst.w cheat(a5) beq.s \nc moveq #10,d4 \nc: bsr random cmp.w #7,d4 bge.s \q addq.w #1,d4 cmp.w #3,d4 ; prevent multiball during brickthru bne.s \ok1 tst.w brickthru(a5) beq.s \ok1 rts \ok1: cmp.w #6,d4 ; prevent brickthru during multiball bne.s \ok2 cmp.w #1,num_balls(a5) beq.s \ok2 rts \ok2: move.w d4,bonus_type(a5) \q: rts Handle_Bonus: tst.w bonus_type(a5) beq.s \q move.w bonus_x(a5),d0 addq.w #1,bonus_y(a5) move.w bonus_y(a5),d1 lsr.w #1,d1 cmp.w #PLANE_LINES,d1 beq.s \q2 move.w bonus_type(a5),d2 add.w d2,d2 move.w bonus_table-2(pc,d2.w),d2 lea bonus_table(pc,d2.w),a0 bsr Adjusted_Sprite move.w bonus_y(a5),d0 lsr.w #1,d0 sub.w #11*TILE_HEIGHT-7,d0 ble.s \q sub.w #7+8,d0 bge.s \q move.w bonus_x(a5),d0 add.w #17,d0 sub.w paddlex(a5),d0 ble.s \q sub.w #17,d0 sub.w paddlew(a5),d0 bge.s \q move.w bonus_type(a5),d2 add.w d2,d2 move.w bonus_collect_table-2(pc,d2.w),d2 jsr bonus_collect_table(pc,d2.w) \q2: clr.w bonus_type(a5) \q: rts bonus_table: dc.w image_expand-bonus_table dc.w image_life-bonus_table dc.w image_multiball-bonus_table dc.w image_slow-bonus_table dc.w image_score-bonus_table dc.w image_brickthru-bonus_table dc.w image_laser-bonus_table bonus_collect_table: dc.w collect_expand-bonus_collect_table dc.w collect_life-bonus_collect_table dc.w collect_multiball-bonus_collect_table dc.w collect_slow-bonus_collect_table dc.w collect_score-bonus_collect_table dc.w collect_brickthru-bonus_collect_table dc.w collect_laser-bonus_collect_table collect_laser: add.w #20,laserpower(a5) rts collect_score: lea temp_buffer(a5),a0 move.l #$500,(a0)+ lea score+4(a5),a1 bra Add_BCD collect_brickthru: add.w #600,brickthru(a5) rts collect_life: addq.w #1,lives(a5) bra Show_Lives_Number collect_expand: cmp.w #34,paddlew(a5) beq.s \q move.w #34,paddlew(a5) bsr.s \l8 moveq #8,d7 \r: bsr try_to_go_right dbra d7,\r bsr.s \l8 \q: rts \l8: moveq #8,d7 \l: bsr try_to_go_left dbra d7,\l RTS collect_slow: lea balls(a5),a6 moveq #b_num-1,d6 \l: cmp.w #3,b_speed(a6) ble.s \s subq.w #1,b_speed(a6) \s: lea b_size(a6),a6 dbra d6,\l rts collect_multiball: moveq #1,d0 lea balls(a5),a0 ; find available ball in a0 lea b_size(a0),a1 ; and destinations in a1 / a2 lea b_size(a1),a2 cmp.w (a0),d0 beq.s multiball exg a0,a1 cmp.w (a0),d0 beq.s multiball exg a0,a2 cmp.w (a0),d0 beq.s multiball rts multiball: lea (a1),a3 moveq #-5,d5 bsr multiball_copy lea (a2),a3 moveq #5,d5 multiball_copy: tst.w (a3) bne.s \skip_this_ball moveq #5,d0 \l: move.l (a0)+,(a3)+ dbra d0,\l lea -24(a0),a0 lea -24(a3),a3 add.w b_angle(a3),d5 blt.s \ball_xinvert cmp.w #17,d5 bge.s \ball_yinvert move.w d5,b_angle(a3) \skip_this_ball: rts \ball_xinvert: clr.w b_angle(a3) neg.w b_xdir(a3) rts \ball_yinvert: move.w #16,b_angle(a3) neg.w b_ydir(a3) rts