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 - jacobly

Pages: 1 ... 6 7 [8] 9 10 ... 14
106
TI Z80 / Re: Online TI Token to Unicode Converter
« on: December 31, 2011, 02:22:14 pm »
Strange, I use it all the time and it works fine for me. The problem is that afaict, none of the above free hosts supports the language it is written it. :P

107
Axe / Re: Axe Q&A
« on: December 31, 2011, 02:06:55 pm »
Data(33,34,26,18,35,27,19,36,28,20)->GDB0
While 1
getKey->K
inData(K,GDB0)->r1
EndIf r1

Data(33,34,26,18,35,27,19,36,28,20,0)->GDB0
While 1
getKey->K
inData(K,GDB0)->r1
EndIf r1

Fixed.

Ok I have a feeling I'd be able to firgure this out myself, but it would prolly take a while since I don't remember much from math :P

Anyway, so I have a projectile flying at (S,T) with an angle, Z.  If Z is zero it faces straight down, 256 degrees, etc.
I have an enemy at, say, (X,Y).  How would I check which side of the projectile the enemy is on (right or left), related to the projectile's angle?
tan⁻¹(S-X,T-Y)-Z^256<128 should be true if the projectile needs to rotate in the positive direction.
tan⁻¹(S-X,T-Y)-Ze0 is optimized but returns the opposite.

108
Axe / Re: Again another question, about programs' name
« on: December 30, 2011, 05:44:22 pm »
Check out this post.

109
Axe / Re: Again another question, about programs' name
« on: December 30, 2011, 05:31:04 pm »
Check out MemKit (it comes with axe).

110
Humour and Jokes / Re: If there was tech support in botswana...
« on: December 29, 2011, 04:36:38 pm »
Because I do.

Why do you use windows?

111
Humour and Jokes / Re: If there was tech support in botswana...
« on: December 29, 2011, 04:27:03 pm »
Because it's not 2015 yet.

Why doesn't everyone use linux?

112
Axe / Re: Develop Axiom with Mimas
« on: December 28, 2011, 10:05:38 pm »
Oh, use rorg 0. It does what you are used to .org doing (org is tasm .org).

Edit: to clarify, rorg works like spasm's .org, and org works like brass's and tasm's .org. org actually changes where in the output file code is generated, but rorg just affect labels and such.

113
Axe / Re: Develop Axiom with Mimas
« on: December 28, 2011, 09:42:30 pm »
Check the length field to make sure it is right. If you put a label at the end of the axiom, you can use that in the length field. Also make sure that the axiom ends with dw 0000.

114
Axe / Re: Develop Axiom with Mimas
« on: December 28, 2011, 09:24:20 pm »
umm... it is pretty much identical to Axe.inc. (except for the comments)

115
Axe / Re: Develop Axiom with Mimas
« on: December 28, 2011, 08:38:05 pm »
First of all, if the axiom is a program in ram, then axe will automatically convert it to an app var the first time something is compiled that uses it (assuming the appvar doesn't already exist).

On the other hand, here is an axe program that should do what you wanted:
Code: [Select]
GetCalc("prgmAXIOM")→A
GetCalc("appvAXM",{A-2}ʳ)→B
Copy(A,B,{A-2}ʳ)

Edit: Oh yeah, and here is a mimas include file that has the same equates as Axe.inc.

116
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: December 26, 2011, 12:17:26 pm »
p_DrawOr: 18 bytes saved
p_DrawXor: 18 bytes saved
p_DrawOff: 14 bytes saved
p_DrawMsk: 10 bytes saved
p_DrawMsk2: 11 bytes saved
Code: [Select]
p_DrawOr:
.db __DrawOrEnd-1-$
push hl
pop ix ;Input ix = Sprite
ld hl,plotSScreen ;Input hl = Buffer
pop af
pop de ;Input e = Sprite Y Position
pop bc ;Input c = Sprite X Position
push af
ld d,7
ld a,e
add a,d
jr c,__DrawOrClipTop
sub 64+7
ret nc
cpl
cp d
jr c,__DrawOrClipBottom
ld b,d
jr __DrawOrNoClipV
__DrawOrClipTop:
inc ix
inc e
jr nz,__DrawOrClipTop
__DrawOrClipBottom:
ld b,a
__DrawOrNoClipV:
ld a,c
add a,d
cp 96+7
ret nc
rrca
rrca
rrca
and $1f
sla e
sla e
add hl,de
add hl,de
add hl,de
ld e,a
inc b
ld a,c
and d
ld d,-7*3
add hl,de
jr z,__DrawOrAligned
ld e,c
ld c,a
ld a,e
cp -7
sbc a,a
ld d,a
and e
cp 96-7
sbc a,a
ld e,a
__DrawOrLoop:
push bc
ld b,c
ld c,(ix)
xor a
__DrawOrShift:
srl c
rra
djnz __DrawOrShift
and e
or (hl)
ld (hl),a
dec hl
ld a,c
and d
or (hl)
ld (hl),a
ld c,13
add hl,bc
inc ix
pop bc
djnz __DrawOrLoop
ret
__DrawOrAligned:
ld de,12
__DrawOrAlignedLoop:
ld a,(ix)
or (hl)
ld (hl),a
inc ix
add hl,de
djnz __DrawOrAlignedLoop
ret
__DrawOrEnd:

p_DrawXor:
.db __DrawXorEnd-1-$
push hl
pop ix ;Input ix = Sprite
ld hl,plotSScreen ;Input hl = Buffer
pop af
pop de ;Input e = Sprite Y Position
pop bc ;Input c = Sprite X Position
push af
ld d,7
ld a,e
add a,d
jr c,__DrawXorClipTop
sub 64+7
ret nc
cpl
cp d
jr c,__DrawXorClipBottom
ld b,d
jr __DrawXorNoClipV
__DrawXorClipTop:
inc ix
inc e
jr nz,__DrawXorClipTop
__DrawXorClipBottom:
ld b,a
__DrawXorNoClipV:
ld a,c
add a,d
cp 96+7
ret nc
rrca
rrca
rrca
and $1f
sla e
sla e
add hl,de
add hl,de
add hl,de
ld e,a
inc b
ld a,c
and d
ld d,-7*3
add hl,de
jr z,__DrawXorAligned
ld e,c
ld c,a
ld a,e
cp -7
sbc a,a
ld d,a
and e
cp 96-7
sbc a,a
ld e,a
__DrawXorLoop:
push bc
ld b,c
ld c,(ix)
xor a
__DrawXorShift:
srl c
rra
djnz __DrawXorShift
and e
xor (hl)
ld (hl),a
dec hl
ld a,c
and d
xor (hl)
ld (hl),a
ld c,13
add hl,bc
inc ix
pop bc
djnz __DrawXorLoop
ret
__DrawXorAligned:
ld de,12
__DrawXorAlignedLoop:
ld a,(ix)
xor (hl)
ld (hl),a
inc ix
add hl,de
djnz __DrawXorAlignedLoop
ret
__DrawXorEnd:

p_DrawOff:
.db __DrawOffEnd-1-$
push hl
pop ix ;Input ix = Sprite
ld hl,plotSScreen ;Input hl = Buffer
pop af
pop de ;Input e = Sprite Y Position
pop bc ;Input c = Sprite X Position
push af
ld d,7
ld a,e
add a,d
jr c,__DrawOffClipTop
sub 64+7
ret nc
cpl
cp d
jr c,__DrawOffClipBottom
ld b,d
jr __DrawOffNoClipV
__DrawOffClipTop:
inc ix
inc e
jr nz,__DrawOffClipTop
__DrawOffClipBottom:
ld b,a
__DrawOffNoClipV:
ld a,c
add a,d
cp 96+7
ret nc
rrca
rrca
rrca
and $1f
ld d,0
sla e
sla e
add hl,de
add hl,de
add hl,de
ld e,a
add hl,de
inc b
ld a,c
and 7
jr z,__DrawOffAligned
ld e,c
ld c,a
ld a,e
cp -7
jr nc,__DrawOffLoop
inc d
cp 96-7
jr nc,__DrawOffLoop
inc d
__DrawOffLoop:
push bc
ld b,c
ld c,(ix+0)
xor a
ld e,$FF
__DrawOffShift:
srl c
rr e
rra
djnz __DrawOffShift
dec d
jr z,__DrawOffSkipRight
ld b,a
or (hl)
and e
ld (hl),a
ld a,b
__DrawOffSkipRight:
dec hl
inc d
jr z,__DrawOffSkipLeft
and (hl)
or c
ld (hl),a
__DrawOffSkipLeft:
ld bc,13
add hl,bc
inc ix
pop bc
djnz __DrawOffLoop
ret
__DrawOffAligned:
ld e,12
__DrawOffAlignedLoop:
ld a,(ix)
ld (hl),a
inc ix
add hl,de
djnz __DrawOffAlignedLoop
ret
__DrawOffEnd:

p_DrawMsk:
.db __DrawMskEnd-1-$
ex (sp),hl
pop ix ;Input hl = Sprite
pop de
pop bc
push hl
ld hl,plotSScreen
ld d,7
ld a,e
add a,d
jr c,__DrawMskClipTop
sub 64+7
ret nc
cpl
cp d
jr c,__DrawMskClipBottom
ld b,d
jr __DrawMskNoClipV
__DrawMskClipTop:
inc ix
inc e
jr nz,__DrawMskClipTop
__DrawMskClipBottom:
ld b,a
__DrawMskNoClipV:
ld a,c
add a,d
cp 96+7
ret nc
rrca
rrca
rrca
and $1f
ld d,0
sla e
sla e
add hl,de
add hl,de
add hl,de
ld e,a
add hl,de
inc b
ld a,c
and 7
jr z,__DrawMskAligned
ld e,c
ld c,a
ld a,e
cp -7
jr nc,__DrawMskLoop
inc d
cp 96-7
jr nc,__DrawMskLoop
inc d

__DrawMskLoop:
push bc

push hl

ld b,c
ld e,(ix+0)
xor a
ld h,a
ld c,(ix+8)
__DrawMskShift:
srl e
rr h
srl c
rra
djnz __DrawMskShift

ld b,h
pop hl
push af

dec d
jr z,__DrawMskSkipRight1

push bc
xor b
cpl
ld c,a

ld a,(hl)
or b
and c
ld (hl),a
pop bc

__DrawMskSkipRight1:
dec hl
inc d
push de
jr z,__DrawMskSkipLeft1

ld a,c
xor e
cpl
ld d,a

ld a,(hl)
or e
and d
ld (hl),a

__DrawMskSkipLeft1:
ld de,appBackUpScreen-plotSScreen+1
add hl,de
pop de
pop af
dec d
jr z,__DrawMskSkipRight2

or b
cpl

and (hl)
or b
ld (hl),a

__DrawMskSkipRight2:
dec hl
inc d
jr z,__DrawMskSkipLeft2

ld a,c
or e
cpl

and (hl)
or e
ld (hl),a

__DrawMskSkipLeft2:
ld bc,plotSScreen-appBackUpScreen+13
add hl,bc

inc ix
pop bc
djnz __DrawMskLoop
ret
__DrawMskAligned:
push hl
ld de,appBackUpScreen-plotSScreen
add hl,de

ld a,(ix+0)
ld d,a
xor (ix+8)
cpl
ld e,a

and (hl)
or d
ld (hl),a

pop hl

ld a,(hl)
or d
and e
ld (hl),a

inc ix
ld de,12
add hl,de
djnz __DrawMskAligned
ret
__DrawMskEnd:

p_DrawMsk2:
.db __DrawMsk2End-1-$
ex (sp),hl
pop ix ;Input hl = Sprite
pop de
pop bc
push hl
ld hl,plotSScreen
ld d,7
ld a,e
add a,d
jr c,__DrawMsk2ClipTop
sub 64+7
ret nc
cpl
cp d
jr c,__DrawMsk2ClipBottom
ld b,d
jr __DrawMsk2NoClipV
__DrawMsk2ClipTop:
inc ix
inc e
jr nz,__DrawMsk2ClipTop
__DrawMsk2ClipBottom:
ld b,a
__DrawMsk2NoClipV:
ld a,c
add a,d
cp 96+7
ret nc
rrca
rrca
rrca
and $1f
ld d,0
sla e
sla e
add hl,de
add hl,de
add hl,de
ld e,a
add hl,de
inc b
ld a,c
and 7
jr z,__DrawMsk2Aligned
ld e,c
ld c,a
ld a,e
cp -7
jr nc,__DrawMsk2Loop
inc d
cp 96-7
jr nc,__DrawMsk2Loop
inc d
__DrawMsk2Loop:
push bc
push hl

ld b,c
ld e,(ix+0)
xor a
ld h,a
ld c,(ix+8)
__DrawMsk2Shift:
srl e
rr h
srl c
rra
djnz __DrawMsk2Shift

ld b,h ;e = left spr, b = right spr, c = left msk, a = right msk
pop hl

dec d
jr z,__DrawMsk2SkipRight

cpl
and (hl)
xor b
ld (hl),a

__DrawMsk2SkipRight:
dec hl
inc d
jr z,__DrawMsk2SkipLeft

ld a,c
cpl
and (hl)
xor e
ld (hl),a

__DrawMsk2SkipLeft:
ld bc,13
add hl,bc

inc ix
pop bc
djnz __DrawMsk2Loop
ret
__DrawMsk2Aligned:
ld e,12
__DrawMsk2AlignedLoop:
ld a,(ix+8)
cpl
and (hl)
xor (ix+0)
ld (hl),a
inc ix
add hl,de
djnz __DrawMsk2AlignedLoop
ret
__DrawMsk2End:

117
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: December 24, 2011, 01:45:01 pm »
p_DrawOr/Xor: save 17 bytes (plus 4 every time a custom buffer is used)
aligned saves 98 cycles, unaligned saves ~173 cycles
save additional 21 cycles every time a custom buffer is used
Code: [Select]
p_DrawOr:
.db __DrawOrEnd-1-$
push hl
pop ix ;Input ix = Sprite
ld hl,plotSScreen ;Input hl = Buffer
pop af
pop bc ;Input c = Sprite Y Position
pop de ;Input e = Sprite X Position
push af
ld b,7
ld a,e
add a,b
cp 96+7
ret nc
rrca
rrca
rrca
and $1f
ld d,a
ld a,c
add a,b
jr c,__DrawOrClipTop
sub 64+7
ret nc
cpl
cp b
jr c,__DrawOrClipBottom
ld a,b
jr __DrawOrClipBottom
__DrawOrClipTop:
inc ix
inc c
jr nz,__DrawOrClipTop
__DrawOrClipBottom:
inc a
ld b,0
sla c
sla c
add hl,bc
add hl,bc
add hl,bc
ld c,d
add hl,bc
ld b,a
ld a,e
and 7
jr z,__DrawOrAligned
ld c,a
ld a,e
cp -7
sbc a,a
ld d,a
and e
cp 96-7
sbc a,a
ld e,a
__DrawOrLoop:
push bc
ld b,c
ld c,(ix)
xor a
__DrawOrShift:
srl c
rra
djnz __DrawOrShift
and e
or (hl)
ld (hl),a
dec hl
ld a,c
and d
or (hl)
ld (hl),a
ld c,13
add hl,bc
inc ix
pop bc
djnz __DrawOrLoop
ret
__DrawOrAligned:
ld de,12
__DrawOrAlignedLoop:
ld a,(ix)
or (hl)
ld (hl),a
inc ix
add hl,de
djnz __DrawOrAlignedLoop
ret
__DrawOrEnd:

p_DrawXor:
.db __DrawXorEnd-1-$
push hl
pop ix ;Input ix = Sprite
ld hl,plotSScreen ;Input hl = Buffer
pop af
pop bc ;Input c = Sprite Y Position
pop de ;Input e = Sprite X Position
push af
ld b,7
ld a,e
add a,b
cp 96+7
ret nc
rrca
rrca
rrca
and $1f
ld d,a
ld a,c
add a,b
jr c,__DrawXorClipTop
sub 64+7
ret nc
cpl
cp b
jr c,__DrawXorClipBottom
ld a,b
jr __DrawXorClipBottom
__DrawXorClipTop:
inc ix
inc c
jr nz,__DrawXorClipTop
__DrawXorClipBottom:
inc a
ld b,0
sla c
sla c
add hl,bc
add hl,bc
add hl,bc
ld c,d
add hl,bc
ld b,a
ld a,e
and 7
jr z,__DrawXorAligned
ld c,a
ld a,e
cp -7
sbc a,a
ld d,a
and e
cp 96-7
sbc a,a
ld e,a
__DrawXorLoop:
push bc
ld b,c
ld c,(ix)
xor a
__DrawXorShift:
srl c
rra
djnz __DrawXorShift
and e
xor (hl)
ld (hl),a
dec hl
ld a,c
and d
xor (hl)
ld (hl),a
ld c,13
add hl,bc
inc ix
pop bc
djnz __DrawXorLoop
ret
__DrawXorAligned:
ld de,12
__DrawXorAlignedLoop:
ld a,(ix)
xor (hl)
ld (hl),a
inc ix
add hl,de
djnz __DrawXorAlignedLoop
ret
__DrawXorEnd:

118
Axe / Re: Routines
« on: December 23, 2011, 11:45:18 pm »
Is this what you want?
Code: [Select]
"appv"Buff(8)→Str0
Copy(L₁,Str0+1,8)
GetCalc(Str0,Y₀)

119
Axe / Re: Routines
« on: December 23, 2011, 09:44:02 pm »
L₁→Str0 and GetCalc("Str0",Y₀) refer to two completely different Str0's. Assuming you want to get L₁ into Str0, as in if you were to type Str0 on the home screen, it would display the string at L₁, then:
Copy(L₁,GetCalc("Str0",length(L₁)→L),L)

120
Axe / Re: Axe Q&A
« on: December 22, 2011, 12:12:23 am »
Here is an example program that might help:
Code: [Select]
:.VELOCITY
:192→θ .begin facing up
:0.0→V .begin stationary
:47.0→X .begin in the middle
:31.0→Y
:Repeat getKey(15)
:getKey(4)-getKey(1)+V→V .press up/down to speed up/slow down
:getKey(3)-getKey(2)+θ→θ .press left/right to turn left/turn right
:cos(θ)*2**V+X^96.0→X .use V and θ to change position
:sin(θ)*2**V+Y^64.0→Y
:Pxl-On(X/256,Y/256)
:DispGraphClrDraw
:End

Pages: 1 ... 6 7 [8] 9 10 ... 14