Getting the SCREEN mode - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: Getting the SCREEN mode (/showthread.php?tid=935) |
RE: Getting the SCREEN mode - TerryRitchie - 09-30-2022 (09-30-2022, 04:21 PM)mnrvovrfc Wrote:(09-30-2022, 03:15 AM)mnrvovrfc Wrote: For a site called "QB64 Game Programming" it might be better to make a recommendation to use "_NEWIMAGE" instead of "SCREEN" for new programs. "SCREEN" prevails, though for a generic tutorial which must accept importing programs from M$QB or QBasic. ...While I wrote this I failed to notice "SCREEN" statement was needed anyway combined with "_NEWIMAGE". I was unable to remember "_NEWIMAGE()" is a function, can't do stuff itself that "SCREEN" does! I'm sorry about that. Why would they need DOSBox? They can simply type the code into QB64 and it will run just fine. Remember, QB64 is nearly 100% compatible with all code written for GWBASIC (line numbers) and QuickBasic. No old computer or DOSBox needed. And as far as making SCREEN 13 bigger, easy peasy: SCREEN13& = _NEWIMAGE(320,200,13) ' Work Screen SCREEN _NEWIMAGE(1024,800,32) ' Graphics Screen _DEST SCREEN13& ' Switch to work screen ' Draw your graphics and such _DEST 0 ' Switch to graphics screen _PUTIMAGE ,SCREEN13& ' Map work screen onto graphics screen RE: Getting the SCREEN mode - Pete - 09-30-2022 Terry, one of the biggest conversion problems is DEFN. Galleon decided to punt on that one. To save on memory, I had a couple of large programs I had to convert 100s of lines to regular function calls. So that is probably the best example of code that could be run more easily on DOSBox than converting to QB64, if yo don't plan to use it much. Now SHELL commands might be a horse of a different color. I can't recall if the earlier versions of DOSBox supported all SHELL commands or not. VAPTAR() PEEK and POKE statements no longer able to function on newer Windows OS's probably can't run on DOSBox, either, but I haven't kept up with that project. One cool thing DOSBox does have is an Android version. You can actually run QBasic programs on Android through that version of DOSBox. Pete RE: Getting the SCREEN mode - TerryRitchie - 09-30-2022 (09-30-2022, 04:47 PM)Pete Wrote: Terry, one of the biggest conversion problems is DEFN. Galleon decided to punt on that one. To save on memory, I had a couple of large programs I had to convert 100s of lines to regular function calls. So that is probably the best example of code that could be run more easily on DOSBox than converting to QB64, if yo don't plan to use it much. Yeah, I remember those discussions way back then about DEFN and your need to do a lot of conversion. RE: Getting the SCREEN mode - Pete - 09-30-2022 DEFN-itly. Pete RE: Getting the SCREEN mode - mnrvovrfc - 09-30-2022 (09-30-2022, 04:38 PM)TerryRitchie Wrote: And as far as making SCREEN 13 bigger, easy peasy:I prefer the jaggies only on an IBM PS/2 Model 30 color monitor or something like that from my high school. Not in the recent time on a 64-bit system LOL. This procedure won't be preferred by somebody who wants to import a game in "SCREEN 13" and "needs" to make it larger. A person would have to be clever enough to check the source code of a graphics program to see if it could support larger dimensions. But actually many old programs are hard-coded to certain screen dimensions. I brought up the point about DOSBOX because a person who cannot have a computer and OS that could run 16-bit Q(uick)Basic has to pick his/her poison: either that or QB64PE, both are complex. That person might not care about 32-bit color, or about resolution larger than old VGA. However there are others who get curious. "But I need to do all that just to make the screen larger? Is there another easier way?" and "What do you think about Freebasic? Could it allow me to do it easier?" and "If I bought Purebasic..." and, well, you begin to understand what is the difficulty of persuading people who want to get into BASIC programming with a small amount of patience. Many people complain about EXE/Linux-executable file sizes and how long an application finishes work (start from pressing [F5] in QB64PE IDE enough said). They would rather do something which is even less efficient because "I just want it to work like 20 years ago, how hard?" Sometime ago I had a personal experience with 32-bit Free Pascal. None of my old programs would run correctly compiled by it because too many things were assumed out of "CRT" and "GRAPH" units, the two modules people were most interested in line with the most "popular" QB/QBasic programs posted on the web. It did have a "VIDEO" unit which does "portable console" like Freebasic "SCREEN 0", which could include changing the dimensions of "bash" or "cmd.exe" window. The line-numbering luddite would just download PC-BASIC which, sadly it's difficult as heck to install it on Fedora and not available for many other Linux distros. It'll be interesting what happens to that one, once a certain popular programming tool finally reaches version 4... (09-30-2022, 04:38 PM)TerryRitchie Wrote: Why would they need DOSBox? They can simply type the code into QB64 and it will run just fine. Remember, QB64 is nearly 100% compatible with all code written for GWBASIC (line numbers) and QuickBasic. No old computer or DOSBox needed.Not if it supports "FOR... NEXT" loops for delaying eg. in an arcade game. RE: Getting the SCREEN mode - Pete - 09-30-2022 Just calculate the frames per second of the old game and add the appropriate _LIMIT statement to the loop. Anyway, in most cases old programs, of any consequence, require some conversion but absolutely nothing comes as close to QBasic products compatibility as QB64. Pete RE: Getting the SCREEN mode - mnrvovrfc - 09-30-2022 Somebody edited the "NIBBLES.BAS" that came with QBasic long ago... Before that, all the "FOR... NEXT" loops to do delays were commented out! So it was impossible to play the game, never mind "twiddle fingers" LOL. BTW That program was a good example of doing graphics with text, which recalls eg. Tandy Color Computer. Much harder to do the 2x3 blocks of the TRS-80 Model III though... Somebody might type in a QB/QBasic program into the QB64PE IDE, complete with those "FOR... NEXT" loops and then boggled by the result. "WTF this is unplayable! This sucks, this QB64 sucks and doesn't run my game right!" However, a small chance that occurs with the knowledgeable among us... RE: Getting the SCREEN mode - TempodiBasic - 10-03-2022 Hi Terry my two cents: I remember an example of QBasic that get the screenmode using a mechanical method by error trapping (on error goto). The news of 32 bit screens aren't an exception to this... but the power of QB64 to create for example _NEWIMAGE(100,60,0) make needing the use of _WIDTH and _HEIGHT more than the ON ERROR GOTO way to get the screen MODE. .... on the other hand I see in WikiHelp a function by Ted Weissgerber that should work and it uses INP and OUT look at this Code: (Select All) FUNCTION ScreenMode& You can find it in the wiki help of IDE. RE: Getting the SCREEN mode - TempodiBasic - 10-04-2022 Hi here the code developed by me following the idea of ON ERROR GOTO Code: (Select All) $Debug As you can see for the nature of ON ERROR GOTO label you need to put a part of code into MAIN and the rest of code into a FUNCTION. I hope you like this routine. RE: Getting the SCREEN mode - SMcNeill - 10-07-2022 Try this: Code: (Select All) Data 0,1,2,7,8,9,10,11,12,13,256,32 |