**************************************************************************** **************************************************************************** ** ** Platinum Edition (Title screen routines) ** ** This software is in the public domain. There is no warranty. ** ** by Patrick Davidson (pad@calc.org, http://pad.calc.org/) ** ** Last updated August 2, 2001 ** **************************************************************************** **************************************************************************** ******************************************** REPEAT A LINE * * Repeates the line in (A2) on screen at (A1) a total of D0+1 times, * copying 20 bytes per line and skipping 10. * * Preserves A0, A2-A7. A1 points to end of data on return. * ******** Repeat_Line: lea 20(a1),a1 repeat_line_loop: movem.l (a2)+,d1-d5 movem.l d1-d5,-(a1) lea 50(a1),a1 lea -20(a2),a2 dbra d0,repeat_line_loop lea -20(a1),a1 rts ******************************************** COPY A PLANE OF TITLE SCREEN copy_title_plane: lea 60(a1),a1 ; skip 2 lines moveq #4,d0 bsr Copy_Screen_Data ; copy 5 lines lea -30(a1),a2 ; A2 -> sides-only line moveq #5,d0 bsr Repeat_Line ; repeat blank on screen 6 times moveq #13,d0 bsr Copy_Screen_Data ; copy 14 lines moveq #66,d0 bsr Repeat_Line ; put blank line 66 times moveq #3,d0 ; copy 4 lines ******************************************* COPY SCREEN DATA * * Copies D0+1 lines of screen data from A0 to A1, skipping 10 bytes after * every 20 as is needed for screen display. * * Preserves A2-A7; A0 and A1 point to end of data on return. * ******** Copy_Screen_Data: lea 20(a1),a1 copy_screen_loop: movem.l (a0)+,d1-d5 movem.l d1-d5,-(a1) lea 50(a1),a1 dbra d0,copy_screen_loop lea -20(a1),a1 rts ******************************************** INITIALIZE TITLE SCREEN Platinum_Title_Screen: bsr Clear_Screen lea title_picture(pc),a0 move.l plane0(a5),a1 bsr.s copy_title_plane move.l plane1(a5),a1 bsr.s copy_title_plane moveq #2,d0 bsr Set_Font lea title_text(pc),a3 moveq #16,d5 moveq #40,d6 moveq #10,d7 bsr Display_Messages ******************************************** TITLE SCREEN LOOP bsr Read_Key_Edges Title_Loop: bsr Read_Key_Edges GETKEY 6,0,8,6 ; ESC beq.s \ret GETKEY 4,6,8,5 ; MODE beq.s Platinum_Title_Screen GETKEY 4,7,4,4 ; F2 beq.s \options GETKEY 3,7,2,4 ; F3 beq.s \instructions GETKEY 1,5,6,0 ; ^ (cheat key) beq.s \cheat GETKEY 2,7,9,4 ; F4 beq.s \highscores GETKEY 1,7,7,4 ; F5 beq.s \about GETKEY 4,1,1,5 ; 1 beq.s \adjust_difficulty GETKEY 3,1,1,6 ; 2 beq.s \change_background GETKEY 2,1,1,7 ; 3 beq.s \change_speed GETKEY 4,2,2,5 ; 4 beq.s \change_ship GETKEY 5,7,6,4 ; F1 bne.s Title_Loop \play: st game_started(a5) \ret: rts \adjust_difficulty: lea difficulty(a5),a6 addq.w #1,(a6) cmp.w #4,(a6) bne.s \options move.w #1,(a6) \options: lea options_data(pc),a6 bra.s title_page \instructions: lea instructions_data(pc),a6 bra.s title_page \highscores: bsr Display_High_Scores move.w #0,oskey bra Platinum_Title_Screen \about: lea about_data(pc),a6 bra.s title_page \cheat: st cheated(a5) bra.s \play \change_background: addq.w #4,back_type(a5) cmp.w #12,back_type(a5) bne.s \options clr.w back_type(a5) bra.s \options \change_speed: not.w ludicrous(a5) bra.s \options \change_ship: not.w classic(a5) bra.s \options title_page: move.l plane0(a5),a1 ; draw blank outline lea 6*30(a1),a1 lea (a1),a2 moveq #87,d0 bsr Repeat_Line move.l plane1(a5),a1 lea 6*30(a1),a1 lea (a1),a2 moveq #87,d0 bsr Repeat_Line move.w difficulty(a5),d0 ; adjust difficulty text add.b #'0',d0 lea diff_char(pc),a0 move.b d0,(a0) move.w classic(a5),d0 ; show ship text lsl.w #3,d0 lea ship_msgs+8(pc,d0.w),a0 lea ship_chars(pc),a1 moveq #7,d0 \cl: move.b (a0)+,(a1)+ dbra d0,\cl move.w ludicrous(a5),d0 ; show speed text muls #3,d0 lea speed_msgs+3(pc,d0.w),a0 lea speed_chars(pc),a1 move.b (a0)+,(a1)+ move.b (a0)+,(a1)+ move.b (a0)+,(a1)+ move.w back_type(a5),d0 ; show background text lea background_msgs(pc,d0.w),a0 lea back_chars(pc),a1 move.b (a0)+,(a1)+ move.b (a0)+,(a1)+ move.b (a0)+,(a1)+ move.b (a0)+,(a1)+ moveq #1,d0 ; show return message bsr Set_Font moveq #18,d1 moveq #85,d0 lea returnmsg(pc),a0 bsr Display_String move.w (a6)+,d0 bsr Set_Font move.w (a6)+,d5 ; display main messages move.w (a6)+,d6 move.w (a6)+,d7 lea (a6),a3 bsr.s Display_Messages bra Title_Loop background_msgs: dc.b "Full" dc.b "Side" dc.b "None" speed_msgs: dc.b "On " dc.b "Off" ship_msgs: dc.b "Classic " dc.b "Platinum" ******************************************** DISPLAY MESSAGES * * Displays a sequence of strings on screen, one above another, in the * currently selected font. May change all registers. Arguments: * * A3 -> Beginning of list of null-terminated strings (empty string marks end) * D5 = X coordinate of messages * D6 = Initial Y coordinates * D7 = Change of Y coordintes * ******** Display_Messages: lea (a3),a0 move.w d5,d1 move.w d6,d0 bsr Display_String \seek: tst.b (a3)+ bne.s \seek add.w d7,d6 tst.b (a3) bne.s Display_Messages rts ******************************************** DATA title_picture: INCBIN title.bin ******************************************** MESSAGES title_text: dc.b "F1 - Start Game",0 dc.b "F2 - Options",0 dc.b "F3 - Instructions",0 dc.b "F4 - High Scores",0 dc.b "F5 - About",0 dc.b 0 EVEN instructions_data: dc.w 0,10,12,7 dc.b "Use left/right arrows to move your ship.",0 IFD ti89 dc.b "Press 2nd to fire the selected weapon.",0 ENDIF IFD ti92plus dc.b "Press LOCK to fire the selected weapon.",0 ENDIF dc.b "Use numbers 1 through 8 to select among",0 dc.b "available weapons. When a $ is dropped,",0 dc.b "collect it to get money to use in the",0 dc.b "Platinum Shop which appears every few",0 dc.b "levels. Use up and down to select shop",0 dc.b "items, ENTER to purchase selected item.",0 dc.b "Press the dot (.) to exit the game at any",0 dc.b "point, or APPS to save the game and exit.",0 dc.b 0 EVEN about_data: dc.w 0,10,12,7 dc.b "Platinum Edition - Version " VERSION_STRING dc.b 0 dc.b "Released on " DATE_STRING dc.b 0 dc.b "Programmed by Patrick Davidson",0 dc.b "E-Mail address: pad@calc.org",0 dc.b "Web site: http://pad.calc.org/",0 dc.b "IRC: PatrickD in #ti (Efnet & irc.kewl.org)",0 dc.b "This program is in the public domain so",0 dc.b "it can be distributed and modified",0 dc.b "with no restrictions. Source code is",0 dc.b "available on the web site.",0 dc.b 0 EVEN options_data: dc.w 1,7,13,9 dc.b "Platinum Edition Options",0 dc.b "Press Option # to Adjust",0 dc.b " ",0 dc.b "1. Skill Level: 1",0 diff_char equ *-2 dc.b "2. Background: Full",0 back_chars equ *-5 dc.b "3. Ludicrous speed: Off",0 speed_chars equ *-4 dc.b "4. Player Ship: Platinum",0 ship_chars equ *-9 dc.b 0 EVEN returnmsg: dc.b "Press MODE to return",0 EVEN