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

Pages: 1 ... 206 207 [208] 209 210 ... 317
3106
Grammer / Re: Grammer
« on: October 06, 2011, 03:10:46 pm »
Hmm, what do you mean by that? I am assuming it wrote an incorrect command to the LCD port to change it to 6-bit mode, but I see nowhere in my code that that could happen...

What where you doing when it compressed it? Like, what program or commands were you using?

3107
Grammer / Re: Grammer
« on: October 06, 2011, 01:48:25 pm »
Okay, here is a mini update adding the P▶Ry( command to control which particle effect is used. I plan to modify this to allow pointing to a different buffer for when I add the ability to create vars. This way, you can have larger buffers (meaning more particles) and multiple buffers to handle different types of particles :)

So now I need a token to use for creating new variables x.x

So here is the program and a new screenie :)

EDIT: Also, here is the program used in the screenie. It is the same as before except you can use + or - to select the particle type.

3108
Grammer / Re: Grammer Tutorial
« on: October 06, 2011, 12:18:48 pm »
This section will deal with how to use logic expressions and loops.
Logic:
Say I wanted to test if Enter was being pressed AND if C is 1. In BASIC, this would be simply:
Code: [Select]
If C=1 and getKey=105
However, in Grammer, there are two key differences: the getKey codes are different and there isn't an and token! So instead, we must use math. As in BASIC, the condition is considered "false" if 0 is returned and true for anything else returned. So in Grammer:
C=1 returns 0 if C is not 1, 1 if C=1
getKey=9 returns 0 if Enter isn't pressed, 1 if it is pressed

So we want to return 1 if and only if both statements are 1. How do we do this? We multiply! If either statement is false, multiplying them returns false, too. But how can we do this in Grammer? It doesn't have order of operations or parentheses! Well not to worry, I try to give the bad news before the good news :) The good news is that you can use spaces or colons to separate chunks of math! So here is the final code:
Code: [Select]
If C=1 *getKey=9
Similarly, with OR logic we use a + instead of *:
Code: [Select]
If C=1 +getKey=9

Loops:
The loops in Grammer act the same way as in BASIC (except for one case with the For( loop)

So here is an explanation of the loops:
Repeat
This uses a conditional expression and loops until it is true. For example, to loop until Enter is pressed:
Code: [Select]
Repeat getKey=9
End
Note that this executes all of the code between the Repeat and End first, then it checks the condition.

While
This also uses a condition, but it only executes the loop as long as the condition is true. For example, to loop while a key is not pressed
Code: [Select]
While getKey=0
End
Note that this will not execute the code in the loop if the condition is false upon entering. For example:
Code: [Select]
3→A
While A=4
<<code that never gets executed>>
End

For(
This works the same way as in BASIC. For example:
Code: [Select]
For(A,0,99
End
However, if you try loop from 0 to 0, for example, the loop will go 65536 times.

So if anybody has any questions, wants help with some code, or wants a specific example, feel free to ask :)

3109
Art / Re: my logo design
« on: October 05, 2011, 04:03:30 pm »
Haha, cool! I like how this looks!

3110
Grammer / Re: Grammer
« on: October 05, 2011, 11:24:40 am »
Hehe, Thanks! I plan to add some other options, too, soon. For example, I was making a pipe system to drop the particles in and it reminded me of a game I played a long time ago (Pipe Dreams, I believe). I thought "Wow, it would be cool if I could have the particles travel along mazes or pipes!" So I started thinking about how to do that... and I have an idea that I want to try! Also, I like that I can make an hourglass >.>

This could make some neat effects!

3111
Grammer / Re: Grammer
« on: October 05, 2011, 08:08:29 am »
I have now added some particle effects to Grammer O.O
Yeong gave a great idea for tokens to use:
R→PR( Clears the Particles (the pixels stay there, though)
R→Ptheta( Executes a cycle (this computes and draws the location of the particles)
R→Px(y,x This adds a particle at pixel position (Y,X)

This only handles up to 383 particles, but it is fast :)

So here is a sample program :) Just press left/right to move the cursor and press down to start dropping particles. Press [CLEAR] to freeze them, press [MODE] to exit :)

prgmPARTEX is 127 bytes O.O

3112
TI Z80 / Re: BASIC Particles
« on: October 05, 2011, 07:23:51 am »
O.O
So there's a chance that grammer will only go to math/science programming D:
No, but this is a neat graphics effect :D You could add this, say, to the tip of a volcano or something :)

3113
TI Z80 / Re: BASIC Particles
« on: October 05, 2011, 01:17:44 am »
Okay, that took a bit longer than expected, but here is version 1 :)
It has a few commands:
0 or {0 will "freeze" existing particles and no longer interact with them
1 or {1 will execute a cycle (computes the location of all the particles
{2,Y,X will add a new particle at pixel position (Y,X)
99 or {99 will display the graph buffer

So an example of how to use this is:
Code: [Select]
0:Asm(prgmPARTICLE     ;Clears all particles
{2,1,3:Asm(prgmPARTICLE  ;Adds a particle at (1,3)
For(A,0,99
{1,99:Asm(prgmPARTICLE    ;Cycles through the particles, then display the graph buffer
End

For those familiar with my libraries, you can chain commands together in a list :)
Another note is that this will handle up to 383 particles (And it handles this without a problem).

So here is an example and a screeny as well as the program :)

EDIT: I can't wait 'till I add this to Grammer :devil:

3114
Grammer / Re: Grammer
« on: October 04, 2011, 10:31:17 pm »
Hmm, how would the rules work? DO you have any ideas? I assume there would need to be a life cycle condition and conditions about where to move the particles (with certain levels of precedence).

3115
Grammer / Re: Grammer
« on: October 04, 2011, 10:22:17 pm »
Actually, that is already possible :) You just add the code after a Stop. For example:
Code: [Select]
.0:Asm(prgmGRAMMER
ClrDraw
Text('0,0,37
DispGraph
Goto Lbl "Stop         ;Jumps to the label named Stop
//HI!
.Stop                    ;The label named Stop
Stop                    ;Exits Grammer
Disp "HELLO!        ;TIBASIC

Also, in other news, I am working on the particle effects suggestion, currently, and I am just stitching up the code and debugging at the moment :) Hopefully we will have water effects to work with in the near future O.O

3116
TI Z80 / Re: BASIC Particles
« on: October 04, 2011, 05:44:35 pm »
Blegh, so I am not going to finish in time, but I have these commands finished:

Clearing all particles
The water particle engine

What I need to add:
A command to add particles
A command to delete particles

These should be doable in under 10 minutes, so these will be attended to after I get out of work in about 4 hours :D

3117
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:-) )

3118
Grammer / Re: Grammer
« on: October 02, 2011, 10:28:53 pm »
Thanks! :) I still have to get to work on the app version, soon, too. I made one that works except for the self modifying code, so I need to fix that up :)

3119
ASM / Re: 16 by 24 bit signed addition
« on: October 02, 2011, 03:51:01 pm »
Oh, right, signed XD. Sorry, I missed that. I don't think I've ever made a signed math routine O.O

3120
ASM / Re: 16 by 24 bit signed addition
« on: October 02, 2011, 03:45:23 pm »
Wait, so are you adding 24 bits at (var1) and 16 bits at (var2)?
If that is the case, does this work (I have not tested this!):
Code: [Select]
  ld hl,(var1)
  ld de, (var2)
  add hl,de
  sbc a,a
  ld b,a
  ld a,(var1+2)
  sub b
  ld (var1+2),a
The result is in AHL and does essentially the same thing (I believe) with two bytes less (I think).

EDIT: Is there a particular reason you are only saving the upper 8 bits and not the lower 16?

Pages: 1 ... 206 207 [208] 209 210 ... 317