0 Members and 1 Guest are viewing this topic.
turnTheEntireOp1ToADecimalStringRegardlessOfSignificateFigures: ld hl, op1+2 ld c, 7outerLoop: ld b, 2innerLoop: ld a, $30 rld ld (de), a inc de djnz innerLoop inc hl dec c jr nz, outerLoop xor a ld (de), a ret
I'm glad there are actually uses for that command. I like the idea of manipulating nibbles, but I don't like the fact that it modifies the source data. Can you use it on ROM code without any problems?
turnTheEntireOp1ToADecimalStringRegardlessOfSignificateFigures: ld hl, op1+2 ld b, 7 ld a, $30loop: rld ld (de), a inc de rld ld (de), a inc de inc hl djnz loop xor a ld (de), a ret
turnTheEntireOp1ToADecimalStringRegardlessOfSignificateFigures: ld hl, op1+2 ld bc, 7loop: ld a, $33 rrd ldi ld (de), a inc de jp pe, loop xor a ld (de), a ret
rrd/rld the two nibbles from (hl) and the last nibble of 'a' make three nibbles. rrd rotates them right and rld rotates them left.
;Inputs:; HL points to the buffer location to draw to; DE points to the sprite data ld bc,080Ch ;010C08Loop: call PutNibble ;CD**** call PutNibble ;CD**** ld a,b ;78 ld b,0 ;0600 add hl,bc ;09 ld b,a ;47 djnz Loop ;10F3 ret ;C9PutNibble: ld a,(de) ;1A add $C0 ;C6C0 jr nc,$+4 ;3002 sub 7 ;D607 rld ;ED6F inc de ;13 ret ;C9
ShiftLeft4: ld hl,GraphBuf+767 ld c,64 xor a ld b,12 rld dec hl djnz $-3 dec c jr nz,$-9 ret
ShiftRight4: ld hl,GraphBuf ld c,64 xor a ld b,12 rrd inc hl djnz $-3 dec c jr nz,$-9 ret
Unless i'm missing something, the first just says "Array", maybe you pasted the wrong thing?
Quote from: chickendude on December 31, 2011, 05:32:36 amUnless i'm missing something, the first just says "Array", maybe you pasted the wrong thing?I am not seeing that... On mine, Hayleia and I have the same thing...
;hl = Nth nibble after address $8000;e = Nibble to store thereNibSto: scf rr h rr l jr nc,__NibStoHigh rrd ld a,e rld ret__NibStoHigh: rld ld a,e rrd ret__NibStoEnd: