Re: A86: Screen Offset Routine
[Prev][Next][Index][Thread]
Re: A86: Screen Offset Routine
In a message dated 4/1/99 9:27:32 PM Eastern Standard Time,
ziggy2282@juno.com writes:
> How can you write a routine to "shake" the screen, by changing the
> offset? I'm trying to make it so that this box I have defined around the
> edges of the screen appears to shake up and down. I did not define the
> very bottom pixel row and the busy indicator row, to allow for this. So,
> how do I shift the box to the lower row then back up, to make it look
> like the screen shakes. I've seen this effect on FFX4 for the 82/83.
> Thanx,
to move down, do this:
move_down:
ld hl,$ffff-16 ;one row up
ld de,$ffff ;bottom row
ld bc,1024-16 ;all but one row
lddr
ret
to move up, do this:
move_up:
ld hl,$fc00+16
ld de,$fc00
ld bc,1024-16
ldir
ret
if you want to "shake" the screen, just run a loop alternating both routines:
shake_screen:
ld b,100 ;do it 100 times (just an example number)
shake_loop:
push bc
call move_down
call delay
call move_up
call delay
pop bc
djnz shake_loop
ret
;added for visibility. may be unnecessary
delay:
ld b,255
delay_loop:
nop
nop
djnz delay_loop
Follow-Ups: