Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ---------------------------------------------------------------------------
- ; Sega screen
- ; ---------------------------------------------------------------------------
- GM_Sega:
- sfx bgm_Fade,0,1,1 ; fade out music
- bsr.w ClearPLC
- bsr.w PaletteFadeOut
- lea ($C00004).l,a6
- move.w #$8004,(a6)
- move.w #$8200+(vram_fg>>10),(a6) ; set foreground nametable address
- move.w #$8400+(vram_bg>>13),(a6) ; set background nametable address
- move.w #$8700,(a6) ; set background colour (palette entry 0)
- move.w #$8B00,(a6) ; full-screen vertical scrolling
- move.w #$8134,(a6) ; disable display
- clr.b (f_wtr_state).w
- move #$2700,sr
- bsr.w ClearScreen
- locVRAM $20
- lea (Nem_SegaLogo).l,a0 ; load Sega logo patterns on tile #1
- bsr.w NemDec
- lea ($FF0000).l,a1
- lea (Eni_SegaLogo).l,a0 ; load Sega logo mappings
- moveq #1,d0 ; start from tile #1
- bsr.w EniDec
- copyTilemap $FF0000,(vram_bg+$61E),((96/8)-1),((32/8)-1)
- tst.b (v_megadrive).w ; is console Japanese?
- bpl.s @jmp0 ; if yes, branch
- locVRAM (vram_fg+$634),4(a6) ; set position to write to..
- move.l #$00310032,(a6) ; and write "TM"
- @jmp0: move.w #$EEE,v_pal_dry+$02+$80
- move.w #-2,v_pcyc_num ; minus size of an entry
- move.w #1,(v_pcyc_time).w
- lea v_pal_dry+$04+$80,a1
- bsr Palcycle_Sega
- move.w #$8174,$C00004 ; enable display
- bsr.w PaletteFadeIn
- sfx sfx_Sega,0,1,1 ; play "SEGA" sound
- move.w #3*60,(v_demolength).w ; stay for 3 seconds
- Sega_WaitEnd:
- move.b #2,(v_vbla_routine).w
- bsr.w WaitForVBla
- lea v_pal_dry+$04,a1
- bsr Palcycle_Sega
- tst.w (v_demolength).w
- beq.s Sega_GotoTitle
- andi.b #btnStart,(v_jpadpress1).w ; is Start button pressed?
- beq.s Sega_WaitEnd ; if not, branch
- Sega_GotoTitle:
- move.b #id_Title,(v_gamemode).w
- rts
- Palcycle_Sega:
- subq.w #1,v_pcyc_time
- bne.s @return
- move.w #3,v_pcyc_time
- addq.w #2,v_pcyc_num
- cmpi.w #@cycle_size,v_pcyc_num ; past cycle's size?
- bne.s @jmp0 ; if not, branch
- move.w #0,v_pcyc_num ; if yes, reset
- @jmp0: move.w v_pcyc_num,d0
- lea @cycle(pc,d0.w),a0
- rept 4 ; repeat next line 4 times ; --> transfer 9 colors in total
- move.l (a0)+,(a1)+ ; copy 2 colors and increment pointers
- endr
- move.w (a0),(a1) ; copy last color
- @return: rts
- @cycle: dc.w $EC0
- dc.w $EA0, $E80, $E60, $E40, $E20, $E00
- dc.w $C00
- dc.w $E00, $E20, $E40, $E60, $E80, $EA0
- @cycle_end: ; remaining half copy before loop. Making it CPU-friendly
- dc.w $EC0
- dc.w $EA0, $E80, $E60, $E40, $E20, $E00
- dc.w $C00
- @cycle_size:= @cycle_end-@cycle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement