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

Pages: 1 2 3 [4] 5 6 ... 24
46
It looks sharp! The shadow of the old logo makes it stand out more on a white background but I suppose that doesn't matter much given your track/album backgrounds.

47
ASM / Re: Compiled language for BASIC programmers
« on: July 02, 2021, 07:00:36 pm »
If I understand what you are saying, you are trying to make a basic program that compiles another program to assembly. Are you using some kind of library/shell or how are you reading files in basic? Do you plan on having some small hex libraries? Also, I would imagine that the time needed to type in a whole compiler in by hand would be huge and the likelihood of the user making a mistake would be high. Debugging an assembly/compiled program can be tricky enough to a new user without having to worry if they had a small typo somewhere in the 10k+ bytes of the compiler program. While I won't dissuade you from the project, there seems to be some pretty huge difficulties involved. Additionally, you probably have a pretty small audience. How many people do you think would be interested enough in the language to spend hours copying it over by hand (assuming they don't have a cable)?

As for the optimized routine, what language do you want it in? Since you say strings I assume you mean basic.

48
Axe / Re: Looping Through an Array in Axe
« on: June 28, 2021, 02:44:21 pm »
Nice! I can't believe I guessed that right. That Return!If was a total shot in the dark.

49
Axe / Re: Looping Through an Array in Axe
« on: June 27, 2021, 03:52:56 pm »
Alright, here are a couple guesses.

For(K,1,L) is starting at 1 and not 0. Is that what you want?

Z+1≠N doesn't change any value and so the loop in CheckRight is pointless unless you use the value of N at some point outside the function. Did you mean Return!If Z+1≠N ? If I remember correctly, the For loop will increment at the end and return that value. That means that CheckRight should always return L no matter what data it is given. (I could be wrong but either way there is no way your code is doing what you want it to)

You are also spilling into CheckRight like you did at the end of your main loop. It shouldn't be a problem but does waste time.

50
Axe / Re: Looping Through an Array in Axe
« on: June 26, 2021, 07:44:21 pm »
Just looking through your code, I'd like to point out a few things.

I don't have my calc on me but your line r₂*37+r₁+192→{r₂→{r₁→{L+1→L*4+L₁-4}+1}+1}ʳ may not work the way you want it to. Either x->{L1}->x or x->{L1}r->x doesn't return x but instead returns L1. If it is the latter you are fine but you should keep that mechanic in mind so it doesn't get you later.

You can put your data at the end of your program. No need to scroll through all the lines of [FFC1C3E7C33E23FB]→Pic0. A lot of the Axe code examples aren't up to date at all. They are all valid as far as I know but they aren't very efficient.

I assume you starting your comments with ./ is just for you. You don't need the slash.

At the end of your program, you set Fix 4, ClrDraw, run into AddMob and use its return to quit. That is asking for trouble since you don't know the values of r1 and r2 and is is possible you corrupt memory as you exit. Just return before you get to AddMob. Also, the Fix 4 isn't really needed. Yea, it technically best practice but doesn't really matter.

