Turbo Pascal PopolonY2k's Framework

Страница 1/5
| 2 | 3 | 4 | 5

By popolony2k

Hero (544)

Аватар пользователя popolony2k

21-06-2016, 17:46

This thread was created to discuss about the PopolonY2k MSX Framework created for using with programs written in Turbo Pascal (Borland and MSX Computer Club).

The current version of the Framework can be found here https://sourceforge.net/p/oldskooltech/code/HEAD/tree/msx/tr...

[]'s
PopolonY2k

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By popolony2k

Hero (544)

Аватар пользователя popolony2k

21-06-2016, 22:17

Continuing the discussion about an issue found by rolandve when he was trying to using some CONIO.PAS functions/procedures in some European MSX like NMS 8250.
Today I started debugging the CONIO.PAS functions/procedures and I realized that this issue is result of an old code refactoring which I made several years ago.

I was used to use Constants to describe some MSX system variables and to access these system variables I used a code like :

Var regs : TRegs;
Const EXPTBL = $FCC1;

Begin
regs.IY := Mem[EXPTBL];
...(rest of code)
End;

But after the code refactoring I changed to an absolute variable assignment, used in Turbo Pascal, like below:

Var      regs : TRegs;
           EXPTBL : Byte Absolute $FCC1;

Begin
  regs.IY := Mem[EXPTBL];
  ...(rest of code)
End;

But I forgot of to change the way to access this memory area from :

    regs.IY := Mem[EXPTBL];

to

  regs.IY := EXPTBL;

So I will post in the next message, the fixes for all affected functions.

Soon, I'll commit this changed module and I'll post the new URL SVN address here.

[]'s
PopolonY2k

By popolony2k

Hero (544)

Аватар пользователя popolony2k

21-06-2016, 22:44

Please check the new revision for CONIO.PAS here

https://sourceforge.net/p/oldskooltech/code/HEAD/tree/msx/tr...

I think that this time everything will be working fine. :)

[]'s
PopolonY2k

By rolandve

Champion (358)

Аватар пользователя rolandve

22-06-2016, 09:18

Yup, it compiles, doesn't crash and after modifying my code I get output.
Without a _GotoXY() to start with, WriteLn() doesn't generate output, because X,Y are set to 0 in _ClrScr(). Is there a reason X,Y in _ClrScr() are initialised at 0,0? in conio.pas?

After OpenDirectTextMode(), WriteLn() add's 2 character after each line of text (CRLF)? A note symbol and an inverse coloured C. Is this by design? If I skip the OpenDIrectTextMode() these characters are not added.

PROGRAM MSXDOS;

{$I inc\types.pas}
{$I inc\dvram.pas}
{$I inc\msxbios.pas}
{$I inc\conio.pas}

Var
	scrHandle : TOutputHandle;
Begin
	OpenDirectTextMode(scrHandle);
	_ClrScr;
	_GotoXY(1,1);
	Writeln('ABCDEFGH');
	CloseDirectTextMode(scrHandle);
END.

By AxelStone

Prophet (3199)

Аватар пользователя AxelStone

22-06-2016, 10:56

@popolony2k you are great man!

TP 3.3 + PopolonY2k's Framework + Kari Lammassari Libs = Why the hell you're using BASIC?

By htdreams

Champion (298)

Аватар пользователя htdreams

22-06-2016, 12:00

@AxelStone: when you say TP 3.3, you are refering to MSX TP 3.3? executing and compiling in a MSX? or crosscompiler with TP 3.3 for MSDOS with some command line compiler to generate MSX code?

By AxelStone

Prophet (3199)

Аватар пользователя AxelStone

22-06-2016, 13:23

@htdreams MSX TP 3.3, at least until Old Bits Studio will be released and considering that it supports all those libraries.

By popolony2k

Hero (544)

Аватар пользователя popolony2k

22-06-2016, 15:09

rolandve wrote:

Yup, it compiles, doesn't crash and after modifying my code I get output.
Without a _GotoXY() to start with, WriteLn() doesn't generate output, because X,Y are set to 0 in _ClrScr(). Is there a reason X,Y in _ClrScr() are initialised at 0,0? in conio.pas?

You're right, this is a bug and now is fixed in the project's SVN repository. Please check the new CONIO.PAS revision at https://sourceforge.net/p/oldskooltech/code/HEAD/tree/msx/tr...

rolandve wrote:

After OpenDirectTextMode(), WriteLn() add's 2 character after each line of text (CRLF)? A note symbol and an inverse coloured C. Is this by design? If I skip the OpenDIrectTextMode() these characters are not added.

In fact OpenDirectTextMode changes the default character printing handler to a new one implemented in DVRAM .PAS (Check the Procedure DirectWrite( chChar : Char ) in DVRAM.PAS). This procedure is much faster than the original character handling procedure, which in fact uses the BDOS character/string output calls. These BDOS functions are tooooooo slow functions.
My DirectWrite original implementation was not considering the CR/LF character handling, but after your report I decided to implement this feature and now it is working with CR/LF, skipping lines when necessary, so please check the new revision for DVRAM.PAS here https://sourceforge.net/p/oldskooltech/code/HEAD/tree/msx/tr...

Just a warning, working with Write/WriteLn in direct text mode (using OpenDirectTextMode), the text won't be scrolled when it reaches the borders of the screen. This is "by design", because I don't want to put a lot of code that could cause some overhead in the DirectWrite function, that is a very fast character handling procedure.
When you can, please compare displaying a big amount of text in the screen using Write/WriteLn without activating the direct text mode (through OpenDirectTextMode procedure) and after using the same Write/WriteLn with the direct text mode working through OpenDirectTextMode.

[]'s
PopolonY2k

By popolony2k

Hero (544)

Аватар пользователя popolony2k

22-06-2016, 14:51

AxelStone wrote:

@popolony2k you are great man!

TP 3.3 + PopolonY2k's Framework + Kari Lammassari Libs = Why the hell you're using BASIC?

Thanks AxelStone.

[]'s
PopolonY2k

By popolony2k

Hero (544)

Аватар пользователя popolony2k

22-06-2016, 14:53

htdreams wrote:

@AxelStone: when you say TP 3.3, you are refering to MSX TP 3.3? executing and compiling in a MSX? or crosscompiler with TP 3.3 for MSDOS with some command line compiler to generate MSX code?

htdreams, in fact my library and Kari's library work perfectly in the original Turbo Pascal 3.0b from Borland too, so this compiler is another option to use these libraries.

[]'s
PopolonY2k

By rolandve

Champion (358)

Аватар пользователя rolandve

22-06-2016, 17:57

@Popolony2k, I appreciate your support for your libraries after all this time.

I decided to also look for a Turbo Pascal manual, just to see which methods and functions TP3 has. Its obvious TP3 was very limited to the dumbest CP/M terminal because in TP4 the nicer features like sound and graphics were added.

I was looking for the simple 'inc(...);' statement, but I couldn't find it. The version 3 manual doesn't mention it, it appears in version 4. That makes me ask, how difficult this is to implement in pascal with inline.
My general knowledge of assembler is very low but just brain waving
- store the byte value of the variable in A
@var3a (LD A, value at address var)
3c (inc A)
@var32 LD @var, A

But I lack knowledge of actually making it work. Does it have to go through the slot selector. Is the byte order Hi:Lo ( Operand, Value or Value, operand). I am pretty sure my first attempt at using assembly will crash my machine. So, how does that inline code look?

Thank

Страница 1/5
| 2 | 3 | 4 | 5