Author Topic: transform an image displayed in hexadecimal String  (Read 5553 times)

0 Members and 1 Guest are viewing this topic.

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
transform an image displayed in hexadecimal String
« on: November 07, 2010, 12:41:35 pm »
hello,
I would like to include a subroutine in my drawing program that transforms screen displayed (96*64 pixels) in hexadecimal text then I record in a string.
But I do not know where to start, can anyone help me? ???
« Last Edit: November 07, 2010, 01:27:08 pm by kindermoumoute »
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: transform an image displayed in hexadecimal String
« Reply #1 on: November 07, 2010, 01:13:01 pm »
transforms an image displayed in hexadecimal text then I record in a string.

Sorry, I don't quite know what you mean. Do you mean like converting a picture into hexadecimal text that is stored into a string? Something like this or this?

Maybe you can write it in french and someone can translate
« Last Edit: November 07, 2010, 01:15:18 pm by squidgetx »

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: transform an image displayed in hexadecimal String
« Reply #2 on: November 07, 2010, 01:20:43 pm »
are you talking about transformations like scale changes and rotations? (affine transformations, for those in geometry).


Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: transform an image displayed in hexadecimal String
« Reply #3 on: November 07, 2010, 01:28:31 pm »
I ask not for a tile image, but all screen. After i'll look yours source.
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline FloppusMaximus

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +57/-5
    • View Profile
Re: transform an image displayed in hexadecimal String
« Reply #4 on: November 07, 2010, 01:57:42 pm »
Are you saying that you want to take the image that is currently displayed on the screen, and dump it out as a hex string?  It would be pretty straightforward to do that in assembly language; I don't know if there's a simple way to do that with Axe.

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: transform an image displayed in hexadecimal String
« Reply #5 on: November 07, 2010, 02:13:42 pm »
With pxl-test(X,Y) command, this isn't possible ?
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: transform an image displayed in hexadecimal String
« Reply #6 on: November 07, 2010, 02:16:46 pm »
With the help of my handy dandy hex display library, this would be fairly simple. For example, this would dump the current contents of L6 into a 1536-byte string pointed to by P:

Code: [Select]
P-2?B
For(A,L?,L?+767)
{sub(B2H,{A})}??{B+2?B}?
End

If you're not dumping this into an OS string, remember that your string will need to be null-terminated.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: transform an image displayed in hexadecimal String
« Reply #7 on: November 07, 2010, 03:21:26 pm »
You want to store the hex of the screen to a TI-BASIC string, right?

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: transform an image displayed in hexadecimal String
« Reply #8 on: November 07, 2010, 04:00:36 pm »
You want to store the hex of the screen to a TI-BASIC string, right?
Yes.

@runer : :o I don't understand your subroutine.
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: transform an image displayed in hexadecimal String
« Reply #9 on: November 07, 2010, 05:37:05 pm »
You want to store the hex of the screen to a TI-BASIC string, right?
Yes.

@runer : :o I don't understand your subroutine.

That's the point of libraries, the code is written and is known to work already ;) It's fairly simple though. One subroutine (N2H) converts nibbles into an ASCII character by returning the nth character in the string "0123456789ABCDEF" and another subroutine (B2H) just calls this subroutine for both nibbles in a byte and combines the two.
« Last Edit: November 07, 2010, 06:53:18 pm by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: transform an image displayed in hexadecimal String
« Reply #10 on: November 07, 2010, 07:33:50 pm »
To clarify, since Nibbles were new when SIlver wrote his french version of the Axe command list, 1 nibble is half a byte. It goes from 0 to 15 instead of 0 to 255.

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: transform an image displayed in hexadecimal String
« Reply #11 on: November 08, 2010, 02:59:56 pm »
:o it work, pretty routine !
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%