Recent

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

winni

  • Hero Member
  • *****
  • Posts: 2482
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

  • Full Member
  • ***
  • Posts: 187
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: 9
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: 9
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

  • Full Member
  • ***
  • Posts: 187
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

  • Full Member
  • ***
  • Posts: 187
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: 9
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)

 

TinyPortal © 2005-2018