Welcome, Guest. Please login or register.


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

Offline Sdw

  • User
  • *
  • Posts: 50
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 48.0 Firefox 48.0
    • View Profile
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: 4859
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 45.0 Firefox 45.0
    • View Profile
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:
* lptlines.lua (0.73 kB - downloaded 86 times.)
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:
* lptlines2.lua (0.48 kB - downloaded 68 times.)

Offline Sdw

  • User
  • *
  • Posts: 50
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 47.0 Firefox 47.0
    • View Profile
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

  • EP addict
  • *
  • Posts: 13313
  • Country: hu
  • OS:
  • Unknown Unknown
  • Browser:
  • Opera 9.80 (Opera Mini 7.6.40234) Opera 9.80 (Opera Mini 7.6.40234)
    • View Profile
    • 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: 1847
  • Country: hu
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 47.0 Firefox 47.0
    • View Profile
    • 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