Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pal_registers equ $ffff8240
- *******************************************************************************
- *
- * Total Recall FX Picture
- *
- *******************************************************************************
- clr.l -(a7)
- move.w #32,-(a7)
- trap #1
- addq.l #6,a7
- move.l d0,old_stack
- movem.l pal_registers,d0-d7
- movem.l d0-d7,old_palette
- bsr initialise ;standard init file
- *******************************************************************************
- *
- * Setup the 2 buffers both and blank and picture onto 256 boundaries
- * and copy them
- *
- *******************************************************************************
- ;copy the pi1 to a 256 boundary
- movem.l sunset+2,d0-d7 copy palette from pic, jmp res
- movem.l d0-d7,pal_registers and put into pal regs
- move.l #buffer,d0 move the location of buffer into d0
- add.l #256,d0 add 256
- clr.b d0 and clear byte to set on 256 boundary
- move.l d0,display display now on 256 boundary
- move.l display,a1 set a1 to display location
- move.l a1,d1 and put the disp loc in d1
- move.l #sunset+34,a3 set a3 to the start of actual pic data (jump res and pal)
- move.l #7999,d0 move 7999 or 32000 bytes into d0
- copy_buffer:
- move.l (a3)+,(a1)+ copy the picture(a3) into the 256 set new position (a1)
- dbra d0,copy_buffer until d0=-1
- **************************************************************************************************
- ;and do the second, effectively creating a blank space on a 256 boundary
- movem.l clear_regs,d0-d7 quick clear registers
- move.l #buffer2,d0 move start of buff2 into d0
- add.l #256,d0
- clr.b d0
- move.l d0,display2 standard set onto 256 boundary (non-STE)
- *******************************************************************************************************
- *
- * Initial values before looping
- *
- *******************************************************************************************************
- move.l display2,d1 display 2 is blank
- move.l display,d0 move the pointer (d0) to END of picture minus 160bytes
- add.l #32000-160,d0 by adding 32000-160 to d0
- move.l d0,a1 move the end of picture pointer(d0) into a1
- move.l display2,a3 move the blank screen (display2) into a3
- clr.l d7
- clr.l d5
- move.l #40-1,d7 move 40longs into d7 -1 cos dbf/dbra counts to -1 not zero
- move.l #200-1,d6 move startscanline (200) into d6
- move.l #200-1,d4 this is required to set d6 after each scanline run - constant
- *******************************************************************************
- *
- * display the "blank space" onto the video display
- * Which will be updated everytime a3 is changed
- *
- *******************************************************************************
- bsr disp_it run the base low/med positions by lsr #8
- move.l display2,a4 a2/a4 contain unmoved positions to reset
- move.l display,a2 data from changed addresses a1/a3
- *******************************************************************************
- *
- * Display the picture using scanlines
- *
- * Below are initial values of DATA and ADDRESS Registers
- *
- *******************************************************************************
- ;a1 = contains start of picture + 31840 (Variable) - display
- ;a2 = original start of picture (Constant) - display
- ;a3 = the start of the video address that will be changed (Variable) - display2
- ;a4 = the start of the video address (Constant) - display 2
- ;d0 = 31840
- ;d1 = display2
- ;d2 = unused
- ;d3 = unused
- ;d4 = 199 Constant
- ;d5 = number of scanlines to move up and draw from Variable
- ;d6 = test whethr the whole picture has been drawn, does d6=0 (Number of scanlines left)
- ;d7 = 40 longwords for copying one scanline
- ***************************************************************************************************
- test_picture_drawn:
- test_whole_scanline:
- copy_scanline:
- move.l (a1)+,(a3)+ ;move the scanline at a1 into the video display at a3
- dbra d7,copy_scanline
- *----------------------------------cut and change for dbra------------------------------------------------------*
- ;subq.b #1,d7 ;subtract 1 from d7 (40) for each longword
- ;tst.b d7 ;test for zero?
- ;bne copy_scanline ;if not done one scanline then repeat
- *----------------------------------------------------------------------------------------*
- move.l d0,a1 ;move end display back into a1
- move.l #40,d7 ;explicit move on 40 into d7 to reset "scanlines done" number
- dbf d6,test_whole_scanline ;has the whole scanline been done?
- ** redraw wait vbl routine needed **
- move.l a2,d0
- add.l #31840,d0
- addi.w #160,d5 ;add 160 to the amount we are going to subtract from the last picture position
- sub.l d5,d0 ;<--- ;then subtract how many scanlines we've already done
- move.l d0,a1 ;<--- ;and move this into the picture start pos 31840-d0
- move.l a4,a3 ;reset pointers
- move.l d4,d6 ;move 200 into d6
- dbra d4,test_picture_drawn ;has the whole picture been copied?
- ;bsr sndh_init
- *******************************************************************************
- *
- * Main loop rountine
- *
- *******************************************************************************
- main_rout
- ;bsr v_sync
- ;bsr sndh_play
- cmpi.b #$39,$fffffc02 ;standard compare spacebar #$39
- bne main_rout ;and loop it until
- *******************************************************************************
- *
- * Restore everything back to normal
- *
- *******************************************************************************
- ;bsr sndh_exit
- bsr restore
- movem.l old_palette,d0-d7
- movem.l d0-d7,pal_registers
- move.l old_stack,-(a7)
- move.w #32,-(a7)
- trap #1
- addq.l #6,a7
- clr.l -(a7)
- trap #1
- *******************************************************************************
- *
- * Display the screen
- *
- *******************************************************************************
- disp_it:
- movem.l d0-d7/a0-a6,-(sp) ;save regs
- ;the following routine destroys nearly everything
- clr.b $ffff820d.w ;clear ste extra bit
- lsr.l #8,d1
- move.b d1,$ffff8203.w
- lsr.w #8,d1
- move.b d1,$ffff8201.w
- movem.l (sp)+,d0-d7/a0-a6 ;restore old regs
- rts
- *******************************************************************************
- *
- * SNDH Routine
- *
- *******************************************************************************
- sndh_init:
- movem.l d0-a6,-(sp)
- move.w #5,d0
- ;move.w #50,d7
- bsr.w player
- movem.l (sp)+,d0-a6
- rts
- sndh_exit:
- movem.l d0-a6,-(sp)
- bsr.w player+4
- movem.l (sp)+,d0-a6
- rts
- sndh_play:
- bsr player+8
- bsr player+8
- bsr player+8
- bsr player+8
- rts
- *******************************************************************************
- *
- * DATA and BSS
- *
- *******************************************************************************
- data
- include 'b:\init.s'
- even
- sunset: incbin 'B:\data\sunset3.pi1'
- player: incbin 'B:\data\dachip.snd'
- even
- bss
- buffer: ds.b 32000
- ds.b 256
- buffer2: ds.b 32000
- ds.b 256
- old_stack: ds.l 1
- old_palette: ds.l 8
- display ds.l 1
- display2 ds.l 1
- clear_regs: ds.l 8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement