05-16-2013, 09:01 PM
scrolling 8 lines:
why does it wrap around? thats like a bit shift affecting the byte next to it?!?!
Code:
function FASTCALL drawthis() as ubyte
asm
LD HL,2000
LD (delayiter),HL
LD HL,16384
drawvert:
LD A,31
LD L,A
LD (screenwidthiter),A
drawblokes:
LD A,(graphic)
DEC A
LD (graphic),A
LD (HL),A
LD BC,(delayiter)
wait1:
dec BC
ld a,B
or C
jr nz, wait1
LD A,(screenwidthiter)
LD L,A
DEC A
LD (screenwidthiter),A
LD B,A
INC B
INC B
INC B
djnz drawblokes
LD A,(screenheightiter)
LD L,A
INC H
DEC A
LD (screenheightiter),A
LD B,A
INC B
djnz drawvert
LD A,31
LD (screenwidthiter),A
LD A,7
LD (screenheightiter),A
LD HL,60000
LD (delayiter),HL
LD HL,16384
LD (screenaddress),HL
screenvert:
LD A,31
LD L,A
LD (screenwidthiter),A
screenhori:
;shift graphic
LD A,(HL)
RLA
LD (HL),A
LD A,(screenwidthiter)
LD L,A
DEC A
LD (screenwidthiter),A
LD B,A
INC B
INC B
INC B
djnz screenhori
LD A,(screenheightiter)
INC H
DEC A
LD (screenheightiter),A
LD B,A
INC B
INC B
djnz screenvert
DEC H
DEC H
DEC H
DEC H
DEC H
DEC H
DEC H
DEC H
LD A,7
LD (screenheightiter),A
jp screenvert
end asm
end function
drawthis()
Print "done"
STOP
ASM
blockiter:
defw 8
delayiter:
defw 60000
screenwidthiter:
defb 31
screenheightiter:
defb 8
scrolliter:
defw 10000
graphic:
defb 255
screenaddress:
defw 0
end asm
why does it wrap around? thats like a bit shift affecting the byte next to it?!?!