[A83] Re: Fw: GrBufCpy
[Prev][Next][Index][Thread]
[A83] Re: Fw: GrBufCpy
I compiled this code...exactly as shown (in ZDS), and I ran it using the
flash debugger. It appeared to do what I think you want it to do. 12
different columns rose up from the bottom of the screen but only the
bottom moved after that. I do have a question though...How do you have
"hlminus12" without a call? I never did that before.
fire: ld e,10101101b ;seed
ld a,0FFh
ld (frame),a ;n
frameloop:
ld b,12 ;x
ld c,63 ;y
ld hl,plotSScreen
inc hl
filter:
ld a,(hl)
call hlplus12
add (hl)
srl a
call hlminus12
cp 0
jr z,firez
dec a
firez: ld (hl),a
inc hl
djnz filter
ld b,12
dec c
jr nz,filter
ld b,12
fire_loop:
ld a,e
ld d,e
firelupp:add e
add e
;dec d
;jr nz,firelupp
inc a
ld e,a
ld (hl),a
inc hl
dec b
jr nz,fire_loop ;x slut?
B_CALL GrBufCpy
ld a,(frame)
dec a
ld (frame),a
cp 0
jr nz,frameloop
ret
hlplus12:
ld de,12
add hl,de
ret
hlminus12:
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
dec hl
ret
frame: db 0,0,0
Thomas Lutz
Steven I.T.
-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org] On Behalf Of Jens
Bj=F6rnhager
Sent: Friday, December 14, 2001 7:06 AM
To: assembly-83@lists.ticalc.org
Subject: [A83] Fw: GrBufCpy
> GrBufCpy copies the 768 bytes from plotSScreen, the graph backup =3D
buffer,
> to the display.
Yes, that's why I'm using it.. :)
> I'm not sure what the problem with your program is, but
> it could be that GrBufCpy destroys all registers, so make sure to
> push/pop appropriately, or disable interrupts and swap with the shadow
> registers.
No, I don't have any registers worth saving when calling GrBufCpy.
And the routine works as it should.
> Alternatively, go to Home Depot and purchase a large sledgehammer.
Yes, this is very frustrating.. :P
If anyone can make out anything of it, here is the routine that screws =
=3D
up
the following routines. Think of this as a demo, where this is one in a
series of effects. This one was supposed to be a kind of fire effect:
fire: ld e,10101101b ;seed
ld a,0FFh
ld (frame),a ;n
frameloop:=3D20
ld b,12 ;x
ld c,63 ;y
ld hl,plotSScreen
inc hl
filter:
ld a,(hl)
hlplus12
add (hl)
srl a
hlminus12
cp 0
jr z,firez
dec a
firez: ld (hl),a
inc hl
djnz filter
ld b,12
dec c
jr nz,filter
ld b,12
fire_loop:
ld a,e
ld d,e
firelupp:add e
add e
;dec d
;jr nz,firelupp
inc a
ld e,a
ld (hl),a
inc hl
dec b
jr nz,fire_loop ;x slut?
B_CALL GrBufCpy
ld a,(frame)
dec a
ld (frame),a
cp 0
jr nz,frameloop
ret
In a nutshell:
I have isolated the problem to appear after a B_CALL GrBufCpy.
This routine messes up the display for routines to come.
This must mean that B_CALL GrBufCpy messes up the
display for routines to come. The display just doesn't behave
like it should after the call. After the call it seems like I just can
write to the first byte-column of the screen. If you don't understand
my problem after this, I can make two 8xp files, one with this routine
and one without so that you can see what the difference is.
I just have no idea what is happening..
/Jens
Follow-Ups:
References: