You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
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.
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.
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'
----------------------------------------------------------------
'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
sleep
REM Boogy on out
end
----------------------------------------------------------------
(copy and paste sprite code below into NOTEPAD and save
as 'Earth.spr')
----------------------------------------------------------------
'earth.spr
42 32
673
<snip> * Excessive content removed by Administrator
</snip>
'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. http://www.geocities.com/dunric/orbit.html
Writing a small Master of Orion clone in QBASIC and (now) PowerBASIC is not an easy task.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: