stefanhaustein / empire

The 90s are back and have uploaded their favorite BBS game!
2 stars 0 forks source link

Organize code #5

Open pleumann opened 4 years ago

pleumann commented 4 years ago

The current source code is too large for Turbo Pascal 3.0 on cp/m. The limit there is about 30K. So we need to split up the current code. Would also make it easier to maintain.

How about this:

pleumann commented 4 years ago

Just found out that Turbo Pascal 3.0 did not yet support conditional compilation - which does suck a tiny bit. Do we

  1. want to look for a way of structuring the code based on top-level "project" files that contain the needed includes or
  2. do we prefer something with proper units that compiles fine with Turbo Pascal 4+ and Free Pascal plus a Python script that generates a version for Turbo Pascal 3.0 (based on some special markers)?
stefanhaustein commented 4 years ago

I don't see anything that can be conditional, so why not go ahead with includes and add more complexity later as needed?

pleumann commented 4 years ago

I don't see how to manage KeyPressed and ReadKey on FPC without conditionally using CRT. And without these we only have Read() for Input, which means a) every input has to be confirmed with and b) the user can type any kind of garbage that would potentially garble the user interface. Alternative is that we split up the code and have top-level files empire.pas for FPC and empire3.pas for Turbo 3, and these include everything as needed.