Programming

PureBasic is one of the most underrated languages on the planet. It’s especially good for beginners (but can be good for experts too). It’s a shame that they teach young programmers to use Python as their first language. Most people make the assumption that BASIC is dead and so stuff like PureBasic is automatically ignored by them. It’s not that BASIC (as a language) is dead; it’s that the old dialects of it are dead (including Visual Basic). Also, the name BASIC comes with the assumption that it’s more “basic” than Python and therefore undesirable, but that’s not true. BASIC is not that basic today.
Python has become way too popular for its own good. Teaching a noob to use Python can allow them to get away with bad code practice. On top of that, Python is incredibly slow and it doesn’t come with all the amazing features that PB does. In college, they started me out with Python and turtle graphics 😛 Nobody uses turtle graphics professionally and it’s not like it’s any easier than traditional graphics. It’s actually a hell of a lot more annoying than simply drawing something at a specific X, Y position.
It’s like giving a kid a utility van as their first car. Yes, it can get stuff done, slowly, but is it a car you would want as your first? No. Most kids would want a sports car. Not a super expensive sports car like a Porsche, but instead like a Mustang or Delorean. That’s PureBasic.
Python isn’t even a real programming language. It’s like the top slowest language out there. A lot of Python Devs will lie and say it is a real programming language, but it’s not – it’s a scripting language. Learning to become a good programmer using a scripting language with no proper variable types or real code blocks is idiotic. Python also doesn’t have all the built in libraries to make programming fun. The reason I got into programming was because I randomly discovered QBASIC in the system folder. It had a lot of stuff built in (for back in the day) and it was just a blank slate where you could make anything. When I was forced to use Python in college, it didn’t have that same fun to it – it was just a chore. I wrote some of the assignments in PureBasic and it did above and beyond what the teacher requested, but she wouldn’t give me credit. I had to rewrite it in Python – no other choice.
Beginner devs often want to make games to test their skill and Python is the worst possible choice you could make for that because of its lack of speed and good libraries for this purpose. On the other hand, you could just use PB and have all that stuff at your fingertips and have it compile to real native code and run as fast as C. It’s the obvious choice.
There is the problem of lower popularity though. Like if you really want to become a programmer professionally, then it’s probably best to go with JavaScript or C#. Each having their different strong-suits. JS if you want to make web apps or games in-browser and C# if you want to either make serious business stuff, or 3D games with Unity.

Python code eventually looks like:
.self .self .self .self .self

So in order to make DOS games in 2021, there are several options. None of them are perfect, but after studying all the options, I’ve discovered the two options I believe to be the best. There are more options if you specifically want to make adventure games. For that you can use either, an old version of AGS, AGI, SCI Studio, or SCI Companion. However, this article will assume you want an open ended system that will allow you to make any type of game. You will need to know C to continue.

I narrowed it down to FreeBASIC and OpenWatcom C. This article will specifically focus on OpenWatcom with the Allegro game engine. I found this to be the best choice for multiple reasons including speed, flexibility, and development on Windows (instead of inside DOS). OpenWatcom was also the compiler used to make DOOM and it’s very fast compared to the primitive Turbo C and the GNU DJGPP. The fact you can build your games in Windows helps a lot too because you can read the code on an HD screen and not be limited to the low resolution of DOS.

So to start out, you should probably download the PCX plug-in for Paint.NET. This will allow you to produce an old compressed image format that can be loaded by your game. The other option is just using bitmaps and that will use more space. And no, there’s no JPG, PNG, or GIF here 🙂 PCX is basically an old fashioned PNG file.

1. Now you can download OpenWatcom V1.9 from their main website. Version 2.0 might also work, but I didn’t try it. Now install Watcom with all the DOS options enabled.
2. Goto this link and download the alleg.lib: http://matejhorvat.si/en/dos/allegwat/allegow.zip
3. Download the allegro source and extract: http://cdn.allegro.cc/file/library/allegro-4.2.3/all423.zip
4. In the directory you extracted, run fix.bat watcom.
5. Copy the lib you downloaded to .\WATCOM\lib386\dos
6. Copy the fixed include files from the thing you extracted into .\WATCOM\h
7. Comment out line 36 in .\WATCOM\h\ALLEGRO\PLATFORM\ALWATCOM.H
8. Open Watcom (LITERALLY – Open Open Watcom) and make a new project – choose 32-bit DOS using DOS/32A LE.
9. Goto Linker Switches #2 and put alleg.lib under Libraries (NOT Library Files).
10. Goto C Compiler switches #5 and disable stack depth check.
11. Goto C Compiler switches #10 and select 80386 stack-based calling -3s.
12. Now you can just add the exhello.c (hello world example) to your project and do a makeall.

