Author Topic: investigating port $2F  (Read 1038 times)

0 Members and 1 Guest are viewing this topic.

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 317
  • Rating: +45/-0
    • View Profile
investigating port $2F
« on: September 29, 2020, 06:38:45 am »
Welcome.

Long story short, i'm trying to code a new LCD tool that optimises port $2F, so i used this page as a reference.
For now, i'm only interested in the port's behaviour under CPU speed 1 (port $20), and while having ports $2A & $2E holding their default values.

DELAYS

For my project, i need to know the exact amount of cycles during which bit 1 of port $02 is reset, depending on port $2F configuration.
But since i don't precisely know when a port is considered read|written during the instruction processing, i checked the amount between them (port $10|$11 read|write <> port $02 check).
So, i was expecting smaller amounts than what's stated on the wiki (48,112,176,240).
Here are the results of my tests :

Spoiler For Spoiler:
port $2F = %------00 :

clock cycles between IN|OUT and IN A,($02) :
41- : port $02 = %------0-
42+ : port $02 = %------1-
clock cycles between IN|OUT and IN A,(C) :
40- : port $02 = %------0-
41+ : port $02 = %------1-

port $2F = %------01 :

clock cycles between IN|OUT and IN A,($02) :
105- : port $02 = %------0-
106+ : port $02 = %------1-
clock cycles between IN|OUT and IN A,(C) :
104- : port $02 = %------0-
105+ : port $02 = %------1-

port $2F = %------10 :

clock cycles between IN|OUT and IN A,($02) :
169- : port $02 = %------0-
170+ : port $02 = %------1-
clock cycles between IN|OUT and IN A,(C) :
168- : port $02 = %------0-
169+ : port $02 = %------1-

port $2F = %------11 :

clock cycles between IN|OUT and IN A,($02) :
233- : port $02 = %------0-
234+ : port $02 = %------1-
clock cycles between IN|OUT and IN A,(C) :
232- : port $02 = %------0-
233+ : port $02 = %------1-

notes :

IN|OUT : any read|write from|to port $10|$11
IN A,(C) : C register holding $02
It's interesting to see that though the opcode used to interact with port $10|$11 doesn't affect the delay, the one used to read port $02 does.

UNEXPECTED BEHAVIOURS

While checking the delays, i came across 2 main inconsistencies, in specific code contexts.
I'll post some code examples later, but for now, here is what i discovered :

bit 1 of port $02 becoming crazy :
Supposedly, only 2 events can alter that bit's state :
1) Bit becomes 0 after interacting with a LCD port (delay counter reset).
2) Bit becomes 1 after the delay counter ended.
Well, apparently, the bit can change under other circumstances i haven't yet identified.
All i know is that it involves the proximity of interactions with ports $02|$20|$2F (and possibly LCD ports).

crash while writing to port $2F :
I still have no idea if it's a CPU, or LCD crash.
Again, it apparently involves the proximity of interactions with the ports.
« Last Edit: October 05, 2020, 12:06:12 pm by the_mad_joob »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6207
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: investigating port $2F
« Reply #1 on: September 30, 2020, 12:40:42 pm »
I get 0, 0, 0, 0 on my 84+
« Last Edit: September 30, 2020, 12:58:22 pm by Eeems »
/e

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 66
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: investigating port $2F
« Reply #2 on: September 30, 2020, 12:55:09 pm »
I want to test this but I can't do it without having the raw assembly to input onto my calc.


Maybe this helps:
jsTIfied with TI-84+ Silver Edition OS 2.55MP gives me 65535, 65535, 65535, 65535


If you could would you send me code. I can convert it into Mimas code and do it on my real calc.
Grammer2 is Good!

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 317
  • Rating: +45/-0
    • View Profile
Re: investigating port $2F
« Reply #3 on: September 30, 2020, 02:04:08 pm »
I get 0, 0, 0, 0 on my 84+
Thanks dude !
It appears i was actually right to be paranoid.
Those numbers are pretty unexpected, if you got them from actual hardware.
Basically, that means the delays i measured on my two 84+SEs aren't enough for the 84+, which definitely shouldn't be the case.
Which OS was it ?

I want to test this but I can't do it without having the raw assembly to input onto my calc.


Maybe this helps:
jsTIfied with TI-84+ Silver Edition OS 2.55MP gives me 65535, 65535, 65535, 65535


If you could would you send me code. I can convert it into Mimas code and do it on my real calc.
Thanks.
Should i understand that you have no way to send data from computer to calc ?
If yes, forget inputting the data by hand, the program is way too big for that.
Anyway, i added the source code on my original post, just in case.
And no, i'm afraid results coming from emulators are definitely irrelevant, cause port $2F isn't accurately emulated =[

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6207
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: investigating port $2F
« Reply #4 on: September 30, 2020, 03:28:46 pm »
I get 0, 0, 0, 0 on my 84+
Thanks dude !
It appears i was actually right to be paranoid.
Those numbers are pretty unexpected, if you got them from actual hardware.
Basically, that means the delays i measured on my two 84+SEs aren't enough for the 84+, which definitely shouldn't be the case.
Which OS was it ?
2.43 with some small tweaks to the certificate. Hardware revision F. I would also test with the 83+SE I have, but it's borked to the point of uselessness.
/e

Offline mrwompwomp

  • LV0 Newcomer (Next: 5)
  • Posts: 1
  • Rating: +0/-0
    • View Profile
Re: investigating port $2F
« Reply #5 on: September 30, 2020, 04:15:22 pm »
I got the same result on all 3 that I could find:
TI-84+ rev V OS 2.55MP
TI-84+ rev S 2.55MP
Prototype TI-83+SE VSC 1.18

21845,21845,21845,21845


Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 317
  • Rating: +45/-0
    • View Profile
Re: investigating port $2F
« Reply #6 on: September 30, 2020, 06:52:53 pm »
2.43 with some small tweaks to the certificate. Hardware revision F. I would also test with the 83+SE I have, but it's borked to the point of uselessness.
My tests were made under 2.43 aswell, so i guess that isolates the OS as a variable to explain the difference.
The only explanation i see right now would be that the delay provided by port $2F is somehow relative to the actual CPU speed (not just the CPU speed mode).
However, with what mrwompwomp just posted (see below), i'm not so sure about that anymore.
If i unlock enough time, i might create a different program that reveals which delays your calc uses, i need to know.
Thanks again.
EDIT : Is there a chance ALCDFIX was installed when you ran my program ?

I got the same result on all 3 that I could find:
TI-84+ rev V OS 2.55MP
TI-84+ rev S 2.55MP
Prototype TI-83+SE VSC 1.18

21845,21845,21845,21845
Cool.
21845 (actually 0101010101010101 in binary) is what to expect if the calc uses the exact same delays as on my original post.
That's the numbers i got on my two TI-84+SEs, and the fact that you got the same on both TI-83+SE & TI-84+ is great progress.
Thanks a lot !
« Last Edit: October 01, 2020, 01:50:27 am by the_mad_joob »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6207
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: investigating port $2F
« Reply #7 on: October 01, 2020, 10:17:47 am »
EDIT : Is there a chance ALCDFIX was installed when you ran my program ?

I believe so.
/e

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 317
  • Rating: +45/-0
    • View Profile
Re: investigating port $2F
« Reply #8 on: October 01, 2020, 11:54:45 am »
I believe so.
Your port $2A doesn't probably hold its default value then, which could explain everything.
Could you please confirm that for me ? (Calcsys - port monitor, or attached program)

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6207
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: investigating port $2F
« Reply #9 on: October 01, 2020, 11:59:32 am »
It's reporting 39
/e

Offline the_mad_joob

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 317
  • Rating: +45/-0
    • View Profile
Re: investigating port $2F
« Reply #10 on: October 01, 2020, 12:08:41 pm »
It's reporting 39
Damn, wrong lead then, since it's the default value.
Anyway, that's a good thing i had that idea, cause it reminded me i'll have to take port $2A into account in my tool.
I'll probably have 2 more programs for you to test, if that's ok.
Thanks again.

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6207
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: investigating port $2F
« Reply #11 on: October 01, 2020, 12:34:42 pm »
It's reporting 39
Damn, wrong lead then, since it's the default value.
Anyway, that's a good thing i had that idea, cause it reminded me i'll have to take port $2A into account in my tool.
I'll probably have 2 more programs for you to test, if that's ok.
Thanks again.
Happy to run whatever you need to test :)
/e

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 66
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: investigating port $2F
« Reply #12 on: October 01, 2020, 02:47:43 pm »
Thanks.
Should i understand that you have no way to send data from computer to calc ?
If yes, forget inputting the data by hand, the program is way too big for that.
Anyway, i added the source code on my original post, just in case.
And no, i'm afraid results coming from emulators are definitely irrelevant, cause port $2F isn't accurately emulated =[

Yah I have no way at the moment. I have a Chromebook for school use only.
Grammer2 is Good!

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6207
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: investigating port $2F
« Reply #13 on: October 01, 2020, 02:53:54 pm »
Thanks.
Should i understand that you have no way to send data from computer to calc ?
If yes, forget inputting the data by hand, the program is way too big for that.
Anyway, i added the source code on my original post, just in case.
And no, i'm afraid results coming from emulators are definitely irrelevant, cause port $2F isn't accurately emulated =[

Yah I have no way at the moment. I have a Chromebook for school use only.

You might want to look into https://ticalc.link/ (https://github.com/Timendus/ticalc-usb/)
/e

Offline E37

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 297
  • Rating: +21/-0
  • Trial and error is the best teacher
    • View Profile
Re: investigating port $2F
« Reply #14 on: October 01, 2020, 06:15:09 pm »
My 84+ SE gave 21845, 21845, 21845, 21845
I'm still around... kind of.