Author Topic: Vista And TinyPTC  (Read 3521 times)

0 Members and 1 Guest are viewing this topic.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Vista And TinyPTC
« on: August 15, 2007 »
Hi,

I am having allsorts of problems with getting my programs to run successfully under Windows Vista, And tinyptc. With any of the following Freebasic versions, 16, 17, 18.

There are no compile errors, all that happens is that Windows Reports to me that the programs executable has failed and asks for me to close it.

There's a couple of programs that do work, and 90% that don't.

Basic framework I use for TinyPTC is.

Code: [Select]

#include once "tinyptc.bi"
#Include Once "Windows.bi"
#Include Once "crt.bi"

Dim Shared ScreenBuffer(640*480)

Declare Function KeyHit( ByVal KeyChar As Integer ) As Integer


While KeyHit(27)<>TRUE
       
        PTC_Update @ScreenBuffer(0)
       
        Erase ScreenBuffer
       
Wend

PTC_Close()


Function KeyHit( ByVal KeyChar As Integer ) As Integer

    If (GetAsyncKeyState(KeyChar) And 32768) Then
        Return True
    Else
        Return False
    End If

End Function


Any solutions would be wicked and awesome, and thanks in advance.
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Vista And TinyPTC
« Reply #1 on: August 15, 2007 »
Hi Clyde, I don't know of any problems with DBF's PTC and Vista.

But I see a couple of things wrong with your code, first you need to call
PTC_Open()
with the correct parameters to initialise PTC.

Then, in the loop, you need to call
PTC_flip()
otherwise you won't see anything ;)

Also, you don't need the Erase Screenbuffer command at all.

So your framework should look something like
Code: [Select]

#include once "tinyptc.bi"
#Include Once "Windows.bi"
#Include Once "crt.bi"

Dim Shared ScreenBuffer(640*480) As Integer

Declare Function KeyHit( ByVal KeyChar As Integer ) As Integer

PTC_open(...)

While KeyHit(27)<>TRUE
       
        PTC_Update @ScreenBuffer(0)
        PTC_flip()
Wend

PTC_Close()


Function KeyHit( ByVal KeyChar As Integer ) As Integer

    If (GetAsyncKeyState(KeyChar) And 32768) Then
        Return True
    Else
        Return False
    End If

End Function

Are you having problems with other people's programs too?

Jim
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Vista And TinyPTC
« Reply #2 on: August 15, 2007 »
Cheers Jim. Do you know I feel a right doughnut. I'd left PTC_Open out.

However, I do get this with other peoples programs and the older programs of mine that do have it in. With regard to others progs maybe it's the version of FB their compiled on.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Vista And TinyPTC
« Reply #3 on: August 15, 2007 »
Actually, I think it's PTC_init() not PTC_open()...doh.  I don't use it much myself.

Not sure what's wrong with other people's programs.  What graphics card do you have and do you have the latest drivers?  ATI and nVidia's Vista drivers were really crummy even up to a month or so ago (they're still crap, but they're getting there).

Jim
Challenge Trophies Won:

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Vista And TinyPTC
« Reply #4 on: August 15, 2007 »
I've got a PNY Nvidia FX5500 and are the latest from NVidia.

Quote from: Jim
ATI and nVidia's Vista drivers were really crummy even up to a month or so ago (they're still crap, but they're getting there).

That would explain why some other programs dont run without crashing at some point. Cheers Jim.
« Last Edit: September 11, 2007 by Clyde »
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Vista And TinyPTC
« Reply #5 on: August 15, 2007 »
Code: [Select]
#include once "tinyptc.bi"
#Include Once "Windows.bi"
#Include Once "crt.bi"

You should really be using "TINYPTC_EXT" too. I use Rbraz's version and it seems to run fine everywhere.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline DrewPee

  • I Toast Therefore I am
  • Pentium
  • *****
  • Posts: 563
  • Karma: 25
  • Eat Cheese - It's good for you!
    • View Profile
    • Retro Computer Museum
Re: Vista And TinyPTC
« Reply #6 on: September 03, 2007 »
Ive had lots of problems too - with freebasic and vista - some of my programs work and some don't - I know one problem that I had was that some of my routines were using rather a large screen and my new laptop couldn't go that large - I have reduced most of my routines now down to 800 x 600 or 640 x 480 but still have various problems with programs crashing etc. . . . ?

Drew
DrewPee
aka Falcon of The Lost Boyz (Amiga)
Ex-Amiga Coder and Graphic Designer
Administrator of > www.retrocomputermuseum.co.uk

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Vista And TinyPTC
« Reply #7 on: September 03, 2007 »
Make sure that you have the latest version of PTC_EXT by Rbraz is my advice.

800 X 600 and 640 X 480 should be safe on nearly every system. Perhaps a new topic with the offending code and we can work through the problems you are having :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: Vista And TinyPTC
« Reply #8 on: September 04, 2007 »
I know it won't help...but i do have vista here and not a single issue with fb...now, i don't use all the potential of fb, true...
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.