PDA

View Full Version : Turbo Pascal 3 Website



CP/M User
February 19th, 2010, 10:43 PM
Hi folks, haven't been here in ages and it's looks all so different now!

I wanted to just say that I had a programming website with some examples on it dedicated to Turbo Pascal 3 - some of those were generic programs and I even made a Generic game for it too based on a game written in BASIC in one of those old Usborne Computer books from the early 80s ("Creepy Computer Games" for those wondering).

Anyway I had to take the site down because it was no longer going to be free, however just before it went I made sure it would get a backup of it. I was going to write direct to the Amstrad CPC Zone forum, but they seem to have disappeared too, so I was hoping someone would help me out, I was going to see if I could get a small spot of it on CPCWiki though I don't know who to contact about it, if someone can help me out or knows someone from the CPC Zone who knows someone who is involved with CPCWiki I would certainally appreciate it.

Thanks.

mbbrutman
February 23rd, 2010, 05:26 PM
I'm surprised that this has not had any replies yet ..

If it is a generic TP3 web site then I think there should be lots of places to host it. If it is more Amstrad related then maybe there is an Amstrad flavored site to contact, but I don't know of any - I am woefully unfamiliar with the Amstrad line.

I have more than enough room at brutman.com, although you might not like the neighborhood. :-) We might be able to twist Erik's arm if it is not too gaudy.

CP/M User
February 23rd, 2010, 09:27 PM
mbbrutman wrote:

I'm surprised that this has not had any replies yet ..

If it is a generic TP3 web site then I think there should be lots of places to host it. If it is more Amstrad related then maybe there is an Amstrad flavored site to contact, but I don't know of any - I am woefully unfamiliar with the Amstrad line.

I have more than enough room at brutman.com, although you might not like the neighborhood. :-) We might be able to twist Erik's arm if it is not too gaudy.

Okay I'll be honest and say it's Amstrad related (because that was what all those programs were running in) but what I did on my old site was have an index of all the programs and anything which was written using Generic Turbo Pascal 3 code was marked as such. I also tried to make it more orientated for the people who had Amstrad Emulators, though I think that was just to get Turbo Pascal 3 up and running on it, but I didn't really make it orientated for people who were just starting out with an Amstrad Emulator! :(

Given as such I'm not sure if John Elliott can help me out here cause he has a site with some Amstrad CPC CP/M related stuff on it. Kevin Thacker (who helped me out with the more Machine Specific stuff to do while in CP/M) also has a site, but I'm unsure if he can help since he's quite busy and dedicates his site towards Assembly programming. The other site CPCWiki I mentioned earlier is gone which is sad, the forum I used to advertise my website on (like this one) has also gone, so I can only assume that my machine has taken a tumble on the Internet! :(

