Page 3 of 3 FirstFirst 123
Results 21 to 26 of 26

Thread: Problems when switching BP7.0 real mode to protected mode

  1. #21

    Problems when switching BP7.0 real mode to protected mode

    Now I've run into another problem...

    I was using a unit found on the net for playing multiple simultaneous sounds in my game (http://www.programmersheaven.com/dow.../download.aspx) and it worked like a charm in real mode. However, to get it to work in protected mode, the IDE needs to leave enough extended memory for the sounds it has to load. From the unit's .doc file:

    Code:
    This library will work in the real-mode IDE but requires a little work
    to get it to work in the protected mode IDE.  By default, the IDE's DPMI
    extender uses all extended memory.  The demo requires 200k of extended
    memory, and any programs using SMIX require extended memory to hold all
    the sounds.  You can decrease the amount of extended memory used by the
    IDE by setting the DPMIMEM environment variable:
      SET DPMIMEM=MAXMEM x
    where x is the number of kilobytes of extended memory to use for the
    IDE.  You will have to find a balance between memory left over for your
    program and memory available for IDE use.  (Source code, online help,
    compilation...)
    I can't figure out where to set the DPMIMEM environment variable...?
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

  2. #22

    Problems when switching BP7.0 real mode to protected mode

    Just open a command prompt (cmd.exe) and type:

    Code:
    SET DPMIMEM=MAXMEM 10000
    Do this before starting BP.

    From the comments it looks like it is only the IDE that use this setting. Have you tried to compile an exe-file of your program and run it after exiting the IDE?
    ZGameEditor - Develop 64kb games for Windows.
    Thrust for Vectrex - ROM-file and 6809 source code.

  3. #23

    Problems when switching BP7.0 real mode to protected mode

    I tried running the compiled exe outside the IDE and the program crashes with a runtime 216 error. I think I'll just try to get everything working without sound and music, and then maybe add it at some later time...
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

  4. #24

    Problems when switching BP7.0 real mode to protected mode

    Quote Originally Posted by dmantione
    That depends on the cpu word size. If the datatype that overflows matches the cpu word size it starts over. If it doesn't match you get an illegal value.
    So you mean that Free Pascal does not "start over" Byte and Word-types on a Intel32 cpu?
    ZGameEditor - Develop 64kb games for Windows.
    Thrust for Vectrex - ROM-file and 6809 source code.

  5. #25

    Problems when switching BP7.0 real mode to protected mode

    Okay, then... I've been able to fix most bugs and the program runs fairly stable now. However, there seems to be some crashes occuring when there are many other applications running in Windows and I think it's because of an array of pointers, I'm using. I'm allocating and deallocating them correctly and normally there's no problem, but sometimes they cause an error 216 (mostly when there are a lot of other applications running). I'm thinking that I might now have set the correct memory settings for compiling in protected mode, but I can't figure out what the correct memory setting would be, since there's only the Stack Size to set and it seems that no matter what I set this to, it runs without problems (even though I've tried both setting it to 0 and the max value!). Any ideas what could be going on?
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

  6. #26

    Problems when switching BP7.0 real mode to protected mode

    Quote Originally Posted by VilleK
    So you mean that Free Pascal does not "start over" Byte and Word-types on a Intel32 cpu?
    If you have:

    [pascal]
    var a:word;
    b:cardinal;

    begin
    b:=65535;
    b:=a+1;
    [/pascal]

    ... there is no start over. However, my comment was mostly targetted at constructions like:
    [pascal]
    var a:0..9;

    begin
    a:=9;
    a:=a+1;
    [/pascal]

    ... there is no start over in these cases.

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •