Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Screen handling
#2
nice, i got 11 secs for zxbasic and 7 secs for your function

I cant seem to get any colour of dots except black

Code:
SUB plotPoint (x as uByte, y as uByte)
ASM
ld d,(IX+5) ;'X
ld e,(IX+7) ;'Y

    ld a, 191
   sub e  
   ret c  
   ld e, a  
   and a  
  
    rra      
   scf      
   rra      
   and a  
   rra      
   xor e        
   and 248
   xor e
   ld h, a
   ld a, d
   rlca
   rlca
   rlca
   xor e
   and 199
   xor e
   rlca
   rlca
   ld l, a
  
    ld a, d
   and 7
   ld b, a
   inc b
   ld a, 1
  
    plotPoint_loop:
        rrca
   djnz plotPoint_loop  
   ;cpl
    ld b, a  
   ld a, (hl)
   or b  
   ld (hl), a
  
END ASM
END SUB

FUNCTION t() as uLong
asm
    DI
    LD DE,(23674)
    LD D,0
    LD HL,(23672)
    EI
end asm
end function


dim time0, time1, time2 as long
dim n as uInteger

cls

for n=1 to 150
plotPoint(n,n-1)
plot n,n+3
next n



time0=t()

Paper 5
INK 2
for n=0 to 191
for y=0 to 191

plotPoint(n,y)
next y
next n
time1=t()


Paper 3
INK 4
for n=0 to 191
for y=0 to 191
plot y,n
next y
next n
time2=t()

print "plotpoint 50,000 plot:"
print time1-time0;"frames =";(time1-time0)/cast(float,50);" seconds"
print
print "zxbasic 50,000 times:"
print time2-time1;"frames=";(time2-time1)/cast(float,50);" seconds"

On the second pass only the green paper shows up
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)