Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Shazane Koronova on January 30, 2007, 05:04:00 pm

Title: Reversing the screen
Post by: Shazane Koronova 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?
Title: Reversing the screen
Post by: Delnar_Ersike 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.
Title: Reversing the screen
Post by: DJ Omnimaga 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)
Title: Reversing the screen
Post by: Delnar_Ersike 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
Title: Reversing the screen
Post by: Spellshaper 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.
Title: Reversing the screen
Post by: trevmeister66 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.
Title: Reversing the screen
Post by: dinhotheone 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???
Title: Reversing the screen
Post by: DJ Omnimaga 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
Title: Reversing the screen
Post by: dinhotheone 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.
Title: Reversing the screen
Post by: DJ Omnimaga 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)
Title: Reversing the screen
Post by: dinhotheone 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
Title: Reversing the screen
Post by: lolje 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!
Title: Reversing the screen
Post by: Jon 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