Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ===========================================================================
- ; loc_92F6:
- MenuScreen_LevelSelect:
- ; Load foreground (sans zone icon)
- lea (Chunk_Table).l,a1
- lea (MapEng_LevSel).l,a0 ; 2 bytes per 8x8 tile, compressed
- move.w #make_art_tile(ArtTile_VRAM_Start,0,0),d0
- bsr.w EniDec
- lea (Chunk_Table).l,a1
- move.l #vdpComm(VRAM_Plane_A_Name_Table,VRAM,WRITE),d0
- moveq #$27,d1
- moveq #$1B,d2 ; 40x28 = whole screen
- jsrto (PlaneMapToVRAM_H40).l, JmpTo_PlaneMapToVRAM_H40 ; display patterns
- ; Draw sound test number
- moveq #palette_line_0,d3
- bsr.w LevelSelect_DrawSoundNumber
- ; Load zone icon
- lea (Chunk_Table+$8C0).l,a1
- lea (MapEng_LevSelIcon).l,a0
- move.w #make_art_tile(ArtTile_ArtNem_LevelSelectPics,0,0),d0
- bsr.w EniDec
- bsr.w LevelSelect_DrawIcon
- clr.w (Player_mode).w
- clr.w (Results_Screen_2P).w ; VsRSID_Act
- clr.b (Level_started_flag).w
- clr.w (Anim_Counters).w
- ; Animate background (loaded back in MenuScreen)
- lea (Anim_SonicMilesBG).l,a2
- jsrto (Dynamic_Normal).l, JmpTo2_Dynamic_Normal ; background
- moveq #PalID_Menu,d0
- bsr.w PalLoad_ForFade
- lea (Normal_palette_line3).w,a1
- lea (Target_palette_line3).w,a2
- moveq #bytesToLcnt(palette_line_size),d1
- - move.l (a1),(a2)+
- clr.l (a1)+
- dbf d1,-
- move.b #MusID_Options,d0
- jsrto (PlayMusic).l, JmpTo_PlayMusic
- move.w #$707,(Demo_Time_left).w
- clr.w (Two_player_mode).w
- clr.l (Camera_X_pos).w
- clr.l (Camera_Y_pos).w
- clr.w (Correct_cheat_entries).w
- clr.w (Correct_cheat_entries_2).w
- move.b #VintID_Menu,(Vint_routine).w
- bsr.w WaitForVint
- move.w (VDP_Reg1_val).w,d0
- ori.b #$40,d0
- move.w d0,(VDP_control_port).l
- bsr.w Pal_FadeFromBlack
- ;loc_93AC:
- LevelSelect_Main: ; routine running during level select
- move.b #VintID_Menu,(Vint_routine).w
- bsr.w WaitForVint
- move #$2700,sr
- moveq #palette_line_0-palette_line_0,d3 ; palette line << 13
- bsr.w LevelSelect_MarkFields ; unmark fields
- bsr.w LevSelControls ; possible change selected fields
- move.w #palette_line_3-palette_line_0,d3 ; palette line << 13
- bsr.w LevelSelect_MarkFields ; mark fields
- bsr.w LevelSelect_DrawIcon
- move #$2300,sr
- lea (Anim_SonicMilesBG).l,a2
- jsrto (Dynamic_Normal).l, JmpTo2_Dynamic_Normal
- move.b (Ctrl_1_Press).w,d0
- or.b (Ctrl_2_Press).w,d0
- andi.b #button_start_mask,d0 ; start pressed?
- bne.s LevelSelect_PressStart ; yes
- bra.w LevelSelect_Main ; no
- ; ===========================================================================
- ;loc_93F0:
- LevelSelect_PressStart:
- move.w (Level_select_zone).w,d0
- add.w d0,d0
- move.w LevelSelect_Order(pc,d0.w),d0
- bmi.w LevelSelect_Return ; sound test
- cmpi.w #$4000,d0
- bne.w LevelSelect_StartZone
- LevelSelect_SpecialStage:
- move.b #GameModeID_SpecialStage,(Game_Mode).w ; => SpecialStage
- clr.w (Current_ZoneAndAct).w
- move.b #3,(Life_count).w
- move.b #3,(Life_count_2P).w
- moveq #0,d0
- move.w d0,(Ring_count).w
- move.l d0,(Timer).w
- move.l d0,(Score).w
- move.w d0,(Ring_count_2P).w
- move.l d0,(Timer_2P).w
- move.l d0,(Score_2P).w
- move.l #5000,(Next_Extra_life_score).w
- move.l #5000,(Next_Extra_life_score_2P).w
- move.w (Player_option).w,(Player_mode).w
- rts
- ; ===========================================================================
- ;loc_944C:
- LevelSelect_Return:
- move.b #GameModeID_SegaScreen,(Game_Mode).w ; => SegaScreen
- rts
- ; ===========================================================================
- ; -----------------------------------------------------------------------------
- ; Level Select Level Order
- ; One entry per item in the level select menu. Just set the value for the item
- ; you want to link to the level/act number of the level you want to load when
- ; the player selects that item.
- ; -----------------------------------------------------------------------------
- ;Misc_9454:
- LevelSelect_Order:
- dc.w $0000 ; EHZ 1 00
- dc.w $0001 ; 2 01
- dc.w $0002 ; 3 02
- dc.w $0003 ; 4 03
- dc.w $0100 ; ??? 1 04
- dc.w $0101 ; 2 05
- dc.w $0102 ; 3 06
- dc.w $0103 ; 4 07
- dc.w $0200 ; WZ 1 08
- dc.w $0201 ; 2 09
- dc.w $0202 ; 3 0A
- dc.w $0203 ; 4 0B
- dc.w $0300 ; ??? 1 0C
- dc.w $0301 ; 2 0D
- dc.w $0302 ; 3 0E
- dc.w $0303 ; 4 0F
- dc.w $0400 ; MTZ 1 10
- dc.w $0401 ; 2 11
- dc.w $0402 ; 3 12
- dc.w $0403 ; 4 13
- dc.w $0500 ; MTZ3 1 14
- dc.w $0501 ; 2 15
- dc.w $0502 ; 3 16
- dc.w $0503 ; 4 17
- dc.w $0600 ; WFZ 1 18
- dc.w $0601 ; 2 19
- dc.w $0602 ; 3 1A
- dc.w $0603 ; 4 1B
- dc.w $0700 ; HTZ 1 1C
- dc.w $0701 ; 2 1D
- dc.w $0702 ; 3 1E
- dc.w $0703 ; 4 1F
- dc.w $0800 ; HPZ 1 20
- dc.w $0801 ; 2 21
- dc.w $0802 ; 3 22
- dc.w $0803 ; 4 23
- dc.w $0900 ; ??? 1 24
- dc.w $0901 ; 2 25
- dc.w $0902 ; 3 26
- dc.w $0903 ; 4 27
- dc.w $0A00 ; OOZ 1 28
- dc.w $0A01 ; 2 29
- dc.w $0A02 ; 3 2A
- dc.w $0A03 ; 4 2B
- dc.w $0B00 ; MCZ 1 2C
- dc.w $0B01 ; 2 2D
- dc.w $0B02 ; 3 2E
- dc.w $0B03 ; 4 2F
- dc.w $0C00 ; CNZ 1 30
- dc.w $0C01 ; 2 31
- dc.w $0C02 ; 3 32
- dc.w $0C03 ; 4 33
- dc.w $0D00 ; CPZ 1 34
- dc.w $0D01 ; 2 35
- dc.w $0D02 ; 3 36
- dc.w $0D03 ; 4 37
- dc.w $0E00 ; DEZ 1 38
- dc.w $0E01 ; 2 39
- dc.w $0E02 ; 3 3A
- dc.w $0E03 ; 4 3B
- dc.w $0F00 ; ARZ 1 3C
- dc.w $0F01 ; 2 3D
- dc.w $0F02 ; 3 3E
- dc.w $0F03 ; 4 3F
- dc.w $1000 ; SCZ 1 40
- dc.w $1001 ; 2 41
- dc.w $1002 ; 3 42
- dc.w $1003 ; 4 43
- dc.w $4000 ; special stage (44)
- dc.w $FFFF ; sound test 45
- ; ===========================================================================
- ;loc_9480:
- LevelSelect_StartZone:
- andi.w #$3FFF,d0
- move.w d0,(Current_ZoneAndAct).w
- move.b #GameModeID_Level,(Game_Mode).w ; => Level (Zone play mode)
- move.b #3,(Life_count).w
- move.b #3,(Life_count_2P).w
- moveq #0,d0
- move.w d0,(Ring_count).w
- move.l d0,(Timer).w
- move.l d0,(Score).w
- move.w d0,(Ring_count_2P).w
- move.l d0,(Timer_2P).w
- move.l d0,(Score_2P).w
- move.b d0,(Continue_count).w
- move.l #5000,(Next_Extra_life_score).w
- move.l #5000,(Next_Extra_life_score_2P).w
- move.b #MusID_FadeOut,d0
- jsrto (PlaySound).l, JmpTo_PlaySound
- moveq #0,d0
- move.w d0,(Two_player_mode_copy).w
- move.w d0,(Two_player_mode).w
- rts
- ; ===========================================================================
- ; ---------------------------------------------------------------------------
- ; Change what you're selecting in the level select
- ; ---------------------------------------------------------------------------
- ; loc_94DC:
- LevSelControls:
- move.b (Ctrl_1_Press).w,d1
- andi.b #button_up_mask|button_down_mask,d1
- bne.s + ; up/down pressed
- subq.w #1,(LevSel_HoldTimer).w
- bpl.w LevSelControls_CheckLR
- +
- move.w #$B,(LevSel_HoldTimer).w
- move.b (Ctrl_1_Held).w,d1
- andi.b #button_up_mask|button_down_mask,d1
- beq.w LevSelControls_CheckLR ; up/down not pressed, check for left & right
- move.w (Level_select_zone).w,d0 ; left or right pressed
- move.w (Level_select_zone).w,d7 ; left or right pressed
- add.w d0,d7
- add.w d7,d7
- move.w d7,d0
- moveq #0,d7
- btst #button_up,d1
- beq.s +
- add.w #2,d0
- move.b LevelSelect_SwitchTable(pc,d0.w),d0 ; set selected zone according to table
- and.w #$FF,d0
- cmpi.w #0,d0
- bge.s no_reset_up
- moveq #45,d0
- no_reset_up:
- move.w d0,(Level_select_zone).w
- rts
- + add.w #3,d0
- move.b LevelSelect_SwitchTable(pc,d0.w),d0 ; set selected zone according to table
- and.w #$FF,d0
- cmpi.w #$46,d0
- ble.s no_reset_dn
- moveq #0,d0
- no_reset_dn:
- move.w d0,(Level_select_zone).w
- rts
- ; ===========================================================================
- ; loc_958A:
- LevSelControls_SwitchSide: ; not in soundtest, not up/down pressed
- move.b (Ctrl_1_Press).w,d1
- andi.b #button_left_mask|button_right_mask,d1
- beq.s + ; no direction key pressed
- move.w (Level_select_zone).w,d0 ; left or right pressed
- move.w (Level_select_zone).w,d2 ; left or right pressed
- add.w d0,d2
- add.w d2,d2
- move.w d2,d0
- moveq #0,d2
- btst #button_left,d1
- bne.s switchtbl_left
- add.w #1,d0
- switchtbl_left:
- move.b LevelSelect_SwitchTable(pc,d0.w),d0 ; set selected zone according to table
- move.w d0,(Level_select_zone).w
- +
- rts
- ; ===========================================================================
- ;byte_95A2:
- LevelSelect_SwitchTable:
- ;<left> <right> <up> <down>
- dc.b $3, $1,$45, $4 ;EHZ 1 00
- dc.b $0, $2,$45, $5 ; 2 01
- dc.b $1, $3,$45, $6 ; 3 02
- dc.b $2, $0,$45, $7 ; 4 03
- dc.b $7, $5, $0, $8 ;??? 1 04
- dc.b $4, $6, $1, $9 ; 2 05
- dc.b $5, $7, $2, $A ; 3 06
- dc.b $6, $4, $3, $B ; 4 07
- dc.b $B, $9, $4, $C ;WZ 1 08
- dc.b $8, $A, $5, $D ; 2 09
- dc.b $9, $B, $6, $E ; 3 0A
- dc.b $A, $8, $7, $F ; 4 0B
- dc.b $F, $D, $8,$10 ;??? 1 0C
- dc.b $C, $E, $9,$11 ; 2 0D
- dc.b $D, $F, $A,$12 ; 3 0E
- dc.b $E, $C, $B,$13 ; 4 0F
- dc.b $13,$11, $C,$14 ;MTZ 1 10
- dc.b $10,$12, $D,$15 ; 2 11
- dc.b $11,$13, $E,$16 ; 3 12
- dc.b $12,$10, $F,$17 ; 4 13
- dc.b $17,$15,$10,$18 ;MTZ 3 1 14
- dc.b $14,$16,$11,$19 ; 2 15
- dc.b $15,$17,$12,$1A ; 3 16
- dc.b $16,$14,$13,$1B ; 4 17
- dc.b $1B,$19,$14,$1C ;WFZ 1 18
- dc.b $18,$1A,$15,$1D ; 2 19
- dc.b $19,$1B,$16,$1E ; 3 1A
- dc.b $1A,$18,$17,$1F ; 4 1B
- dc.b $1F,$1D,$18,$20 ;HTZ 1 1C
- dc.b $1C,$1E,$19,$21 ; 2 1D
- dc.b $1D,$1F,$1A,$22 ; 3 1E
- dc.b $1E,$1C,$1B,$23 ; 4 1F
- dc.b $23,$21,$1C,$24 ;HPZ 1 20
- dc.b $20,$22,$1D,$25 ; 2 21
- dc.b $21,$23,$1E,$26 ; 3 22
- dc.b $22,$20,$1F,$27 ; 4 23
- ; --------------------------------------------------------------
- dc.b $27,$25,$20,$28 ;??? 1 24
- dc.b $24,$26,$21,$29 ; 2 25
- dc.b $25,$27,$22,$2A ; 3 26
- dc.b $26,$24,$23,$2B ; 4 27
- dc.b $2B,$29,$24,$2C ;OOZ 1 28
- dc.b $28,$2A,$25,$2D ; 2 29
- dc.b $29,$2B,$26,$2E ; 3 2A
- dc.b $2A,$28,$27,$2F ; 4 2B
- dc.b $2F,$2D,$28,$30 ;MCZ 1 2C
- dc.b $2C,$2E,$29,$31 ; 2 2D
- dc.b $2D,$2F,$2A,$32 ; 3 2E
- dc.b $2E,$2C,$2B,$33 ; 4 2F
- dc.b $33,$31,$2C,$34 ;CNZ 1 30
- dc.b $30,$32,$2D,$35 ; 2 31
- dc.b $31,$33,$2E,$36 ; 3 32
- dc.b $32,$30,$2F,$37 ; 4 33
- dc.b $37,$35,$30,$38 ;CPZ 1 34
- dc.b $34,$36,$31,$39 ; 2 35
- dc.b $35,$37,$32,$3A ; 3 36
- dc.b $36,$34,$33,$3B ; 4 37
- dc.b $3B,$39,$34,$3C ;DEZ 1 38
- dc.b $38,$3A,$35,$3D ; 2 39
- dc.b $39,$3B,$36,$3E ; 3 3A
- dc.b $3A,$38,$37,$3F ; 4 3B
- dc.b $3F,$3D,$38,$40 ;ARZ 1 3C
- dc.b $3C,$3E,$39,$41 ; 2 3D
- dc.b $3D,$3F,$3A,$42 ; 3 3E
- dc.b $3E,$3C,$3B,$43 ; 4 3F
- dc.b $43,$41,$3C,$44 ;SCZ 1 40
- dc.b $40,$42,$3D,$44 ; 2 41
- dc.b $41,$43,$3E,$44 ; 3 42
- dc.b $42,$40,$3F,$44 ; 4 43
- dc.b $44,$44,$40,$45 ;SS 44
- ; --------------------------------------------------------------
- dc.b $45,$45,$44, $0 ;Sound Test 45
- even
- ; ===========================================================================
- ; loc_9522:
- LevSelControls_CheckLR:
- cmpi.w #$45,(Level_select_zone).w ; are we in the sound test?
- bne.w LevSelControls_SwitchSide ; no
- move.w (Sound_test_sound).w,d0
- move.b (Ctrl_1_Press).w,d1
- btst #button_left,d1
- beq.s +
- subq.b #1,d0
- bcc.s +
- moveq #$7F,d0
- +
- btst #button_right,d1
- beq.s +
- addq.b #1,d0
- cmpi.w #$80,d0
- blo.s +
- moveq #0,d0
- +
- btst #button_A,d1
- beq.s +
- addi.b #$10,d0
- andi.b #$7F,d0
- +
- move.w d0,(Sound_test_sound).w
- andi.w #button_B_mask|button_C_mask,d1
- beq.s + ; rts
- move.w (Sound_test_sound).w,d0
- addi.w #$80,d0
- jsrto (PlayMusic).l, JmpTo_PlayMusic
- lea (debug_cheat).l,a0
- lea (super_sonic_cheat).l,a2
- lea (Debug_options_flag).w,a1
- moveq #1,d2 ; flag to tell the routine to enable the Super Sonic cheat
- bsr.w CheckCheats
- +
- rts
- ;loc_95B8:
- LevelSelect_MarkFields:
- lea (Chunk_Table).l,a4
- lea (LevSel_MarkTable).l,a5
- lea (VDP_data_port).l,a6
- moveq #0,d0
- move.w (Level_select_zone).w,d0
- lsl.w #2,d0
- lea (a5,d0.w),a3
- moveq #0,d0
- move.b (a3),d0
- mulu.w #$50,d0
- moveq #0,d1
- move.b 1(a3),d1
- add.w d1,d0
- lea (a4,d0.w),a1
- moveq #0,d1
- move.b (a3),d1
- lsl.w #7,d1
- add.b 1(a3),d1
- addi.w #VRAM_Plane_A_Name_Table,d1
- lsl.l #2,d1
- lsr.w #2,d1
- ori.w #vdpComm($0000,VRAM,WRITE)>>16,d1
- swap d1
- move.l d1,4(a6)
- moveq #$D,d2
- - move.w (a1)+,d0
- add.w d3,d0
- move.w d0,(a6)
- dbf d2,-
- addq.w #2,a3
- moveq #0,d0
- move.b (a3),d0
- beq.s +
- mulu.w #$50,d0
- moveq #0,d1
- move.b 1(a3),d1
- add.w d1,d0
- lea (a4,d0.w),a1
- moveq #0,d1
- move.b (a3),d1
- lsl.w #7,d1
- add.b 1(a3),d1
- addi.w #VRAM_Plane_A_Name_Table,d1
- lsl.l #2,d1
- lsr.w #2,d1
- ori.w #vdpComm($0000,VRAM,WRITE)>>16,d1
- swap d1
- move.l d1,4(a6)
- move.w (a1)+,d0
- add.w d3,d0
- move.w d0,(a6)
- +
- cmpi.w #$45,(Level_select_zone).w
- bne.s + ; rts
- bsr.w LevelSelect_DrawSoundNumber
- +
- rts
- ; ===========================================================================
- ;loc_965A:
- LevelSelect_DrawSoundNumber:
- move.l #vdpComm(VRAM_Plane_A_Name_Table+planeLocH40(20,23),VRAM,WRITE),(VDP_control_port).l
- move.w (Sound_test_sound).w,d0
- move.b d0,d2
- lsr.b #4,d0
- bsr.s +
- move.b d2,d0
- +
- andi.w #$F,d0
- cmpi.b #$A,d0
- blo.s +
- addi.b #4,d0
- +
- addi.b #$10,d0
- add.w d3,d0
- move.w d0,(a6)
- rts
- ; ===========================================================================
- ;loc_9688:
- LevelSelect_DrawIcon:
- move.w (Level_select_zone).w,d0
- lea (LevSel_IconTable).l,a3
- lea (a3,d0.w),a3
- lea (Chunk_Table+$8C0).l,a1
- moveq #0,d0
- move.b (a3),d0
- lsl.w #3,d0
- move.w d0,d1
- add.w d0,d0
- add.w d1,d0
- lea (a1,d0.w),a1
- move.l #vdpComm(VRAM_Plane_A_Name_Table+planeLocH40(27,22),VRAM,WRITE),d0
- moveq #3,d1
- moveq #2,d2
- jsrto (PlaneMapToVRAM_H40).l, JmpTo_PlaneMapToVRAM_H40
- lea (Pal_LevelIcons).l,a1
- moveq #0,d0
- move.b (a3),d0
- lsl.w #5,d0
- lea (a1,d0.w),a1
- lea (Normal_palette_line3).w,a2
- moveq #bytesToLcnt(palette_line_size),d1
- - move.l (a1)+,(a2)+
- dbf d1,-
- rts
- ; ===========================================================================
- ;byte_96D8
- LevSel_IconTable:
- dc.b $0,$0,$0,$0 ;00 EHZ
- dc.b $D,$D,$D,$D ;01 ???
- dc.b $D,$D,$D,$D ;02 WZ
- dc.b $D,$D,$D,$D ;03 ???
- dc.b $1,$1,$1,$1 ;04 MTZ
- dc.b $1,$1,$1,$1 ;05 MTZ3
- dc.b $A,$A,$A,$A ;06 WFZ
- dc.b $2,$2,$2,$2 ;07 HTZ
- dc.b $3,$3,$3,$3 ;08 HPZ
- dc.b $D,$D,$D,$D ;09 ???
- dc.b $4,$4,$4,$4 ;0A OOZ
- dc.b $5,$5,$5,$5 ;0B MCZ
- dc.b $6,$6,$6,$6 ;0C CNZ
- dc.b $7,$7,$7,$7 ;0D CPZ
- dc.b $B,$B,$B,$B ;0E DEZ
- dc.b $8,$8,$8,$8 ;0F ARZ
- dc.b $9,$9,$9,$9 ;10 SCZ
- dc.b $C ;Special Stage
- dc.b $E ;Sound Test
- even
- ;byte_96EE:
- LevSel_MarkTable: ; 4 bytes per level select entry
- ; line primary, 2*column ($E fields), line secondary, 2*column secondary (1 field)
- dc.b 2, 2, 2, $1E ;EHZ1
- dc.b 2, 2, 2, $20 ;EHZ2
- dc.b 2, 2, 2, $22 ;EHZ3
- dc.b 2, 2, 2, $24 ;EHZ4
- dc.b 4, 2, 4, $1E ;???1
- dc.b 4, 2, 4, $20 ;???2
- dc.b 4, 2, 4, $22 ;???3
- dc.b 4, 2, 4, $24 ;???4
- dc.b 6, 2, 6, $1E ;WZ1
- dc.b 6, 2, 6, $20 ;WZ2
- dc.b 6, 2, 6, $22 ;WZ3
- dc.b 6, 2, 6, $24 ;WZ4
- dc.b 8, 2, 8, $1E ;???1
- dc.b 8, 2, 8, $20 ;???2
- dc.b 8, 2, 8, $22 ;???3
- dc.b 8, 2, 8, $24 ;???4
- dc.b $A, 2, $A, $1E ;MTZ1
- dc.b $A, 2, $A, $20 ;MTZ2
- dc.b $A, 2, $A, $22 ;MTZ3
- dc.b $A, 2, $A, $24 ;MTZ4
- dc.b $C, 2, $C, $1E ;MTZ3_1
- dc.b $C, 2, $C, $20 ;MTZ3_2
- dc.b $C, 2, $C, $22 ;MTZ3_3
- dc.b $C, 2, $C, $24 ;MTZ3_4
- dc.b $E, 2, $E, $1E ;WFZ1
- dc.b $E, 2, $E, $20 ;WFZ2
- dc.b $E, 2, $E, $22 ;WFZ3
- dc.b $E, 2, $E, $24 ;WFZ4
- dc.b $10, 2, $10, $1E ;HTZ1
- dc.b $10, 2, $10, $20 ;HTZ2
- dc.b $10, 2, $10, $22 ;HTZ3
- dc.b $10, 2, $10, $24 ;HTZ4
- dc.b $12, 2, $12, $1E ;HPZ1
- dc.b $12, 2, $12, $20 ;HPZ2
- dc.b $12, 2, $12, $22 ;HPZ3
- dc.b $12, 2, $12, $24 ;HPZ4
- dc.b 2,$28, 2, $46 ;???1
- dc.b 2,$28, 2, $48 ;???2
- dc.b 2,$28, 2, $4A ;???3
- dc.b 2,$28, 2, $4C ;???4
- dc.b 4,$28, 4, $46 ;OOZ1
- dc.b 4,$28, 4, $48 ;OOZ2
- dc.b 4,$28, 4, $4A ;OOZ3
- dc.b 4,$28, 4, $4C ;OOZ4
- dc.b 6,$28, 6, $46 ;MCZ1
- dc.b 6,$28, 6, $48 ;MCZ2
- dc.b 6,$28, 6, $4A ;MCZ3
- dc.b 6,$28, 6, $4C ;MCZ4
- dc.b 8,$28, 8, $46 ;CNZ1
- dc.b 8,$28, 8, $48 ;CNZ2
- dc.b 8,$28, 8, $4A ;CNZ3
- dc.b 8,$28, 8, $4C ;CNZ4
- dc.b $A,$28, $A, $46 ;CPZ1
- dc.b $A,$28, $A, $48 ;CPZ2
- dc.b $A,$28, $A, $4A ;CPZ3
- dc.b $A,$28, $A, $4C ;CPZ4
- dc.b $C,$28, $C, $46 ;DEZ1
- dc.b $C,$28, $C, $48 ;DEZ2
- dc.b $C,$28, $C, $4A ;DEZ3
- dc.b $C,$28, $C, $4C ;DEZ4
- dc.b $E,$28, $E, $46 ;ARZ1
- dc.b $E,$28, $E, $48 ;ARZ2
- dc.b $E,$28, $E, $4A ;ARZ3
- dc.b $E,$28, $E, $4C ;ARZ4
- dc.b $10,$28, $10, $46 ;SCZ1
- dc.b $10,$28, $10, $48 ;SCZ2
- dc.b $10,$28, $10, $4A ;SCZ3
- dc.b $10,$28, $10, $4C ;SCZ4
- dc.b $12,$28, $12, $28 ;Special Stage
- dc.b $17,$10, $17, $28 ;Sound Test
- ; ===========================================================================
- ; loc_9746:
- CheckCheats: ; This is called from 2 places: the options screen and the level select screen
- move.w (Correct_cheat_entries).w,d0 ; Get the number of correct sound IDs entered so far
- adda.w d0,a0 ; Skip to the next entry
- move.w (Sound_test_sound).w,d0 ; Get the current sound test sound
- cmp.b (a0),d0 ; Compare it to the cheat
- bne.s + ; If they're different, branch
- addq.w #1,(Correct_cheat_entries).w ; Add 1 to the number of correct entries
- tst.b 1(a0) ; Is the next entry 0?
- bne.s ++ ; If not, branch
- move.w #$101,(a1) ; Enable the cheat
- move.b #SndID_Ring,d0 ; Play the ring sound
- jsrto (PlaySound).l, JmpTo_PlaySound
- +
- move.w #0,(Correct_cheat_entries).w ; Clear the number of correct entries
- +
- move.w (Correct_cheat_entries_2).w,d0 ; Do the same procedure with the other cheat
- adda.w d0,a2
- move.w (Sound_test_sound).w,d0
- cmp.b (a2),d0
- bne.s ++
- addq.w #1,(Correct_cheat_entries_2).w
- tst.b 1(a2)
- bne.s +++ ; rts
- tst.w d2 ; Test this to determine which cheat to enable
- bne.s + ; If not 0, branch
- move.b #$1F,(Continue_count).w ; Give 31 continues
- ; The next line causes the bug where the OOZ music plays until reset.
- ; Remove "&$7F" to fix the bug.
- move.b #SndID_ContinueJingle,d0 ; Play the continue jingle
- jsrto (PlayMusic).l, JmpTo_PlayMusic
- bra.s ++
- ; ===========================================================================
- +
- move.w #7,(Got_Emerald).w ; Give 7 emeralds to the player
- move.b #MusID_Emerald,d0 ; Play the emerald jingle
- jsrto (PlayMusic).l, JmpTo_PlayMusic
- +
- move.w #0,(Correct_cheat_entries_2).w ; Clear the number of correct entries
- +
- rts
- ; ===========================================================================
- level_select_cheat: dc.b $19, $65, 9, $17, 0 ; 17th September 1965, Yuji Naka's birthdate
- rev02even
- ; byte_97B7
- continues_cheat: dc.b 1, 9, 9, 1, 6, 2, 3, 0 ; 23rd of June, 1991, Sonic1's release date
- rev02even
- debug_cheat: dc.b 1, 9, 9, 2, 1, 1, 2, 4, 0 ; 24th November 1992, Sonic 2's release date in the EU and US: "Sonic 2sday"
- rev02even
- ; byte_97C5
- super_sonic_cheat: dc.b 4, 1, 2, 6, 0 ; Book of Genesis, 41:26
- rev02even
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement