Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Xeda112358 on January 29, 2011, 11:26:20 pm

Title: Zeda's Hex Codes
Post by: Xeda112358 on January 29, 2011, 11:26:20 pm
Hey all you BASIC programmers out there (and occasional Axer)! I have something that YOU might like. You know those amazing little creatures? Those hex opcodes? Well guess what?! I've got em :D

Here is a small PDF that I have been working on that has a mild sample of about 40 hex opcodes. If anybody has cool suggestions, lemme know and I'll see what I can conjure up!
Title: Re: Zeda's Hex Codes
Post by: Deep Toaster on January 29, 2011, 11:29:53 pm
Whoa, that sure beats http://tibasicdev.wikidot.com/hexcodes :w00t:

Awesome work, as always. You should update that page too ^
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on January 29, 2011, 11:36:18 pm
I have been :D I optimised a few codes on that page and you will see my posts littered all over TIBD with random hex codes :D
Title: Re: Zeda's Hex Codes
Post by: ztrumpet on January 29, 2011, 11:43:02 pm
There are some of Zeda's (aka Thunderbolt) Hex Codes already there. :)  Nice pdf. ;D
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on January 29, 2011, 11:48:33 pm
Thankee! Yeah, I now have that document uploaded on UTI, TIBD, TICalc, and here. Whenever somebody asks for an opcode, I plan to add it to that document. I still need to add CopyProg...
Title: Re: Zeda's Hex Codes
Post by: kalan_vod on January 30, 2011, 09:22:06 pm
Awesome job, wish we had these back in the day without libs :P
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on January 30, 2011, 09:26:01 pm
Yeah, I know what you mean :D That's why I'm doing this. I've really gotta find some new ideas for opcodes, though. I mean, I have tons of opcodes, but some of them get really involved.
Title: Re: Zeda's Hex Codes
Post by: DJ Omnimaga on January 31, 2011, 12:53:23 am
Cool! Nice job! Should you put them on WikiTI too? I think they got a page with hex opcodes for BASIC programmers.
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on January 31, 2011, 12:56:58 am
Oh, how do I put them there?
Title: Re: Zeda's Hex Codes
Post by: DJ Omnimaga on January 31, 2011, 03:26:20 am
Oh for that you would need to register and edit the page there. You would need to learn Wikimedia syntax, though.
Title: Re: Zeda's Hex Codes
Post by: mrmprog on February 14, 2011, 09:54:07 pm
Any new updates on these opcodes?
Title: Re: Zeda's Hex Codes
Post by: program4 on February 14, 2011, 10:05:38 pm
Perhaps the ASM equivalents of certain drawing commands would be good, like PxlOn( and PxlOff( and Line(. Sometimes drawing on the graphscreen is slow...

Also, are you going to put in the number to string hex opcode? Somehow I am obsessed about converting from a number to a string.  :D
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on February 14, 2011, 10:07:32 pm
Well howdy *cough* stranger *cough*. Hmm, well I do have a few opcodes now that you mention it... Also, do you have any new ideas?

This is pretty much the opcode of CopyProg:
Code: [Select]
EFD74AFE04C013131AFE712837
3EAA327984D7D878B7C0
EB4E234623C5
7EE61F77
117884
EDB0
AF12
EFF14278C1D8
EBD306
B728050901090009
4E234623
F5E5C5
3E07D306
EFD74AFE04
EB4E234623
7E
FE71F52003237E0D
E61F77
117884EDB0AF12
EFF1423803EFC64F
F1C8
E1E53A7884
EF704E1313
C1E1F1
EF5480
C9
You will probably need to read what that one does either in the CopyProg topic here or on UTI or on TICalc, but it really is a very useful program...


Input a list and it outputs ASCII on the homescreen:
Code: [Select]
EFD74A3DC0
EB462323
C5EF7A41E5
EFEF4A
EF0445
E1C1
10F1
C9
An example for this one would be using 65+{7,4,11,11,14:Asm(prgmDISP. That will display HELLO on the homesreen. The cool part is that if you change the 65 to 97, it will display the lowercase version :D

I would prefer to keep the codes a little on the smaller side, so if y'all have any random ideas, please feel free to ask!
Title: Re: Zeda's Hex Codes
Post by: TIfanx1999 on February 15, 2011, 12:24:19 am
Very nice Xeda. I'm sure many will find these useful! =)
Title: Re: Zeda's Hex Codes
Post by: Deep Toaster on February 15, 2011, 09:25:40 am
Input a list and it outputs ASCII on the homescreen:
Code: [Select]
EFD74A3DC0
EB462323
C5EF7A41E5
EFEF4A
EF0445
E1C1
10F1
C9
An example for this one would be using 65+{7,4,11,11,14:Asm(prgmDISP. That will display HELLO on the homesreen. The cool part is that if you change the 65 to 97, it will display the lowercase version :D

That actually might be really useful. You could even hack it to encrypt text :D
Title: Re: Zeda's Hex Codes
Post by: JustCause on February 15, 2011, 10:38:05 am
Awesome! BASIC programmers all over the world cheer...

...and at least one Axe programmer. (QuickKey 2 is actually super useful for cUbEs.)
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on February 15, 2011, 11:58:10 am
Okay, this code returns the iPart( value of a real number as a string. So if you do -334.67:Asm(prgmR2S, Ans will be the string "-334"

Code: [Select]
EFD74A
217984
11EC86
7EE60F
470448
2D7E07
3005
0C3EB0121C
2C
2CCDD19D052805CDD19D10F4
C5EF524BD7EFC64F
E1E5EF2743
C11313
21EC86
EDB0
C9
3E30ED6F121CC9
Title: Re: Zeda's Hex Codes
Post by: DJ Omnimaga on February 16, 2011, 01:18:58 am
Nice stuff Xeda, thanks for sharing with BASIC programmers. Also welcome here mrmprog. :)
Title: Re: Zeda's Hex Codes
Post by: mrmprog on February 22, 2011, 01:07:16 pm
I know that this was released on most of the calc sites, but where can I find the most recent PDF?
Title: Re: Zeda's Hex Codes
Post by: AngelFish on February 22, 2011, 01:51:00 pm
Okay, this code returns the iPart( value of a real number as a string. So if you do -334.67:Asm(prgmR2S, Ans will be the string "-334"


Um, that's the Int command. The iPart( command returns the imaginary component of a complex number.
Title: Re: Zeda's Hex Codes
Post by: JosJuice on February 22, 2011, 01:55:32 pm
Okay, this code returns the iPart( value of a real number as a string. So if you do -334.67:Asm(prgmR2S, Ans will be the string "-334"


Um, that's the Int command. The iPart( command returns the imaginary component of a complex number.
I thought iPart( returns the integer part of a number?
Title: Re: Zeda's Hex Codes
Post by: AngelFish on February 22, 2011, 01:58:10 pm
Hm so it does. My mistake.
Title: Re: Zeda's Hex Codes
Post by: DJ Omnimaga on February 23, 2011, 05:00:41 pm
Yeah, I think the difference between int and ipart was with negative numbers or something. You would have to check TIBD for the differences.
Title: Re: Zeda's Hex Codes
Post by: program4 on February 23, 2011, 05:46:31 pm
iPart just takes off anything to the right of the decimal, so iPart(-1.7)=-1. int is the greatest integer function, or the greatest integer less than the input. Since -2 is the greatest integer less than -1.5, int(-1.5)=-2.
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on February 23, 2011, 08:59:01 pm
I know that this was released on most of the calc sites, but where can I find the most recent PDF?
Oh, sorry, I never saw this post... erm, the latest updated version... is included in this post! :D I only added a few codes and programs, but here is version 1.20

EDIT: I accidentally put another opcode for RunIndicator Off. I put EF0745 which is something I use very frequently (for debugging) instead of EF7045.
Title: Re: Zeda's Hex Codes
Post by: Deep Toaster on February 24, 2011, 10:10:21 am
Okay, this code returns the iPart( value of a real number as a string. So if you do -334.67:Asm(prgmR2S, Ans will be the string "-334"


Um, that's the Int command. The iPart( command returns the imaginary component of a complex number.

imag( :)
Title: Re: Zeda's Hex Codes
Post by: squidgetx on February 26, 2011, 11:44:03 am
Xeda, is the Off code the equivalent of actually turning it off, in terms of power consumption?
Title: Re: Zeda's Hex Codes
Post by: Deep Toaster on February 26, 2011, 11:49:46 am
"Calc off" turns off the LCD only, I believe. Then there's bcall(_powerOff), which is EF0850, but that doesn't even completely power off the calculator.
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on February 26, 2011, 12:20:39 pm
The ones that turn the screen off is immediately following. The one I provided does turn off the calc without using the bcall. (it modifies the Status port)
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on February 27, 2011, 10:43:19 am
Okay, so if you read the edit to the previous download, I accidentally the run indicator off opcode, so here is a fixed version. I use EF0745 much much more frequently (for debugging) than EF7045 so.... oops? It doesn't harm anything, it just displays a number that I use in debugging to check register values. Luckily, somebody over on TIBD mentioned that the library they were working on kept displaying some random number instead so... Thanks BlakPilar!
Title: Re: Zeda's Hex Codes
Post by: ralphdspam on February 27, 2011, 12:37:57 pm
Ooh! I have to use this in my next Axe program. :)

EDIT: All of them, of course! :D
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on February 27, 2011, 12:40:43 pm
Which one? Or do you mean all of them >_> ? :D if you have any ideas, too, feel free to let me know!
Title: Re: Zeda's Hex Codes
Post by: Deep Toaster on February 27, 2011, 02:15:39 pm
This might be hard, but how about writing back a string to a label in the program? Something like

Code: (TI-BASIC) [Select]
:Lbl 0
:{1,1,2,3
:Lbl 1
:Ans→L₁
:"{1,3,4,7→Str1
:"0,1
:Asm(SMC

True SMC in BASIC is something we have yet to see :D
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on February 27, 2011, 02:21:57 pm
You mean like have it overwrite the data following Lbl 0? Hehe, if that is what you mean then you can do something like that with CopyProg because you can store the program as a string and manipulate it and you can use CopyProg to execute the string as a program :D

CopyProg was originally requested as an opcode by mrmprog, so I decided to include it in the list of opcodes :D

However, if you mean edit a line of code following Lbl 0 and to be able to edit it inline like that (while the program is executing), that could be fun... I might need to adjust a few pointers to make it possible, but it can be done, I believe.
Title: Re: Zeda's Hex Codes
Post by: ztrumpet on February 27, 2011, 03:31:23 pm
Actually, Iambian wrote a small program called Celtic to do this a few years back.  It kinda evolved since then...
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on February 27, 2011, 03:34:29 pm
Uh-huh, I remember something about that, I cannot remember... what did he call it again, Gaelic? ;D
I still think an opcode would be nice for those who don't have connectivity stuff to download :)
Title: Re: Zeda's Hex Codes
Post by: DJ Omnimaga on February 28, 2011, 03:33:11 am
If you really mean Celtic, it's still called Celtic today, but since it stopped being updated, it has since merged with Doors CS 7.
Title: Re: Zeda's Hex Codes
Post by: program4 on March 01, 2011, 09:00:08 pm
I have an idea: how about a program that allows detection of multiple key presses (like the one in BatLib, I think)? I might find that useful in some BASIC programs.
Title: Re: Zeda's Hex Codes
Post by: mrmprog on March 01, 2011, 09:04:30 pm
That would be handy, and so would an inline editor.What about a find and replece routine where you could search for str1 in a var and replace it with str2? You can do that with copyprog but an opcode would be faster.
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 01, 2011, 11:07:45 pm
I have an idea: how about a program that allows detection of multiple key presses (like the one in BatLib, I think)? I might find that useful in some BASIC programs.
Hmm, as a quick reference to that, you can check here (http://www.ticalc.org/archives/files/fileinfo/425/42546.html) for two versions of what you might be looking for. returns all of the keys being pressed in the form of a 7 element list. This is command 10 (pretty much) in BatLib.

A better option might be  this (http://www.ticalc.org/archives/files/fileinfo/432/43208.html) might be more practical/useful as it doesn't require an input. This is command 43 in BatLib.
That would be handy, and so would an inline editor.What about a find and replece routine where you could search for str1 in a var and replace it with str2? You can do that with copyprog but an opcode would be faster.
A code to change token vars (not programs/appvars or other named vars) is actually not too difficult. I will come up with one shortly and edit this post when I have it finished!

EDIT: Actually, see my next post for the code :D
Title: Re: Zeda's Hex Codes
Post by: aeTIos on March 02, 2011, 07:35:25 am
Hm, I like opcodes, maybe I'm going to learn programming with them too. too bad that you break when pressing ON :(
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 02, 2011, 12:26:05 pm
It isn't the opcodes that break when you press ON, it breaks when the program finishes and enters BASIC again :D
Anywho, instead of editing my previous post, here is an opcode:
Code: [Select]
EFD74AFE04C0
1313
21B184EB
EDA0EDA0
3EAA327984D7D878B7C0
1313
21AF84EB
EDA0EDA0
3C327A84D7D878B7C0
EB4E234623
117884
EDB0
AF12
EFF142D878B7C0
EB4E234623

3AAF84
EDB1E0
3AB084
BE20F4
3AB284
772B
3AB184
7723EDA1E018E5
The inputs are:
Str1=SearchStr
Ans=ReplaceStr
Str2=VarName

What it does is it takes the first two bytes of the search string and finds those in the variable you are searching. Every time it comes across a match, it replaces it with the first two bytes of the replace string.
*VarName uses the same syntax as CopyProg

So if I wanted to change every instance of Goto 0 to Goto V in prgmRAWRZ
Code: [Select]
"ERAWRZ→Str2
"Goto 0→Str1
"Goto V
Asm(prgmREPLACE
Since tokens like Str1 and Pic1 are two bytes, you can similarly do something like:
Code: [Select]
"ERAWRZ→Str2
"Pic1→Str1
"Pic7
Asm(prgmREPLACE
The variables have to be in RAM in order to edit them, otherwise the code exits.
Title: Re: Zeda's Hex Codes
Post by: Deep Toaster on March 02, 2011, 06:26:03 pm
A find/replace function? :o These hex codes are getting to be really useful!
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 02, 2011, 06:29:28 pm
It only uses two bytes, though, but I have been meaning to get around to making an actual search/replace function for BatLib, so when I do, I will post the code :D

EDIT:I just thought of an interesting use for this program !
Code: [Select]
1→B
ClrHome
Disp " Goto  1"," Goto  2"," Goto  3    ;Put a space before the numbers :P
Repeat A=105
Output(B,1,"}
Repeat A
getKey→A
End
Output(B,1,"                         ;There is a space there
B+(A=34)-(A=25
If Ans=4 or not(Ans
1+2not(Ans
Ans→B
End
"EB1→Str2
"Goto A→Str1
"Goto "+sub("123",B,1
Asm(prgmB
Goto A
Lbl 1
1
Goto Z
Lbl 2
2
Goto Z
Lbl 3
3
Lbl Z
Pause Ans
You can potentially avoid using the Menu( command to jump to labels if you reallllly don't want to use the built in Menu( command :D
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 03, 2011, 02:30:26 pm
Here is a cool little opcode... it will take a string in Ans as the name of a var to execute as a BASIC program. The input is also the same as CopyProg (or the output of GetName). So for example, if appvar HELLO has BASIC data, you can do:
Code: [Select]
:"UHELLO
:Asm(prgmEXEC
Anyway, the opcode is:
Code: [Select]
EFD74AFE04C0
EB4E234623
117884
EDB0
AF12
FDCB08CE
EF9B4A
FDCB088E
C9
Title: Re: Zeda's Hex Codes
Post by: aeTIos on March 03, 2011, 03:24:00 pm
I have a question: is there a hex code that copies the OS Ans var to the HL (Axe Ans) var? That would be useful!
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 03, 2011, 03:52:11 pm
Oh, that is rather easy. It won't work for numbers greater than 9999 but it is EFD74AEFEF4AEB

If you want a code to convert values up to 65535, that will require a larger opcode :D

(But I do have it >_>)
Title: Re: Zeda's Hex Codes
Post by: Scipi on March 03, 2011, 04:27:45 pm
Is there an opcode that would take a two element list in ans and put say, pic1 in that location on the screen?
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 03, 2011, 09:48:13 pm
How do you mean? Do you mean start drawing a picture from the coordinate? I might be able to come up with one...
Title: Re: Zeda's Hex Codes
Post by: aeTIos on March 04, 2011, 10:26:54 am
Oh, that is rather easy. It won't work for numbers greater than 9999 but it is EFD74AEFEF4AEB

If you want a code to convert values up to 65535, that will require a larger opcode :D

(But I do have it >_>)
please give it, it would be useful for some things, like checking RAM
(You wrote a code for this that stores to Ans, maybe you can rewrite a part of it too, like the store to Ans part?
Isnt that replacing EFD74A with EF4AEB?)
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 04, 2011, 11:54:05 am
Oh, that is rather easy. It won't work for numbers greater than 9999 but it is EFD74AEFEF4AEB

If you want a code to convert values up to 65535, that will require a larger opcode :D

(But I do have it >_>)
please give it, it would be useful for some things, like checking RAM
(You wrote a code for this that stores to Ans, maybe you can rewrite a part of it too, like the store to Ans part?
Isnt that replacing EFD74A with EF4AEB?)
Storing to Ans is not a problem, just reading from it. If you want to store the Axe "Ans" to the OS Ans, you would need to do EF9247EF5641EFBF4A

To store to Ans and make use of numbers greater than 9999, then you would need a code that looks kind of like this:
Code: [Select]
7EE5E60FCB3FF53C4F060009EB606822B48423F130061AE60FCDB54E1AE6F007070707CDB54E1B0D79B720EAE111090019ED5BB4847BC9
D5E5CD804EED5BB4841922B484E13E0ACD804ED1C9
EB0608210000290730011910F9C9
Do not use that because that only works in a very specific context, but that is what the code looks like in BatLib. I am not sure how to translate that to Axe because it uses calls.

Anywho, the OS bcall EFEF4A does not convert numbers >9999, but EF9247 can store numbers up to 65535.

ReadAns:
EFD74AEFEF4AEB
StoreAns:
EF9247EF5641EFBF4A

If you want to use this in Axe and you want to preserve Ans, simply put an E5 at the beginning and E1 at the end.
Title: Re: Zeda's Hex Codes
Post by: aeTIos on March 04, 2011, 12:52:57 pm
Thanks!
(Maybe you noticed, I am grabbing system things everywhere on this forums... hinthint?)
Spoiler For What am I doing:
I want to create a shell!
Title: Re: Zeda's Hex Codes
Post by: Stefan Bauwens on March 04, 2011, 12:55:01 pm
Thanks!
(Maybe you noticed, I am grabbing system things everywhere on this forums... hinthint?)
Spoiler For What am I doing:
I want to create a shell!
What about your game? Boing?

EDIT: Hey, I've 50 posts. :)
Title: Re: Zeda's Hex Codes
Post by: aeTIos on March 04, 2011, 01:12:39 pm
I am focusing on my shell first, I think, but i'll continue it if I have time
Title: Re: Zeda's Hex Codes
Post by: Scipi on March 04, 2011, 02:58:22 pm
How do you mean? Do you mean start drawing a picture from the coordinate? I might be able to come up with one...

Yes that's exactly what I mean. I'm still messing around in BASIC so that would be a very fast way to do sprites.
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 04, 2011, 03:31:21 pm
Well would a code to draw sprites be better? I have one that takes hexadecimal sprites here: http://www.ticalc.org/archives/files/fileinfo/425/42592.html
It has the opcode included :D

FreeRAM stored to Axe "Ans" is this: 2A1598, I believe. If that fails, just do EFE542
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 26, 2011, 10:28:47 am
Okay, so I have 5 more opcodes, 3 simple ones and 2 less simple:
These simple ones I found in an "Extra.txt" document included with one of my old programs :D I seem to keep things like this in scattered places :)
Auto DMS
  21FA893E0677C9
    This displays any number in Degrees-Minutes-Seconds automatically.

Auto Fractions
  21FA893E0C77C9
    This displays numbers in fraction form if they can be, automatically.

Remove Cursor
  FDCB0CE6C9
    This stops displaying the blinking cursor.
CharLength
This one is one I added to BatLib a little while ago. It returns the char length of a string instead of the token length. For example, where length("sin(ln( would return 2 in BASIC, this code returns 7 because there are 7 chars.
Code: [Select]
EFD74AD604C0
676FEB
4E234623EB
C5D5E51A
EFA342F5
EBEF9445
F1E1D109C1
20020B13
0B1378B120E5
EF9247
EF5641
EFBF4A
C9
SCharLength
This returns the pixel width that a string would use if displayed with the small font.
This one was a request from earlier this morning:
Code: [Select]
EFD74AD604C0
676FEB
4E234623EB
C5D5E51A
EFA342F5
EBEF9445
218D8477EFB44C06004F
F1E1D109C1
20020B13
0B1378B1
20DB
EF9247
EF5641
EFBF4A
C9
EDIT: Changed two cases of ED62 to 676F because it saves 7 cycles. Thanks Runer112 :P
EDIT 2: I forgot to change some 7E's to 1A's when I was optimising my BatLib version... The last two have been adjusted accordingly.
Title: Re: Zeda's Hex Codes
Post by: Freyaday on March 26, 2011, 06:08:30 pm
Two questions: something that takes the value in HL turns that bit on, and one that turns it off.
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 26, 2011, 08:01:08 pm
From an offset? Or that bit? Since you cannot actually edit Flash, here is a version that has its offset in RAM:
The code starts the same way, so you can make this a call (I am assuming you are using Axe):
Code: [Select]
7DE6073C473E010F10FDCB2CCB1DCB2CCB1DCB2CCB1D01008009Using the following codes, you can add them to the end of the above code or if you are using a call you use it after the call:
Code: [Select]
BitOn:    B677
BitOff:   2FA677
BitChange:AE77
BitTest:  A63D3FED6223
If instead you want to perform BitOn, BitOff, and BitChange and return the previous state of the bit, use these:
Code: [Select]
BitOn:    47A63D3FF578B677F1ED6223
BitOff:   47A63D3FF5782FA677F1ED6223
BitChange:47A63D3FF578AE77F1ED6223
So here is a code to turn on a pixel and return HL as 1 if the pixel was already on or 0 if the pixel was off using Axe code (to make it more clear):
Code: [Select]
Asm(7DE6073C473E010F10FDCB2CCB1DCB2CCB1DCB2CCB1D01008009
Asm(47A63D3FF578B677F1ED6223
Title: Re: Zeda's Hex Codes
Post by: Freyaday on March 27, 2011, 01:02:44 am
Yay! I can finally get my sprite editor working!
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 27, 2011, 01:03:19 am
Is this for Axe?
Title: Re: Zeda's Hex Codes
Post by: Freyaday on March 27, 2011, 01:10:48 am
Yes, yes it is.
Not an Edit: Post 200!
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 27, 2011, 01:11:29 am
So you couldn't use pixel on/off or are you editing sprites directly in a data file?
Title: Re: Zeda's Hex Codes
Post by: Freyaday on March 27, 2011, 01:18:18 am
This is to create the sprite data, because currently the sprite only exists in the graph screen buffers.
PS: I have a Great Aunt Zeda. She has a road named after her.

Edit: Will this work on the last 8 pages or will it overflow and screw me over?
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 27, 2011, 01:20:39 am
This is to create the sprite data, because currently the sprite only exists in the graph screen buffers.
Oh, I see, now! Cool!
PS: I have a Great Aunt Zeda. She has a road named after her.
^-^

EDIT: Oh, wow, I never saw your edit Freyaday... I am not sure what you mean, but using the example before of turning a bit on and returning the previous state, this version also uses two pointers-- one points to the data, and the other is the bit offset:
Code: [Select]
<<Ans points to a var>>
Asm(E5
<<Ans is the bit to edit>>
Asm(7DE6073C473E010F10FDCB2CCB1DCB2CCB1DCB2CCB1DC109
Asm(47A63D3FF578B677F1ED6223
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on April 20, 2011, 09:41:17 pm
I figured I would upload the latest version of the hex code list :) The only updates are the ones mentioned a few posts back :/
Title: Re: Zeda's Hex Codes
Post by: Munchor on April 21, 2011, 11:18:26 am
I figured I would upload the latest version of the hex code list :) The only updates are the ones mentioned a few posts back :/

Nice Zeda, will you be updating this on Omni Downloads and ticalc.org too?
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on April 21, 2011, 11:28:17 am
I probably should update it here XD If I get around to it, I will update it on TICalc, too :)
Title: Re: Zeda's Hex Codes
Post by: Munchor on April 21, 2011, 11:37:08 am
I probably should update it here XD If I get around to it, I will update it on TICalc, too :)

I hope you do.

Is this group of hex codes the right place for me to add routines like this (http://wikiti.brandonw.net/index.php?title=Z80_Routines:Math:Multiplication) in hex? Or not really?
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on April 21, 2011, 11:39:20 am
Er, not really :/ These are tools for BASIC programmers, not routines for assembly programmers :)
Title: Re: Zeda's Hex Codes
Post by: Munchor on April 21, 2011, 11:41:27 am
Er, not really :/ These are tools for BASIC programmers, not routines for assembly programmers :)

Yeah I thought so, I need to create some library like that, but then again, not that useful.
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on September 03, 2011, 06:18:11 pm
I was on the french site tout82 trying to help out with some hex codes for the 82/83 when I thought of an optimisation that applied to about ten of the codes. Here is an example:
Code: [Select]
Auto Fractions:
21FA893E0C77C9
optimises to:
3E0CFD770AC9
Code: [Select]
Alpha Press Lock
21028A3ED0B677C9
optimises to:
3ED1FD7712C9

So here is v1.31
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on March 12, 2012, 02:40:42 pm
Yay, a necropostable topic! I cannot believe I never added these two codes, these are codes I am proud of for making!

Shift screen right 4   (Added v1.32)
  2140930E40AF060CED672310FB0D20F5C9
    This will shift the screen right 4 pixels.
Shift screen left 4   (added v1.32)
  213F960E40AF060CED6F2B10FB0D20F5C9
    This will shift the screen 4 pixel left.

Also, for completeness:

Shift screen up 4   (added v1.32)
  21709311409301D002EDB0EB013000EF304CC9
    This will shift the screen 1 pixel up.

Shift screen down 4   (added v1.32)
  210F96113F9601D002EDB823013000EF304CC9
    This will shift the screen 1 pixel down.

I wonder what else I should add...
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on November 27, 2012, 08:24:37 am
In a future update, I should include:
Edit Lock/Unlock Programs
EFD74AFE04C03CEB4E234623117884121CEDB0AF12EFF142D8EE0377C9

Put the name of the program in Ans, if it exists, this will toggle the lock status of the program. Maybe I should also make a Hide/Unhide code and a short code to toggle between appvars and programs. These two, however, would require that I check for duplicates, so the code would get even more involved.

EDIT:
This might be hard, but how about writing back a string to a label in the program? Something like

Code: (TI-BASIC) [Select]
:Lbl 0
:{1,1,2,3
:Lbl 1
:Ans?L?
:"{1,3,4,7?Str1
:"0,1
:Asm(SMC

True SMC in BASIC is something we have yet to see :D
Almost two years ago, but... I do not have the opcode for this one since the programs (http://ourl.ca/17635) are pretty big, opcode-wise, but I finally made it :D I think it is rather snazzy as well. Also, I am not content with this being the final version :P When I do finalise it, I will put it in the hex opcodes list.

EDIT2: This is more for Axe programmers. I looked back at this post and felt that I should update it. I created a much better routine for Grammer and BatLib that I have adapted for Axe. It is now much faster and it works with relative addresses. Also, it recognises negative numbers:
To store to Ans and make use of numbers greater than 9999, then you would need a code that looks kind of like this:
Code: [Select]
7EE5E60FCB3FF53C4F060009EB606822B48423F130061AE60FCDB54E1AE6F007070707CDB54E1B0D79B720EAE111090019ED5BB4847BC9
D5E5CD804EED5BB4841922B484E13E0ACD804ED1C9
EB0608210000290730011910F9C9
Do not use that because that only works in a very specific context, but that is what the code looks like in BatLib. I am not sure how to translate that to Axe because it uses calls.

Anywho, the OS bcall EFEF4A does not convert numbers >9999, but EF9247 can store numbers up to 65535.
Blegh, such an inefficient code XD Anyways, these 70 bytes can go in Axe, in-line, using Asm(

Code: [Select]
EFD74A2178847EE680F5237ED68011000038284704237E07070707E5626B29291929EBE1E60F835F30011405280D3E80A8280847077E38E32318DBF128077B2F5F7A2F5713EBIt is a bit big, but it works. Plus, it can be easily adapted further to make it easy to read list elements, so if you want to pass a list to your Axe program (for a library, for example), you can.
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on January 09, 2013, 11:31:22 pm
Last night I posted a hex code on TI-BASICDeveloper for making programs run on startup. To use it, pass the name of the program in Ans with a "[" before the name. For example, to run prgmHELLO on startup:
"[HELLO]:Asm(prgmOFFSCRPT

Here is the code:
Code: [Select]
EFD74AFE04C0
EB4E234623
C5E5212C00
09E521CC9D
E7EFF1423803EFC64F
E1EF6A4E
1313
21D59D
012A00EDB0
E1C1
EDB0AF12
FDCB33CE
C9
154F46465343525054
2109807C
EF7B4FC9
83
FDCB09A6
EFD348
EF7E4F
212B80
E7EFF142D8
FDCB08CE
EF9B4A
FDCB088E
AF473CC9
This is my first ever use of OFFSCRPT, so I apologise for anything that I broke D:
Title: Re: Zeda's Hex Codes
Post by: Shmish21 on September 28, 2020, 01:21:21 pm
How would you make the I/O port set the ring and tip to high/low and stay there? (Tried to add in my own native assembly but it didn't work, also sorry for posting on a potentially dead Forum)
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on September 28, 2020, 02:14:23 pm
In binary, when you write 00 to port 0, it sets the two lines to 1 (HIGH maybe?). Basically, what you write gets inverted.
When you write a 0 to one of the lines, you kind of release it, but when you write a 1 (setting the line LOW?), you kind of lock it there.

So when you have two calculators connected, and one sets the lowest bit to LOW, the other calculator cannot pull it HIGH. But when the line is already HIGH, either or both calculators can bring it LOW.
When both calculators bring a line LOW, it remains LOW until all calculators have "released" it back to high.

A TI-OS-related caveat: at the home screen or in a BASIC program, if the lines are not released, the calc will basically be frozen, so before you return control back to TI-OS, make sure to write a 0 to port 0 (this brings both lines to 1).

Now, given the topic, I would assume that you want a hexcode. There are many ways to interact with the port, but the very basics: 3E0xD300, where x is 0, 1, 2, or 3 will write to the port, and DB00 will read from the port.
Title: Re: Zeda's Hex Codes
Post by: Shmish21 on September 28, 2020, 04:53:31 pm
In binary, when you write 00 to port 0, it sets the two lines to 1 (HIGH maybe?). Basically, what you write gets inverted.
When you write a 0 to one of the lines, you kind of release it, but when you write a 1 (setting the line LOW?), you kind of lock it there.

So when you have two calculators connected, and one sets the lowest bit to LOW, the other calculator cannot pull it HIGH. But when the line is already HIGH, either or both calculators can bring it LOW.
When both calculators bring a line LOW, it remains LOW until all calculators have "released" it back to high.

A TI-OS-related caveat: at the home screen or in a BASIC program, if the lines are not released, the calc will basically be frozen, so before you return control back to TI-OS, make sure to write a 0 to port 0 (this brings both lines to 1).

Now, given the topic, I would assume that you want a hexcode. There are many ways to interact with the port, but the very basics: 3E0xD300, where x is 0, 1, 2, or 3 will write to the port, and DB00 will read from the port.


Thank you so much, your knowledge on this stuff is outstanding! Another quick question I have is what would each of the different statuses do exactly. I know you already explained what writing 00 and 01 do, but if possible could you put what each does 0-3. It would help to be able to reference back to it.

P.S. I am using the I/O port for 1 bit sound purposes.
Title: Re: Zeda's Hex Codes
Post by: Xeda112358 on September 28, 2020, 05:23:48 pm
The numbers in binary:
0 ==> 00
1 ==> 01
2 ==> 10
3 ==> 11

So writing a 3 brings both lines LOW, writing 2 sets the upper line LOW and the lower line HIGH.
Writing 0 and 1 do the opposite of 3 and 2, respectively.

The routine here (https://www.omnimaga.org/the-axe-parser-project/assembly-programmers-help-axe-optimize!/msg273787/#msg273787) might be useful to you :)