Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Hot_Dog on August 28, 2011, 12:11:19 am

Title: Problems with Port $2A
Post by: Hot_Dog on August 28, 2011, 12:11:19 am
I'm trying to use this SafeCopy routine with port $2A when port $20 is set to 1.  However, I get problems that normally occur when one doesn't delay long enough for the LCD.  In other words, the delay port doesn't seem to be working.  Any suggestions?

Code: [Select]

safecopy2:
ld a, $87
out ($2A), a
ld c,$10
ld a,$80
setrow:
nop
nop
nop
nop
nop
;in b,(c)
;rl b
;jp c,setrow
out ($10),a
ld de,12
ld a,$20
col:
;in b,(c)
;rl b
;jp c,col
nop
nop
nop
nop
out ($10),a
push af
inc c
ld b,64
row:

rowwait:
;in a,($10)
;rla
;jp c,rowwait
ld a, (hl)
out (c), a
add hl,de
djnz rowwait
pop af
dec h
dec h
dec h
dec c
inc hl
inc a
cp $2c
jp nz,col

ret

Title: Re: Problems with Port $2A
Post by: calc84maniac on August 28, 2011, 12:27:48 am
Keep in mind that when you set 15MHz, you need a longer delay (in terms of cycles) because each cycle is shorter.
Title: Re: Problems with Port $2A
Post by: thepenguin77 on August 28, 2011, 12:51:39 am
Like calc84 said, you need quite a few cycles of delay in 15Mhz mode. To cover all LCDs, you'll probably have to get an upper range of 180 cycles per loop with your average lcd running at 150 cycles.

Your $87 gets divided by 4 and only comes out to 33 cycles. That plus your current 43 only leaves you with 76, and that is nowhere even close to what you need.

Try getting your main loop up somewhere around 120 and setting (2Ah) to $FF. That should give you 183 and will definitely work. From there, you can scale it down to your needs. However, you can't go lower than 123, but, that's ok I guess.
Title: Re: Problems with Port $2A
Post by: Hot_Dog on August 28, 2011, 10:13:49 am
Oh, gotcha.  My problem was I thought the upper six bits was the number of clock cycles (1 cycle = 4 T-States) rather than the number of T-states
Title: Re: Problems with Port $2A
Post by: Monkeyanator on August 28, 2011, 11:22:47 am
Hey, I don't know anything about calculator programming. I know C++, Objective C, and Adobe AS3 all fairly well... but I am completetly foreign to what you use to code for calculators. In fact, I don't even know what you use to code for it! I really need some help... can someone PM me? I really want to get started with it.
Title: Re: Problems with Port $2A
Post by: calcdude84se on August 28, 2011, 11:37:05 am
Monkeyanator, you have made 3 posts in various topics that are all similar, the most recent two being exactly the same. If you are not a spambot, and are just very confused, then please delete your other two posts and create a topic introducing yourself via this link. (http://www.omnimaga.org/index.php?action=post;board=10.0)
Edit: And on a less threatening note, welcome to Omnimaga! :)