Author Topic: [question] Mirage 16x16 pic  (Read 4581 times)

0 Members and 1 Guest are viewing this topic.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
[question] Mirage 16x16 pic
« 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?
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: [question] Mirage 16x16 pic
« Reply #1 on: November 20, 2010, 11:35:36 am »
Yeah, you could. It's actually 15x15, like

Code: [Select]
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:

Code: (Axe) [Select]
:.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
« Last Edit: November 20, 2010, 11:38:09 am by Deep Thought »




Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [question] Mirage 16x16 pic
« Reply #2 on: November 20, 2010, 11:39:09 am »
where is it. byte wise.

I was thinking of a program to change any mos's prgm's icons
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: [question] Mirage 16x16 pic
« Reply #3 on: November 20, 2010, 11:40:16 am »
Oh, the icon is the 30 bytes starting with the 5th byte of the program.




Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: [question] Mirage 16x16 pic
« Reply #4 on: November 20, 2010, 11:40:34 am »
Apparently starting with the 2nd byte of the program :P

...edit: fail
« Last Edit: November 20, 2010, 11:40:58 am by squidgetx »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: [question] Mirage 16x16 pic
« Reply #5 on: November 20, 2010, 11:43:05 am »
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).
« Last Edit: November 20, 2010, 11:47:08 am by Deep Thought »




Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [question] Mirage 16x16 pic
« Reply #6 on: November 20, 2010, 11:53:59 am »
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?
« Last Edit: November 20, 2010, 11:55:02 am by happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: [question] Mirage 16x16 pic
« Reply #7 on: November 20, 2010, 11:56:06 am »
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.
« Last Edit: November 20, 2010, 11:57:04 am by Deep Thought »




Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [question] Mirage 16x16 pic
« Reply #8 on: November 20, 2010, 12:04:22 pm »
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?
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: [question] Mirage 16x16 pic
« Reply #9 on: November 21, 2010, 11:46:12 am »
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:

Code: (Axe) [Select]
: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.
« Last Edit: November 21, 2010, 11:47:25 am by Deep Thought »




Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: [question] Mirage 16x16 pic
« Reply #10 on: November 21, 2010, 07:13:01 pm »
oh ok,  I thought mirage os programs started with return. Isn't rt  return (i assumed as i have no experiance with asm)
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: [question] Mirage 16x16 pic
« Reply #11 on: November 21, 2010, 07:25:02 pm »
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.