Welcome, Guest |
You have to register before you can post on our site.
|
Latest Threads |
The QB64 IDE shell
Forum: Utilities
Last Post: JasonPag
09-16-2024, 05:37 PM
» Replies: 9
» Views: 762
|
Importance regarding Ches...
Forum: Utilities
Last Post: JasonPag
09-01-2024, 06:34 PM
» Replies: 0
» Views: 31
|
Chess and Analysis and En...
Forum: Utilities
Last Post: JasonPag
08-28-2024, 02:37 PM
» Replies: 0
» Views: 32
|
DAY 009:_PutImage
Forum: Keyword of the Day!
Last Post: grymmjack
09-02-2023, 02:57 PM
» Replies: 54
» Views: 2,034
|
Fall Banner Contest?
Forum: Site Suggestions
Last Post: grymmjack
08-31-2023, 11:50 PM
» Replies: 36
» Views: 1,261
|
ColorPicker - Function th...
Forum: Dav
Last Post: Dav
08-31-2023, 11:04 PM
» Replies: 3
» Views: 315
|
Goals(1) = New Tile()
Forum: Works in Progress
Last Post: RhoSigma
08-31-2023, 09:45 PM
» Replies: 3
» Views: 127
|
micro(A)v11
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 09:14 PM
» Replies: 90
» Views: 3,589
|
Updating The Single Most ...
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 09:13 PM
» Replies: 7
» Views: 254
|
QBJS Image Question
Forum: QBJS, BAM, and Other BASICs
Last Post: bplus
08-31-2023, 05:49 PM
» Replies: 5
» Views: 155
|
|
|
Andross from Star Fox |
Posted by: SierraKen - 07-26-2022, 05:59 PM - Forum: Programs
- Replies (1)
|
|
Someone named Joshua Dickerson figured this out back in the 90's and posted it online, I'm guessing the newsgroup comp.lang.basic.misc where I used to hang out.
He made one of the faces and later on I added some more to the screen. They rotate. I don't know anything about how he made this but it's pretty cool so I thought I would share it.
Andross is the bad guy from the Super Nintendo game Star Fox.
Code: (Select All) 'By Joshua Dickerson
'
DECLARE SUB InitProgram ()
DECLARE SUB MainLoop ()
DECLARE SUB Calc3D ()
DECLARE SUB Rotation ()
DECLARE SUB DrawObject ()
'
Dim Shared Lines, World(500, 3)
Dim Shared X, Y, Z, sX, sY, Xa, Ya, Za, sXs, sYs, D
Dim Shared R1, R2, R3, Sr1, Sr2, Sr3, Cr1, Cr2, Cr3, mX, mY, mZ, Eye
'
Read Lines
For I = 1 To Lines
For J = 1 To 3
Read World(I, J)
Next
Next
'
InitProgram
MainLoop
Screen 0
End
'
'CUBE LOOKING THINGY
'
'EMPEROR ANDROSS (STAR FOX)
Data 142
'
'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄNOSEÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Data 5,-4,10,-5,-4,10,-5,-4,10,-5,-25,10
Data -5,-25,10,0,-52,0,0,-52,0,5,-25,10
Data 5,-25,10,5,-4,10,5,-25,10,10,-18,2
Data 10,-18,2,10,2,2,10,2,2,5,-4,10
Data 10,2,2,-10,2,2,-10,2,2,-5,-4,10
Data -10,2,2,-10,-18,2,-10,-18,2,-5,-25,10
'
'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄMOUTHÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Data -10,2,2,-28,26,0,-10,2,2,0,14,5
Data 0,14,5,10,2,2,28,26,0,10,2,2
Data -28,26,0,0,14,5,0,14,5,28,26,0
Data -28,26,0,0,18,6,0,18,6,28,26,0
Data -28,26,0,0,31,6,0,31,6,28,26,0
Data 0,14,5,0,18,6,-28,26,0,0,36,5
Data 0,36,5,28,26,0,0,31,6,0,36,5
Data -8,47,0,0,36,5,0,36,5,8,47,0
'
'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄOUTLINE OF FACEÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Data 0,-52,0,-26,-47,0,-26,-47,0,-37,-32,0
Data -37,-32,0,-37,-6,0,-37,-6,0,-28,26,0
Data -28,26,0,-8,47,0,-8,47,0,8,47,0
Data 8,47,0,28,26,0,28,26,0,37,-6,0
Data 37,-6,0,37,-32,0,37,-32,0,26,-47,0
Data 26,-47,0,0,-52,0
'
'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄFOREHEADÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Data 0,-52,0,-23,-33,10,-23,-33,10,-5,-25,10
Data -26,-47,0,-23,-33,10,-37,-32,0,-23,-33,10
Data -37,-18,0,-23,-33,10,-10,-18,2,-23,-33,10
Data 0,-52,0,23,-33,10,23,-33,10,5,-25,10
Data 26,-47,0,23,-33,10,37,-32,0,23,-33,10
Data 37,-18,0,23,-33,10,23,-33,10,10,-18,2
'
'ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄEYES + CHEEKSÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
Data -37,-18,0,-23,-26,12,-23,-26,12,-10,-18,2
Data -37,-18,0,-23,-13,10,-23,-13,10,-10,-18,2
Data -37,-18,0,-23,-17,12,-23,-17,12,-10,-18,2
Data -23,-33,10,-23,-26,12,-23,-17,12,-23,-13,10
Data -10,2,2,-23,-13,10,-23,-13,10,-37,-6,0
Data 37,-18,0,23,-26,12,23,-26,12,10,-18,2
Data 37,-18,0,23,-13,10,23,-13,10,10,-18,2
Data 37,-18,0,23,-17,12,23,-17,12,10,-18,2
Data 23,-33,10,23,-26,12,23,-17,12,23,-13,10
Data 10,2,2,23,-13,10,23,-13,10,37,-6,0
'
Sub Calc3D
'
X = -1 * X: Xa = Cr1 * X - Sr1 * Z: Za = Sr1 * X + Cr1 * Z
X = Cr2 * Xa + Sr2 * Y: Ya = Cr2 * Y - Sr2 * Xa: Z = Cr3 * Za - Sr3 * Ya
Y = Sr3 * Za + Cr3 * Ya: X = X + mX: Y = Y + mY: Z = Z + mZ: sX = D * X / Z
sY = D * Y / Z
'
End Sub
'
Sub DrawObject
'
Rotation
For I = 1 To Lines Step 2
X = World(I, 1)
Y = World(I, 2)
Z = World(I, 3)
Calc3D
sXs = sX: sYs = sY
'
X = World(I + 1, 1)
Y = World(I + 1, 2)
Z = World(I + 1, 3)
Calc3D
For ty = 1 To 100 Step 80
For tt = -100 To 150 Step 60
Rem LINE (sXs, sYs)-(sX, sY), Eye
Line (sXs + tt, sYs + ty)-(sX + tt, sY + ty), Eye
Next tt
Next ty
Next
'
End Sub
'
Sub InitProgram
'
Screen 9, 1, 0, 1
Window (-200, -150)-(200, 150)
View (8, 9)-(632, 341), 0, 15
Cls 'PAGE 0
'
Screen 9, 1, 1, 0
Window (-200, -150)-(200, 150)
View (8, 9)-(632, 341), 0, 15
Cls 'PAGE 1
'
D = 1200 'View point and rotation values
mZ = -1500
mX = -5
R1 = 0
R2 = 0
R3 = .3
'
End Sub
'
Sub MainLoop
'
While InKey$ = ""
_Limit 10
'R1 = R1 + RND(1) * .05: IF R1 > 6.28 THEN R1 = 0
'R2 = R2 + RND(1) * .05: IF R2 > 6.28 THEN R2 = 0
'R3 = R3 + RND(1) * .05: IF R3 > 6.28 THEN R3 = 0
R1 = R1 + .1: If R1 > 6.28 Then R1 = 0
'
Cls: Eye = 7: DrawObject
Page = Abs(Page = 0) 'Page switching is used to hide the drawing
Screen 9, 1, 1 - Page, Page 'process so the image looks smooth.
Wend
'
End Sub
'
Sub Rotation
'
Sr1 = Sin(R1): Sr2 = Sin(R2): Sr3 = Sin(R3)
Cr1 = Cos(R1): Cr2 = Cos(R2): Cr3 = Cos(R3)
'
End Sub
|
|
|
_INTEGER64 calculation |
Posted by: vinceg2022 - 07-25-2022, 09:12 PM - Forum: Learning Resources and Archives
- Replies (8)
|
|
Hi all
Just a quick query.
Why does this code produce these results
billion&& = 10000000000
PRINT billion&&
billionCalc&& = 100000 * 100000
PRINT billionCalc&&
10000000000
1410065408
Is it something to do with the type that would be used for the 2 x 100000 values are not _INTEGER64, so it miscalculates them, or am I just not getting it.
|
|
|
Welcome Everyone ! |
Posted by: MasterGy - 07-25-2022, 03:16 PM - Forum: MasterGy
- Replies (4)
|
|
Hello !
Thanks to SMcNEIL for creating a separate folder for me !
Unfortunately, I lost a lot of the smaller code, but the bigger works are all there.
I'm short on time right now and I've been patching old programs. You already know almost all of them, but the latest versions will always appear here. The packages also contain the source codes. It also contains an exe that I generated under Win7, with QB64 1.2.
If you have a different operating system, you can create an EXE from the source code.
Have fun !
|
|
|
something strange is happening, $replace not working |
Posted by: madscijr - 07-25-2022, 02:50 PM - Forum: Help Me!
- Replies (5)
|
|
I could be having a brain misfire, but I could swear the $replace function worked in QB64, why am I getting an illegal string-number conversion on line 9?
Code: (Select All) Dim sOld$
Dim sOldWord$
Dim sNewWord$
Dim sNew$
sOld$ = "This is my sentence to change my words."
sOldWord$ = "my"
sNewWord$ = "your"
sNew$ = Replace$(sOld$, sOldWord$, sNewWord$)
Print "Original: " + Chr$(34) + sOld$ + Chr$(34)
Print "Replace : " + Chr$(34) + sOldWord$ + Chr$(34)
Print "With : " + Chr$(34) + sNewWord$ + Chr$(34)
Print "New : " + Chr$(34) + sNew$ + Chr$(34)
|
|
|
Manually resizing with $RESIZE:ON |
Posted by: SMcNeill - 07-24-2022, 08:28 PM - Forum: Learning Resources and Archives
- Replies (7)
|
|
As I posted in a different thread in the Help area, I thought I'd go ahead and share these two demos here to help preserve them for the future.
Demo 1 here is an example of how to use $RESIZE:ON to adjust your program's width and height, without adjusting the fontsize or scale. This works basically like the IDE does, and resizes the number of rows and columns which you have available for use with the program:
Code: (Select All) $Resize:On
activeScreen = _NewImage(80, 25, 0) 'standard screen 0
Screen activeScreen
DrawBorder
_Delay .25
clearInitialResize = _Resize 'clear thr size change from where QB64 first starts up
Do
If _Resize Then
tempScreen = _NewImage(_ResizeWidth \ _FontWidth, _ResizeHeight \ _FontHeight, 0)
Screen tempScreen
_FreeImage activeScreen
activeScreen = tempScreen
DrawBorder
End If
Loop Until _KeyHit
System
Sub DrawBorder
Color 4
For x = 1 To _Width
Locate 1, x: Print Chr$(219);
Locate _Height, x: Print Chr$(219);
Next
For y = 1 To _Height
Locate y, 1: Print Chr$(219);
Locate y, _Width: Print Chr$(219);
Next
Color 15
Locate _Height \ 2, _Width \ 2 - 12: Print "Resize On, Non-Scale Demo"
Locate _Height \ 2 + 2, 3: Print "Width:"; _Width
Locate _Height \ 2 + 3, 3: Print "Height:"; _Height
End Sub
Demo 2 here works in a very similar manner, except it uses two screens. The activeScreen always remains the same size -- 640 x 400 pixels, in this case, and the viewScreen changes size and scales the image on the screen to suit whatever size we expand it to:
Code: (Select All) $Resize:On
activeScreen = _NewImage(640, 400, 256) '256 color screen so we can use _PUTIMAGE for scaling
viewScreen = _NewImage(640, 400, 256) 'a second screen to scale to
Screen viewScreen
_Dest activeScreen: _Source activeScreen
DrawBorder
_Delay .25
clearInitialResize = _Resize 'clear thr size change from where QB64 first starts up
Do
If _Resize Then
tempScreen = _NewImage(_ResizeWidth, _ResizeHeight, 256)
Screen tempScreen
_FreeImage viewScreen
viewScreen = tempScreen
End If
_PutImage , activeScreen, viewScreen
_Limit 30
Loop Until _KeyHit
System
Sub DrawBorder
Color 4
For x = 1 To _Width \ _FontWidth
Locate 1, x: Print Chr$(219);
Locate _Height \ _FontHeight, x: Print Chr$(219);
Next
For y = 1 To _Height \ _FontHeight
Locate y, 1: Print Chr$(219);
Locate y, _Width \ _FontWidth: Print Chr$(219);
Next
Color 15
Locate 3, 3: Print "Resize On, Scale-Size Demo"
Locate 5, 3: Print "Width:"; _Width
Locate 6, 3: Print "Height:"; _Height
End Sub
Note that neither of these demos maintain aspect ratio, so images may stretch or skew depending on how you resize them. If this isn't your desired effect, then you'd have to adjust for that inside the program with a few IF statements manually.
|
|
|
Making QB64 work on Linux |
Posted by: mnrvovrfc - 07-22-2022, 11:50 PM - Forum: General Discussion
- Replies (18)
|
|
Hello. Used QB64 since v0.86 approximately, was on the oldest of the forums for a while and contributed a few programs. Used v0.98 a lot but turned off by its bugginess and the inability to play ancient tracker modules. I created a few multimedia apps but not patient enough to do games which is what I want to do the most. I like creating and listening to electronic music on my computer.
TL;DR
While I have an Internet connection for a short time, after a pause of eight years, decided to test "Phoenix Edition" on various Linux distros. Tried so far with Fedora (v35 GNOME and v36 MATE and XFCE), Solus (MATE) and Void ("glibc" XFCE). One will need to do a bit of investigating so it works properly on Solus. Do not pick "musl" branch for Void because it will not work; it's 64-bit only and might be counterproductive to use a programming system like this. AV Linux is installed on another external disk but might not last long because I cannot use the touchpad, cannot change a lot of things because I purposely run it live with persistence. Tried many other distros like Bunsen Labs Lithium, Linux Mint, Mageia, OpenSUSE "Tumbleweed", Salix, usually failed because they insisted being installed only to an internal hard drive. Also had Ubuntu Studio v22.04 but my computer isn't powerful enough for it. I have Manjaro installed on hard disk and probably QB64 works there too (and for Arch) but I picked a package for some other BASIC. That one might be temporary, though, I don't like the desktop environment I chose for it (same as for Ubuntu Studio).
DISCLAIMER: I don't do "VirtualBox" or alike, it doesn't work on my computer. It might affect what could be done with QB64.
This programming system works without problems on Porteus, at least on my side. It only requires the download of "05-devel.xzm".
Info about Porteus GNU/Linux here:
https://distrowatch.com/table.php?distribution=porteus
(linked that page because the "standard" site is not "https" and some people are touchy about that)
Note this will not work on Slackware or whatever else is based on it! Do not try it!!! I am able to list precisely the shared libraries required for "qb64" and any ELF executable created with this programming system. Used "readelf" program.
Code: (Select All) libGL.so.1
libGLU.so.1
libX11.so.6
libc.so.6
libgcc_s.so.1
libm.so.6
libstdc++.so.6
However on eg. Slackware you will also need the header files, at least those that correspond to "Freeglut", "libX11" and the font-handling libraries. I'm sorry, I don't have any information about that. I only wanted to report a successful use of QB64 on a distro less known than Fedora, the 'untus and others.
BTW note to the developers. This is to cause a QB64-created program to be able to report runtime errors. You should consider changing the "MessageBox" code so on Linux, it searches for "xmessage" and if it doesn't find it, use "zenity" instead. Some distros don't come with "xmessage" and no easy way to acquire it, Solus is one of them. On Fedora the "xmessage" dialog might look strange and after that, it complains on terminal about a font missing "charsets". I made the change to "libqb.cpp" but I'm not going to post the portion with changes unless I'm asked for it.
One more thing, sorry if I keep writing. A BMP file could be loaded successfully but each time, it errors on the terminal about 16-bit files not supported. "_DEFLATE" and "_INFLATE" do not work, but "zlib" library seems to exist. Thank you for implementing "SHELL", this is very helpful and before that I had to write my own routine which was clunky.
|
|
|
A neat little MS-DOS emulator |
Posted by: JRace - 07-22-2022, 06:27 PM - Forum: General Discussion
- Replies (8)
|
|
Don't know if anyone other than myself is interested, but TAKEDA, toshiya has a site full of computer emulators, including a really cool, *small* MS-DOS emulator.
It is a single-file emulator which runs DOS EXEs directly, with no need for any subdirectories or configurations.
The download ZIP actually contains many builds, each emulating a different CPU. 32-bit and 64-bit versions are included for each emulator.
It is for Windows only (runs fine on Windows 7 Pro), and runs text-mode DOS programs with no graphics or sound.
It's a command-line program, but you can drag-and-drop an EXE file onto it to run.
I use it to make various DOS compilers and interpreters run under Win. It even works with SOME multi-file compiler suites, such as Quick C and Small C. It can be much more handy than firing up DOSBox just to quickly check something in QB or GWB.
It has a command-line switch which allows you to make a single-file Windows executable of your DOS program.
(One problem, though: Some DOS programs (e.g.QBasic) can have trouble finding a file you want to open (even though the file open dialog shows it!), so you must "take the long way" to it by navigating to the directory which holds the file.
http://takeda-toshiya.my.coocan.jp/
(The site is in Japanese with a little English, but it's easy to find one's way around.)
free ssl image hosting
|
|
|
MasterGy's new home on the web! |
Posted by: SMcNeill - 07-22-2022, 05:16 PM - Forum: MasterGy
- Replies (1)
|
|
Bplus mentioned to me some time ago about adding a spot in the "Prolific Programmers" area so MasterGy could showcase all his work here, and unfortunately, with all that's been going on in my life, I just never got around to it and forgot about it. My apologies to MasterGy -- you're more than welcome to have your own little home here, and to set you own rules and style for how you keep track of your stuff in it! I honestly should have gotten this up long ago, when Bplus first mentioned it, but I read it on my ipad and forgot about it by time time when I got home to where my PC is and it's much simpler to deal with the forum interface and all with the admin account.
If, for some reason, you don't want this little home on the web, after all this time, just let me know @MasterGy, and I'll clean it up for you. Otherwise, let me be the first to say:
Welcome to your new home on the web!! ;D
|
|
|
|