Advertisement
FireRat_Genesis

"Generic" Sega Logo

Nov 15th, 2016
522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ---------------------------------------------------------------------------
  2. ; Sega screen
  3. ; ---------------------------------------------------------------------------
  4.  
  5. GM_Sega:
  6.         sfx bgm_Fade,0,1,1          ; fade out music
  7.         bsr.w   ClearPLC
  8.         bsr.w   PaletteFadeOut
  9.         lea ($C00004).l,a6
  10.         move.w  #$8004,(a6)
  11.         move.w  #$8200+(vram_fg>>10),(a6)   ; set foreground nametable address
  12.         move.w  #$8400+(vram_bg>>13),(a6)   ; set background nametable address
  13.         move.w  #$8700,(a6)         ; set background colour (palette entry 0)
  14.         move.w  #$8B00,(a6)         ; full-screen vertical scrolling
  15.         move.w  #$8134,(a6)         ; disable display
  16.         clr.b   (f_wtr_state).w
  17.         move    #$2700,sr
  18.         bsr.w   ClearScreen
  19.         locVRAM $20
  20.         lea (Nem_SegaLogo).l,a0     ; load Sega logo patterns on tile #1
  21.         bsr.w   NemDec
  22.         lea ($FF0000).l,a1
  23.         lea (Eni_SegaLogo).l,a0     ; load Sega logo mappings
  24.         moveq   #1,d0               ; start from tile #1
  25.         bsr.w   EniDec
  26.         copyTilemap $FF0000,(vram_bg+$61E),((96/8)-1),((32/8)-1)
  27.  
  28.         tst.b   (v_megadrive).w         ; is console Japanese?
  29.         bpl.s   @jmp0               ; if yes, branch
  30.         locVRAM (vram_fg+$634),4(a6)        ; set position to write to..
  31.         move.l  #$00310032,(a6)         ; and write "TM"
  32. @jmp0:      move.w  #$EEE,v_pal_dry+$02+$80
  33.         move.w  #-2,v_pcyc_num          ; minus size of an entry
  34.         move.w  #1,(v_pcyc_time).w
  35.  
  36.         lea v_pal_dry+$04+$80,a1
  37.         bsr Palcycle_Sega
  38.         move.w  #$8174,$C00004          ; enable display
  39.         bsr.w   PaletteFadeIn
  40.         sfx sfx_Sega,0,1,1          ; play "SEGA" sound
  41.         move.w  #3*60,(v_demolength).w      ; stay for 3 seconds
  42.  
  43. Sega_WaitEnd:
  44.         move.b  #2,(v_vbla_routine).w
  45.         bsr.w   WaitForVBla
  46.         lea v_pal_dry+$04,a1
  47.         bsr Palcycle_Sega
  48.         tst.w   (v_demolength).w
  49.         beq.s   Sega_GotoTitle
  50.         andi.b  #btnStart,(v_jpadpress1).w  ; is Start button pressed?
  51.         beq.s   Sega_WaitEnd            ; if not, branch
  52.  
  53. Sega_GotoTitle:
  54.         move.b  #id_Title,(v_gamemode).w
  55.         rts
  56.  
  57. Palcycle_Sega:
  58.         subq.w  #1,v_pcyc_time
  59.         bne.s   @return
  60.         move.w  #3,v_pcyc_time
  61.         addq.w  #2,v_pcyc_num
  62.         cmpi.w  #@cycle_size,v_pcyc_num     ; past cycle's size?
  63.         bne.s   @jmp0               ; if not, branch
  64.         move.w  #0,v_pcyc_num           ; if yes, reset
  65. @jmp0:      move.w  v_pcyc_num,d0
  66.         lea @cycle(pc,d0.w),a0
  67.         rept    4               ; repeat next line 4 times      ; --> transfer 9 colors in total
  68.             move.l  (a0)+,(a1)+     ; copy 2 colors and increment pointers
  69.         endr
  70.         move.w  (a0),(a1)           ; copy last color
  71. @return:    rts
  72.  
  73. @cycle:     dc.w    $EC0
  74.         dc.w    $EA0, $E80, $E60, $E40, $E20, $E00
  75.         dc.w    $C00
  76.         dc.w    $E00, $E20, $E40, $E60, $E80, $EA0
  77. @cycle_end: ; remaining half copy before loop. Making it CPU-friendly
  78.         dc.w    $EC0
  79.         dc.w    $EA0, $E80, $E60, $E40, $E20, $E00
  80.         dc.w    $C00
  81. @cycle_size:=   @cycle_end-@cycle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement