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.


Topics - Xeda112358

Pages: 1 ... 10 11 [12] 13
166
BatLib / BatLib Default Modes
« on: April 12, 2011, 04:26:06 pm »
Okay, so currently, I would like to know if ReCode should automatically set Full or not. So, what is your opinion?

167
Other Calculators / Balltrix (ported by Xeda)
« on: April 10, 2011, 09:47:50 pm »

168
Math and Science / Sums, Pascal, and Equations for Sets
« on: March 31, 2011, 12:14:48 am »
So pretty much, this is a direct copy/paste from my post on UTI:
Okee dokey then, so I have been working for the past two days on forming equations for finite sets of data. For example, if I have {0,-33,i,27,6}, I would want to find an equation where if x=0, then the result is 0, and if x=1, the result is -33, et cetera. I have a method that accomplishes this and I have explored it much in the past few days, but I get the feeling there is either an easier way or this method is just something I haven't gotten to, yet. Anyway, here is what I do...
First, to make things simpler, I want to make two sets (one real and the other imaginary), so I end up with:
{0,-33,0,27,6}+i{0,0,1,0,0}. I want to tackle one at a time, so I arrange the first list into a column like so:
Code: [Select]
  0
-33
  0
 27
  6
Now from there, you make a second column that is the difference of Un+1 and Un:
Code: [Select]
  0
-33   -33-0=-33
  0   0--33=33
 27    27-0=27
  6    6-27=-21
And from then you add another column using the same idea until you reach one element in the column:

Now from there, fill the last column space with 30. From there, you can work your way backwards to fill in the rest of the columns:

At this point, we should denote the column spaces in this manner:
a-First column space (the original numbers)
b-Second column space
c-Third column space
d-Fourth column space
e-Last column space

So, looking at the matrix, e follows the equation y=30. Now we move to d which must be -162+sum(e,n,0,x) or -162+30x. c is going to be 300+sum(d,x,0,n) which can be represented as 300-162x+30(x2+x)/2). This can be simplified, but for the sake of making the concept clear, I will not simplify it. As we continue with the last two, we get:
b=-201+300x-162(x2+x)/2+30(x3+3x2+2x)/6
a=-201x+300(x2+x)/2-162(x3+3x2+2x)/6+30(x4+6x3+11x2+6x)/24

And that is the equation for the real part of the original set of numbers. Applying the same method, we get for the imaginary part:
ai=i(-10x+25(x2+x)/2-21(x3+3x2+2x)/6+6(x4+6x3+11x2+6x)/24)

And now we simply need to combine the two equations to get the ridiculously large equation:
-201x+300(x2+x)/2-162(x3+3x2+2x)/6+30(x4+6x3+11x2+6x)/24+i(-10x+25(x2+x)/2-21(x3+3x2+2x)/6+6(x4+6x3+11x2+6x)/24)

Anyway, that is the method I have used and explored and that is the long, tedious way of obtaining results. The faster way will require the use or knowledge of Pascal's Triangle and by knowledge... hehehe, this ties into some of my other explorations that I haven't gotten into here...
For a quick way to obtain the diagonals, let us represent those as {a,z,y,x,w,...} and we can look at it in this form:
Code: [Select]
[[a l m n o ...
  b z
  c   y
  d     x
  e       w
...         ]]
a=a
z=b-a
y=c-2b+a
x=d-3c+3b-a
w=e-4d+6c-3b+a
...
If you notice those coefficients, you will note the relationship to Pascal's Triangle. There is another relationship you may not have noticed in the first example. Firstly, it should be pretty clear that taking the values in row 1, we have the coefficients required for the end equation. Those coefficients go along with some polynomial and those polynomials are the equations to the diagonals of Pascal's Triangle. So, if the first diagonal (all 1s) is represented as P0, then the equations are as follows:
P0=1
P1=x
P2=(x2+x)/2
P3=(x3+3x2+2x)/6
P4=(x4+6x3+11x2+6x)/24
...
The pattern is fairly easy:
P0=1
P1=Σ1
P2=ΣΣ1
P3=ΣΣΣ1
P4=ΣΣΣΣ1
So P4 should be read as the sum of the sum of the sum of the sum of 1. SO using the above notation (in the code box), the equation that hits {a,b,c,d,e,...} would be a*P0+l*P1+m*P2+n*P3+o*P4...

So it would be nice to have {a,l,m,n,o,...}, right? Well that, too, makes use of Px as well as an alternating negative sign. As examples:
a=a
l=z-y+x-w...
m=y-2x+3w-4v...
n=x-3w+6v-10u...
o=w-4v+10u...
...
If you notice the coefficients there, you will note that:
a= uses 0 for its coefficients
l= uses P0 for its coefficients
m= uses P1 for its coefficients
n= uses P2 for its coefficients
o= uses P3 for its coefficients
...

So now with that in mind, we can model this simple set of data: {π²,-3,6,2}
a=π²
b=-3
c=6
d=2

So:
Code: [Select]
a=a         = π²        = π²
z=b-a       = -3-π²     = -3-π²
y=c-2b+a    = 6+6+π²    = 12+π²
x=d-3c+3b-a = 2-18-9-π² = -25-π²

Code: [Select]
a=a         = π²                  = π²
l=z-y+x     = -3-π²-12-π²-25-π²   = -40-3π²
m=y-2x      = 12+π²+50+2π²         = 62+3π²
n=x         = -25-π²              = -25-π²
And finally the equation:
π²P0+(-40-3π²)P1+(62+3π²)P2+(-25-π²)P3
Which turns to:
π²+(-40-3π²)x+(62+3π²)(x2+x)/2+(-25-π²)(x3+3x2+2x)/6

So anywho, there are probably a few things I missed and maybe a few mistakes, but is there an easier approach to this?

169
Math and Science / Random Number question
« on: March 17, 2011, 01:30:28 am »
Okay, so I made a routine in ReCode to generate a random integer and I wanted to test how random it is. Does anybody know of a way to do this? I am working on a mini game that uses a 4x4 grid and it initializes the game by selecting a random plot on the grid. I then got the idea to test how long it would take for it to randomly select each plot and then I wanted to test the "randomness" of certain routines. So that brings me to my question...

Anyway, here is a screenshot showing what I was talking about.

170
News / BatLib officially released
« on: March 13, 2011, 03:16:55 pm »
BatLib has been officially released a few days ago. is an App aimed at programmers of all skill levels. It includes 92 commands that make programming either easier, faster, or just plain possible. There are sprite commands, sound commands, string commands, reading from archive, data manipulations, and even a programming language! v4.00.92.43. Here are screenshots of the included hybrid BASIC demo programs:



http://www.omnimaga.org/index.php?action=downloads;sa=view;down=596


171
BatLib / BASIC ReCode v2.00
« on: March 13, 2011, 02:33:32 pm »
Now that I have put some serious work into BASIC ReCode, I figured a topic should be started to explain routines, help people out, and to share ideas. First off, here is what I have managed to make using the current version of ReCode:

That took 809 bytes of memory, but you can see it has speed and ability. You can download a PDF of the commands and syntax below, but as a warning, the While command will fail miserably if there is an End statement inside of it. So for example:

Code: [Select]
While getKey≠15
getKey→A
If A=9
Then
Fill(2
DispGraph
End
End
This will fail because it will try to pick up at the second End when it exits the loop and that End will send the parser to another random spot in memory. This isn't a problem if the parser can reach a Stop, but it isn't likely. For now, using a trick that results from the way the parser is designed, you can avoid If Then...End statements by putting a space after non-text commands (text is read until it reaches a newline token). For example:
Code: [Select]
While getKey≠15
getKey→A
If A=9
Fill(2 DispGraph
End
It uses less memory, anyway and is faster, but I added the If Then...End form for readability.

Here is the readme to ReCode:

172
TI Z80 / EXEC: Executing Appvars in BASIC
« on: March 03, 2011, 04:05:44 pm »
After a request from aeTIos for a code to execute BASIC programs from an Axe program, I decided to make this for BASIC programmers... This will let you store the name of a program or even an appvar in Ans and execute it as a BASIC program. This is great if certain situations require certain sub programs-- especially if you decide to store your sub programs to appvars!

On top of that, if the program or appvar is archived, instead of throwing an error, this program simply unarchives the var and executes it.
Here is an example showing an appvar being executed.

173
Axe / Axe: How to Execute BASIC Programs
« on: March 03, 2011, 05:36:24 am »
Okay, so earlier I was asked by aeTIos for a hex code to run BASIC programs in Axe and I have heard that this was requested by others, so here goes my rendition... I am sorry in advance if my Axeing is horrible, this is only my second routine:
Code: [Select]
"prgmHELLO"→Str1                     ;Name of the var
Str1                                 ;To get the pointer to the string in HL (Ans)
Asm(E7FDCB08CEEF9B4AFDCB088E         ;

As a word of warning, do not use "Stop" in your BASIC programs... This seems to cause a crash :(
You can use "Return" and all the other commands, though, to my knowledge.

I hope this helps!

174
ASM / APQ (Another Parser Question)
« on: February 28, 2011, 11:53:46 pm »
(Yes, the subject title was stolen from Hot_Dog... Hi Hot_Dog!)
I was wondering if there was a way that I could parse the inputs of a command manually using a parser hook. One reason I want to do this is because I want to modify the dim( command to accept archived variables and strings without throwing an error.

Any help would be much appreciated!

175
ASM / CheckFindSym problem
« on: February 19, 2011, 09:16:18 pm »
Okay, so for some time I have noticed that whenever I create a variable, CheckFindSym and FindSym seem to have trouble returning the correct pointer to the variable until after the var has been used. For example, in the screenshot below, CopyProg is creating a program, then when it finds that program and copies it to Str2, it copies starting at an offset. The data copies to the program, though. After the program is executed, though, the pointer seems to be corrected.

176
TI Z80 / LSDOS
« on: February 07, 2011, 12:30:31 am »
Using the power of CopyProg and GetName, LSDOS is a BASIC program that acts like a shell. In fact, it does more than just act like a shell. You can use it to look at your variables and not just the names-- you can actually check the contents. Whether it is an Appvar, string, or some other variable, even in archive. It also tells you whether the var is archived or not as well as the size. So what is planned for the future?

-A picture view mode
-Deleting
-Assembly routines to be used by asm programs
-If a BASIC program has the header "If 0:Then" it will use the data in the next lines (until it reaches "End") to load subprograms that will be included with LSDOS
-The ability to copy vars to other vars (determined by the user).

*By the way, the name is a spin off of a spin off of MirageOS:
MirageOS >> HallucinationOS >> LSDOS
...just check the logs if you don't believe me >_>

177
TI Z80 / GetName: Another great BASIC tool
« on: February 05, 2011, 06:28:13 pm »
GetName is a program inspired by a request from mrmprog over on UTI. This also happens to be the same person who inspired the idea of CopyProg. So what does this program do? Well, it is really simple, actually. It returns the name of a program. Let me elaborate a little more. Say I wanted the name of the first program in the program menu. I would do:
Code: [Select]
:0
:Asm(prgmGETNAME
If I wanted the name of the second program, I would use 1 instead of 0. Also, instead of just returning "RAH" it will return the name of the program with a prefix byte. So if it is a normal program, the string starts with "E" followed by the name. If it is a protected program, it starts with "F" and if you are familiar with CopyProg, you will start to see the usefulness of this.

If the program does not exist, "." is returned. This program makes it easy to show a list of all the programs on the calc. It also makes it easy to play with that list, especially if you happen to have prgmCOPYPROG. You can make a BASIC shell with these two programs. If you want to play prgmRANDOM and it happens to be in the archive, that is no problem!
Code: [Select]
:B                  ;the number for program to copy to RAM and execute
:Asm(prgmGETNAME
:Ans→Str1
:"[TEMP             ;This tells CopyProg to create and copy to prgmTEMP
:Asm(prgmCOPYPROG
:prgmTEMP           ;Executes the program
:"-[TEMP            ;This tells CopyProg to delete prgmTEMP
:Asm(prgmCOPYPROG

178
Other Calculators / ZToolPack
« on: February 04, 2011, 06:07:51 pm »
ZToolPack



http://www.omnimaga.org/index.php?action=downloads;sa=view;down=628

ZToolPack is a small collection of useful and small assembly programs that I have made for BASIC users. In this collection you will find:

ASMCall    -Allows you to use asm hex codes in a BASIC program
BSprt      -Draw 8x8 sprites using X,Y and a hex string
CopyProg   -Copies variables from RAM or Archive to another var
DataString -Converts a list to a string or visa versa
DataType   -Change variables to another type. Ex.: Pic to Str
ListToReal -Copies list elements to real vars
MultiGraphs-Manipulate 16 graphs/pics without using user RAM
MultiPics  -Manipulate any of 256 pictures with 6 functions
Xtra       -Get hacked vars and tokens (like greek alphabet)

179
TI Z80 / Samocal
« on: February 04, 2011, 02:45:19 am »
Samocal is an RPG I started and never finished over two years ago. It made use of Celtic 3, but it was still slow and data files were still very large. So guess what? I've been programming assembly for well over a year and ya know what, I'm getting a little bored. I think it is time I pick up this old project again, but this time I will use BatLib to take advantage of the speed and memory efficiency I designed it for. Below you will see what the old program looked like.
For an example of size, in the old version, a map uses about 1000 byte (16x24 tiles). In this version. 16x24 tiles will use less than 200 bytes.

Currently, my priority is on BatLib, but I figured I may as well get the word out here. Feel free to comment!

180
BatLib / BatLib Demo Programs
« on: January 30, 2011, 06:40:27 pm »
This topic is here to showcase projects using the BatLib library. Now that BatLib is stable, I have made a useful program: A spriteset/fontset editor.

  BatLib does not use pictures to store sprites like some other libraries. This makes sprite display faster and if you don't need a whole pictures worth of data, more memory friendly. Plus, you can use pretty much any data type you want to store sprite data.
  Because of this, I made the command GetSprite (35) so that the user could copy a sprite from the graph screen in the correct format to be used for other commands. I decided to take this one step further by making this program.

This program makes it easy for you to edit individual sprites in a sprite set or fontset. It includes simple routines to change pixel states as well as clearing, inverting, copying, and pasting sprites. The program also allows for some customization for the layout of the editor.

I hope this is useful!

Oh, P.S.- Str9 is the cursive fontset :D

Pages: 1 ... 10 11 [12] 13