It should now be working and have made an EXE file about 757KB.
(Make sure you are adhering to the C89 standard. So basically declare all variables only at the beginning of code blocks and make sure all functions/methods are written above what’s calling them.)

When you create the watcom project, I recommend using DOS/32A LE. This way it’s smaller and there is no need for an external DOS extender like DOS4GW. Initially my EXE was 757KB which is really big just to draw a sprite, so I ended up following the guide here:
https://liballeg.org/stabledocs/en/alleg043.html

…which made my EXE down to 500KB with no sound enabled (I’m going to use PC speaker). It’s still bigger than I expected, but I couldn’t figure out how to further optimize. I tried the space optimization in watcom and it only saved like 5KB. So I downloaded UPX for DOS and applied -9 compression and got 200KB. And that’s with the DOS extender linked in, so that’s good enough for me.

Saving thumbnails from youtube videos is a problem especially if it’s from a channel you don’t own. There are solutions for downloading youtube videos and there are also many websites that allow you to paste ONE youtube link to get the thumbnail. If you are backing up a youtube channel either for archival or your own purpose, there is no way to get the thumbnails and data for all the videos as far as I can tell. So I made this program. It will also retrieve data like ID, title, viewCount, and uploadDate and will store that in an index text file. You need to get a bunch of youtube links to paste in. I get them by using the Firefox add-on called “Copy Selected Links”. I can then goto a YouTube channel, click videos, scroll down, and select/copy the videos I want. If you do the whole channel, make sure you only select like 50-ish videos at a time otherwise the copy links doesn’t work. Then you paste all that into my program and it’ll save your thumbnails. It doesn’t actually take very long even though it takes a while to describe. The end goal could be an offline video archival system with another program to view the content offline and load up VLC media player or whatever.

For programmers: There’s not a very easy way to get youtube data without using their stupid API key system. You’re not meant to obtain youtube data without it, but there are ways. The one way is to use this link: https://www.youtube.com/get_video_info?video_id= and just put the ID in there. You’ll then need to decode the data with Uri.UnescapeDataString(url). It’s confusingly Uri, not Url. There are other methods of this too. Once you do that, you’ll have a string with all the youtube data in it, then you can just perform normal string based functions on it. It’s almost like a JSON object, but seems clustered, so I don’t think you can just use a JSON reader on it. My program uses NO libraries at all (except .NET 4.0). The icon size is many times bigger than the program itself.

UPDATE V1.5

I have updated the program to get video data in addition to the thumbs. It gets ID, title, views, and upload date and puts them in an index file called 1A_YouTube.txt in the same folder. It’s sorted in chronological order. You can search that file to find the video you want. I made this software for my own archival purpose, but I think others may find it useful. If you have a request, send a message under contact us. If I make the final version, it WILL NOT be open source. I am a partial open source advocate – meaning I will give source, but only for small or preliminary versions.

New link: https://drive.google.com/file/d/1WD0bCY9aLutGGjHBS7w2rx9pyNsOWzD0/view

New source: https://pastebin.com/3vd3yixF

Old Version

Here’s the link to the old thumbnail downloader: https://drive.google.com/file/d/1AtJ1cJ9QXnRXnFeIfzCEw77VrboxyOMo/view

Here’s the main source file (no project, sorry): https://pastebin.com/qu2yeXuZ

Today I was playing around an practicing some skills with x64dbg. x64dbg is a debugger for 64-bit Windows similar to OllyDbg. I used to use OllyDbg a lot back in the day and I even have a lot of old youtube videos I posted on me hacking and patching stuff. It’s really fun to be able to change an EXE without access to the source code.

Anyway, the only main difference between x64dbg and OllyDbg is that one is 64-bit, but otherwise they are pretty similar, although not completely and I am having some problems, but I was able to improve MS-PAINT a fair amount.

This is for Windows 7 paint, but probably works on 10. Ordinary people start reading here. I changed these three things:

  • Paint has a problem where if you paste a really large image, it will save that image size and whenever you open paint, you have to resize the image smaller again, just so you can paste or work with a new image. This patch makes it keep a small image size. Just run the original paint and make sure you set the image size small. Now whenever you run this it will stay that size no matter what.
  • The “do you want to save box” when you quit is removed, so remember to save your file before quitting. I personally don’t like nag message, so I removed it.
  • The palette in the new Paint (newer than XP), uses a bunch of obscure colors that somebody must have decided while they were smoking. I mean, it might be cool for some art work, but all of it is generally going to look the same then. I replaced the palette with the original Paint’s common 16 VGA colors. The classic EGA/VGA color scheme. It’s good if you do work with retro stuff cause it has those colors by default. You can also change the color palette yourself with a hex editor (this part didn’t require any hacking), you just need to search for the RGB hex color codes. Choose an obscure one to start cause it might find other matches. This works right out of the download though, I’m just saying for people who want to change to their own palette.

