**************************************************************************** **************************************************************************** ** ** Monster for TI-89 / TI-92 Plus - Title screen ** ** Copyright 2004 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 September 15, 2004 ** **************************************************************************** **************************************************************************** CHAR_WIDTH equ 8-2*IS89 ; width of character in calc's font LINE_SKIP equ 11-2*IS89 ; # rows between lines of text MSG_START_X equ 14-11*IS89 ; X coordinate to start main text INFO_START_X equ 41-40*IS89 ; X coordinate for info/instructions TOP_HEIGHT equ 76-18*IS89 ; height of top region of screen *************************************** SET UP TITLE SCREEN Title_Screen: bsr Clear_Screen_Buffer lea title_picture(pc),a1 ; copy logo lea title_picture+820(pc),a0 IFD ti89 lea 100(a5),a2 lea 100+s2(a5),a3 move.w #204,d0 \l: move.l (a0)+,(a2)+ move.l (a1)+,(a3)+ dbra d0,\l ENDIF IFND ti89 lea 155(a5),a2 lea 155+s2(a5),a3 moveq #40,d0 \lo: moveq #19,d1 \li: move.b (a0)+,(a2)+ move.b (a1)+,(a3)+ dbra d1,\li lea 10(a2),a2 lea 10(a3),a3 dbra d0,\lo ENDIF moveq #2-IS89,d0 bsr Set_Font moveq #MSG_START_X+CHAR_WIDTH,d1 ; show initial text moveq #PLANE_LINES-LINE_SKIP,d0 lea title_message_4(pc),a0 bsr Display_String moveq #MSG_START_X+CHAR_WIDTH/2,d1 moveq #PLANE_LINES-2*LINE_SKIP,d0 lea title_message_3(pc),a0 bsr Display_String moveq #MSG_START_X,d1 moveq #PLANE_LINES-3*LINE_SKIP,d0 lea title_message_2(pc),a0 bsr Display_String moveq #MSG_START_X,d1 moveq #PLANE_LINES-4*LINE_SKIP,d0 lea title_message_1(pc),a0 bsr Display_String move.w #1,bounce_status(a5) move.w #5,bounce_y(a5) IFND ti89 move.w #40,bounce_x(a5) ENDIF clr.w bounce_xv(a5) ***************************************** MAIN TITLE SCREEN LOOP title_loop: bsr do_bounce GETEDGE 6,0,8,6 ; ESC beq \ret GETEDGE 1,1,8,4 ; + bne.s \ncu1 bsr contrast_up \ncu1: GETEDGE 1,2,9,0 ; - bne.s \ncd1 bsr contrast_down \ncd1: GETEDGE 2,7,9,4 ; F4 beq \show_inst GETEDGE 1,7,7,4 ; F5 beq \show_info GETEDGE 4,7,4,4 ; F2 beq \show_scores GETEDGE 5,7,6,4 ; F1 bne.s title_loop lea s2(a5),a2 move.w #WIDTH_BYTES*(PLANE_LINES-TOP_HEIGHT)/2-1,d0 \c: clr.w -(a2) dbra d0,\c moveq #2-IS89,d0 bsr Set_Font moveq #MSG_START_X+CHAR_WIDTH,d1 ; show speed text moveq #PLANE_LINES-LINE_SKIP,d0 lea title_message_4s(pc),a0 bsr Display_String moveq #MSG_START_X+3*CHAR_WIDTH/2,d1 moveq #PLANE_LINES-2*LINE_SKIP,d0 lea title_message_3s(pc),a0 bsr Display_String moveq #MSG_START_X+CHAR_WIDTH/2,d1 moveq #PLANE_LINES-3*LINE_SKIP,d0 lea title_message_2s(pc),a0 bsr Display_String moveq #MSG_START_X+3*CHAR_WIDTH/2,d1 moveq #PLANE_LINES-4*LINE_SKIP,d0 lea title_message_1s(pc),a0 bsr Display_String \title_loop_2: bsr do_bounce GETEDGE 6,0,8,6 ; ESC beq.s \ret GETEDGE 1,1,8,4 ; + bne.s \ncu2 bsr contrast_up \ncu2: GETEDGE 1,2,9,0 ; - bne.s \ncd2 bsr contrast_up \ncd2: GETEDGE 2,7,9,4 ; F4 beq \start_super GETEDGE 4,7,4,4 ; F2 beq.s \start_medium GETEDGE 3,7,2,4 ; F3 beq.s \start_fast GETEDGE 5,7,6,4 ; F1 bne.s \title_loop_2 moveq #4,d7 moveq #0,d6 move.l #$10000,d5 rts \start_super: moveq #8,d7 move.l #$12000,d6 move.l #$30000,d5 rts \start_fast: moveq #6,d7 move.l #$8000,d6 move.l #$20000,d5 rts \start_medium: moveq #5,d7 move.l #$4000,d6 move.l #$15000,d5 rts \show_scores: move.w #-1,exit_status(a5) \ret: addq.l #4,sp rts \show_inst: lea instructions(pc),a3 bra.s \show_stuff \show_info: lea information(pc),a3 \show_stuff: moveq #1,d0 bsr Set_Font lea (a5),a1 move.w #WIDTH_BYTES*TOP_HEIGHT/2-1,d0 \s: clr.w s2(a1) clr.w (a1)+ dbra d0,\s moveq #1,d6 \d: move.w d6,d0 moveq #18-17*IS89,d1 add.w #10-1*IS89,d6 lea (a3),a0 bsr Display_String \e: tst.b (a3)+ bne.s \e tst.b (a3) bne.s \d clr.w bounce_status(a5) bra title_loop contrast_up: ; adjust contrast JMP_ROM OSContrastUp contrast_down: JMP_ROM OSContrastDn Clear_Screen_Buffer: ; initialize buffer lea (a5),a0 move.w #2*PLANE_SIZE/4-1,d0 moveq #0,d1 \c: move.l d1,(a0)+ dbra d0,\c rts **************************************** TITLE SCREEN DATA title_picture: INCBIN title.bin title_message_1: dc.b 'Press F1 to start the game',0 title_message_2: dc.b 'Press F2 to view hi-scores',0 title_message_3: dc.b 'Press F4 for instructions',0 title_message_4: dc.b 'Press F5 for information',0 title_message_1s: dc.b 'Press F1 for slow speed',0 title_message_2s: dc.b 'Press F2 for medium speed',0 title_message_3s: dc.b 'Press F3 for fast speed',0 title_message_4s: dc.b 'Press F4 for super speed',0 IFND ti89 instructions: dc.b 'Arrow keys move paddle; P pauses.',0 dc.b 'Press . to leave this amazing game.',0 dc.b 'Press APPS to save games and exit.',0 dc.b 'LOCK releases, fires, slows paddle.',0 dc.b 'Use + and - to adjust contrast.',0,0 information: dc.b 'Copyright 2004 by Patrick Davidson.',0 dc.b 'Freely redistributable, No Warranty',0 dc.b 'E-Mail: pad@ocf.berkeley.edu',0 dc.b 'http://www.ocf.berkeley.edu/~pad/',0 dc.b 'Source code is on the web site.',0,0 ENDIF IFD ti89 instructions: dc.b 'Arrow keys move, P pauses',0 dc.b 'Press . to quit playing.',0 dc.b 'Press APPS to save & exit',0 dc.b '2nd: release, laser, slow',0 dc.b '+ and - adjust contrast.',0,0 information: VERSION_MESSAGE dc.b 'Copr. 2004 Patrick Davidson',0 dc.b 'Freeware, No Warranty',0 dc.b 'pad@ocf.berkeley.edu',0 dc.b 'www.ocf.berkeley.edu/~pad',0 dc.b 'Source code is on web site',0,0 ENDIF EVEN ***************************************** SCROLL AROUND TOP OF SCREEN do_bounce: neg.w bounce_status(a5) ble.s \nobounce IFND ti89 ; bounce X tst.b bounce_xv(a5) blt.s \bounceleft bsr Scroll_Right addq.w #1,bounce_x(a5) cmp.w #78,bounce_x(a5) bne.s \noxbounce st bounce_xv(a5) bra.s \noxbounce \bounceleft: bsr Scroll_Left subq.w #1,bounce_x(a5) cmp.w #1,bounce_x(a5) bne.s \noxbounce sf bounce_xv(a5) \noxbounce: ENDIF tst.b bounce_yv(a5) ; bounce Y blt.s \bounceup bsr Scroll_Down addq.w #1,bounce_y(a5) cmp.w #TOP_HEIGHT-42,bounce_y(a5) bne.s \nobounce st bounce_yv(a5) bra.s \nobounce \bounceup: bsr Scroll_Up subq.w #1,bounce_y(a5) bne.s \nobounce sf bounce_yv(a5) \nobounce: bsr Wait_VBL bsr Display_Screen bra Read_All_Keys Scroll_Up: lea (a5),a0 move.w #WIDTH_BYTES*(TOP_HEIGHT-1)/2-1,d0 \sul: move.w WIDTH_BYTES(a0),(a0) move.w WIDTH_BYTES+s2(a0),s2(a0) addq.w #2,a0 dbra d0,\sul rts Scroll_Down: lea WIDTH_BYTES*TOP_HEIGHT(a5),a0 move.w #WIDTH_BYTES*(TOP_HEIGHT-1)/2-1,d0 \sdl: subq.w #2,a0 move.w -WIDTH_BYTES(a0),(a0) move.w -WIDTH_BYTES+s2(a0),s2(a0) dbra d0,\sdl moveq #WIDTH_BYTES/2-1,d0 \c: clr.w -(a0) clr.w s2(a0) dbra d0,\c rts IFND ti89 Scroll_Right: lea (a5),a0 bsr.s \sr lea s2(a5),a0 \sr: move.w #WIDTH_BYTES*TOP_HEIGHT/2-1,d0 andi #0,ccr \srl: roxr.w (a0)+ dbra d0,\srl rts Scroll_Left: lea WIDTH_BYTES*TOP_HEIGHT(a5),a0 bsr.s \sl lea WIDTH_BYTES*TOP_HEIGHT+s2(a5),a0 \sl: move.w #WIDTH_BYTES*TOP_HEIGHT/2-1,d0 andi #0,ccr \sll: roxl.w -(a0) dbra d0,\sll rts ENDIF