Hello! Smile
I need to do a ipoint routine, but I've a problem with the port $11: I menage to write on the lcd, but not to read.
Example:

Code:
start:
        bcall _clrlcdfull
        di
        ld a,$30
        out ($10),a
        call Ralentir
        ld a,$80
        out ($10),a
        call Ralentir
        ld a,$EF
        out ($11),a
        call Ralentir
 
        ld a,$30
        out ($10),a
        call Ralentir
        ld a,$80
        out ($10),a
        call Ralentir
        ld a,$FF
        in a,($11)
        ld h,0
        ld l,a
        bcall _disphl
        jp _getkey
 
Ralentir:
         push bc
         ld bc,$FF
Ralentir2:
         push bc
         ld bc,$FF
Ralentir1:
         djnz Ralentir1
         pop bc
         djnz Ralentir2
         pop bc
         ret

I thought this display "239", but i read "0" Confused
Do anyone know why this?
Thanks you! Very Happy
PS: Sorry for my bad English, but I'm French
So, you're setting column $30-$20=16 (which is only valid in 6-bit mode), then row $80-$80=0, then setting that pixel block to $EF. You then set the accumulator to $FF (for some reason0 and read in the data on the screen and display it. The biggest problem I notice is that If you want to deal with the pixel block at the top-left of the screen, you need column $20 (which is the first column block), not $30. If you're in 8-bit mode, $30 isn't even a valid column. Am I correct in thinking that this doesn't make a pixel appear on the screen?
Hum... in first, i thought than the column start at $20, but it isn't write: when i take $20, the pixel don't appear, and when i use $30, it appear... Maybe it's different in a 83+ (i use a ti82stats.fr with wabbitemu to test this)
M@thieu41 wrote:
Hum... in first, i thought than the column start at $20, but it isn't write: when i take $20, the pixel don't appear, and when i use $30, it appear... Maybe it's different in a 83+ (i use a ti82stats.fr with wabbitemu to test this)
I'm basing the numbers I'm quoting you on this documentation:

http://wikiti.brandonw.net/index.php?title=83Plus:Ports:10
http://wikiti.brandonw.net/index.php?title=83Plus:Ports:11

Quote:
[20~3F]: Set column. [20~2E] are valid columns in 8-bit mode, [20~33] are valid columns in 6-bit mode. [34~3F] values are also accepted, but do not correspond to a drawable area.
Yes, I've gone here to learn how to use the port $10, but it can't be that:
$2E-20 +1 = 15
96/8 = 12 = $3B - $30 +1
96/6 = 16 = $3F - $30 +1
So, there is a problem if its between $20 and $3F...
And with $30, pixels appear at the top-left of the screen

EDIT:
Solved: someone tells me i need to do a "dummy read" before, because the coordinates are update after the first "in", when we read.
Thanks you for your answer Smile
Fascinating; I should update WikiTI if I can verify that on a TI-83 Plus calculator. That's a rather important mistake if it is indeed one. Smile Oddly enough, my FastCopy routines in Doors CS set the column to $20 for the upper-left, and everything works well.
It's strange:
I've done some test:

Code:
start:
 ld a,$FF
 ld (grbuf),a
 ld de,grbuf+1
 ld hl,grbuf
 ld bc,64*96/8-1
 ldir
fastCopy:
 di
 ld a,$80
 out ($10),a
 ld hl,gbuf-12-(-(12*64)+1)
 ld a,$20
 ld c,a
 inc hl
 dec hl
fastCopyAgain:
 ld b,64
 inc c
 ld de,-(12*64)+1
 out ($10),a
 add hl,de
 ld de,10
fastCopyLoop:
 add hl,de
 inc hl
 inc hl
 inc de
 ld a,(hl)
 out ($11),a
 dec de
 djnz fastCopyLoop
 ld a,c
 cp $2B+1
 jr nz,fastCopyAgain
 call _getkey
 ret

It works, the screen is black Confused
I don't understand Surprised

EDIT:
I think we can start at $20 or at $30, it's not important, the 2 are working Smile
Maybe $20-$2F and $30-$3F are duplicates of each other in 8-bit mode. Anyway, as you say, that's not the point of what you're asking. Let's go back to your original question, which is why you can't read the LCD properly. Does anything change if you use $20 instead of $30 in the read portion of your program?
Someone found my problem: it's because when i put the coordinates, the writing is properly, but if we want to read, we have to read 2 times, because the first time, we read at the late coordinates!
Thanks for your help! Smile

PS: I can use $20, or $30, nothing change
Aha, that's an excellent point. I didn't think of that, and I should have. Anyway, may I ask what project this is for?
It's for a project with the linkport (a kind of snake for 2 players). I had a problem with ipoint, witch put on the interrupts, and the interrupts do some problem with the port 0 Smile
M@thieu41 wrote:
It's for a project with the linkport (a kind of snake for 2 players). I had a problem with ipoint, witch put on the interrupts, and the interrupts do some problem with the port 0 Smile
Then it sounds like you were using Getkey_, which is a very bad idea. Have you considered using direct input?
Ho... _Getkey was just for the example Laughing . In my game, i use the direct imput of course Smile
M@thieu41 wrote:
Ho... _Getkey was just for the example 0x5 . In my game, i use the direct imput of course Smile
Oh, that's good! Out of curiosity, though, why are you not using something like iGetPixel to write to the gbuf, then iFastCopy to copy the graph buffer all at once?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement