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 ... 9 10 [11] 12 13
151
TI Z80 / BASIC Particles
« on: October 04, 2011, 05:00:34 pm »
Recently, I got a request to add particle effects to Grammer and I was originally going to just avoid this, thinking it would be too complex. However, the idea started bugging me and so I thought back to a post by Builderboy. So during class, naturally, I started trying to code a water-like particle effect... and it works! The only issue is that it can only do a few cycles a second once it has to handle 100 particles, so this is where I am:

I am going to work on an assembly particle engine that BASIC users can use. I plan to add this to Grammer, too, but for now, I want to make it for BASIC users. For the first version, I plan to use non-user RAM (saveSScreen in this case) to store particle data and it will handle up to a few hundred particles. There will be a command to add or remove particles as well as a command to run a cycle (or multiple cycles?) I also want to add the ability to save particle states, eventually, too.

So what do y'all think? I will try to come up with some working code before I have to go to work (so in the next 45 minutes 3:-) )

152
Grammer / Grammer Tutorial
« on: October 01, 2011, 05:30:48 pm »
This is probably going to gloss over a lot of key aspects, so if you have questions, feel free to ask :)
I realised that I still have yet to actually upload a tutorial anywhere for how to program with Grammer, so here goes :) This first section will describe some of the key aspects and it will provide an example :)

Part 1:
First off, I would like to introduce you to Grammer. Grammer is an interpreted programming language (like TI-BASIC), that can be programmed on your calculator (like TI-BASIC). If you program a lot in TI-BASIC, that will be helpful in learning Grammer, but it might cause some confusion, too. Because of that, I will introduce you to some of the key differences:

Numbers:
(simple) In Grammer, values are integers from 0 to 65535. Anything above or below is looped back around.
(complicated) Grammer uses 16-bit math. This makes things fast and simple for the interpreter while still being useful for games (I could have gone with 8-bit for even faster speed)

Math:
(simple) Math is done right to left and doesn't use order of operations. There are no parantheses. Also, overflow is detected for many operations and the overflow is stored to another var (theta prime)
(extra) Theta prime usually holds remainders or "carry." For example, if adding exceeds 16-bit range, 1 is returned as a "seventeenth bit."

Variables:
(simple) The letters can be used like in BASIC. These are called pointer vars in Grammer. You have A through Theta as well as their primes. For example, A and A' are two different pointer vars. Theta prime is used by the interpreter to return extra data or info so there are 53 vars to use and a system var. There are also strings and programs that can be accessed. To do this, you store them to a pointer var. For example, "HELLO→A is valid.
(complicated) When storing strings to a pointer var, you are actually storing the memory address that the data is located at. This is why they are called pointer vars. They point to the data, they don't actually contain it.

Using this information and a command reference, you will be on your way to making games!
(you can even use this to run algorithms faster than BASIC, if you are interested!)

So no we will make a simple program that moves a cursor around the screen! To do this, we will use the rectangle commands, getKey, and a Repeat loop. Depending on how you want the program to run will determine the header. For now, use .0:Asm(prgmGRAMMER as that will work universally for any method:
Code: [Select]
.0:Asm(prgmGRAMMER         ;This is the start of the program
0→X →Y                     ;Initiallises the coordinates. Note the space.
Repeat A=15                ;A will hold have the keypress, so this checks for [CLEAR]
Line(X,Y,6,6,2             ;draws an inverted 8x8 rectangle
DispGraph                  ;updates the LCD screen
Line(X,Y,6,6,2             ;Reinverts the rectangle.
Repeat A                   ;Repeats loop until A is not 0
getKey→A                   ;Stores the key code to A
End                        ;Ends the Repeat loop
X+A=3 -A=2                 ;Updates X coordinate based on key press, Result in Ans
If <91                     ;If it goes below zero, so this checks for going offscreen!
→X                         ;If it is on screen still, the new value is stored to X
Y+A=1 -A=4                 ;Updates X coordinate based on key press, Result in Ans
If <59                     ;Checks if the cursor would be offscreen
→Y                         ;If it is on screen still, the new value is stored to Y
End

Stop                       ;Ends the program
Press Clear or ON to exit :)

153
Math and Science / A Page of My Notes
« on: September 24, 2011, 06:25:35 pm »
Okay, so this might be a thread where people can post "a page of [their] notes." Pretty much, just something interesting that you jotted down-- something crazy and impossible even. I think it is neat to hear the ideas of others simply as a mind exercise. I like seeing how much I can warp my thought process to follow that of somebody else.

So I will go first and this isn't entirely outlandish. This is actually from a notebook from when I was in seventh grade (2005), so there are likely errors and whatnot, but it is still a cool idea :) At the end of this excerpt, I will expand on the idea :) Feel free to comment!

6/30/05 Thurs. Why Superconductors Act the Way They Do
A few Nobel Prize winners (for the discovery of superconductors), said that super conductors work because two electrons come together to form a bond, yet that normally would not happen. I think they said they don't know why. Here is what I think: 2 likes repel (positive and positive push away and negative and negative push away ). Well, think about it. Superconductors survive at very low temperatures and A:) at low temperatures, electrons are forced together because the atom is extremely "cold" and like most things, it "bunches up." And B) the magnetic fields that would normally destroy the bond isn't there because of the temperature

----

So anyway, a lot of that looks a little vommity, but here is what I would add and revise:

As temperature decreases, electrical fields are diminished. This would be attributed to the fact that to cool down, energy must be removed, blah blah. This would make the repelling forces of two electrons significantly weaker, allowing them to bond together.

In an electrical transfer of energy, electrons are kind of pushed along. Normally, some energy is lost this way, but with the idea of the two bonded electrons, they don't have energy to lose! So by the time they reach the end of the superconductive environment, they gain back their energy and there repelling forces and no energy is lost once they have split back up!

Anywho, I really have never studied this kind of thing properly, so I am sure there are some key ideas missing and incorrect, but it is still neat to think about, right?

154
TI Z80 / Prime Tester benchmarks
« on: September 18, 2011, 11:05:47 am »
I was curious about what makes for a worthy enough prime tester to upload to TICalc. I think speed, RAM usage, and method are all key. The fastest version I have so far is 89 bytes, tests for primality in numbers greater than 5, and so uses a list of {2,3,5} to make sure it is not any of those. It takes 30 seconds to say 90000049 is prime and 103 seconds to say 1166881097 is not prime (this is 77477*15061). I am sure it could be faster and smaller, so any ideas?


90000049,prime,30 seconds,uses only A and Ans,89 bytes
90000049,prime,50 seconds,uses only A and Ans,65 bytes
90000049,prime,104 seconds, uses A and Ans,46 bytes
1166881097,Composite,103 seconds, uses A and Ans,89 bytes

155
Math and Science / A Math... Question :)
« on: September 17, 2011, 11:56:49 am »
I have a little math challenge for y'all… This one isn't difficult so long as you don't overthink it, but if you do (like me) you will probably laugh at the simple solution. My hope is that you are like me and this keeps you occupied for a little while :

Find 132 consecutive composite natural numbers.

  • Natural numbers are {1,2,3,4,…}
  • A composite number is a number that isn't prime like 15 (15=3*5)
  • An example of 12 consecutive composites is: {114,115,116,117,…,125,126}

I have two solutions that I came up with (one of them required Latex)
Have fun!?

156
Math and Science / Builderboy's Lobster Puzzle-- A geometric approach
« on: September 09, 2011, 06:32:42 pm »
So Builderboy presented a puzzle along these lines on IRC, earlier:

You have a flat surface (for all intents and purposes, 2D)
A lobster is at position x (Builder said frog, Qwerty said turtle)
The lobster moves 1 unit away in a random direction (any angle). It tires out after 3 moves

The question is, what is the chance that Lobztor will be within 1 unit of its starting position?

Here is my approach:
-First draw a circle with center at point x of radius 1. This is the target region as well as all the first move positions
-Choose a point on the circle as the center for a second circle of radius 1.
Note that 1/3 of the circle is in the 1 unit range.
-From here, draw infinitely many circles on this circle

You will notice that this creates a circle of its own with radius of 2 units! Using the powers of geometry, we find the ratio of the area of these two circles and get....1/4. Yay! It is pretty close to magic in my opinion!

EDIT: Just so y'all know, that is 530 circles drawn by Grammer in that screenie at 6MHz. :D

157
ASM / Programming the TI-83/82
« on: September 03, 2011, 12:55:11 am »
I have received a request to make a program version compatible with the TI-83/TI-82 STAT. I understand that I won't be working with flash or bcalls, but how do I make assembly programs for them? What do I have to do with the compiler to make it compile as a .83p? By the way, I am working with the DCS SDK.

158
TI Z80 / ASMComp
« on: August 10, 2011, 05:49:12 pm »
I am surprised that I have not mentioned this before, here... Anywho, a while ago I started a small project called ASMComp for crazy fools like myself or those who do not have access to their computers all the time. What it is is a tool for developing in assembly on the calc. Until recently, the only feature was to allow for commented code.

Here is what this version has or lacks:
-I haven't added back in commenting for some reason (laziness?)
-You can use equate files
-You cannot define equates yet (other than labels)
-You can use labels
-You can use token strings

So to take directly from the readme, this is an example of code, currently:
Code: [Select]
     :[FWAHAHA
     :.5EQU
     :AsmPrgm
     :EF[HOMEUP]
     :EF[CLRSCRNFULL]
     :21[MESSAGE]
     :EF[PUTPS]
     :210000
     :115F3F
     :EF[INVERTRECT]
     :C9
     :Lbl MESSAGE
     :02"HI"
     :End
The nice part is that this doesn't automatically include the BB6Dh header for asm programs and the code can be output to non-program vars. I plan to add in the ability to do simple math such as (3+[MESSAGE]) as well as add in variables (like 3->A), the ability to define 1 or 2 byte equates (or maybe multi-byte equates), add in If statements to control what sections of code get compiled, and all sorts of other goodies. I imagine code looking something like this:
Code: [Select]
:[MEOW       ;The type and name of the output file
:.5EQU        ;The equates file to use
:=1 COM1     ;Sets an equate for COM0
:=1 COM2     ;Sets an equate for COM1
:=0 COM3     ;Sets an equate for COM2
:AsmPrgm      ;This makes a header for the assembly program
:EF[RCLANS]
:EF[CONVOP1]
:B720{COM1prgm}     ;uses relative jump
:EF[CLRLCDFULL]C9
:Lbl COM1prgm
:If 1=COM1
: 3D20{COM2prgm}
: EF[HOMEUP]
: C9
:Lbl COM2prgm
:If 1=COM2
: 3D20{COM3prgm}
: 3E02D310C9
:Lbl COM3prgm
:If 1=COM3            ;The following chunk of code is not included since COM3=0
: 3D20{END}
: 3E03D310C9
:Lbl END
:C9
:End

So what do y'all think? Is this project worth my attention?

159
Grammer / Grammer
« on: June 18, 2011, 10:04:53 am »
Latest Version:Grammer v1.14.10.11
Latest App version:Grammer 2.31.12.11
(may not actually be the latest versions .__.)

Some of y'all may have noticed a few fleeting moments when my sig contained something about "Grammer" so here is pre release. Pretty much, take BASIC ReCode, make it as safe as BASIC, add in lots of cool new features like labels, calls, and executing other programs, and you have Grammer. The best part, this version is going to be nothing like the final product. I plan to add in a program editor with tokens that are not at all like the OS tokens and I plan to add in the ability to add new libraries of commands. For example, I have ideas for graphics libraries and math libraries. Right now, the readme is a mess and I do not expect anybody to be able to code much, yet. However, I have added in some math that is more than simple (square roots, rounded square roots, lcm(, gcd(, nCr, and the like). I have made arbitrary math programs and sub programs with it, games, and other types of programs, but unfortunately I have neither the latest version nor all of my programs. For now, you will have to live with a sample version  >:D

...Also, I am throwing David a bone here... I have designed a sprite routine that can draw sprites to pixel coordinates (not just every 8) and can be multiples of 8 pixels wide  ;D

160
BatLib / BatLib News
« on: May 04, 2011, 07:59:07 am »
I plan to keep future updates to BatLib over at United-TI. This will likely mean less input, but I can deal with that. Here is the thing: BatLib is an app that I started for my own uses. I only released it to begin with to make a name for myself and now that I have made a name for myself, I have been taken on a guilt trip too many times whenever I have wanted to leave in the past.

I will still frequent Omnimaga, probably, but I would rather my IP be banned and my account deleted. I could just troll the hell out of this place instead, but I would rather be a little more mature about it.

So here is the deal: I have tools that I make for my own programming. Since these tools can be replicated easily, I have no problem sharing them. If you have neat ideas, I have no problem listening. If you want to use the tools I create for myself, you can, but for now, I will not be keeping my tools up to date, here.

161
TI-BASIC / [Request] BASIC Subprograms
« on: April 25, 2011, 09:11:07 pm »
Hello all! I am working some more on LSDOS and I am now in need of ideas for BASIC sub programs. I am looking for sub-programs that many BASIC programs can use. For example, I might make a program to handle high-scores that can be used by several programs.

Thanks in advance!

162
TI Z80 / On-Calc Virtual Processor
« on: April 24, 2011, 12:38:30 am »
I have decided, once again, to start up another project... This time it is going to be a virtual processor on the calc. The reason I decided to start this was to give beginners a safe way to play with assembly, get accustomed to hexadecimal and syntax, and to get them used to low level stuff. For that reason, I wanted some input about what instructions should be supported. I am using BatLib extensively, so I have access to some resources (like for reading/writing bytes and the emulated LCD and whatnot). At the moment, I have this stuff finished:

-The memory map consists of 4 memory banks of 256 bytes each (1024 bytes, total)
-There are 16 pages in all making a total of 4096 bytes of memory
-There is a PC register (functioning)
-There is an SP register (not used yet)
-There are registers a,b,c,d,e,h,l,f as in Z80 assembly
-I have loads all of the loads working in the form of ld reg8,reg8 where reg8 can be a,b,c,d,e,h,l, or (hl)
-There is an emulated LCD port that is 32x32
-There are four emulated ports for memory mapping

The emulated LCD port cannot be written to, yet (there isn't an in/out instruction), but here is how it works:
-Load a byte into the port (port 0). This is an MSB
-Load another byte and this becomes the LSB. At this point, the LCD "refreshes" using the MSB and LSB as an address in memory for where the LCD data is.

Unfortunately, a 32x32 screen means that half of a page is used up (128 bytes), but at least you don't have to write every byte of an image to a port x.x

So anyway, here is what I plan to add soon:
add / adc
sub / sbc
and / xor
or / compare (really I didn't want to type "cp")
jr / jp / call / ret
ld (address),reg8 / ld reg8,(address)
ld reg8,immediate / (in/out/bit/extended/ex de,hl/ex sp,hl /ex pc,hl
push / pop

port 5- key port: write is the same as the actual key port, read is the same. The value refreshes after the next instruction finishes.


So does anybody have any suggestions or ideas?!




Here is a screeny, too. When you notice that I use these commands:
dim(14,Str2,0,15
dim(14,Str2,1,1
dim(14,Str2,2,49
dim(14,Str2,3,255
...
Str2 has the name of the hacked string and I am writing to the first few bytes 0F0131FFFFFFFFF...
That translates to:
Code: [Select]
ld b,(hl)
ld a,b
ld l,a
So the first time it was run, hl was 0, so it read byte 0 (0F) and stored it to b. Then it loaded b into a and then it loaded a into l. The next time it was run, hl was 000Fh and byte 15 was FFh, so FF was loaded into b, b into a, and a into l. The next time it was run, hl=00FFh and byte 255 was 00h, so 0 was loaded into b, then a, then l and it all starts all over again.

As a note, I could have just done 37h and it would have done ld l,(hl), but I needed an example XD

163
Other Calculators / MOVED: Zeda's Hex Codes
« on: April 21, 2011, 11:48:42 am »
This topic has been moved to TI-BASIC Language.

http://ourl.ca/10558

164
TI-BASIC / Zeda's Hex Codes
« on: April 21, 2011, 11:37:20 am »

165
ASM / Create vars in a Parser Hook
« on: April 19, 2011, 12:45:01 pm »
I am now trying to get BatLib to create variables like programs and that isn't much of a problem. The problem is that when creating programs or appvars, it throws an error, even if it successfully creates the var! So, I was wondering if there is a special method that I have to go about to create programs and whatnot... ?

Thanks in advance!

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