Omnimaga
Calculator Community => TI Calculators => General Calculator Help => Topic started by: Happybobjr on November 20, 2010, 11:28:31 am
-
how/where is the 16x16 icon added in mirrage programs?
I mean like the memory location. Would i be able to make an icon editor in axe?
-
Yeah, you could. It's actually 15x15, like
11111111 11111110
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
10000000 00000010
11111111 11111110
The zeroes on the rightmost column are for padding.
To make a program show a custom icon, set Axe to compile for no shell, then in the program, use this heading:
:.NAME
:Asm(C901)
:Asm(30-BYTE (64-CHAR) HEX ICON)
:Asm(DESCRIPTION IN HEX)
:Asm(00)
EDIT: Here's SirCmpwn's post (with routine): http://ourl.ca/4129/80700
-
where is it. byte wise.
I was thinking of a program to change any mos's prgm's icons
-
Oh, the icon is the 30 bytes starting with the 5th byte of the program.
-
Apparently starting with the 2nd byte of the program :P
...edit: fail
-
Nope, it's the 5th (after $BB,$6D for the ASM header and $C9,$01 for the MirageOS header).
To access it, use something like GetCalc("prgmNAME")+4 (since it starts after the 4th byte).
-
would i be able to make an icon editor in axe?
Would i just
psudocode
getcalc("prgmPROGRAM")->A
{A-2}r + 30 -> {A-2}r (note: i have tested successfully that increasing prgm size works (although I have only tried once))
the shift all but the first 5 (?) bytes down 30.
add the picture to those 30 bytes.
would that work?
-
Well, that would work, but remember you're still overwriting the 30 bytes that come after the program data.
An easier way is to get the user to compile the program as MirageOS, and since it already comes with 30 bytes of the default Axe icon, you can just change that directly without having to worry about size changing or moving stuff around.
-
ok, Well come to think of it, i could just have the code look for if it is or is not a mos prgm.
if not, nothing will happen.
How do i see if the first byte is rt. (in axe)
also, would i just add the hex of the picture in the 30 bytes?
-
ok, Well come to think of it, i could just have the code look for if it is or is not a mos prgm.
if not, nothing will happen.
How do i see if the first byte is rt. (in axe)
also, would i just add the hex of the picture in the 30 bytes?
Yeah, basically it's 2 bytes per row but not using the last row. Not sure what you mean by seeing if the first byte is rt... If you mean checking if the program starts with [BB6DC901] (the entire MOS header), the most efficient way is something like this:
:GetCalc("prgmNAME")→P .Find the program
:!If {P}r-28091 .Check if it starts with $BB,$6D
:!If {P+2}r-457 .Check if the next two bytes are $C9,$01
:...
:.It's a MOS program, so do whatever you want with it.
:...
:End
:End
I'd check for two bytes at once (with the r) because it's faster and smaller. 28091 and 457 are used here because 28091 is the combined two bytes of $BB,$6D and 457 is the combined two bytes of $C9,$01.
-
oh ok, I thought mirage os programs started with return. Isn't rt return (i assumed as i have no experiance with asm)
-
Yeah, return is C9. MirageOS programs have a header of a return (RET) followed by the number 1 (don't ask why, it's just there). But all ASM programs start with the two bytes $BB,$6D, which come before the RET, so you'd have to check for that as well.