Much of your code is laughably very unoptimized but if you are having trouble with other bugs I won't confuse you more with optimization. Don't worry, my first code was just as bad. (I'm sorry, I just get really excited when I see Axe code to optimize)

If you are still having trouble, (or have any in the future) upload your .8xp and I'll find out what is wrong. (and have a blast in the progress)

51
ASM / Re: ASM Optimized routines
« on: June 18, 2021, 06:15:20 pm »
Wow, that's really neat. I don't have a use for that at the moment but I bet I can find one in some old, slow code.

How did you go about making the routine generator? I assume there are some simple rules it follows.

52
ASM / Re: Graphics demo
« on: May 01, 2021, 01:49:10 pm »
It has been a long time, but I have stuff to show so why not?
Ever heard of a calculator game with achievements? Ill show off the help menu popup although it isn't anything special. Also, if the framerate drops too low, greyscale quality is dropped to help performance. It has multiple levels of quality but I had to set it to drastic changes to get the quality drop to show up on the emulator. In menus, it pulls quality back up. All three can be turned on or off with settings of course.

The whole thing is finished now and all the bugs have been fixed. Maybe some day Ill actually publish it.

53
News / Re: Bringing the community together!
« on: April 01, 2021, 08:12:21 pm »
I, for one, welcome our new overlords as long as there will be a blue skin. I don't really care for Cemetech's shade of red. Since it is an acquisition, that means money is changing hands right? I won't sell my support for less than a brand new 4-function calculator!

54
ASM / Re: HEX Asm on TI-83+
« on: February 27, 2021, 11:37:26 am »
Mimas is another option. Mimas should let you type out any code from a tutorial in almost the same format as on a pc. It supports a most of the features that you would get from writing asm on a pc and comes with a very nice small font IDE. Its only downsides are that you can only copy-paste one line at a time and it is missing the declarations for the more obscure B_CALLS and other less-used definitions. (you can still use them, you just have to type in the hex) It supports converting back and forth from asm files on your pc to the on-calc version as well in case you want to import some routines or share your code. All in all, it is surprisingly powerful and feature-complete.

Edit: I know you said you didn't want to use Axe, but if you decide on directly typing in hex Axe supports inline hex, comments and constants. You can declare constants and labels and use them in your hex to make it a little more readable. It can be used as a more flexible version of the 83's built in AsmPrgm( command. I would assume Grammar can be used in a similar way.

I would also recommend some kind of shell for running your program / letting you keep your source files in archive. zStart is my favorite. DoorsCS7 is a great shell but it uses a lot of archive space on the 83's limited storage.

55
TI 68K / Re: Best way to perform clipping with irregular shapes
« on: February 22, 2021, 08:15:03 pm »
If you can reduce every shape down to a series of lines (or can get away with approximating them as such) then you could just take the lines that outline the shape you want to test and check it against every line that makes up the environment. There are pretty simple formulas that you can use to check if 2 line segments intersect. If the calc you are using has a built in multiplication instruction it would likely be faster than drawing lines and use less memory depending on how it is implemented. But if you use really complex shapes or need precision with curved surfaces drawing to a buffer is your best bet. Drawing to a buffer also lets you save the buffer if the area doesn't change which makes it really fast.

If you are having trouble drawing to the larger area, you could use the built in sprite routines to draw the whole thing to the 240x128 area, copy that much to the 256x256 buffer, shift everything over, draw again, copy that much to the larger buffer and repeat until all the area is filled. If you are redrawing that every frame, it could get pretty slow.

Additionally, if you only have one object you are testing for collision, you can simply shift the environment around that one object. Since the things it will collide with will be inside the size of the default sprite drawing box, you don't need to worry about using a larger buffer. This does assume that you redraw the clipping buffer each frame/update.

Since you said you are making an rpg, I assume the environment is pretty static and using my second suggestion of a collision buffer, drawing everything to the screen just copying it chunk by chunk to the buffer is probably the best since it is the simplest.

56
Axe / Re: Timekeeping
« on: January 29, 2021, 04:19:16 pm »
Here's my text axiom:
All commands located under Matrix (2nd->math)
All the text drawing commands use small font and are unaffected by modes like Fix 5. It does use the built in pen for text locations so commands like Axe's built in Text(x, y) would affect text drawn from the axiom. All commands are just as fast as Axe's or faster. This is because a lot of Axe's text stuff is calls to the operating system which is slow but very size-efficient. Drawing text with this axiom is about 2x faster than using Axe's built in text routines. Thanks Zeda for for optimization help!

Text drawing commands:
Since this is an axiom, I can't take a variable number of arguments for the text like Axe does. You will just have to call text( multiple times if you want to draw multiple strings.
text(x, y, string) //Moves the pen to x, y and draws the text to the main buffer.
text(x, y, string, buffer) //Same as text(x, y, string) but it draws to the specified buffer. Putting L6 in for the buffer would make it identical to text(x, y, string)
text(string) //Draws the string to the main buffer at the pen's current location.
text(string, buffer) //Draws the string to the specified buffer at the pen's current location.

Conversion functions. Most of these just take a value and turn it into a string to be displayed. Several are redundant from Axe but I needed to make copies because Axe's are locked into their functions.
VALUE>char //converts the value (0-255) into a character and returns a pointer to the string. Not terribly useful.
VALUE>dec //converts the value (0-65536) into a string. Works like Axe's >Dec function but is faster. It also gives a string which means it can be used in place of Axe's >dec function. It also doesn't have the weird spaces padding it to 5 characters long.
VALUE>decr //Converts the binary value (0-255) to a string of 1's and 0's.
POINTER>decrr //Converts the 4 byte value pointed into a string. Basically its >Dec but for 4 byte numbers. Note that it wants a pointer!
POINTER>tok //Gets the string for the token pointed to. Note that this is a pointer. Similar to Axe's >Tok
POINTER>tokr //Returns 1 if the value pointed to is a 2-byte token or 0 otherwise.
If you want to display hex values, just use Axe's built int >Hex. It returns a pointer so it works with all the text( commands.

57
Axe / Re: Timekeeping
« on: January 29, 2021, 02:30:47 pm »
Here is an axiom that I wrote a while ago to deal with 4 byte numbers and timekeeping. It uses the system clock so it is accurate to the second. If you need fractions of a second, you will have to use interrupts.

Commands:
All commands are located under Vars->Window->T/Theta or U/V/W

Time:
ClkOn //Starts the system clock if it isn't running already.
ClkOff //Stops the system clock and sets it to 0. If you want to zero the clock, just turn it off and back on. Note that this resets the user's on-calc clock as well. Not that anyone really cares...
GetTime(oPtr) //Sets the 4 bytes pointed to to the current time in seconds. If you are expecting time to be less than 16 hours, you can just read the first two bytes of that. For example you can do GetTime(oA) and then just read A to get the time passed in seconds. (Although doing so will modify B as well)

4 byte math:
Although you didn't ask for this, Ill document it anyway since there is a lot of 4 byte math commands in the axiom.
All commands return their first argument.

Add(oPtr1, oPtr2) //Adds the number pointed to by oPtr2 to oPtr1. oPtr2 is unchanged. Like all 4 byte commands, this returns the first argument, oPtr1.
Add(oPtr1) //Increments the 4 byte value pointed to.
Sub(oPtr1, oPtr2) //The same as Add( but subtracts the numbers instead. oPtr2 is unchanged.
Sub(oPtr1, oPtr2)r //Returns the sign of the subtraction operation. Basically it returns 1 if the value pointed to by oPtr1 is greater than oPtr2, 0 if they are equal and -1 (65536) if oPtr2 is greater. The contents of oPtr1 and oPtr2 are unchanged
Sub(oPtr1) //Decrements the value pointed to.
Ld(oPtr1, oPtr2) //Sets the value pointed to by oPtr1 to the value pointed to byo Ptr2. Basically {oPtr2}r->{oPtr1}r:{oPtr2+2}r->{oPtr1+2}r
Ld(oPtr1, low, high) //Loads the value of low, high into oPtr1. Basically low->{oPtr1}r:high->{oPtr1+2}r
Ld(low, high)r //Loads the value of low, high into a temporary spot and returns the pointer to it. Useful if you want to do a constant operation (like adding 285 to a number) but don't want to have a dedicated scrap area of memory for it. There can only be one at a time so make sure you aren't using the value of the last one before using another.
Ld(oPtr1)r //Sets the 4 byte value pointed to by Ptr1 to 0
Mul2(oPtr1) //Multiplies the value pointed to by oPtr1 by 2. Like all 4 byte commands, it returns a pointer to its first argument, oPtr1. This means that doing Mul2(Mul2(oPtr1)) is a good way of multiplying by 4
Div2(oPtr1) //Works the same way as Mul2 but divides by 2 instead.
Mul(oPtr1, oPtr2) //Multiplies oPtr1 by oPtr2. Unlike other commands, this modifies oPtr2. You have been warned.
Div(oPtr1, oPtr2) //Divides oPtr1 by oPtr2. Unlike other commands, this modifies oPtr2.
Div()r //Returns the pointer to the remainder of the last Div(oPtr1, oPtr2) operation.
_min(oPtr1, oPtr2) //Returns the pointer to the smaller of oPtr1 and oPtr2. This leaves both oPtr1 and oPtr2 unchanged. (but the result returned will be either oPtr1 or oPtr2)
_max(oPtr1, oPtr2) //Returns the pointer to the larger of oPtr1 and oPtr2.


If you need a routine to display 4 byte values, I can share my text axiom.

58
Axe / Re: Variable Subroutines
« on: January 06, 2021, 09:13:46 am »
That looks good, but I can't do that given my Axe version doesn't have New( and Delete( (and also only supports two-character labels).
However, I think I have this figured out now. What I did was put Lbl A0 at the beginning of my code and Buff(1)→GDB3ND at the very end, and use this little subroutine (I left out a lot of code to make it short:
Code: [Select]
.This is my execution subroutine
Lbl X
.Get the program, use X and Y0
Return!If X
If LA0=E9D95
 .We are running in a program
 Return!If {Y0-2}r>EC000-GDB3ND .Too large, can't execute
 Copy(Y0,GDB3ND,{Y0-2}r) .assuming this is a special format
 Goto (GDB3ND) .The program will automatically exit this subroutine
ElseIf LA0/4096=4
 .This is an app, let's just use 9D95!
 Return!If {Y0-2}r>8811 .This is the real limit from 9D95h to BFFFh
 Copy(Y0,E9D95,{Y0-2}r)
 Goto (E9D95)
End .Still haven't bothered working with shells at this point

Of course, this assumes the executable data begins right with the file.

To get the New( and Delete( you need to do #Axiom(MEMKIT) assuming you have it installed. If you don't, download Axe again and go to Axe Parser/Tools/Memkit. The tokens are located in the vars menu. When adding axioms, the tokens don't show up as soon as you add the #Axiom( line. You will have to quit and reopen the program to get them to show up.

If you Axe version only supports two character labels you must be using some ancient version. Here, get the current version.

Like Deep Toaster said, you can't just copy code to any location and expect it to run. Your 24k of normal memory starts at 9D95h. There may be a program there already that you are overwriting. Additionally, in the ram version of your program, any kind of complex code won't run from that buffer. If you try to run code that does :Goto (E9D95+20) then it won't goto 20 bytes after the start of its code, but 20 bytes after the start of your code. And then bad things happen.
Additionally the program can be bigger than 8811 bytes large, they just can't have executable code after that. Having data over that limit is fine.


I would also like to pick on your axe code a bit. I get it is going to be messy because you are still trying to get the code to work but I can't help myself. This will just be style and optimization stuff.
First off, you can use up to like 14 upper and lowercase letters for label (and variable) names. No need to make them short like in TI-BASIC.
The first line of your subroutine is Return!If X and X is never used again after that. What's the point?
Your line :If LA0=E9D95 can be turned into a conditional comment. For example:
Code: [Select]
:...If LA0=E9D95  .I'm using a conditional comment. Since this will only ever be an app or a program and never swap, why compile the code for the other?
:.Stuff for program version here
:...Else .No need for an ElseIf here. If we aren't a program, we have to be an app.
:.Stuff for app here
:...
You need parenthesis for  Return!If {Y0-2}r>EC000-GDB3ND. It should look like  ReturnIf {Y0-2}r>(EC000-GDB3ND). Axe has no order of operations and always goes from left to right. I'm not sure why you made it Return!If since you are trying to return if it is greater and not if it isn't.
Again, the ! makes means you are returning when you don't want to and running when you do. Return!If {Y0-2}r>8811 .Why return if it IS less than that size?
In general, it is more efficient to do :!If X-5 instead of :If X=5
You can put the line :[]->GBD3ND at the end of your program instead of Buff(1)->GBD3ND. It gets the pointer to the end of your program just the same and doesn't add that additional byte.

59
Axe / Re: Variable Subroutines
« on: January 05, 2021, 04:19:02 pm »
Here is a subroutine I have thrown together really quickly. I haven't tested it but it should be able to run any program or appvar whose name is passed to it. It needs to be compiled as an app!

:Lbl Execute .Call it like :Execute("prgmNAME")
:Return!If GetCalc(r1,Y1) .Get the variable and return if we can't find it.
:New(E9D95,0,{Y1-2}r-2->r1) .Create space for it to be copied to. Since we don't need the program's name anymore, we can store its size to r1. The -2 is for the program header
:r1:Asm(E5) .Push the value of the program's size. E5 *should* be the code for 'push hl' We need to push it because we don't know if the program we are running will destroy the variable we save it to. You could probably save it to E9D93, but it is safer this way
:Copy(Y1+2,E9D95,r1) .Copy the program to the area of memory we just created. The +2 is to skip over the program header BBh, 6Dh
: (E9D95)() .Run the program
:Asm(E1)->r1 .Get the saved value of size of the program.
:Delete(E9D95,0,r1) .Restore memory to how it was before we copied the program in.
:Return .Done!

Edit: Forgot about the 2 bytes for the program header

60
Axe / Re: Variable Subroutines
« on: January 04, 2021, 01:58:36 pm »
I'm a bit late, but if you want to have a memory area that holds executable code and not use a fixed area, you can use the Buff(<size>) command to create a buffer at the end of the program where you can store code at. Or, if you know what you want to put there, you can simply include the assembly code as hex and jump to the data. Since Axe already lets you directly use assembly code, I assume you are trying to do something else.

You could use the Memkit axiom to create space somewhere you know will be under the execution limit. Its command New( is usually used to resize existing programs or appvars, but it doesn't have to. You can call New( on anywhere you want (although bad things would probably happen if you tried it under 9D95h) to get a safe area of memory. For example, if you have an app you can do New(E9D95, 0, 1000) to create 1000 bytes at the start of where programs usually execute. You can then do:
Code: [Select]
:GetCalc("prgmWHATEVER", Y1) .Get pointer to the program
:Copy(Y1, E9D95, 1000) .Copy it to the ram area. Since programs are normally executed from E9D95, you can use absolute jumps and calls without problem
:(E9D95)() .Run the program. Once it is finished you should use Delete( to restore the 1000 bytes of memory you took. Or you can copy a different program there and run it first
This assumes you are using an app. If you are using a program you are running at 9D95h and bad thing will happen if you try to push it around and write code over yourself. You don't have to use 9D95h. You can use some area after the end of your program instead.

Alternatively, if you are using a ti-84+ and don't care about 83+ compatibility, you could swap the extra ram page into 4000h-7FFFh and just put whatever you want in that 16k block of ram. Then you have 40k of ram to work with! I could be wrong but I'm pretty sure that BCALLs use that block so you should probably swap it back every time you want to read or run from it. Although they may swap it back for you.

I can give more detailed examples and code for any of this, but I don't know what you are trying to do.

Pages: 1 2 3 [4] 5 6 ... 24