![]() |
Forum Index : Microcontroller and PC projects : QB64 Revisited
Author | Message | ||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Need to do some BASIC code prototyping but prefer to do it on the PC. I have DOSBox installed and my MSPDS 7.1 (fancy QuickBasic) but I thought I'd take another look at QB64. I tried it years ago and it felt too darned clunky but now I find it to be really nice. The first time that I compiled/ran (Run or F5) a Hello World in the IDE, it took an eternity but now it's fine. The IDE, at first, looked like the original DOS screen but I hit Alt/Enter to give me full-screen and changed the font and now it looks great. The cool thing is that it checks your code as you enter it and the "status" panel tells you what it expects you to type next. Only had an hour with this thing but it's growing on me rapidly ![]() |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
never played with 6.4 but I did a *LOT* of 5.0 when I was in my early 20s We ported a lot of our older work to it to leverage the burgeoning PC market and it worked. The snobbery surrounding PCs (it has to be an IBM PC controller or it doesn't even get a look in) allowed us to access bids and markets that were otherwise closed. Thing is the ported software was sometimes at a disadvantage because of the screen modes but otherwise un-modded stuff that was always seen as not good enough became instantly wow just on the basis of the platform. The compiled nature was very nice, very quick - I even did a primitive text-based windowing environment based on a large array which I copied screen memory to/from. I was never really comfortable about all the DECLAREs for SUBs at the front of the code - always thought that was a bit clunky Wow, what a memory trip. Found some of the old code in my deep store... and a part of me wants to port it to a micromite... for no reason at all ![]() SUB ProcessRadarData SHARED SampPeriod, TimeChangeFlag, WindPTR, TimeDone, BurstFlag SHARED DataPtr, RadarValid, Mode$ SHARED AzimuthRaw!, ElevationRaw!, RangeRaw!, TimeRaw! SHARED TempValid, Mb100PTR PutStatus ("Processing Radar") IF Mode$ = "T" THEN RadarValid = yes LOCATE 23, 2: COLOR white, black: PRINT "Tracking"; SPACE$(50); ELSE RadarValid = no LOCATE 23, 2: COLOR white, red: BEEP: PRINT "Update suspended, RADAR IS NOT TRACKING. Mode is "; Mode$; END IF IF RadarValid = yes AND DataPtr < Limit THEN DataPtr = DataPtr + 1 WindPTR = DataPtr - 1 OldPTR = DataPtr - 2 'get radar data FD!(Rng, DataPtr) = RangeRaw! FD!(Ele, DataPtr) = ElevationRaw! FD!(Az, DataPtr) = AzimuthRaw! FD!(Tm, DataPtr) = TimeRaw! + SampPeriod + 2 'calculate trig data FD!(Ht, DataPtr) = FD!(Rng, DataPtr) * SIN(FD!(Ele, DataPtr)) FD!(Pl, DataPtr) = FD!(Rng, DataPtr) * COS(FD!(Ele, DataPtr)) FD!(Th, DataPtr) = (((FD!(Pl, DataPtr) / 1000) ^ 2) / 16990) + FD!(Ht, DataPtr) + VAL(PreFlight$(2)) FD!(PlotX, DataPtr) = FD!(Pl, DataPtr) * SIN(FD!(Az, DataPtr)) FD!(PlotY, DataPtr) = FD!(Pl, DataPtr) * COS(FD!(Az, DataPtr)) IF DataPtr > 1 THEN FD!(Wh, WindPTR) = INT((FD!(Th, DataPtr) + FD!(Th, OldPTR)) / 2) x! = FD!(PlotX, OldPTR) - FD!(PlotX, DataPtr) y! = FD!(PlotY, OldPTR) - FD!(PlotY, DataPtr) t! = FD!(Tm, DataPtr) - FD!(Tm, OldPTR) FD!(Wv, WindPTR) = INT(SQR((x! ^ 2) + (y! ^ 2)) / t! * 10) / 10 IF y! = 0 THEN y! = .000001 END IF wdt! = ATN(x! / y!) IF y! < 0 THEN wdt! = wdt! + PI! ELSE IF x! < 0 THEN wdt! = wdt! + 2 * PI! END IF FD!(Wd, WindPTR) = (INT(fnDegs!(wdt!) * 10) / 10) / Deg2Rad! IF FD!(Wh, WindPTR) > 2999 AND PreFlight$(5) = "15" AND TimeDone = no THEN SampPeriod = 28 TimeChangeFlag = yes END IF IF FD!(Wh, WindPTR) >= LevelsHt!(Mb100PTR) THEN TempValid = yes END IF IF WindPTR > 2 THEN IF FD!(Wh, WindPTR) < FD!(Wh, WindPTR - 1) AND FD!(Wh, WindPTR - 1) < FD!(Wh, WindPTR - 2) THEN BurstFlag = yes TempValid = yes ELSE BurstFlag = no END IF 'phew! END IF END IF END IF ClearStatus END SUB |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
@CaptainBoing I suspect that there's a miscommunication here (?) QB64 is for windoze, Linux, etc. and has nothing to do with MS (and it's open-source) I believe that MS QuickBasic only reached V4.5 and the PDS (professional development system) went to V7.1(?) |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
oh right... I was certain QB5 was a thing, but then I certainly remember QB45... I have no data either way so I yield - it is highly likely time has stewed my brain. To think about it, I think you are right and I am confusing things with VB5 which is where I engaged the Borg - my Wolf359. still might port it just as an academic exercise - see what you started? Me looking at 35 year old code is more interesting than work ![]() Edited 2021-12-06 19:49 by CaptainBoing |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Oh, I had to recently do the same thing for a client who wanted to switch a 3M/Microtouch monitor to an ELO-touch. Back in the late 80s, I hard-coded the serial-comms because the mouse-emulator driver was crap so now I needed to rewrite this for the ELO-touch. Edited/compiled/linked using DOSBox in Windows and it was a fun task. When I started with QB2, I came across a couple of performance bottlenecks due to MS wanting to preserve backward compatibility with BASICA. I discovered Crescent Software's "QuickPak" utilities that provided alternatives to QBs built-in functions. Crescent also included the full MASM source code and Crescent's owner, Ethan Winer, encouraged his customers to get into MASM, using his routines as templates. This made learning MASM quite painless and I really got into this stuff. |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5089 |
Hi Tinine, Thanks for the trigger for QB64. Just tried the Win version on W10. It is fast. It solved the 4squares problem in below 1 ms (Yep, on a fast PC). That is 50000 times faster than an MM2. And it can also work without line numbers, is auto indenting. Now I need a comprehensive set of commands for USB serial port. Will do some investigating later today. Confirm the delay with the first compile (maybe it is unpacking stuff first). I downloaded the Linux(64) version also. Will try this tonight. Volhout Edited 2021-12-06 22:31 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Oh cool beans ![]() ![]() Did a quick search and found this |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |