0 Members and 1 Guest are viewing this topic.
Ah i didn't know Axe could only do multiples of 8. It's kinda silly since it's super easy to draw extra Y tiles, unless there's some weird trick he's using. One of my projects now has a 16x16 sprite drawing routine i've written for it. Changing one number turns it into a 16x12 sprite drawing routine It could easily be a 16 x any number routine. I don't know how to write an Axiom and it's likely what i write ends up being less optimized than what Runer wrote. Ah and i am clueless when it comes to grayscale, are you using grayscale? And really, for a tilemap, it's usually more efficient to implement the sprite drawing into the mapper itself, not keeping the x and y coordinates on the screen but rather your position in the buffer, that way you don't have to recalculate your position in the buffer each time you go to draw a tile.And squidgetx, unpacking the sprites would take the same space in RAM, but it would save space in your program. And it wouldn't even take up the user's RAM, just saferam. And you wouldn't have to have every map's set of sprites unpacked at the same time, just your current set. It might not be worth the trouble, but it'd save you 6 bytes (or 8, if you're using 16x16 sprites) per sprite.@DJ: I think 16x16 is generally faster since you don't have to do as many calculations (it's faster to draw one 16x16 sprite than it is to draw 4 8x8 sprites)
47 - - - ld b,a 0E 10 - - ld c,16 - - - - - - - - drawPlayerLoop: C5 - - - push bc DD 56 00 - ld d,(ix) ;sprite DD 5E 01 - ld e,(ix+1) AF - - - xor a B8 - - - cp b CA 71 A0 - jp z,skipSpriteClip CB 3A CB 1B F9 srl d \ rr e \ rra \ djnz $-5 ;rotate sprite - - - - skipSpriteClip: B6 - - - or (hl) 77 - - - ld (hl),a 2B - - - dec hl 7E - - - ld a,(hl) B3 - - - or e 77 - - - ld (hl),a 2B - - - dec hl 7E - - - ld a,(hl) B2 - - - or d 77 - - - ld (hl),a DD 23 - - inc ix DD 23 - - inc ix 11 0E 00 - ld de,14 19 - - - add hl,de C1 - - - pop bc 0D - - - dec c C2 5E A0 - jp nz, drawPlayerLoop C9 - - - ret
26 00 - - ld h,054 - - - ld d,h6B - - - ld l,e ;hl=de29 - - - add hl, hl ; 219 - - - add hl, de ; 329 - - - add hl, hl ; 629 - - - add hl, hl ; 12 - - - - - - - - ; x / 878 - - - ld a,bCB 38 - - srl bCB 38 - - srl bCB 38 - - srl b58 - - - ld e,b19 - - - add hl,de ; A present on a le decalage dans hl11 42 93 - ld de,gbuf+2 ; Prendre le debut du graphbuffer19 - - - add hl,de ; Puis ajouter le decalageE6 07 - - and $07
//Subroutine takes arguments in sub args, at $83A5, in the form X,Y,Buffer,Spriteaddress(Axe code):r2*12+r1+r3+2->r3r1^16->r2r3->r1r4(Immediately proceeded by asm code):E5DDE1 push hl / pop ix ;(move r4, the sprite pointer to ix)2AA783 ld hl, ($83A7) ;(load r2, the offset, into hl)45 ld b, l ;(load into b)2AA583 ld hl, ($83A5) ;(load the draw location to hl) 0E 0C - - ld c,12 - - - - - - - - drawPlayerLoop: C5 - - - push bc DD 56 00 - ld d,(ix) ;sprite DD 5E 01 - ld e,(ix+1) AF - - - xor a B8 - - - cp b CA 71 A0 - jp z,skipSpriteClip CB 3A CB 1B F9 srl d \ rr e \ rra \ djnz $-5 ;rotate sprite - - - - skipSpriteClip: B6 - - - or (hl) 77 - - - ld (hl),a 2B - - - dec hl 7E - - - ld a,(hl) B3 - - - or e 77 - - - ld (hl),a 2B - - - dec hl 7E - - - ld a,(hl) B2 - - - or d 77 - - - ld (hl),a DD 23 - - inc ix DD 23 - - inc ix 11 0E 00 - ld de,14 19 - - - add hl,de C1 - - - pop bc 0D - - - dec c C2 5E A0 - jp nz, drawPlayerLoop C9 - - - ret
16x16 is the same speed as 12x12, it's just that the bits on the edges are kind of wasted space and time. Axe can only draw sprites in multiples of 8, so 16 would be the natural choice when working with 12x12 tiles.