Author Topic: Reversing the screen  (Read 5384 times)

0 Members and 1 Guest are viewing this topic.

Shazane Koronova

  • Guest
Reversing the screen
« on: January 30, 2007, 05:04:00 pm »
I want to reverse every pixel on the screen, white to black and black to white, as a battle transition effect.  How can I do it?

Delnar_Ersike

  • Guest
Reversing the screen
« Reply #1 on: January 30, 2007, 05:30:00 pm »
A very slow method you could use is:
c1-->
CODE
ec1...
For(A,0,62
For(B,0,94
PxlChange(A,B
End
End
...c2
ec2
however, I do not recommend it because it is terribly slow: It takes about 10 seconds to complete for the whole screen!

You could make or use an assembly resource to do the task, for it will be WAY faster. However, it usually is very hard to find an assembly resource suited for the purpose. Hmmm...lolje did very fast inverting in Age of Culture II 0.75, maybe somebody else will know how he did it.

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
Reversing the screen
« Reply #2 on: January 31, 2007, 03:44:00 am »
xlib can do it with the rectangle libraries, see xlib guru for function details. (I may post more details later)

Delnar_Ersike

  • Guest
Reversing the screen
« Reply #3 on: January 31, 2007, 05:37:00 am »
QuoteBegin-xlibman+31 Jan, 2007, 9:44-->
QUOTE (xlibman @ 31 Jan, 2007, 9:44)
xlib can do it with the rectangle libraries, see xlib guru for function details. (I may post more details later)  

 stupid me, I forgot about the DrawShape: Inverted Rectangle feature in xLib :paf:tripaf.gif

Offline Spellshaper

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1690
  • Rating: +0/-0
  • This is me. Or maybe not.
    • View Profile
Reversing the screen
« Reply #4 on: January 31, 2007, 06:59:00 am »
QuoteBegin-Delnar_Ersike+31 Jan, 2007, 17:37-->
QUOTE (Delnar_Ersike @ 31 Jan, 2007, 17:37)
QuoteBegin-xlibman+31 Jan, 2007, 9:44-->
QUOTE (xlibman @ 31 Jan, 2007, 9:44)
xlib can do it with the rectangle libraries, see xlib guru for function details. (I may post more details later)

stupid me, I forgot about the DrawShape: Inverted Rectangle feature in xLib :paf:tripaf.gif

 ^^

all hail xlib. :bow:worship.gif

CODEX can do the job too, albeit a tad slower.

Offline trevmeister66

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1009
  • Rating: +14/-5
    • View Profile
Reversing the screen
« Reply #5 on: January 31, 2007, 11:14:00 am »
you could just do it in inefficient BASIC code, where you just do pt- or pxl- change...or you can go with the much faster xlib way.
Projects:    nameless RPG: 1.0%  |  Reverse Snake v1.5: 100%  |  Secret Project: 5%  |  DUNGEON: 70%

My MW2 Blog <-- Please visit :)

Offline dinhotheone

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 410
  • Rating: +2/-1
    • View Profile
Reversing the screen
« Reply #6 on: February 01, 2007, 03:27:00 pm »
xlibman, i went to the guru but i cant seem to find this lib anywhere, i read like all i could find, i am also interested in it... is there anyway you could post a link???

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
Reversing the screen
« Reply #7 on: February 01, 2007, 03:41:00 pm »
o.oblink.gif i was sure it was in here, if you mean xlib? It's in the calculator RPG download section of Omnimaga

Offline dinhotheone

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 410
  • Rating: +2/-1
    • View Profile
Reversing the screen
« Reply #8 on: February 02, 2007, 09:25:00 am »
sry, i didnt mean i cant find xlib, i meant where do i find out how to use the inverse rectangle function of xlib. i dont think its in the guru.

Edit:
nvm i found the info at maxcoderz, sice ive only been here a short while i sorta assumed that the guru was more complete than it actually is. I assumed that since it wasnt in there that you couldnt do it.

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
Reversing the screen
« Reply #9 on: February 02, 2007, 01:25:00 pm »
it's in the guru! o.oblink.gif

I'm sure i added it, else it is in the readme (which is also in the guru)

Offline dinhotheone

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 410
  • Rating: +2/-1
    • View Profile
Reversing the screen
« Reply #10 on: February 02, 2007, 03:56:00 pm »
well on the wiki i cant find it, i guess ill look again, i could have sworn i read it all though...

Edit:
i c, i didnt actually see the readme link on the main page, i have the tutorial part bookmarked. i see it now, sry :/confused.gif

Offline lolje

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 299
  • Rating: +2/-0
    • View Profile
Reversing the screen
« Reply #11 on: February 03, 2007, 01:52:00 am »
1. get http://www.ticalc.org/archives/files/fileinfo/359/35907.html (direct link http://www.ticalc.org/pub/83plus/asm/libs/xlib.zip)
2. send it to your ti 83+/84+ device
3.install it by pressing [Apps], switching to xlib and pressing [1] to install and [3] to quit
4.open a Basic program with the OS-Editor and type in
c1-->
CODE
ec1:real(12,8,0,0,95,63c2
ec2

5.run - and it works...

Note: xlib includes many other functions apart from shapes - just view the readme included in the .zip file!
83+/84+ xLIB projects
Age of culture II (~89%)

Contact: [email protected]

Offline Jon

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 278
  • Rating: +0/-0
    • View Profile
Reversing the screen
« Reply #12 on: February 03, 2007, 12:37:00 pm »
My asm way of doing it. :)smile.gif


c1-->
CODE
ec1
 ld hl,plotsscreen
 ld b,4
loop1:
 push bc
 ld b,192
loop2:
 ld a,(hl)
 xor 255
 ld (hl),a
 djnz loop2
 pop bc
 djnz loop1
 ret
c2
ec2



Not that anyone here cares about an ASM way of doing things :(sad.gif