necro wrote:damn, that is still very fast...wait...10 minute for the sprite?
Yup, I started over a few times though
gangsta wrote:can u give the source for that?
Sure, but it's not optimized at all, just a bit of code to be able to test everything:
Code: Select all
; #define NODOUBLEBUFFER
graph.clear()
ld hl,background
ld de,gbuf2
ld bc,768
ldir
ld hl,background2
ld de,gbuf1
ld bc,768
ldir
graph.output("Greyscale test")
gs.enable()
ld de,$4030
redraw:
push de
gs.drawXor(sprite,8,d,e)
gs.copyBuffer()
loop:
gs.getcsc()
cp 2
jr z,left
cp 4
jr z,up
cp 1
jr z,down
cp 3
jr z,right
cp 9 ; Enter quits
jr nz,loop
pop de
gs.disable()
ret
left:
pop de
push de
gs.drawXor(sprite,8,d,e)
pop de
dec d
jr redraw
right:
pop de
push de
gs.drawXor(sprite,8,d,e)
pop de
inc d
jr redraw
up:
pop de
push de
gs.drawXor(sprite,8,d,e)
pop de
dec e
jr redraw
down:
pop de
push de
gs.drawXor(sprite,8,d,e)
pop de
inc e
jr redraw
Jim e wrote:I'm noticing something, some code is getting reused in several routines, plus there are dependants that honestly could cause problems. Perhaps you should make a dependant section. Like section that normally the coder wouldn't use directly. Maybe just a MISC area.
Such as this, it's used a few times in my routine and could be useful routine
[...]
If it's a useful routine, you should just add it as a routine, and let all routines that need it depend on it. Anything that you don't need to be able to call seperately should be put in the gs.enable() routine, so it gets included when you enable greyscale.
Also ionrandom could be replaced be another routine just a random 256 a nd a H times E routine.
I'm gonna try add things personally but could you give me quick rundown on precisely the format.
Just take a look at the template that the website generates when you try to add a routine. If you don't understand it, feel free to ask.