Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ============================================================================================
- ; Sega Screen example
- ; 2014, Hitaxas
- ; ============================================================================================
- Hitaxas_splashScreen: ;Stop previous music, clear vram and screen to set up this new screen
- moveq #$FD,d0 ; set music ID to stop
- jsr (PlayMusic).w ; play music ID
- jsr (Pal_FadeFrom).w ; fade palette out
- move #$2700,sr ; disable interrupts
- move.w ($FFFFF60C).w,d0 ; load VDP register 81XX data
- andi.b #%10111111,d0 ; set display to "disable"
- move.w d0,(VDP_control_port).l ; save to VDP
- jsr (ClearPLC).w ; clear pattern load cues
- jsr (ClearScreen).w ; clear VRAM planes, sprite buffer and scroll buffer
- lea (Metablock_Table).l,a1 ; load dump location
- lea (MAPS_SEGA).l,a0 ; load compressed mappings address
- move.w #$2000|($2800/$20),d0 ; prepare pattern index value to patch to mappings
- jsr (EniDec).w ; decompress and dump
- move.l #$60000003,d0 ; prepare VRAM write mode address (Plane B E000)
- moveq #$28-$01,d1 ; set map box draw width
- moveq #$1E-$01,d2 ; set map box draw height
- jsr ShowVDPGraphics ; flush mappings to VRAM in a square like manner
- lea (VDP_control_port).l,a6 ; load VDP control port
- move.l #$68000000,(a6) ; set VDP to VRAM write mode (Address 2800)
- lea (ART_SEGA).l,a0 ; load compressed art address
- jsr (NemDec).w ; decompress and dump to VDP memory
- lea (Pal_SEGANew).l,a0 ; load palette address
- lea (Second_palette_line2).w,a1 ; load palette buffer address
- moveq #$0E,d0 ; set repeat times
- Hitaxas_splashScreen_PalLoop:
- move.l (a0)+,(a1)+ ; copy colours to buffer
- move.l (a0)+,(a1)+ ; ''
- dbf d0,Hitaxas_splashScreen_PalLoop ; repeat until done
- move.w ($FFFFF60C).w,d0 ; load VDP register 81XX data
- ori.b #%01000000,d0 ; set display to "enable"
- move.w d0,(a6) ; save to VDP
- jsr Pal_FadeTo ; fade palette in
- move.w #3*60,(Demo_Time_left).w ; set delay time (3 seconds on a 60hz system)
- Hitaxas_splashMainLoop:
- move.b #$02,(Delay_Time).w ; set V-blank routine to run
- jsr (DelayProgram).w ; wait for V-blank (decreases "Demo_Time_left")
- tst.b ($FFFFF605).w ; has player 1 pressed start button?
- bmi.s Hitaxas_splashGotoTitle ; if so, branch
- tst.w (Demo_Time_left).w ; has the delay time finished?
- bne.s Hitaxas_splashMainLoop ; if not, branch
- Hitaxas_splashGotoTitle:
- move.b #$04,(Game_Mode).w ; set the screen mode to Title Screen
- rts ; return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement