Welcome, Guest. Please login or register.


Author Topic: Detecting LPTs with wrong number of lines? (Read 2579 times)

Offline Sdw

  • User
  • *
  • Posts: 50
Detecting LPTs with wrong number of lines?
« on: 2016.August.19. 17:43:18 »
Since I am generating most of my LPTs in code, there is a slight risk that I have a bug somewhere (a loop going one iteration too much/little) and ending up with for example a 311 line or 313 line LPT.
Is there a way of detecting this easily? I guess most TVs will sync properly even if the line count isn't exactly correct (at least it worked that way when I was coding for the Atari2600/VCS) so spotting it by eye is probably a bit hard.
I didn't find anything in ep128emu that could give this info.

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Detecting LPTs with wrong number of lines?
« Reply #1 on: 2016.August.19. 19:07:32 »
I didn't find anything in ep128emu that could give this info.

It is possible to test the length of the LPT with a simple Lua script like this one:
[ Guests cannot view attachments ]
It runs on every interrupt (breakpoint at 0038h), and counts the total number of lines in the LPT, so it does not correctly support multi-frame or interlaced LPTs. Another, simpler version that does not use breakpoints and just prints the current number of lines in the LPT:
[ Guests cannot view attachments ]

Offline Sdw

  • User
  • *
  • Posts: 50
Re: Detecting LPTs with wrong number of lines?
« Reply #2 on: 2016.August.20. 00:26:41 »
Thank you, what a neat solution, I didn't know that ep128emu was scriptable with LUA.
And thanks to this I found out I had some seriously off LPTs, running 304 lines at several places!
Seems like both ep128emu and my real Enterprise128+CRT TV didn't mind 304 lines though, it seemed to work fine.
But now of course I have adjusted so that it is proper 312 lines everywhere.

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14710
  • Country: hu
    • http://enterprise.iko.hu/
Re: Detecting LPTs with wrong number of lines?
« Reply #3 on: 2016.August.20. 08:18:42 »
About 25 years ago my Junosty tv (cheap russian tv, which popular used for computers in Hungary at those years) can detect wrong numbers of LPBs: screen started scrolling up or down :-)

Offline Povi

  • EP addict
  • *
  • Posts: 2290
  • Country: hu
    • http://povi.fw.hu
Re: Detecting LPTs with wrong number of lines?
« Reply #4 on: 2016.August.21. 23:27:55 »
About 25 years ago my Junosty tv (cheap russian tv, which popular used for computers in Hungary at those years) can detect wrong numbers of LPBs: screen started scrolling up or down :-)
Yes, but there was a hw solution to fix the scroll: just adjust the potentiometer at the back on the Junosty
*** Speicherplatz zu klein