CODE |
ec1;--- Copy the gbuf to the screen and clear graph buffer (fast) ;Input: nothing ;Output:graph buffer is copied to the screen and subsequently cleared fastCopy: di ld a,$80 out ($10),a ld hl,gbuf-12-(-54125+(12*64)+1) ld a,$20 ld c,a inc hl dec hl fastCopyAgain: ld b,64 inc c ld de,-(12*64)+1 out ($10),a add hl,de ld de,11 fastCopyLoop: add hl,de inc hl inc de ld a,(hl) ld (hl),0 Post by: bfr on April 06, 2007, 10:15:00 am EDIT: Liazon, are you sure that routine works? The assembler won't assemble the "gbuf-12-(-54125+(12*64)+1)" part, but it does when I replace gbuf with plotsscreen. But, when I do that, it seems to clear the buffer and then copy the cleared data to the screen. o.o Which seems pretty pointless. Any ideas? I'm using Brass with Latenite, in case that helps. Post by: Liazon on April 09, 2007, 09:50:00 am the concept is pretty simple. replace a inc hl for ld (hl),0 so that you can load 0 into the buffer area you're readinf from AFTER you've loaded it into a and before outing it. Since you have 1 less inc hl and the row has 12 bytes, you need to ld de,11 so you can add 11 + inc hl = +12 within the loop. maybe you can post more of your code and we can help out? Post by: Netham45 on April 10, 2007, 02:33:00 am Post by: Halifax on April 10, 2007, 10:18:00 am Just to show proof that the routine works I have written a little sample. It writes 64 bytes to plotsscreen and then calls the routine that Liazon posted. Then it calls a getkey and after a key is pressed it calls ionfastcopy which updates plotsscreen showing that it is blank. |