Turbo Pascal nostalgia trip

Page 1/3
| 2 | 3

By SdC

Resident (38)

SdC's picture

14-06-2018, 14:34

Hello MSX family!
The MSX was my gateway to a life long career as a Microsoft Engineer. Now I'm in my midlife crisis, I'm back at it....
My first goal was to able to be able to get Turbo Pascal up and running; came across MSXPad but that is quite cumbersome and does not work on Windows x64 as-is.
So decided to create a build environment from the ground up, so I could use modern editors (specifically Microsoft Visual Code)
The result is that I now have a tool chain scripted together with a template project, that runs natively on pretty much any Windows Win32 version (and even ReactOS!) on x64 and x86.
Windows 10 x64 absolutely refuses to run the cross-compiler 3.3f executable, so I'm running that through DosBox.
All scripted so it's a single click to compile and run (fMSX, BlueMSX and OpenMSX all work)

Just for fun, I tested it running on Reactos in Virtualbox on Ubuntu in Hyper-V on Windows 10 x64.

Good to see there are more crazy people like me still coding 8 bit Smile

Login or register to post comments

By raymond

Champion (318)

raymond's picture

14-06-2018, 20:21

Welcome back to the MSX-community! Good to hear that the MSX community has another TP-programmer. See also:

QA thread for TP
MCCE Turbo Pascal

By AxelStone

Prophet (2572)

AxelStone's picture

20-06-2018, 22:40

Sure, nice to see a TP programmer. Wellcome!!!

By Grauw

Enlighted (7315)

Grauw's picture

20-06-2018, 23:27

Nice! My own toolchain (Assembly, Eclipse, openMSX) is set up similarly, and compiling and running with a single button or key press is a really nice workflow which allows to iterate quickly.

I didn’t know about ReactOS, that’s an interesting alternative to Wine (which I’m not a big fan of).

One thing I think would be interesting is if there were a basic MSX-DOS2 runtime for Windows, Linux & Mac consisting of an unthrottled Z80 emulator, initialised with a DOS environment, and forwards all DOS calls to the host environment, so that MSX-DOS tools can just be executed from the PC command line and read/write text and files to the host system. Would be nice to integrate e.g. MSX-C compilation in a toolchain, or to move program code to tools without having to rewrite it in another language.

By SdC

Resident (38)

SdC's picture

21-06-2018, 08:02

Thanks for the welcome.
I'm still reading up on everything that happened between '88 and '18....

Before I can actually start serious coding, I need to get Microsoft Visual Code configured to respond properly to compiler errors and such.
Re-learning Pascal is fun: I am doing more in .NET/Powershell now, and not having classes is a bit of a challenge, but stong standardized variable TYPE's can help a lot... looking through some of the MSX .PAS code floating around, I don't see much of that. The include libs are mostly to add the commands that BASIC has.

Grauw, for the runtime, you mean something like Cygwin where you can run a Linux GCC etc. in Windows? I guess that's sort-of how Konami etc. all used to work. Unthrottled? I know BlueMSX can run at 100% host speed, I'm curious the others can too. And BlueMSX can mount a host folder as disk drive instead of having to do the intermediate step of building a DSK/ROM image.
But a workflow like you outline is a bit too far with the current tools, although can be built into the emulator code, which is open I guess... so.... what's stopping you? Wink

By Vampier

Prophet (2193)

Vampier's picture

21-06-2018, 17:20

i would use openMSX which has scripting support / dir as disk support and decent command line support (which i already said in a shorter version on facebook) - just don't use fMSX... not as accurate as openMSX. BleuMSX hasn't had a release since 10 years now while openMSX is still actively developed,

By Grauw

Enlighted (7315)

Grauw's picture

21-06-2018, 19:37

@SdC Well Cygwin is slightly different as it requires programs to be recompiled with the new libraries. What I was thinking about is a very lightweight emulator with no sound or video support (CPU only), just for command line MSX-DOS(2) applications, which high-level emulates the BDOS calls on the host OS.

Existing emulators don’t really fit the bill because they don’t output to the host OS console, open a window, and are also comparatively slow because they emulate many more things at an accuracy level unnecessary for these purposes, and run the full boot sequence. In my programming environment if I compile and run in openMSX unthrottled it still takes a few seconds before my program executes. While in a build script I would want it (e.g. GEN80, MSX-C, PMARC or my unit tests) to take a fraction of a second to execute to completion.

I think it would be a neat project, by putting it out there maybe the idea could inspire someone Smile. E.g. someone who feels like writing a Z80 emulator, but would like a smaller-scope application for it than a full blown emulator. (People like konamiman or TomH or others with similar interests.)

By popolony2k

Hero (521)

popolony2k's picture

22-06-2018, 08:59

Welcome...

...again to the MSX Community @SdC.

In fact there are a lot of things written in Turbo Pascal and the Kari Lamassari library is an alternative to use several specific features on MSX.

Another alternative is my Framework that has been improved everytime I can, with new modern features.

In fact I'm working (silently), in a new Turbo Pascal version that will turn TP into a little bit more performatic compiler because this is an old single step compiler, so the generated binary is not so optimized to performance.

Please, feel free to follow this thread too PopolonY2k Framework

[]'s
PopolonY2k

By SLotman

Paragon (1202)

SLotman's picture

22-06-2018, 13:11

Quote:

MSXPad but that is quite cumbersome and does not work on Windows x64 as-is

Install MSXPad normally. Then download and extract this, overrinding files.

Presto, thanks to DOSBox, MSXPad fully working on 64 bits.

By SdC

Resident (38)

SdC's picture

23-06-2018, 13:13

SLotman wrote:
Quote:

MSXPad but that is quite cumbersome and does not work on Windows x64 as-is

Install MSXPad normally. Then download and extract this, overrinding files.

Presto, thanks to DOSBox, MSXPad fully working on 64 bits.

Thanks, but I'm already using dosbox in my own build scripts as well :)

By SdC

Resident (38)

SdC's picture

03-07-2018, 21:13

I've put the scripts on Github, if anyone is interested to take a look: https://github.com/decocq-stuff/msx-pascal-project-template
I'm certainly interested in feedback!

Page 1/3
| 2 | 3
My MSX profile