/*---------------------------------------------------------------------- * File Name: dvdp.s * * Copyright (c) 1994 Sega of America, Inc. All Rights Reserved. * * Author(s): Jonathan Flamm * Date: 5-10-94 * Description: Mars vdp library routines direct mode * * History: * *---------------------------------------------------------------------*/ .include "mars.equ" /*-------------------------------------------------------------------- * _clear: clear frame buffer bitmap mode * * void clear( ) *-------------------------------------------------------------------*/ .align 4 .globl _clear _clear: mov.l @(l_BM_PIXELS,pc),r1 mov #0, r0 mov.l @(l_framebuffer,pc),r2 _clloop: dt r1 mov.l r0, @r2 nop nop nop nop nop nop nop nop nop nop nop nop bf.s _clloop add #4, r2 rts nop /*-------------------------------------------------------------------- * _clear: clear frame buffer bitmap mode * auto fill mode * * void clear( ) *-------------------------------------------------------------------*/ .align 4 .globl _clearf _clearf: mov.l @(l_0x100, pc), r2 ! line offset = 0x100 mov r2, r3 ! page size = 0x100 mov r2, r4 ! num pages = 0x100 add #-1, r4 ! skip line start table shlr r4 mov.l @(l_vdpreg, pc), r1 ! load to access vdp registers _clfloop: mov r2, r0 mov.w r0, @(fillstart,r1) mov r3, r0 add #-1, r0 mov.b r0, @(filllength,r1) mov #0, r0 ! fill length and data mov.w r0, @(filldata,r1) ! data write triggers fill _clfENwait: mov.b @(framectl,r1), r0 ! wait for fill to complete tst #2, r0 ! when FEN bit = 0 bf _clfENwait dt r4 bf.s _clfloop add r3, r2 ! increment fb pointer rts nop /*-------------------------------------------------------------------- * Literal Pool *-------------------------------------------------------------------*/ .align 4 l_vdpreg: .long _vdpreg l_framebuffer: .long _framebuffer + 0x200 l_BM_PIXELS: .long 0x4600 l_0x100: .long 0x100