[Turbo Pascal] Q&A official thread

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

By rolandve

Champion (372)

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

11-05-2016, 16:46

I will test it once I've got everything up-and-running. Still waiting for a moment to bring my MSX to its MSX2+ upgrade with turbo capabilities. Then with the MegaFlash I can start programming. Its just that I read the code and didn't see comments about width 80. Will check to see when i've got TP up-and-running.

Grts

By popolony2k

Hero (544)

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

11-05-2016, 18:08

rolandve wrote:

I will test it once I've got everything up-and-running. Still waiting for a moment to bring my MSX to its MSX2+ upgrade with turbo capabilities. Then with the MegaFlash I can start programming. Its just that I read the code and didn't see comments about width 80. Will check to see when i've got TP up-and-running.

Grts

Hi friend I'm back again Smile

I have tested the code I sent you before and it works perfectly in 80x24.

Enjoy.

[]'s
PopolonY2k

By popolony2k

Hero (544)

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

11-05-2016, 18:18

In fact...

...this text mode switching used in CONIO.PAS is a MSX BIOS CALL, so if you're using just a MSX1 without 80 column extension card, this call will work only for 40 column mode. If you're using a MSX2 or a MSX1 with 80 column card (which is integrated with the MSX BIOS of course), it will work for 80 column too.

My suggestion is to check the MSXBIOS.PAS to understand a little bit more how you can integrate the MSX BIOS calls to your Turbo Pascal code.

[]'s
PopolonY2k

By rolandve

Champion (372)

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

11-05-2016, 19:26

I certainly will. I've got no other experience then MSX basic programming but what I think I understand from surfing around this board is that any high level programming language is obsolete. Its only assembly I see, but I can't find a decent book. I like to learn by modifying code and see what happens.

In many examples (C and Pascal) I see libraries that are 100% assembly). That of course is very good because of speed. It makes me wonder about the BIOS though. I think I see people use the BIOS like its a library. So my question is: is the BIOS a library that jumps to the rom for the actual code or is the basic rom just the wrapper around the BIOS.?

Grts

By popolony2k

Hero (544)

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

11-05-2016, 21:00

rolandve wrote:

I think I see people use the BIOS like its a library. So my question is: is the BIOS a library that jumps to the rom for the actual code or is the basic rom just the wrapper around the BIOS.?

Grts

In fact I'm using MSX BIOS (or even PC BIOS in the earlier days) like an extension or library. Considering the MSX BASIC, I think that MSX BASIC uses a lot of MSX BIOS calls, so it can be considered a wrapper to the MSX BIOS.

[]'s
PopolonY2k

By Grauw

Ascended (10819)

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

11-05-2016, 21:05

User of would maybe be a better term, except that there is no clear line between the BIOS and BASIC, they’re intertwined on many levels, the BIOS containing calls that only make sense for the BASIC interpreter.

By popolony2k

Hero (544)

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

11-05-2016, 23:16

AxelStone...

..I'm following your discussion in the another thread (About C programming).

You can try this code using my libs, to find the YM2413 (OPLL).

{$i types.pas}
{$i msxbios.pas}
{$i sltsrch.pas}
{$i sleepb.pas}
{$i ym2413.pas}

{$v-}

Var
      nSlotId : TSlotNumber;

Begin
  nSlotId := FindYM2413;

  If( nSlotId <> ctUnitializedSlot )  Then
    WriteLn( 'OPLL Slot found at ', nSlotId )
  Else
    WriteLn( 'OPLL not found' );
End.

This piece of code should work in the YM2413 sound chip detection.

[]'s
PopolonY2k

By AxelStone

Prophet (3199)

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

12-05-2016, 23:34

Hi Popolony, In the other thread Graw has given me the solution thanks anyway. I've taken a look to your libs and are really good, keep working on it Wink . You are right, port code between Pascal <-> C is quite direct, so I'll follow your libs from near, I can learn reading them.

It seems that compiled languages (MSX-C / Turbo Pascal) starts having a hollow in MSX developers comunity. Cool!!

By raymond

Hero (653)

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

13-05-2016, 11:50

popolony2k wrote:

AxelStone...

..I'm following your discussion in the another thread (About C programming).

You can try this code using my libs, to find the YM2413 (OPLL).

{$i types.pas}
{$i msxbios.pas}
{$i sltsrch.pas}
{$i sleepb.pas}
{$i ym2413.pas}

{$v-}

Var
      nSlotId : TSlotNumber;

Begin
  nSlotId := FindYM2413;

  If( nSlotId <> ctUnitializedSlot )  Then
    WriteLn( 'OPLL Slot found at ', nSlotId )
  Else
    WriteLn( 'OPLL not found' );
End.

This piece of code should work in the YM2413 sound chip detection.

[]'s
PopolonY2k

It finds my OPLL at slot 136, how does this translate back to Slot and Sub-Slot numbers?

By Creepy

Champion (335)

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

13-05-2016, 12:05

Translate it to binary and use this to translate it:

ExxxSSPP
E = 1: Slot is expanded.
SS: Sub slot number
PP: Primary slot number

(see documentation for bios call RDSLT)

So 136 = 10001000 in binary.

So chop it up: Primary slot = 00 and sub slot = 10
00 binary = 0 decimal
10 binary = 2 decimal

So it is in slot 0-2 (primary slot 0, subslot 2). This value can be used directly with the bios calls for reading, writing and switching to slots (RDSLT, WRSLT etc)

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