Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Runer112

Pages: 1 ... 59 60 [61] 62 63 ... 153
901
The Axe Parser Project / Re: Bug Reports
« on: January 20, 2012, 11:16:14 am »
The fact that tokens could be inside of the app would need to be dealt with.

902
The Axe Parser Project / Re: Bug Reports
« on: January 20, 2012, 11:04:51 am »
* Runer112 checks documentation

Oh, Disp ►Tok and Text ►Tok call for different arguments. That's a little confusing. But I see how printing the token pointed to would generally be more useful. Maybe Disp ►Tok should be changed to accept a pointer to a token as well for consistency? I think it would only need to be two bytes bigger; ld e,(hl) \ inc hl \ ld d,(hl) instead of ex de,hl. And this would actually be saving two bytes for printing tokens from a pointer.

903
Calculator C / Re: C Q&A Thread
« on: January 19, 2012, 09:34:54 pm »
Lose the "void" since you're calling the function, not declaring it. As far as making sure you're calling the function with the proper arguments, I can't help you there because I don't know anything about device-specific C development.

904
The Axe Parser Project / Re: Axe Parser
« on: January 17, 2012, 05:19:29 pm »
Some things I'm particularly curious about:
- The token numbers are difficult for developers to type in manually, any ideas of how I could generate a list of equates?

After searching around and not having found any existing list of token hook equates, I figured I should compile one myself, and I did. Feel free to include it in the next release of Axe.

http://www.ticalc.org/archives/files/fileinfo/445/44517.html

905
Click it.

906
The Axe Parser Project / Re: Bug Reports
« on: January 15, 2012, 05:47:08 pm »
Not sure if this is a bug report or a feature request, but it appears that Axe will not "nest" peephole optimizations. I put "nest" in quotation marks because that's not a very accurate description of what I mean. This code example should hopefully better illustrate what I'm trying to say:

Source      Compiled
If <96-1
.Blah
End
      ld  de,-96
add hl,de
sbc hl,hl
ld  a,h
or  l
jp  z,End

As you can see, the inc hl \ dec hl optimization was applied, but the sbc hl,hl \ ld a,h \ or l optimization was not applied.

907
Axe / Re: Axe Q&A
« on: January 15, 2012, 04:54:12 pm »
Yes, that is a perfectly valid optimization. However, with the introduction of the peephole optimizer in Axe 1.0, Axe will perform simple optimizations like that automatically so you don't have to. ;)

908
Axe / Re: How to display a Pic
« on: January 15, 2012, 01:37:36 pm »
Don't use Bitmap() unless you absolutely need it, which you don't for just displaying full-screen pictures. The Bitmap() routine adds over 200 bytes to your program.

909
ASM / Re: Set by Address restrictions?
« on: January 15, 2012, 01:39:28 am »
I think you mean:

Code: [Select]
ld bc,(var1-1) ;c=(var1-1), b=(var1)

And that's the same size as Hot_Dog's suggestion, but it's 3 cycles slower. ;)

910
Axe / Re: Axe Q&A
« on: January 13, 2012, 07:08:46 pm »
.Draw a byte of top border (88-95,1)
.Draw a byte of left border (0-7,2)
ᴇC0FF→{L₆+23}ʳ

.Copy byte (88-95,1) of top border to draw rest of top border (0-87,1) and (0-95,0)
Copy(L₆+23,-1,23)ʳ

.Copy byte (0-7,0) of top border to draw bottom border (0-95,62) and (0-95,63)
Copy(,L₆+744,24)

.Draw byte of right border (94-95,2)
.Draw byte of middle (80-93,2)
ᴇ0300→{L₆+34}ʳ

.Copy byte (80-87,2) of middle to rest of third row middle (8-79,2)
Copy(L₆+34,-1,9)ʳ

.Copy third row (0-95,2) to fourth through sixty-second rows (0-95,3-61)
Copy(-1,+12,59*12)

911
Axe / Re: Axe Q&A
« on: January 13, 2012, 06:56:26 pm »
ᴇC0FF→{L₆+23}ʳ
Copy(L₆+23,-1,23)ʳ
Copy(,L₆+744,24)
ᴇ0300→{L₆+34}ʳ
Copy(L₆+34,-1,9)ʳ
Copy(-1,+12,59*12)

912
Axe / Re: Axe Q&A
« on: January 12, 2012, 11:47:43 pm »
You started out pretty good with 68,006 cycles

Rect(0,0,96,64)
RectI(1,1,94,62)


Then you went way in the wrong direction with 2,614,503 cycles D:

Rect(0,0,96,64)
For(J,1,94)
For(K,1,62)
Pxl-Off(J,K)
End
End


And here's my Runer-optimized™ speed/size blend, coming in at 16,303 cycles; that's faster than ClrDraw! :evillaugh:

ᴇ80FF→{L₆+11}ʳ
Copy(L₆+11,-1,11)ʳ
Copy(,L₆+756,12)
ᴇ0100→{L₆+22}ʳ
Copy(L₆+22,-1,9)ʳ
Copy(-1,+12,61*12)

913
The Axe Parser Project / Re: Axe Parser
« on: January 12, 2012, 06:29:05 pm »
Sorry for the double post again!


Well, I found a solution to the issue! The easy way to fix it would've been to simply add 5 or 10 bytes of code to the existing method. But I wanted to minimize as much code bloat as possible in fixing this bug, and I would say I certainly did. Not only did I fix the bug, but the hook is now a byte smaller! ;D

Code: [Select]
.nolist
#include "ti83plus.inc"
.list

#define cxPrevApp cxPrev+cxCurApp-cxMain

#define p_GetArc $55E7
#define p_ReadArcApp $5658
#define p_CopyArc $568D

#define TokenHook_Temp appRawKeyHandle
#define AxiomTokens statVars
#define AxiomTokens_End curGStyle

.org $71E0


TokenHook:
.db $83
ld a,(cxCurApp)
cp kPrgmEd
ret nz
ld bc,(EditTop)
ld a,(bc)
cp tDecPt
ret nz
inc bc
ld a,(bc)
cp tDecPt
jr z,TokenHook_IsAxe
sub tA
cp tTheta-tA+1
ret nc
TokenHook_IsAxe:
push hl
ld hl,cxPrevApp
ld a,kPrgmEd
cp (hl)
jr z,TokenHook_SkipAxiomSearch
TokenHook_AxiomSearch:
ld (hl),a
push de
B_CALL(_IsAtTop)
push de
push hl
B_CALL(_BufToBtm)
B_CALL(_IsAtTop)
sbc hl,de
ld b,h
ld c,l
ex de,hl
ld de,AxiomTokens
call TokenHook_AxiomSearch_Start
pop hl
ld (editTop),hl
B_CALL(_BufToTop)
pop hl
ld (editTop),hl
pop de
TokenHook_SkipAxiomSearch:
inc e
ld hl,AxeTokens
ld b,0
jr TokenHook_CompareLoop_Start
TokenHook_CompareLoop:
cp e
inc hl
jr z,TokenHook_LowByteMatch
TokenHook_NoMatch:
inc hl
ld c,(hl)
inc c
add hl,bc
TokenHook_CompareLoop_Start:
ld a,(hl)
inc a
jr nz,TokenHook_CompareLoop
TokenHook_DoneNoMatch:
add hl,hl
ld hl,AxiomTokens
jr nc,TokenHook_CompareLoop_Start
pop hl
ret
TokenHook_LowByteMatch:
ld a,(hl)
cp d
jr nz,TokenHook_NoMatch
TokenHook_Match:
ld de,localTokStr
push de
ld c,17
ldir
pop hl
pop bc
ret


TokenHook_AxiomSearch_CheckHeader:
call ReadArc
inc de
add a,c
ld bc,$C0DE
sbc hl,bc
ld c,a
ret z
TokenHook_AxiomSearch_Loop___:
pop bc
TokenHook_AxiomSearch_Loop__:
pop bc
TokenHook_AxiomSearch_Loop_:
pop hl
TokenHook_AxiomSearch_Loop:
ld a,tAsmComp
cpir
ret po
push hl
dec hl
dec hl
ld a,(hl)
cp t2ByteTok
jr nz,TokenHook_AxiomSearch_Loop_
TokenHook_AxiomSearch_Backtrack:
dec hl
ld a,(hl)
cp tSpace
jr z,TokenHook_AxiomSearch_Backtrack
sub tColon
cp tEnter-tColon+1
jr nc,TokenHook_AxiomSearch_Loop_
TokenHook_AxiomSearch_FindAxiom:
pop hl
push hl
push bc
dec hl
rst 20h
ld hl,OP1
ld (hl),AppVarObj
ld a,tRParen
ld bc,10
cpir
dec hl
ld (hl),b
ld l,OP1&$FF
call p_GetArc+1
jr c,TokenHook_AxiomSearch_Loop__
TokenHook_AxiomSearch_FoundAxiom:
ex de,hl
ld c,b
call TokenHook_AxiomSearch_CheckHeader
ld b,32+1
TokenHook_AxiomSearch_ScanAxiom:
call ReadArc
inc de
ld a,h
or l
jr z,TokenHook_AxiomSearch_EndOfAxiom
add hl,de
ld de,5
add hl,de
ex de,hl
djnz TokenHook_AxiomSearch_ScanAxiom
TokenHook_AxiomSearch_EndOfAxiom:
call TokenHook_AxiomSearch_CheckHeader
call ReadArc
inc de
ld a,c
push hl
ld bc,(TokenHook_Temp)
add hl,bc
ld bc,-AxiomTokens_End
add hl,bc
jr c,TokenHook_AxiomSearch_Loop___
ld hl,(TokenHook_Temp)
ex de,hl
pop bc
call p_CopyArc+5
res statsValid,(iy+statFlags)
pop bc
pop hl
TokenHook_AxiomSearch_Start:
ld (TokenHook_Temp),de
ld a,$FF
ld (de),a
jr TokenHook_AxiomSearch_Loop


ReadArc:
ex de,hl
xor a
cp c
jr z,ReadArc_RAM
push bc
push hl
call p_ReadArcApp+11
pop de
inc de
pop bc
ret
ReadArc_RAM:
ld e,(hl)
inc hl
ld d,(hl)
ex de,hl
ret


AxeTokens:
.db $F4,$03,5,"Copy("
.db $FE,$03,5,"Exch("
.db $0E,$04,5,"Freq("
.db $66,$01,5,"Buff("
.db $62,$01,5,"sign{"
.db $06,$00,5,Lconvert,"Char"
.db $08,$04,4,Lconvert,"Hex"
.db $02,$04,5,"Data("
.db $4E,$01,7,"Bitmap("
.db $02,$00,4,Lconvert,"Tok"
.db $80,$04,7,"#Axiom("
.db $04,$04,5,"Rect("
.db $06,$04,6,"RectI("
.db $58,$02,3,"var"
.db $5A,$02,4,"appv"
.db $5C,$02,3,"grp"
.db $F6,$01,4,"port"
.db $52,$01,5,"Text "
.db $D8,$01,8,"Pt-Mask("
.db $DA,$01,7,"pt-Get("
.db $D0,$01,3,"Get"
.db $14,$04,5,"rotC("
.db $16,$04,6,"rotCC("
.db $18,$04,6,"flipV("
.db $1A,$04,6,"flipH("
.db $C8,$03,7,"inData("
.db $B8,$01,5,"input"
.db $74,$01,6,"float{"
.db $72,$01,4,"nib{"
.db $F6,$03,9,"#Realloc("
.db $68,$01,6,"#Icon("
.db $80,$01,2,Llambda,"("
.db $38,$03,5,"Load("
.db $3A,$03,5,"Next("
.db $14,$03,7,"Render("
.db $3C,$03,6,"DrawL("
.db $3E,$03,6,"DrawR("
.db $16,$03,6,"DrawS("
.db $82,$03,6,"Print("
.db $44,$03,3,"Up("
.db $46,$03,5,"Down("
.db $5C,$03,5,"Left("
.db $40,$03,6,"Right("
.db $42,$03,4,"New("
.db $5E,$03,7,"Delete("
.db $FF

EDIT: This code was changed at 11:15PM EST on 1/12 to fix a critical bug that made all key programming tokens in the PRGM menu inaccessible. Please do not use any copies of the code made before this time! :banghead:

EDIT 2: [10:00PM EST 1/13] Changed the "var" and "appv" token replacements to use the standard lowercase "v" instead of the recursive one. None of the OS tokens, including the recursive equation tokens themselves, actually use the recursive equation characters 02h-04h, so there's no reason why Axe should either.

914
The Axe Parser Project / Re: Axe Parser
« on: January 12, 2012, 03:17:16 pm »
I just realized that the token hook has a very minor bug in it. I was relying on the indicator $00 to signal that there are no more tokens to be compared, but I seemed to forget that a couple of tokens actually have $00 as the low byte of the compare value. I suggest fixing this by making $FF signal the end of token comparisons, as this is an odd number and is thus not a valid low byte for the compare value. Fixing the code itself for this change is actually quite easy, and will only cost 1 byte and 4 cycles. Add an inc e before the comparison loop and change or a at the end of the comparison loop to inc a.

EDIT: Let me think this through a bit, this makes my Axiom token replacement cache generator less optimized...

915
The Axe Parser Project / Re: Features Wishlist
« on: January 10, 2012, 09:16:59 pm »
How about the ability to use Pt-Mask()r with arbitrary buffers? Unlike Pt-Mask(), it only uses one buffer which is only referenced once, so arbitrary buffer support would be just as easy as with the three basic sprite drawing commands.

Also, the command list description for Pt-Mask()r should probably be changed a bit. The sprite argument isn't a "grayscale sprite" like with Pt-Mask().

Pages: 1 ... 59 60 [61] 62 63 ... 153