Hacking in BASIC
Rick Murray (539) 13840 posts |
But clearly not fascinating enough to tell the difference between hacking and cracking. Adiós correo no deseado! |
Joseph Turco (5563) 22 posts |
im actually learning BBC BASIC as my first programming language. Im reading the first steps book. Just trying to juggle between either using an editor, or from a task window/command line. i noticed from a task window that the draw functions don’t work. I hope to get to the point where i can dig into assembly through BASIC. |
Paolo Fabio Zaino (28) 1882 posts |
Hi Joseph,
If you need to plot graphics from a TaskWindow you can use the very handy !GraphTask (made by Druck), it’s free, link to download it here: https://armclub.org.uk/free/ |
Joseph Turco (5563) 22 posts |
oh ok, thanks Paolo! |
Joseph Turco (5563) 22 posts |
Sorry if this is not the right place to ask this, and what i should of done i make a new fourm post. I am using the “first steps in programming” book to learn how to program and learn BBC BASIC. currently i am on page 51 where you are drawing blocks and then a circle as well. I got the program to execute with no issues, however, i had a question about the way the system displays colours in BASIC mode. In the code, it has me defining what MODE to use, and from my understanding, this is what dictates what colours BASIC can display. for example, i am using mode 12, and the colors in mode 12 in relation to the code should match up to what should be displayed. The diagram in the code listing on page 51 shows boxes in a few different, but not similar colours. When i execute the code, i am getting more of a gradient of colors, ones that are very similar and not like the code diagram shows. Is this becuase the OS is running with a higher colour output as per what is set in !display? please excuse my ignorance. |
Rick Murray (539) 13840 posts |
The old (Archimedes/RiscPC era) hardware was capable of very low colour modes – 2, 4, and 16 colours. MODE 12 is a 16 colour mode. However, contemporary hardware usually only offers a paletted 256 colour mode. There is no 16 colour equivalent, so you’ll get 256 colours instead. This may explain the differences that you are seeing. |
Steve Fryatt (216) 2105 posts |
Yes: the old low-colour modes don’t necessarily work well on modern hardware, and how they don’t work well varies from machine to machine (so the Pi is different to an ARMX6, to a Titanium, and so on). You might wish to read the current BBC BASIC Reference Manual, which is available free in PDF form (although IIRC, ROOL suggest making a bounty donation if you make use of it). You can buy a printed copy, too. This documents BASIC as it is on modern RISC OS 5 systems – a very different beast from when the First Steps book was written. ETA: this doesn’t make the First Steps book bad, but it’s useful to be aware of where it’s no longer completely accurate. The main issues will be graphics and colours, but there’s likely other stuff too (and RISC OS 5 BASIC has useful new bits, as well). |
Joseph Turco (5563) 22 posts |
ah alright i understand. many thanks. Is the BBC BASIC Reference manual a good learning source, or does the name speak for itself? |
Steve Fryatt (216) 2105 posts |
It’s a bit of both: there’s useful chapters at the start giving overviews of different bits of the language, then a detailed reference of all of the keywords at the end. I’d suggest using the two books in parallel: work through First Steps, but refer to the relevant bits of the BBC BASIC Reference Manual as you go to see what the current situation is. For example, RO5 BASIC has commands like The problem is more acute when you move on to the Wimp books (First Steps in Wimp Programming(?), Wimp Programming For All), as these tend to end around RISC OS 2 or maybe 3.1. Software written to their standards will feel clunky by modern standards (and did even in the days of the RiscPC), but finding out what you need to do differently can be a real challenge. 1 Off the top of my head, so check the actual syntax for yourself! |
David J. Ruck (33) 1635 posts |
Just a quick point; MODEs 12 and 15 have tall rectangular pixels for back when we had to use TVs or CGA monitors which had limited vertical resolutions (without using interlace). It’s better to use the equivalent square pixel modes such as 20 and 21 (or VGA 27 and 28), like those rich people with multi-sync monitors back in the day. |
Stuart Swales (8827) 1357 posts |
I think that it might be helpful for newbies these days if BASIC, when presented with a numeric MODE to select, actually checked what MODE it obtained, and summarise the problems that may be encountered if continuing for the unwary. Or even, you did MODE 12 but are in the Desktop, and GraphTask is not running… I think we might have enough CPU power to do this ;-) |