Recent

Author Topic: Convert pictures of a Turbo Pascal program ported to ptcGraph  (Read 15436 times)

winni

  • Hero Member
  • *****
  • Posts: 3134
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #15 on: May 20, 2021, 11:10:49 am »
Hi!

The overflow of bytes or words to roll to zero was widely used in Turbo Pascal apps - most of speed reasons. Disabling Range Check did the job.

If you did not want this behaviour we had some functions like Range2Byte - the same like math.ensureRange does today.

Winni


Roland57

  • Sr. Member
  • ****
  • Posts: 310
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #16 on: May 20, 2021, 11:26:56 am »
@Winni

Thanks for the informations. Yes, I understand what you say: there aren't really errors in the program, but it's rather a programming style. Indeed the program works well when range checking is off.

Tracking the errors was a way for me to study the program and try to understand how it works. But for now I think I will let it as it is.

By the way, I tested the program on Windows (on two different machines). It works, but is very slow.

retronick

  • New Member
  • *
  • Posts: 17
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #17 on: May 20, 2021, 05:23:34 pm »
 As long as you know it's not really a bug and just the behavior of the compiler i think it's save t o turn off range checking. its just a game and not some kind of medical device.

I notice when you reach Act 1 the screen doesn't clear. I never got to act 2 so i don't know what happens there.

Anyway good job on porting this!

retronick

  • New Member
  • *
  • Posts: 17
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #18 on: May 20, 2021, 09:24:08 pm »
It looks like you commented out all the cleardevice statements in the act procedures when you were debugging. You need to uncomment them for the act scenes to look right.

Roland57

  • Sr. Member
  • ****
  • Posts: 310
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #19 on: May 21, 2021, 07:57:18 am »
It looks like you commented out all the cleardevice statements in the act procedures when you were debugging. You need to uncomment them for the act scenes to look right.

Indeed. And also here, in the main program:

Code: Pascal  [Select][+][-]
  1.     ClearDevice;
  2.     CurLevel^.Draw;

Anyway good job on porting this!

Thank you. You did the most difficult. For my part, I did not do much.  :)

Roland57

  • Sr. Member
  • ****
  • Posts: 310
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #20 on: May 21, 2021, 08:18:28 am »
So, here is the current version of the project. Later I will create a git repository.

I have not really tested the level editor. It is on my to-do list.

I wonder what are the keys for cheating. Here are the values:

 #251 : score up by 1000 pts
 #252 : bonus pacman (life)
 #253 : eat a power pill
 #254 : toggle visible/invisible mode
 #255 : skip level


What are the keys for those values?

retronick

  • New Member
  • *
  • Posts: 17
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #21 on: May 21, 2021, 07:08:01 pm »
if you have a numeric keypad on your computer hold down the Alt key and type the number on the numeric key pad.

i believe same values as ascii / chr(number)

Roland57

  • Sr. Member
  • ****
  • Posts: 310
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #22 on: August 01, 2022, 03:16:06 pm »
Hello!

With the holidays I came back to this project. I could fix range check errors and all memory leaks.  :)

So I decided to create a repository on GitLab: Ghost Invasion

The next step would be to add music and sound effects.  :)

Fred vS

  • Hero Member
  • *****
  • Posts: 2726
    • StrumPract is the musicians best friend
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #23 on: August 01, 2022, 05:43:58 pm »
So I decided to create a repository on GitLab: Ghost Invasion

WoW, superbe and out-of-the-box.


 ;D

Fre;D
« Last Edit: August 01, 2022, 05:48:38 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Handoko

  • Hero Member
  • *****
  • Posts: 4712
  • My goal: build my own game engine using Lazarus
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #24 on: August 01, 2022, 05:47:09 pm »
Thank you for sharing it.

But I can't compile it using Lazarus GTK2, Ubuntu Mate 22.04.

Fred vS

  • Hero Member
  • *****
  • Posts: 2726
    • StrumPract is the musicians best friend
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #25 on: August 01, 2022, 05:53:40 pm »
Thank you for sharing it.

But I can't compile it using Lazarus GTK2, Ubuntu Mate 22.04.

Hello.

It was the same here with Debian 11.

The fixes:
First:
Code: Pascal  [Select][+][-]
  1. sudo apt-get install libxxf86dga1

And then:
Code: Pascal  [Select][+][-]
  1. sudo ln -s /usr/lib/x86_64-linux-gnu/libXxf86dga.so.1 /usr/lib/x86_64-linux-gnu/libXxf86dga.so

Fre;D
« Last Edit: August 01, 2022, 08:40:17 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Handoko

  • Hero Member
  • *****
  • Posts: 4712
  • My goal: build my own game engine using Lazarus
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #26 on: August 01, 2022, 05:55:04 pm »
Thank you for the reply.

Maybe that should be documented on the project readme.txt.

Roland57

  • Sr. Member
  • ****
  • Posts: 310
Re: Convert pictures of a Turbo Pascal program ported to ptcGraph
« Reply #27 on: August 01, 2022, 07:50:37 pm »
Thanks for your feedback guys.

@Fred

Thank you for the solution. Link added in this discussion.
« Last Edit: August 01, 2022, 08:58:15 pm by Roland57 »

 

TinyPortal © 2005-2018