I've tried looking around at Free Websites, but the one I signed up for is hopeless and it doesn't let you setup a website to how you want it! :( Geocities was good cause you could upload your own pages, however I used it as a plain file server, I've got some HTML code which allows you to have a File Server look the only other problem I have is no icons or pics used to display folders and files, etc.

Lawrence Woodman
February 24th, 2010, 12:30 AM
I've tried looking around at Free Websites, but the one I signed up for is hopeless and it doesn't let you setup a website to how you want it! :( Geocities was good cause you could upload your own pages, however I used it as a plain file server, I've got some HTML code which allows you to have a File Server look the only other problem I have is no icons or pics used to display folders and files, etc.


You could try 5QuidHost (http://www.5quidhost.co.uk/), I have had an account with them for quite a while and found them to be excellent. I haven't tried their free hosting, but I expect that it would be the same quality as the paid, just with less facilities.

CP/M User
March 6th, 2010, 12:18 AM
Lawrence Woodman wrote:

You could try 5QuidHost (http://www.5quidhost.co.uk/), I have had an account with them for quite a while and found them to be excellent. I haven't tried their free hosting, but I expect that it would be the same quality as the paid, just with less facilities.

This looked like a good service, unfortunately I was starting to get concerned when they only take php based stuff, but then I read that php is only an extension of regular HTML so made a HTML file and just changed the extension to php, but after clicking on their free website plans they will only accept people who are in the UK! :eh:

I had an offer from someone here offering me some space, but I haven't heard back, though if it's going to mean a lot of setting up and allocation for a tiny site which won't be making any money then I don't expect people to go to the trouble. Unfortunately I'm just back to square one though.

Anyone know if Angelfire Free Websites are any good? I know they have been going for a while, but if it's all Advertising and Popups - unless it's like Geocities you could bypass all that by having it as a File Server with some text files on it, then that would work.

CP/M User
March 12th, 2010, 08:35 PM
I've just setup my website so it can be found here (http://turpas3.angelfire.com/) now. If anyone wants to duplicate it or simply use any of the generic programs which are on my website or include them on your website then please feel to use it for your own.

CP/M User
August 26th, 2010, 02:59 AM
mbbrutman wrote:

I'm surprised that this has not had any replies yet ..

If it is a generic TP3 web site then I think there should be lots of places to host it. If it is more Amstrad related then maybe there is an Amstrad flavored site to contact, but I don't know of any - I am woefully unfamiliar with the Amstrad line.

I have more than enough room at brutman.com, although you might not like the neighborhood. :-) We might be able to twist Erik's arm if it is not too gaudy.


Apologies for my late reply Mike. Naturally I found where the gang were hanging out. The old Forum was gone and their Wiki page was hacked when I tried to go there (which was where the new forum had moved to).

Unfortunately my absence from that community has had a negative impact on Turbo Pascal, problem could be it's rival is BASIC and people who know BASIC generally have stuck with it and now it's possible to take your BASIC programs and compile them! Given that was the prime reason to use TP, a BASIC Compiler steers BASIC closer to be the more aggressive. Sure there are perhaps advantages in TP which BASIC cannot handle as well, or cannot perform as efficently. Inline Machine Code is still of TPs advantage as well as Constant Arrays, though BASIC can do just as well with that if Files are implented.

Anyway the general feeling I think is people have since either moved onto Assembly which is always going to be the best language to use on that kind of system, or have something like BASIC to Compile or have built up a C Library which can implement some very functional programs. TP is perhaps seen as a language which requires CP/M which also maybe it's limitation. But I keep plugging away at it even if I've here and there with it! :(

My website is looking for more programs though, mostly been working on Amstrad Specific stuff, one of those things I've made which can eventually go there is an Mandelbrot which I converted from the IBM PC version of TP3 which I originally translated from a Turbo Pascal 6 program. Like the PC version I made a fast version. This thing loads a 320x200 screen and uses 4 files to load the information - 64k in total is drawn pixel by pixel on screen, takes 9 minutes to complete, though is pretty good considering they used to take hours on a 4Mhz processor to complete! :D

CP/M User
August 27th, 2010, 02:45 PM
Thought this thread could do with some code! :D


{ For all of you who are interested on fractals, here is a little program,
taken from a source code in Modula-2, that will draw a Mandelbrot fractal.
Just one problem: If your computer doesn't have a math coprocessor, the
program will run "a bit" slow.
Try modifying all the constants, you'll get strange results.}
{$U+} { Supposed to be used for Breaking During Programs }
Program Mandelbrot; {Using real numbers. For TP 6.0 and above }

Const Colours=15; {Number of colors to be on the image. }
Width=640; {Width of the image. }
Height=400; {Height of the image. }
Limit=8.0; {Until when we calculate. }
XRMin=-2.0; {Left limit of the fractal. }
XRMax=1.0; {Right limit of the fractal. }
YRMin=-1.3; {Lower limit of the fractal. }
YRMax=1.3; {Upper limit of the fractal. }
Var XPos,YPos:Integer;
Procedure mode(mo:byte);
begin
Inline($3A/mo/
$CD/$9B/$BE/
$0E/$BC);
end;
Procedure grapen(col:byte);
begin
Inline($3A/col/
$CD/$9B/$BE/
$DE/$BB);
end;
Procedure Plot(Xpos, Ypos : integer);
begin
Inline($2A/ypos/
$ED/$5B/xpos/
$CD/$9B/$BE/
$EA/$BB);
end;


{ Calculates the color for each point. }
Function ComputeColour(XPos,YPos:Integer):Byte;
Var RealP,ImagP:Real;
CurrX,CurrY:Real;
a2,b2:Real;
Counter:Byte;
Begin
CurrX:=XPos/Width*(XRMax-XRMin)+XRMin;
CurrY:=YPos/Height*(YRMax-YRMin)+YRMin;
RealP:=0;
ImagP:=0;
Counter:=0;
Repeat
a2:=Sqr(RealP);
b2:=Sqr(ImagP);
ImagP:=2*RealP*ImagP+CurrY;
RealP:=a2-b2+CurrX;
counter:=succ(counter);
Until (Counter>=Colours) or (a2+b2>=Limit);
ComputeColour:=Counter-1;
End;
var xpos2, ypos2 : integer;
Begin
mode(1);
ypos2:=height;
xpos2:=0;
repeat
begin
xpos2:=0;
repeat
begin
grapen(ComputeColour(Xpos2,Ypos2));
plot(Xpos2, Ypos2);
xpos2:=xpos2+2;
end;
until (xpos2=width);
ypos2:=ypos2-2;
end;
until (ypos2=0);
repeat until keypressed;
mode(2);
End.

Don't worry about this comment:

{Using real numbers. For TP 6.0 and above }

I leave it there as bit of a in-joke the code works perfectly good in TP3! :D

I thought some of you maybe interested even though I made some modifications from the original program, I was quite suprised how easy it was to port to another computer system. Originally I had it running in CP/M-86 & DOS using Turbo Pascal 3. The original program itself ran in VGA Mode 13h - 320x200x256 on those systems although I made it smaller to make it fit into an array so it would draw out faster. I ported it to CP/M-80 by exploting the commands of my machine by substituting the IBM specific statements with those my machine uses. As a result there are the procedures Mode, Grapen & Plot.

Mode - sets up the Video Resolution in the beginning it uses 1 which is 320x200 (40x25 Text) mode which allows 4 colours. And at the end of the program where it goes back to 2 which is 640x200 (80x25 Text) Mode - the Mode CP/M prefers to run in.

Grapen - think of this as a way to Graphically change the colour of the Pixel. What happens in this program is I setup Grapen procedure and in that is the function for Calculating the next colour. That value is then used for the Grapen which sets the Colour for the Pixel.

Plot - Is the Procedure for Drawing that Pixel, it relies on what's been set from the Grapen otherwise it will simply stick with whatever the default colour is. This is a bit different from what the IBM program was doing cause from memory the Plotting Procedure on that system allows you to set the colour when your going to plot a pixel (I think).

The other modifications I had to make was all in the Looping. Originally the program used a Nested FOR statement. Unfortunately for reasons only known to Borland, a FOR statement in TP3 doesn't allow Stepping - so for example one cannot do 2,4,6,8,10 and so on in a FOR - you can decrease the value by adding 1 or subtracting one in a FOR statement, though this leads to other programs and potential for Infinate Loops! :satisfie: So I changed it around to a Nested Repeat ... Until statement which never usually lets me down and has worked again in this case! :D The reason I had to do this is all about the Video Setup on my computer. Every mode while it has a different Resolution, has to be calculated out to 640x400. This is the computers way of solving the problem with Circles so a Circle is round everytime in all 3 resolutions. In the High Resolution mode 640x200 where 2 colours are only possible, Increments between Pixels are 1 for 1, but in Mode 1 where 4 colours are allowed each increment is 2, so the next pixel along is 2 positions away - hence 0,2,4,6,8 and so on. And in the Low-res mode where 16 colours are allowed it's 0,4,8,12,16 and so on. To make it work on my system I had to tell the system how this loop should function in order to properly display the Mandelbrot. The only other thing I had to watch out for was how the Y Position works on my computer. Top left hand corner begins at 398 and 0 is the bottom left hand side - so a bit different from a PCs Video Mode. :D