I may eventually make a patcher program instead so people can make their own palettes for Paint. I’m not sure why Microsoft decided to hard code these oddball color codes in there. Well, it’s Microsoft 😉

Download Patched MSPAINT: https://drive.google.com/file/d/1IYfBWzPsPhdlXHgXpKj6VBijccowZnHx/view?usp=sharing

If you are not aware, planet source code is a website that used to host example Visual Basic source code. The site has recently been taken down due to problems with the server, however the source code archives have been retained.

The problem is that the included reader/indexer for the CD archive is not usable without database drivers that are outdated. I made a new reader program that indexes the CD without the need for any database drivers. This archive is good for people who are learning how to program and want examples for VB6.

The download link contained in this post just contains the reader program and a CSV for the data instead of a database. If you want the whole database I will link that as well.

It works with the archive you can download here. You will find the subfolders called .\Data\Pics and .\Data\Zips empty in this download. You need to place all the zip files from this post in there. They may not be 100% the same. I really hope they are. I downloaded the 7 CDs myself and converted into zip. Whats in the download linked in this post is altered, so hopefully they didn’t put different stuff in there. Please let me know if you have problems. This program can be made to work with other versions of the archive also. So if you have a different mdb file with newer content, send it to me and I can make this working with it.
https://www.vbforums.com/showthread….o-Resource-CDs

There is a search feature (with whole string or each term option), category selection, image viewer, and zip file extractor. In order for the zip function to work, you need to have installed 7-zip. You will need 7-zip to open this download also. Everyone should use it at this point. It’s free and better than WinRAR.

It uses .NET 4.0. I believe that is included in Windows 10, but not 100% sure. I use 7 and XP and confirm it is working on both of those. If it’s not working on 10, tell me and I’ll make a release with a different version of framework.

Download Source: https://drive.google.com/file/d/1rtVMN4014T3PkqpIYDkJusPs8h8Idj/view?usp=sharing

(THIS ONE IS NOT FOR VBFORUMS USERS CAUSE THEY CAN’T USE EXEs, but for everyone else who wants an EXE) Download EXE: https://drive.google.com/file/d/1fkZKjUO-NmP0qlA9oUK-n_y3DVUKb6iZ/view?usp=sharing

I’ve recently been working on a small game in PureBasic. It’s mainly just to get used to programming in PB. I tend to use C# all the time now and never really got heavily into PB. It is an excellent programming language and despite basic being in the name, it is not a “basic” language. There are several differences. I’d wager that this is one of the best languages of all time. The only problem is that its syntax is a little odd and I think that keeps programmers who are used to the C style languages away (which is most programmers). The main aspect that I believe makes it so great, is that it goes all the way from a very easily understandable/human readable language, down to binary. There is no runtime engine at all. It runs everything directly on the CPU with no interpretation engine or virtual machine. The problem with most programming languages now a days is that they almost all use a runtime or virtual machine. This creates a huge overhead for the CPU and can cause programs to run a lot slower than they would if they were running directly on the CPU. Languages that compile directly to binary are usually harder to understand and more cumbersome for the programmer.

Programmers have become accustomed to high performance hardware and have gotten lazy about coding. PureBasic is elegant because it still seems to hold the old philosophy of speed and small code. I think programmers need to be taught some philosophy on programming rather than just the logic. It seems that European programmers (especially Russians) do understand this. The exes produced with this language are also incredibly small. Just like cars and government, more unnecessary layers of shit are added as time goes on. More overly complex layers that eventually get to the point where no-one person can understand the whole thing. And the laziness/lack of care of never taking the time to remove those layers. This is what Windows 10 has become and why I refuse to upgrade. I will eventually run Linux when I simply can not use Windows 7 anymore.

Anyway, without further a dew (that’s probably not right, whatever).

Here is the game. I have included the source code in the archive. I know probably no programmers will read this anyway though. The game might not be optimized in terms of difficulty. I was more focused on getting used to the language rather than nitpicking away at the game dynamics.

You play the game by moving the tiny orange fish around with the mouse and start by eating only the smallest fish until you grow bigger and can start eating the larger ones. Eventually, when you win, the fish bloats up and gets larger than the whole screen – that’s a bug, but I thought it was cool, so I left it in.

https://drive.google.com/open?id=1Mn9fv4tF86tww63vCyfmWocs-9r-QvHq