Author Topic: Miscellaneous Programs  (Read 9081 times)

0 Members and 1 Guest are viewing this topic.

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Miscellaneous Programs
« 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)
Code: [Select]
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:
Code: [Select]
For(X,0,94
For(Y,0,62
Pxl-Change(Y,X
End
End

Celtic III/xLib
Code: [Select]
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.)

Quote from: Code
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

Quote from: code
"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,"

« Last Edit: September 04, 2009, 05:58:31 pm by {AP} »

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Miscellaneous Programs
« Reply #1 on: September 04, 2009, 04:38:14 pm »
{Placeholder}

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Miscellaneous Programs
« Reply #2 on: September 04, 2009, 04:41:58 pm »
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?

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Miscellaneous Programs
« Reply #3 on: September 04, 2009, 05:42:02 pm »
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 ;)
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Miscellaneous Programs
« Reply #4 on: September 04, 2009, 05:58:07 pm »
Whoops.
It was Noahbaby, not Simplethinker.
My bad. x.x

The sprite editor does sound pretty cool though.
Looking forward to it sometime. =P

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Miscellaneous Programs
« Reply #5 on: September 04, 2009, 06:12:08 pm »
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

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Miscellaneous Programs
« Reply #6 on: September 04, 2009, 07:06:29 pm »
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)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Miscellaneous Programs
« Reply #7 on: September 04, 2009, 07:54:08 pm »
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

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Miscellaneous Programs
« Reply #8 on: September 04, 2009, 08:19:26 pm »
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.

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Miscellaneous Programs
« Reply #9 on: November 05, 2009, 07:28:52 pm »
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:

The animation is better on an actual calc. Stupid wabbitemu.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Miscellaneous Programs
« Reply #10 on: November 06, 2009, 02:04:53 am »
mhmm that looks nice :)

Btw did you still have that map editor you were working on a while ago?

Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: Miscellaneous Programs
« Reply #11 on: November 14, 2009, 10:35:16 am »
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. :)
« Last Edit: November 14, 2009, 10:58:21 am by Galandros »
Hobbing in calculator projects.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6267
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Miscellaneous Programs
« Reply #12 on: November 14, 2009, 11:09:31 am »
Celtic III does have a way, and it is in the manuel right now actually.
/e

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Miscellaneous Programs
« Reply #13 on: November 14, 2009, 02:12:41 pm »
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.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6267
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Miscellaneous Programs
« Reply #14 on: November 14, 2009, 02:23:40 pm »
hmm, wierd, I've done real(8->K before and it works...
/e