Omnimaga
Calculator Community => Other Calculators => Topic started by: {AP} on September 04, 2009, 04:37:59 pm
-
I'll store random other programs I've made here. Some useful... some not so much.
Most require Celtic III/xLib and will be labeled as such.
I'll try and include a typed out form and download as well.
(EDIT: Attachment included at bottom.)
Um... yeah... here we go.
[Celtic III/xLIB]PICVIEW
View pictures stored on calc. Does 1-255.
Controls
Left/Right: Navigate
Clear: Exits and keeps the current picture on the screen. (sans the number in the corner)
1→X
Repeat K=15
real(0,0
real(3,X,0,0
real(6
Text(57,83,X
real(8→K
min(255,max(1,X+sum(ΔList(Ans={2,3→X
End
real(3,X,0,1
[Celtic III/xLib and Basic]INVERT
Inverts the screen. Used it on several occasions while making titles.
Just run it.
Basic:
For(X,0,94
For(Y,0,62
Pxl-Change(Y,X
End
End
Celtic III/xLib
real(12,8,0,0,04,62
DispGraph
(DispGraph gets rid of the 'Done' that normally pops up. Your call.)
[Celitic III]Sprite-to-Hex
Made awhile ago. I haven't looked at the code in ages so it may not be optimized very well at all.
All I know is that it works. Pick the size and picture, move the inverted box over what you want converted, then hit [2ND].
It'll convert the sprite to hexadecimal code for whatever you may need it for.
(Noahbaby, IIRC, made a better one at the same time I did.)
DelVar L1
" →Str1
4→dim(L1
ClrDraw
ClrHome
DispGraph
Input "PIC: ",X
Repeat sum(8,16,32
ClrHome
Input "SIZE: (8,16,32) ",S
End
If S=8
11→L
If S=16
5→L
If S=32
2→L
real(3,X,0,0
1→X
1→Y
0→A
0→B
Repeat K=54
real(8→K
If not(A=X) or not(B=Y //No symbol for "not equal" on here... but use it on-calc
Then
A→X
B→Y
real(12,8,SX,SY,SX+S-1,SY+S-1,1
real(12,8,SX,SY,SX+S-1,SY+S-1,0
End
min(L,max(0,X+sum(ΔList(K={2,3→A
min(8/(S/8)-1,max(0,Y+sum(ΔList(K={4,1→B
End
ClrHome
Disp "LOADING...
SB+S-1→M
If M>62
62→M
For(Y,SB,M
For(C,0,S/8*2-1
For(X,0,3
4C+SA+X→N
If N<95
Then
pxl-Test(Y,N→L1(X+1
Else
0→L1(X+1
End
End
0
For(X,1,4
Ans+2^(X-1)L1(5-X
End
det(29,Ans
Str1+Ans→Str1
End
End
sub(Str1,2,length(Str1)-1→Str1
If length(Str1)=60
Str1+"0000→Str1
If length(Str1)=248
Str1+"00000000→Str1
If length(Str1)=14
Str1+"00→Str1
ClrDraw
ClrHome
real(0,1
Disp "","","","
identity(5,Str1,0,0,S/8,S,0,0,1
[Cetltic III/xLIB]CHORDS
I made this program to study piano chords. It shows the 14 basic major/minor chords on the piano.
Controls
Left/Right: Show previous/next chord
Clear: Exits program
"CDEFGAB→Str0
3→dim(L1
Fill(1,L1
{6,10,12,16,18,24,28,30,34,36,40,42→L2
0→L
1→A
real(3,5,0,0
real(12,7,0,24,94,62
Repeat L
Repeat sum(K={24,26,45
getKey→K
End
real(0,0
real(3,5,0,0
real(12,7,0,24,94,62,0
If K=45
Then
1→L
Else
min(14,max(1,A+sum(ΔList(K={24,26→A
If A>0
1→L1(1
If A>2
3→L1(1
If A>4
5→L1(1
If A>6
6→L1(1
If A>8
8→L1(1
If A>10
10→L1(1
If A>12
12→L1(1
sub(Str0,round(A/2,0),1
If not(fPart(A/2
Then
Ans+" MINOR→Str9
Else
Ans+" MAJOR→Str9
End
For(X,2,3
L1(X-1
If X=2
Ans+4
If X=3
Ans+3
Ans→L1(X
End
If not(fPart(A/2
L1(2)-1→L1(2
ClrHome
SortA(L1
For(X,1,3
If 12<L1(X
L1(X)-12→L1(X
End
For(X,1,3
If sum(L1(X)={1,6
0→Y
If sum(L1(X)={3,8,10
1→Y
If sum(L1(X)={5,12
2→Y
If sum(L1(X)={2,4,7,9,11
3→Y
real(1,L2(L1(X)),1,1,22,5,Y,24,3,0,1
real(1,L2(L1(X))+42,1,1,22,5,Y,24,3,0,1
Text(25,35,Str9
End
End
End
ClrDraw
ClrHome
Output(1,1,"
-
{Placeholder}
-
Nice, the sprite to hex thing might be actually useful if I ever did a celtic game. I wonder where is the Simplethinker version anymore, though? Was it in ASM?
-
I wonder where is the Simplethinker version anymore, though? Was it in ASM?
Are you thinking of the sprite editor I sometimes mention on IRC? I wrote one in Python (for the computer) but I haven't released it yet. Right now it can save/load/edit whole tilesets (which includes a name and number for each tile), and can export them as hex strings (for use in things like CelticIII) or with the ".db" for ASM tiles.
I haven't released it yet since:
1) It's not very user-friendly yet (most of the saving/loading has to be done on the command line with confusing arguments).
2) I'm going to eventually integrate it into my tilemap editor.
3) It contains a lot of horribly embarrassing code and is written in an interpreted language, so I'll need to clean it up a little before I let anyone else see it ;)
-
Whoops.
It was Noahbaby, not Simplethinker.
My bad. x.x
The sprite editor does sound pretty cool though.
Looking forward to it sometime. =P
-
Oooh I see, what would be cool is a map editor that does every tilemap format Celtic and xLIB can support and that actually runs at decent speed
-
Map editor = easy
Speed = shouldn't be an issue
Supports every tilemap format = not as easy
Sounds like something I can put together.
I'll need it soon anyway. (or at least something similar)
-
Well the main format to support is xlib :D (consequently, Celtic too, due to backward compatibility). There is alerady a xlib tilemapper in the archives, called Draw N Map, but some stuff irks me about it, altough it's very good (Metroid II Expansion maps were edited with it). What irks me the most is how it only shows 12x7 tiles at once on the screen. As a result, I often messed up the upper or lower row of my maps and had to redo them
-
Hm, I think I thought of a way to have maps be just about any size pretty easily.
I'll work on this program now.
Before I forget.
-
New program that I made for some friends while they were playing the Pokemon TCG.
[Celtic III/xLib]Coin Flip!
[ENTER] - Flip the coin
[CLEAR] - Exit
Screenshot:
(http://img190.imageshack.us/img190/6065/coinn.gif)
The animation is better on an actual calc. Stupid wabbitemu.
-
mhmm that looks nice :)
Btw did you still have that map editor you were working on a while ago?
-
Strange real(8->K gives a syntax error in my TI-84+SE
:real(8
:Ans->K
//this does not gives error
Nice programs. I did one PICVIEW in pure TI-BASIC. It throws errors if doesn't exist, but works.
Also I used your PICVIEW code and added xlib detection to maybe release in some package of utils, later on.
The detect consist of:
:1:real(0
:If not(Ans
:Then
:Disp "XLIB NOT ENABLED
:Stop
:End
//code with xlib
I found in http://tibasicdev.wikidot.com/xlib-tutorial.
Does this detect works with CelticIII? Does CelticIII has its way to distinguish itself from xlib in TI-BASIC? We can add this info to TI-Basic Developer...
EDIT: Noticed that PICVIEW left/right navigation is a bit too fast on SE.
EDIT2: Using TI-BASIC getkey solves that. :)
-
Celtic III does have a way, and it is in the manuel right now actually.
-
Strange real(8->K gives a syntax error in my TI-84+SE
:real(8
:Ans->K
//this does not gives error
Though xLIB/C3's getkey commands put the result in Ans, it doesn't actually return the result. It's similar to the List->Matr command, since it updates a variable without modifying Ans.
-
hmm, wierd, I've done real(8->K before and it works...
-
Strange real(8->K gives a syntax error in my TI-84+SE
:real(8
:Ans->K
//this does not gives error
I used to have the same issue. Somehow, it just started working for me the shorter way, so that's what I used.
Also, feel free to use/modify these programs as you wish. If released, it'd be nice to at least be thrown in the credits though. =)
-
If it didn't initially work it might be better to use it in a way it always worked IMHO, tho, because then many people might have trouble running your programs. That seems a bit like that xLIB glitch with using real(10 with programs containing the Theta symbol in their names
-
Strange real(8->K gives a syntax error in my TI-84+SE
:real(8
:Ans->K
//this does not gives error
I used to have the same issue. Somehow, it just started working for me the shorter way, so that's what I used.
Also, feel free to use/modify these programs as you wish. If released, it'd be nice to at least be thrown in the credits though. =)
Credits will be given, of course. :) Better write down a note.
If it didn't initially work it might be better to use it in a way it always worked IMHO, tho, because then many people might have trouble running your programs. That seems a bit like that xLIB glitch with using real(10 with programs containing the Theta symbol in their names
I completely agree in maintain maximum compatibility.
Strange bugs with xlib and/or TI-OS... O.ó
-
I think the Theta glitch only occurs on certain calculators in particular. I thought a short while ago it was due to the 2007 hardware change (see TI-Boy SE issues), but I had it happen on emulator many times too
-
The theta glitch is odd. I never heard of that one before.
-
It caused at least 4 people to have trouble running Metroid II: Evolution. It was most likely an xLIB glitch
EDIT: Here's one of these 4 people: http://www.junemann.nl/maxcoderz/viewtopic.php?p=48065#p48065