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 ... 186 187 [188] 189 190 ... 317
2806
Grammer / Re: Grammer 2-The APP
« on: November 21, 2011, 01:03:34 am »
Okay, so update-wise, before I make the next official release, I want to put this out for testing. It seems there have been a lot of issues lately (mostly sprites). I have been hard at work making sure these bugs have been fixed (I am not sure they have been, though) as well as making sure these next commands are safe and in working order. Anyway, here are the next commands:
sub( deletes data from a variable. The syntax is:
sub(#ofbytes,Offset,"VarName
So an example of using this might be to delete 7 bytes from the beginning of an appvar:
Code: [Select]
sub(7,0,"UAvar
This code should not delete any data from outside the program. If you try to delete 7 bytes of the last 3 bytes of the var, only the last 3 are deleted. If you try to delete 4 bytes and there is only 1 byte left in the var, only that 1 byte is deleted. See below for negative effects.
augment( is used to insert data into a variable. It has the same syntax as sub( and it will cause a memory error (see next command) if there is not enough memory available.
solve(3, is used to create a Custom Error Handler. The argument for this is a pointer to the error handler. Whenever Grammer throws an error (there is a Memory error and ON Break error), code will be diverted here. The error code is passed in Ans as either 0 for ON or 1 for Memory. For example, here is an error handler that will display the error if ON is pressed and then quit and a menu to quit or continue for a Memory error:
Code: [Select]
.0:
ClrDraw
0→A
solve(3,Lbl "EH
Repeat 0
augment(120,0,"EB
Text('0,0,A
A+1→A
DispGraph
End
.EH
→Ɵ'       ;Stores the error code to Ɵ'
Disp π9872       ;so that we don't mess up the graph buffer
ClrDraw
If !Ɵ'
Text(º"ERR:BREAK":DispGraph:Stop
Text(º"ERR:MEM
Text(6,1,"Ignore
Text(12,1,"Quit
1→Z'
Repeat getKey(54       ;Use 2nd to select an option
Line(0,Z'*6,6,28,2
DispGraph
Line(0,Z'*6,6,28,2
Repeat getKey
End
2*getKey(1 +getKey(4
If                      ;There is a space here
→Z'
End
If Z'-1
Stop
Disp π9340
End
solve(3,0 will reset the handler so Grammer handles it.
Here are the changes and bug fixes:
-Changed the Send( command so that it now creates a var filled with zeros (instead of unknown data)
-Changed UnArchive command to return a pointer to the var data in RAM
-Fixed Pt-On( and Pt-Off( command up (any bugs that I found).

So the negative effects of augment( and sub( deal with the fact that these might shift your program around in memory. Don't worry, this won't affect the parser, but what it can do is mess around with labels. For example, if you get the pointer to a label and store it to P, then you delete some data from a var and your program is shifted down some bytes, then P will no longer point to the correct location!

So here are proposed ideas on my part:
1) Make a "Relative Pointer Mode" that will use Goto , Return, Lbl , Func, and prgm, based on relative addressing. (This means that it won't matter where in memory the program is because these will all work as offsets from teh start of the program).
2) Add a ' modifier to the commands to tell it to use relative addressing. So Lbl '"Hello will find the offset into the program that the label .Hello is at. Then prgm' will call the offset into the program.

So technical stuff aside, here is the download, currently.

the circle command in this version will let you use an optional argument as the byte pattern for drawing >.> I don't know if this will be changed or not, so it is not documented. So don't use it in a game!

2807
Site Feedback and Questions / Re: Is this Normal for Omnimaga Stats?
« on: November 20, 2011, 06:43:11 pm »
I believe today's stats aren't added to the weekly stats until after today is over.

2808
TI Z80 / Re: zStart - an app that runs on ram clears
« on: November 20, 2011, 06:23:38 pm »
And it could launch apps too ? O.o That would be awesome :D
Hmm, that seems useful and doable O.O Would it just require finding the app page and jumping to 4080h?

2809
TI Z80 / Re: Grammer Tetris
« on: November 20, 2011, 01:08:58 pm »
I only could optimise a little bit, so far, so good coding! And I also noticed that this is about as fast and as smooth as a Gameboy game I played one O.O

2810
Miscellaneous / Re: How often would you seek programming help?
« on: November 19, 2011, 11:14:25 pm »
I usually try to struggle through code myself, but every once in a while I need help. And I like cookies...

2811
Miscellaneous / Re: Why did you learn how to program?
« on: November 19, 2011, 11:12:23 pm »
I started to learn because I was just intrigued. I had no intention of getting as far as I have, I just wanted a fast way to make and compute algorithms. I think the first thing I wanted to do was make a prime tester, but I cannot remember. I still use my calc often to compute algorithms, but I obviously do more than that, now ♥

2812
TI-BASIC / Re: TI-BASIC Q&A
« on: November 19, 2011, 10:04:10 pm »
I did that! In one of my first RPG's I stored EVERYTHING to a picture for save data. I even let the user make custom sprites for their character (they could only view it in the stats menu). I felt so clever when I realised I could use the pixels as powers of 2, then I learned that was called binary XD

EDIT: @epic7: That probably didn't cause a crash then XD

2813
TI-BASIC / Re: TI-BASIC Q&A
« on: November 19, 2011, 10:01:26 pm »
In any event, it is very likely not the fault of the OS or the program XD That is the best part about BASIC-- you usually have to know some really advanced stuff to make it cause a glitch or a crash :)

2814
TI-BASIC / Re: TI-BASIC Q&A
« on: November 19, 2011, 09:56:16 pm »
If that was all you had, that was probably what corrupted it :/

2815
TI-BASIC / Re: TI-BASIC Q&A
« on: November 19, 2011, 09:53:19 pm »
What assembly programs or apps did you run?

2816
TI-BASIC / Re: TI-BASIC Q&A
« on: November 19, 2011, 09:44:39 pm »
Now I want to see what I can do O.O I remember I used to store strings to pictures by storing 19 letters to a row (I used 5 pixels to determine which of 32 chars to use and vice versa). So I would get 1197 characters out of 767 bytes instead of 1208 bytes :)

2817
TI-BASIC / Re: TI-BASIC Q&A
« on: November 19, 2011, 09:13:11 pm »
DJ_O used to make some pretty amazing/fast BASIC programs that could rival Axe >:D Although generally it is slower :/ People love the challenge of BASIC >:D

2818
TI-BASIC / Re: TI-BASIC Q&A
« on: November 19, 2011, 09:10:11 pm »
Hehe, there are lots of cool things you can do in BASIC that you might never even think of O.O I just can't think of any at the moment...

2819
TI-BASIC / Re: TI-BASIC Q&A
« on: November 19, 2011, 09:03:36 pm »
Have you ever used Repeat loops? They are very lovely for these kinds of loops. Repeat will kepp repeating the loop until the condition is true. It does not test the condition before entering the loop (a while loop does). For example, this code will move a pixel around on the screen in a 16x16 area:
Code: [Select]
3→X
3→Y
Repeat A=45     ;Later I will store the key value to A. This means repeat until clear is pressed.
pxl-Test(Y,X→C
9→B
Repeat A          ;getKey will be stored to A, so this repeats until a key is pressed
B+1
If Ans>9
Then
Pxl-Change(Y,X
0
End
Ans→B
getkey→A
End
If A=105     ;Enter
1→C
If A=23       ;Delete
0→C
If A=21       ;2nd
not(C→C
Pxl-Off(Y,X
If C
Pxl-On(Y,X
Y+(A=34)-(A=25
If Ans<0
15
If Ans>15
0
Ans→Y
X+(A=26)-(A=24
If Ans<0
15
If Ans>15
0
Ans→X
End
I may have mistyped something, but that should give you an idea of how to make things work :)
You can press clear to exit, 2nd to invert the pixel, Enter to turn the pixel on, and Del to turn the pixel off.

EDIT: I love Repeat loops :) I actually learned them long before I understood While loops. It think this is more useful...

2820
TI-BASIC / Re: TI-BASIC Q&A
« on: November 19, 2011, 08:37:46 pm »
Also, if you only have one line following the If statement, you don't need an End or a Then :)
For example:
Code: [Select]
If A=1
3→D

Pages: 1 ... 186 187 [188] 189 190 ... 317