[A83] Fw: GrBufCpy
[Prev][Next][Index][Thread]
[A83] Fw: GrBufCpy
> GrBufCpy copies the 768 bytes from plotSScreen, the graph backup =
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 =
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:=20
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: