Author |
Message |
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
Posted: 11 Jun 2003 04:56:29 am Post subject: |
|
|
Hi !
This time, I'd like to do a fade out (or fade in) effect ; I mean, once the picture is displayed, I want to change "color" (in fact contrast) slowly, until all the screen is white (fade out).
I searched documentation on changing contrast and I found it (asmguru, quite simply).
I first tried the code, which, one more time, does not do anything on Virtual TI, so I had to test it on my own TI. It worked. Well, the code I'm talking about just increments one time the contrast (or decrement it, as you want).
Code: ld a,(8008h)
add a,18h
inc a
or 0C0h
call lcd_busy
out (lcdinstport),a
ret
lcd_busy:
push af
inc hl
dec hl
pop af
ret
So, of course, I wanted to modify it, in order to have something like a "fade out". The first time I tried (so I always tried on my calculator as VTI does not change contrast), it bugged, but I had'nt a "Ram Cleared", I saw a "Ram Failed" ! And then, a message like "Please re-install TI-OS. The calculator will shut down after pressing a key." !!!!!!!!!
I pressed a key, I turned the calculator on, and only RAM was cleared (fortunately, I always archive my prgms). So it wasn't too bad.
This morning, I tried one more time to change contrast in a loop, and it bugged one more time... (with another code, of course) : the screen were all black (that's what I wanted to do : a fade IN), but then, the calculator shut down without message and I couldn't turn it on any more ! So I removed all the 5 batteries (even the little lithium battery), I re-put them in the TI, and then all worked. One more time, only RAM was cleared although I removed the lithium battery !!!!
So here is the code I used, please tell me what's wrong, I prefer having your opinion before killing my calculator ;-)
Code: #include "ASM.inc"
.org 9D95h
plus:
nop ; pause for the "player" (useless because getkey follows)
B_CALL(_getkey) ; wait for a key, to see contrast's evolution
ld a, (contrast) ; contrast (8447h on TI-83+) is in a
add a, 18h ; I have to add this value
inc a ; incrémente
or 0C0h ; I have to use this mask
call lcd_busy ; pause for the screen
out (lcdinstport), a; adjust contrast through LCD port (10h)
ld (contrast), a ; update it
cp 0FFh ; if it is maximum
jr nz, plus ; stop; else, continue
ret
lcd_busy: ; something do spend time
push af
dec hl
inc hl
pop af
ret
.end
END
So what's your opinion ? Thx for your help ! |
|
Back to top |
|
|
John Barrus
Member
Joined: 25 May 2003 Posts: 131
|
Posted: 11 Jun 2003 09:23:43 am Post subject: |
|
|
I read the asmguru tutorial and the only difference between yours and their's is that you updated (contrast) after the LCD communication, whereas asmguru did it before... Maybe LCD driver communication destroys registers... |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 11 Jun 2003 12:58:50 pm Post subject: |
|
|
well, at the beginning of your code, u have :
Code: .org 9D95
when u should have
Code: .org 9D93
.db $BB,$6D
that may help, but i dought it... |
|
Back to top |
|
|
62 52 53 53 Formerly known as 62 52 53 53
Active Member
Joined: 30 May 2003 Posts: 607
|
|
Back to top |
|
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
Posted: 11 Jun 2003 03:02:52 pm Post subject: |
|
|
Code: .org 9D93
.db $BB,$6D
Jbir did it in his application, it's strange. I don't know what it does, so I don't do it... for the moment
It is perhaps what I did wrong...
http://www.arasian.com/vortex/83pasm/glossary.htm#bb6d
Last edited by Guest on 11 Jun 2003 03:20:39 pm; edited 1 time in total |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 11 Jun 2003 03:03:16 pm Post subject: |
|
|
why? it doesn't do contrast either... but u should already have the Flash Debugger... |
|
Back to top |
|
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
Posted: 11 Jun 2003 03:24:42 pm Post subject: |
|
|
The link didn't allow me to download it, so I searched in the site.
In fact, it is named "SDK for the TI-83+".
I'll see what it is.... |
|
Back to top |
|
|
62 52 53 53 Formerly known as 62 52 53 53
Active Member
Joined: 30 May 2003 Posts: 607
|
Posted: 11 Jun 2003 03:31:33 pm Post subject: |
|
|
.org 9D93=.org Usermem-2
.db $BB,$6D=token which tells calculator the prog is asm
The flash debugger will prevent him from killing his calculator
Last edited by Guest on 11 Jun 2003 03:34:16 pm; edited 1 time in total |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 11 Jun 2003 03:38:15 pm Post subject: |
|
|
VTI does that too, oh well . except with VTI u have to have v.2.5b and v.3.0b to do both asm and apps... and then it is seperately |
|
Back to top |
|
|
Tyraniek
Member
Joined: 07 Jun 2003 Posts: 133
|
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 11 Jun 2003 04:01:47 pm Post subject: |
|
|
ya, it is pretty slow, and it doesnt support contrast... and it is glitchy... like the quick key repeat |
|
Back to top |
|
|
David The XORcist!
Advanced Member
Joined: 20 May 2003 Posts: 268
|
Posted: 13 Jun 2003 03:26:14 pm Post subject: |
|
|
Ok,
Here's how it works.
Valid contrasts are 18h - 3Fh. Before sending them to (lcdinstport), you have to make sure that they are in this range.
The value of the (contrast) RAM location is, nota bene, 18h units lower than the driver setting.
Also, there's is no need for any delay routines because the instructions that are preceding OUT will make a sufficient delay.
Code: ;Set contrast to value in A
;Valid range: 0 - 27h
DI
LD B,A
CP 28h
JR NC,contrast_is_invalid
ld (contrast),a
add a,18h
OR 0C0h
out (lcdinstport),A
|
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 13 Jun 2003 08:18:14 pm Post subject: |
|
|
is the di really necessary? just askin'... |
|
Back to top |
|
|
NETWizz Byte by bit
Bandwidth Hog
Joined: 20 May 2003 Posts: 2369
|
Posted: 14 Jun 2003 03:16:17 am Post subject: |
|
|
Yes, the DI is really necessary because it prevents maskable interrupts that may interfere with the databus and system ports while you try to directly talk to the hardware. Believe me, you do not want TI-OS to talk to the same port you do at the same time
When you are done, you will also need to use EI, or the interrups will not run locking up your calculator unless you run a routine based on direct input or something. |
|
Back to top |
|
|
|