Author Topic: wincpctelera - create a smooth windows port of a game  (Read 585 times)

0 Members and 1 Guest are viewing this topic.

Offline teopl

  • CPC664
  • ***
  • Posts: 132
  • Country: cs
  • Liked: 58
  • Likes Given: 109
Hello! :)

I am using wincpctelera for game development mainly for debugging and it's a really great thing for that purpose.

However I am wondering if it can be used in porting the game to windows and still work smooth like on real hardware?

Currently I have issue that game has a delay after keyboard input and acts "not smooth" in general.

I calculate object positions based on time I have from interrupt handler function and then I looked into that and I saw that on wincpctelera interrupt handler is called in non equal intervals (2,3,4,5,... ms). Can I make wincpctelera to call it exactly 300 times per second in equal intervals?

I then tried to call the handler from a separate thread loop and got better precision but screen is blinking constantly. Can this be avoided?

So before I spend more time on investigation I would like some advice if someone has similar issues or hopefully a solution to this.

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 647
  • Country: fr
  • Liked: 558
  • Likes Given: 1169
Re: wincpctelera - create a smooth windows port of a game
« Reply #1 on: 15:59, 25 April 20 »
Hi @teopl,
you can try the latest version i just committed, i removed some useless tempo and changed the interruption function.
Now it seems to be always closed to 3ms and the keyboard input is read every 1ms.

Hope it's better otherwise i'll need a little code example with the problem

Arnaud

Offline teopl

  • CPC664
  • ***
  • Posts: 132
  • Country: cs
  • Liked: 58
  • Likes Given: 109
Re: wincpctelera - create a smooth windows port of a game
« Reply #2 on: 16:29, 25 April 20 »
Thanks for ultra fast response :) It works now much much better!

Btw, I had issue opening .sln file so I merged the code from the older commit and also I removed the log WinCpcTelera_PrintInt("Int" not to slow down.

But, it works!

Offline Arnaud

  • Supporter
  • 6128 Plus
  • *
  • Posts: 647
  • Country: fr
  • Liked: 558
  • Likes Given: 1169
Re: wincpctelera - create a smooth windows port of a game
« Reply #3 on: 16:38, 25 April 20 »
Thanks for ultra fast response :) It works now much much better!

Btw, I had issue opening .sln file so I merged the code from the older commit and also I removed the log WinCpcTelera_PrintInt("Int" not to slow down.

But, it works!

Oops i forget to remove traces  ;D Great if it works better.

Concerning your Windows port, what will you do with sound ?



Offline teopl

  • CPC664
  • ***
  • Posts: 132
  • Country: cs
  • Liked: 58
  • Likes Given: 109
Re: wincpctelera - create a smooth windows port of a game
« Reply #4 on: 16:57, 25 April 20 »
That is what I am thinking now, I converted .aks songs to .wav using SongToWav.exe and I will try to play it the windows way :)

Maybe I will later add some sound library - do you have some suggestion regarding the sound?


Offline teopl

  • CPC664
  • ***
  • Posts: 132
  • Country: cs
  • Liked: 58
  • Likes Given: 109
Re: wincpctelera - create a smooth windows port of a game
« Reply #5 on: 19:41, 25 April 20 »
Just tried this and it plays .mp3 fine https://github.com/dr-soft/miniaudio
I will see if it will be good when it comes to changing the songs, playing sfx, ...

If someone knows a better lib for mp3/ogg playback which is minimal and simple, please reply.