0 Members and 1 Guest are viewing this topic.
.nolist#include "ti83plus.inc".list.org $9D95#define var_r1 $83A5 ;Sprite column (0-11)#define var_r2 $83A7 ;Sprite row (0-7)#define var_r3 $83A9 ;Pointer to 8x8 grayscale sprite data#define var_r4 $83AB ;Pointer to front buffer#define var_r5 $83AD ;Pointer to back buffer .dw $C0DE ;Header .db $FF ;Shells .db tPlot2,0 ;Token .db 0 ;Replacement Type .db 0 ;Arguments .db 56 ;Size;Calculate byte offset ld a,(var_r2) ;[13] Sprite row (0-7) -> Multiply by 96 for byte offset (0-672) add a,a ;[4] *2 add a,a ;[4] *4 add a,a ;[4] *8 add a,a ;[4] *16 add a,a ;[4] *32 (0-224) ld h,0 ;[7] Move to hl to avoid overflow ld l,a ;[4] ld d,h ;[4] Copy hl to de to prepare for *3 ld e,l ;[4] add hl,de ;[11] add hl,de ;[11] *96 (0-672) ld a,(var_r1) ;[13] Sprite column (0-11) add a,l ;[4] Add to byte offset (will not overflow, l mod 32 = 0) ld e,a ;[4] Move result to de ld d,h ;[4] ld hl,(var_r5) ;[16] Back buffer pointer add hl,de ;[11] +offset push hl ;[11] Save for later;Prepare to copy sprite to buffers ld hl,(var_r4) ;[16] Front buffer pointer add hl,de ;[11] +offset ld ix,(var_r3) ;[20] Sprite data ld de,12 ;[10] Row increment ld c,2 ;[7] Buffer counterputSpriteLoop1: ld b,8 ;[7] Row counterputSpriteLoop2: ld a,(ix) ;[19] Copy a byte from the sprite to the buffer ld (hl),a ;[7] inc ix ;[10] Move forward 1 byte in sprite add hl,de ;[11] Move forward 12 bytes in buffer djnz putSpriteLoop2 ;[13/8] Repeat for 8 rows dec c ;[4] Decrease buffer counter jr z,end ;[12/7] End if done with both buffers pop hl ;[11] Retrieve back buffer pointer+offset jr putSpriteLoop1 ;[10] Repeat for second bufferend:.end
ld iy,(var_r5) ;[20] Back buffer pointer add iy,de ;[15] +offset; de will be destroyed, so saving result in iy for later... .db $FD ;[4] Load second buffer pointer+offset back into hl from iy ld d,h ;[4] Undocumented: ld h,iyh .db $FD ;[4] ld e,l ;[4] Undocumented: ld l,iyl ex de,hl ;[4]
ld hl,(var_r5) ;[16] Back buffer pointer add hl,de ;[11] +offset; de will be destroyed, so saving result on stack for later push hl ;[11]... pop hl ;[10] Pop second buffer pointer+offset back into hl from stack
They were disabled is for 2 reasons.First of all, I wasn't sure if they still worked or not after mixing subroutines and data because I didn't do any testing with them after making this change. But it sounds like they probably do work so I guess it's just lucky that it still functions without having debugged. There might be other problems still with subroutines, token names, compatibility options, or at least some combination probably still doesn't work.The other issue is that I am completely changing the axiom capability with "acalls". The acalls are similar to bcalls except they call axe routines instead of OS routines. They're basically just jumps whose label gets automatically replaced by the parser with the label of the axe routine in the program, inserting the routine into the program if it doesn't already exist. Works with all conditionals of jumps and calls too. Another new feature is adding options for the r modifier or double rr modifier to be used with axioms. There is also a new form for implicit storing where you can store to the function itself like how ->nib{} would work for example. With all these changes, the code was completely under construction so rather than commenting it out and replacing it with the old code, I decided to just keep it there but have it disabled until I actually finish it.
HoMM: [==--------] Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :PtiDE: [----------] Explored and understood the main part of the code: just started writing a Tokenizer.
It looks like Axioms do in fact work! My routine works without crashing my calculator, and almost does exactly what I wanted it to! The only problem is that it seems to be ignoring the sprite row input and draws all sprites to the second sprite row (row 16 of the display). Anybody see a problem in my code that might be causing this?EDIT: It completely works now! Although I realize this is a very specific routine, if you're drawing 8x8 aligned grayscale sprites, this routine can draw the sprites almost twice as fast as the combination of Pt-Off() and Pt-Off()r
For(B,0,7)For(A,0,11)Plot2(A,B,calculation for sprite pointer,L₆,L₃)EndEnd
L₆→r₄L₃→r₅For(r₂,0,7)For(r₁,0,11)calculation for sprite pointer→r₃Plot2(EndEnd
Edit: Is there some special way you have to compile Axioms? Because I can't figure out how.
I just wanted to pop in and say something. Im worried that having a super faster routine for sprites isnt going to help your speed as much as you think it might. I ran some tests with the regular Axe sprite routine and i was able to display over 4000 a second even in 6Mgz mode. In the other thread you said you needed over 2000 per second, so im worried that some of the slowdown isnt coming from the sprite displaying. Have you tried out your routine in the program? Im eager to hear new details! I really hope everything works out