**************************************************************************** **************************************************************************** ** ** 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 November 24, 2001 ** **************************************************************************** **************************************************************************** ******************************************** REPEAT A LINE * * Repeats 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: moveq #19,d1 \l: move.b (a2)+,(a1)+ dbra d1,\l lea 10(a1),a1 lea -20(a2),a2 dbra d0,Repeat_Line 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: moveq #19,d1 \l: move.b (a0)+,(a1)+ dbra d1,\l lea 10(a1),a1 dbra d0,Copy_Screen_Data rts ******************************************** INITIALIZE TITLE SCREEN Platinum_Title_Screen: bsr Clear_Screen_Center IFND ti89 bsr Prepare_Center ENDIF lea title_picture(pc),a0 move.l plane0(a5),a1 IFND ti89 lea 3*30+5(a1),a1 ENDIF bsr.s copy_title_plane move.l plane1(a5),a1 IFND ti89 lea 3*30+5(a1),a1 ENDIF 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_All_Keys Title_Loop: bsr Read_All_Keys GETEDGE 6,0,8,6 ; ESC beq.s \ret GETEDGE 4,6,8,5 ; MODE beq.s Platinum_Title_Screen GETEDGE 4,7,4,4 ; F2 beq.s \options GETEDGE 3,7,2,4 ; F3 beq.s \instructions GETEDGE 1,5,6,0 ; ^ (cheat key) beq \cheat GETEDGE 2,7,9,4 ; F4 beq.s \highscores GETEDGE 1,7,7,4 ; F5 beq.s \about GETEDGE 4,1,1,5 ; 1 beq.s \adjust_difficulty GETEDGE 3,1,1,6 ; 2 beq.s \change_background GETEDGE 2,1,1,7 ; 3 beq.s \change_speed GETEDGE 4,2,2,5 ; 4 beq.s \change_ship GETEDGE 1,1,8,4 ; + beq.s \contrast_up GETEDGE 1,2,9,0 ; - beq.s \contrast_down GETEDGE 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 #5,(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 Clear_Screen_Center IFND ti89 bsr Prepare_Center ENDIF bsr Display_High_Scores 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 \contrast_up: JSR_ROM OSContrastUp \tl: bra Title_Loop \contrast_down: JSR_ROM OSContrastDn bra.s \tl title_page: move.l plane0(a5),a1 ; draw blank outline IFND ti89 lea 3*30+5(a1),a1 ENDIF lea 6*30(a1),a1 lea (a1),a2 moveq #87,d0 bsr Repeat_Line move.l plane1(a5),a1 IFND ti89 lea 3*30+5(a1),a1 ENDIF 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 #58-40*IS89,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: IFND ti89 add.w #40,d5 ENDIF \l: 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 \l 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 9 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@ocf.berkeley.edu",0 dc.b "http://www.ocf.berkeley.edu/~pad/",0 dc.b "IRC: PatrickD on irc.kewl.org and EfNet",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