@thelastpsion@bitbang.social
@thelastpsion@bitbang.social avatar

thelastpsion

@thelastpsion@bitbang.social

Vintage platform necromancy. #Psion hardware and software hackery, especially SIBO/EPOC16 (Series 3, etc).

Made the #PsiDrive, a USB drive for Psion SSDs. Slowly rewriting the SIBO SDK.

WARNING: Will #sidequest (#HaikuOS, #Linux, #BSD, #NeoVim, #virtualisation #virtualization, #Arduino, #RP2040, #PlatformIO, #FreePascal #ObjectPascal, #ObjC, #zig, #OCaml, #compilers)

If you have old Psion source code (OPL, C, C++, assembly), docs or schematics, get in touch!

#retrocomputing #permacomputing

This profile is from a federated server and may be incomplete. Browse more on the original instance.

M0CUV, to retrocomputing
@M0CUV@mastodon.radio avatar

In other news, I have started the descent into by downloading Basilisk II in order to emulate a classic Macintosh SE/30. I looked briefly on eBay for a real one, but I doubt I could justify it - “what, MORE computers?!”

thelastpsion,
@thelastpsion@bitbang.social avatar

@M0CUV Slippery slope. You'll be back in the Psion world before you know it. 😜

thelastpsion, to random
@thelastpsion@bitbang.social avatar

0.264 for currently building. Please stand by...

thelastpsion, to retrogaming
@thelastpsion@bitbang.social avatar

Just tried compiling Wari, a game written in #Psion OO C. The project uses #Borland Make 3.6.

Got it to compile first time with my SIBO SDK setup - all good!

However... Borland Make uses 16-bit DPMI, and its extender won't load 32-bit DPMI binaries. If I pre-load the 32-bit extender, it won't load 16-bit DPMI binaries, so Make won't run!

TL;DR: I can't use the new #ctran with Borland Make 3.6.

Looks like I'll be converting that Makefile to GNU Make or a #TopSpeed project.

#dos #dosbox

thelastpsion,
@thelastpsion@bitbang.social avatar

Why can't I recompile #ctran for 16-bit #DOS? Because many of #FreePascal's libraries are too big to fit into 64 KiB data blocks, and won't compile no matter which memory model I use.

There is a chance I'll rewrite ctran in the future. #FreeVision (the #Borland #TurboVision "clone") with #ObjectPascal is certainly an option. I could also rewrite the lot in C or C++.

But today is not that day. For now, I'd rather just rewrite a Makefile.

#dosbox #retrocomputing

thelastpsion,
@thelastpsion@bitbang.social avatar

Modifying the old makefile to work with make went well! It mostly required replacing double-spaces with tabs, escaping backslashes, and switching the wildcard syntax to something more modern.

As a result, Wari now compiles on the SIBO C SDK with GNU Make for DOS! I wonder if the developer would appreciate a pull request?

So... Does it compile with my new version of ? Well...

thelastpsion,
@thelastpsion@bitbang.social avatar

DROP-IN REPLACEMENT, BABY!

This is Wari, a #Psion #EPOC16 game written in Psion's proprietary OO C, back in 1996.

It was compiled with a modified version of the Psion SIBO C SDK, containing my new FOSS version of the #ctran OO preprocessor.

It literally just worked!

The fun doesn't stop here, but the first milestone has been reached. Two months of work. I am both pleased and relieved!

#retrocomputing #retrodev #retroprogramming

ActionRetro, to Haiku
@ActionRetro@bitbang.social avatar
thelastpsion,
@thelastpsion@bitbang.social avatar

@ActionRetro Not overkill! I bet MAME would take about 10 minutes to compile on that.

(cc @begasus)

thelastpsion, to retrocomputing
@thelastpsion@bitbang.social avatar

Does anyone know if there's much of a difference between MAKE files and MAKE files?

There's an old project on GitHub that uses Borland MAKE as part of its build process. I was thinking of migrating it to GNU MAKE (on DOS) to remove a proprietary dependency.

ActionRetro, to random
@ActionRetro@bitbang.social avatar

Send me right to jail

thelastpsion,
@thelastpsion@bitbang.social avatar

@ActionRetro WHAT DID YOU DO?!

Also, I want one.

thelastpsion, to random
@thelastpsion@bitbang.social avatar

Apologies for the delay, fans. is currently building. I foresee no issues, so I should be able to get the pull request done to HaikuPorts tomorrow morning (UK time).

is really handy for this sort of work. I need to see if there's something better than VNC for remote desktop access of Haiku from Linux for testing graphical apps.

thelastpsion, to random
@thelastpsion@bitbang.social avatar

Class-building time for .

The compiler tutorials I've read don't talk about how to deal with classes and inheritance. I assume that a metaclass has to be built for each class. But should I then store those metaclasses for later use, or do I regenerate them when needed? I assume the former.

Also, my parser doesn't currently check for duplicate classes or methods (inside classes). Should it be in the parser, or should it be part of the thing that builds the output?

thelastpsion, to random
@thelastpsion@bitbang.social avatar

If I want to have any hope of learning to write #EPOC16 device drivers in the future, I'm going to need to learn x86 (specifically 8086 and NEC V30) assembly.

That is DEFINITELY not a Today Problem. It's not even a This Year Problem.

#Psion

thelastpsion, to random
@thelastpsion@bitbang.social avatar

Idle thought today re #ctran:

I wonder if it's worth making a little interface using #FreeVision (the #TurboVision-compatible library that comes with #FreePascal) to display information about #Psion OO category (class definition) files?

Yes, I realise this is feature creep. But currently I'm outputting a lot of information to the terminal that the original CTRAN.EXE doesn't do. How much do I leave in as a "verbose" option, and how much to I move to a shiny TUI?

Something for another time.

NanoRaptor, to random
@NanoRaptor@bitbang.social avatar

Vantabeige.

thelastpsion,
@thelastpsion@bitbang.social avatar

@NanoRaptor Vantabeige is closely related to Vartabeige, the colour of the batteries that you forgot were still attached to your PCBs.

thelastpsion, to random
@thelastpsion@bitbang.social avatar

Done a lot of work on #ctran tonight. In fact, I think we might have a working parser! I definitely need to check over what I've done, but it's looking promising.

I need to add more checks to make sure that tokens don't appear in files that aren't meant to have them (e.g. DECLARE should only be in .EXT files). Then I need to test that the tree is being built the way I think it is.

After that, it's time to do something with EXTERNALs and REQUIREs to make MANY trees.

thelastpsion,
@thelastpsion@bitbang.social avatar

I think we have a parser!

On the left is the original demo category file, including comments and whitespace.

On the right, the file has been lexed, parsed, and finally re-generated from the tree created by the parser.

I've also tried it with the 481-line OLIB.EXT, and it generates an almost identical 480-line file. The only difference is the comment at the start of the original: "Generated by Ctran from olib.cat".

thelastpsion,
@thelastpsion@bitbang.social avatar

The parser doesn't create a proper tree. Instead, it's made up of 5 arrays:

  • EXTERNALs (array of String)
  • INCLUDEs (array of String)
  • REQUIREs (array of String)
  • CLASSes (array of a custom class type)
  • ELEMENTS (the order in which each one appears in the file)

The screenshot below shows this in more detail.

To use the "tree," I step through each element. For the first one, I see that it's an EXTERNAL file with an index of 0, so I go to ExternalList[0] and get the filename.

thelastpsion,
@thelastpsion@bitbang.social avatar

I think I could generate Psion OO C headers from this now.

There would be no error checking to see if the "parent" classes actually exist, of course. That's going to take some extra multi-file-parsing shenanigans, scanning through the EXTERNAL and REQUIRE arrays and parsing each one. The trees from EXTERNAL files are then used as a reference, while REQUIRE files are more like including a file. (INCLUDEs are just converted to #include lines and copied to generated C headers.)

thelastpsion,
@thelastpsion@bitbang.social avatar

If you're interested in how I've done this, the code is here:

https://github.com/PocketNerdIO/ctran

Be warned, though. It's a mess. Right now my aims are "having working code" and "learning Pascal" rather than "pretty."

thelastpsion,
@thelastpsion@bitbang.social avatar

Upcoming tasks:

  • Remove the old public token-grabbing methods. They were for the old parser, so aren't needed.
  • Move a load of "testing" code to a separate class, inheriting the main class.
  • Expose the "tree" as read-only properties, either as 5 separate arrays or as one record.

Then, one of these (both need doing eventually):

  • Try to generate a OO C header.
  • Start working out how to handle EXTERNALs and REQUIREs. This involves instantiating an unknown number of parsers.
thelastpsion,
@thelastpsion@bitbang.social avatar

I guess I could create a dynamic array of parser classes?

Is that something I can do in #ObjectPascal? Is it even a good idea?

Thoughts for another time. For now, it's time to check I've pushed all my commits, and head to bed.

#FreePascal

thelastpsion,
@thelastpsion@bitbang.social avatar

Quick #ctran update:

✅ Expose the "tree" as read-only properties, as 5 separate arrays.

I thought this was going to be awkward. #FreePascal won't let you create a property that is an "array of" some type. I assumed I'd have to do a load of rewriting to accommodate new custom types.

Turns out I just needed to create the new types and put them in the relevant public/private declarations. And for the three "array of string" variables, I just used TStringArray. No other changes. It Just Worked.

thelastpsion,
@thelastpsion@bitbang.social avatar

So, to come on :

⬜ Move a load of "testing" code to a separate class, inheriting the main class.
⬜ Remove the old public token-grabbing methods. They were for the old parser, so aren't needed.

The first one should be relatively simple (I think). I've not tried inheritance in classes yet, so we'll see how things go. Hopefully it doesn't make me want to refactor everything as one or more interfaces.

thelastpsion,
@thelastpsion@bitbang.social avatar

Mmm... Shiny #DOS goodness alongside shiny #Linux goodness.

Exactly the same #ObjectPascal code on both, just using #FreePascal's cross-compiler for 32-bit DOS. Zero changes needed.

#ctran

image/png

thelastpsion, to neovim
@thelastpsion@bitbang.social avatar

I'm definitely in danger of spending too much time tweaking and , and not enough time programming.

But I just need to do a few... more... tweaks...

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines