No announcement yet.


  • Filter
  • Time
  • Show
Clear All
new posts

  • GET/PUT in PB/DOS?

    Are GET and PUT (i.e. the graphics commands in qbasic) supported in PowerBASIC?
    They seem to be, but even with the Screen mode 13 libraries I cannot get them to display
    sprites I create. The code is as follows:

    Copy and paste code below into PB/DOS and save as 'test.bas'
    REM Use Assembly to jump to Mode 13
    ! mov ax, &h0013
    ! int &h10
    REM Now DIMension our sprite, and load it in!
    DIM earth%(673)
    CLOSE 1: OPEN "earth.spr" FOR INPUT AS #1: INPUT #1, a, b: INPUT #1, ArSize: FOR load = 0 TO ArSize: INPUT #1, earth%(load): NEXT: CLOSE #1
    REM Now place our sprite in the middle of the screen
    PUT (120, 60), earth%, PSET
    REM wait for keypress
    REM Boogy on out

    (copy and paste sprite code below into NOTEPAD and save
    as 'Earth.spr')
    42 32
    * Excessive content removed by Administrator
    'rem done!

    Run this code in QBASIC (with SCREEN 13 in place of the Assembly calls, of course)
    and it works beautifully. Run the code in PowerBASIC and the sprites don't appear, even
    though the same screen mode (13) is being accessed by the program.

    Writing a small Master of Orion clone in QBASIC and (now) PowerBASIC is not an easy task.


    [email protected]

    Few cats act their age, while
    most just cough up furballs.
    Few cats act their age, while
    most just cough up furballs.

  • #2
    PowerBASIC's GET and PUT statements work only in the natively supported graphics modes. Since you are using a non-supported mode, you'll have to write your own Get/Put replacements that work with that screen mode.

    Tom Hanlin provided an overview of how to do this in another topic in this forum today.

    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    mailto:[email protected]


    • #3
      Umm, since Screen 13 is not an official mode supported by PB, and you kicked it into that mode using assembly language, I wouldn't be surprised to see this type of thing crash your program. put and get are designed to work with certain screen modes. Each mode has different characteristics, such as color depth, interlacing (sort of), etc. One of the EGA modes for example (remember when EGA was all the rage!! Loved EGATrek!) must be bankswitched if I remember correctly, so you'd have to (if referencing the frame buffer directly) switch to red, grab the pixels, then switch to green, then to blue (get and put did this for you in PB/QB), whereas other modes are straight 4bits per pixel. So you'll probably have to implement your own put/get routines or use others' routines to access the frame buffer directly. It shouldn't be too hard.

      It has always bugged me that PB and QB never really did support sprites. XORing the puts just doesn't cut it. Even saving the underside and drawing still produces flickering. I sure some fast asm code would not have this problem.

      good luck. Now I'll let someone answer who really knows.