BBC BASIC 3D 10 PRINT
Вставка
- Опубліковано 28 сер 2024
- A quick, improvised video showing a BBC BASIC version of 8-Bit Show and Tell's (@8_Bit) "3D 10 PRINT" Commodore 64 BASIC program - see • My New Favourite C64 O... .
The video goes over an explanation of the differences and how text and graphics work on the BBC, including definable colour palettes, user-definable characters and colour selection, as well as VDU control codes.
No prizes for further crunching my code! I'm taking advantage of longer line lengths in BBC BASIC!
This was a lot of fun! Great to see it ported, and at the same time I get a better idea of the features of BBC BASIC, which I hear great things about. I actually have a BBC now but haven't got around to playing with it. I'm glad you mentioned (at the end) that you're using a Pi accelerator. I knew the BBC was fast, but I didn't think it was THAT fast!!
The graphic overlays are a nice touch.
Glad you enjoyed it! The BBC has a 2MHz 6502 and some advantages, like the screen is scrolled in hardware (the start address can be changed and the VidProc handles wraparound of the address, so the data doesn't actually need moving).
The BBC is nice for writing 6502 on as you have a built-in assembler in BBC BASIC, although there's no monitor, which seems a strange way round! I use EXMON2 but there's no NMI-type button on it for nosing at running things.
With the full-fat PiTubeDirect, you get a much faster virtual 6502: ua-cam.com/video/9YSvyUEiIdQ/v-deo.html - and the latest software has a 6502 JIT core which gives you 900-1000MHz emulation, rendering that Mandelbrot set in about 30s (still 1.5s on the ARM).
I would love to see you doing a vid on the BBC, especially if you play with thee Basic build in assembler, I would very much like to see a star command being made!
BBC BASIC was the most efficient BASIC produced in my opinion. I'd love to use it in a compiler though.
Excellent video. I hope you do more like this.
Really cool! Thanks for this. Cheers from Canada!
I use to do a bit of bit mapping on the acorn electron lots of maths working out the vdu data its quite simple its set out in the manual as user definable graphics
"B%=0:REP.:B%=128-B%:FORC%=0TO39:Z%=239+RND(2):C.B%+2:B%=128-B%:C.Z%*2-477+B%:VDUZ%:N.:U.0"
If you make B=64 then you can flip it with just -B and adjust your arithmetic. I am, of course, doing what I said I wouldn't - I have some more optimisations and might do another short update and I'll see where you Z change gets me, too! (And you can drop the colon after REP.)
Not sure if BBC Basic or PERL 🤓🤣
You can't use the shortcuts for commands like REP. and C. because they tokenise to one byte each anyway plus 0 is exactly the same as FALSE so you're saving nothing there as well.
Still watching but my first impression is that your first implementation is so *fast* compared to the C64!
Love this kind of thing, reminds me of using the BBC in Primary school in the 80s. Our teacher was very passionate about Microcomputers anyway, but he recognized a latent talent in myself and a friend of mine for computing and would encourage us to experiment as much as possible, even staying after class to (shock! horror!) play Elite!
I wish I knew what happened to the source code, but one of the most fun projects I had was a "GIGO" generator, Garbage In, Garbage Out! ... I guess you could think of it like an Eliza implementation, but instead of digital phrenology, it would tell you jokes and all sorts of random things ... you typed into it like a text adventure and we even had little easter eggs, so certain words would trigger graphical effects on the VDU.
Magical stuff for the young and passionate, and inspired me to a career in programming which I'm still at today ... and wouldn't change a moment of it.
Thank you Mr Lumley, your patience and passion were the marks of an absolutely Superlative Teacher!
Edit: @12:14 I actually thought that monochrome version looked pretty swish!
what's even more impressive is that the c64 uses a hardware-tilemapped display where each character is a single byte, and the BBC (in this case) is using a bitmapped display where each character requires the CPU copying 8 bytes from the font to the screen. plus the CPU is disabled while the display hardware is reading (the 20KB of display) from RAM. It's really a testament to the skill of Furber, Wilson & co that it runs this fast.
@@Spongman He's got a CPU accelerator installed which he mentions near the end of the video. I was also impressed by the speed, but it's getting a huge boost from a Raspberry Pi.
@@8_Bit a great combo though, as you'll see BBC basic is very powerful, and with pi boost I think you could an almost daily driver!
I am hoping to inherit a Sinclair QL and want to explore the options for getting a boost for that. I've got an RPI 4 just hanging around ... also want to get RISC OS on it, lots of nostalgia from my high school days and I want to use the Maestro app again. I know your a musician too so you might have a lot of fun with that
Aside from the already mentioned accelerator the C64 Basic by Microsoft has a significant disadvantage: it treats every number as floating point. An article called "Prime Sieve on the Commodore 64" even mentions, that other available BASIC extensions didn't help here.
At least my Mega65 BASIC has integer support.
VDU stands for visual display unit.....you can change it to 640x256 and theres pokes for multi color but it uses over 20kb of memory...its in the user manual how to do this i remember coloring in mode 0 and using all the colors at the sametime on screen .i use to work my mums knitting patterns into an electron and it was using over 20kb of memory just for that mode leaving about 8000bytes freebl to program with i would use about 4-6 kb in basic programming although programing games in basic is something i almost got the hang of i just couldnt deal with the subroutines and poking around it memory it loaded in hex decimal values
Just been playing with this on BASIC V on RISC OS via a Pi 3B and I've got your code down to just 62 bytes.
I don't know why you've done it but you don't need the first B%=NOT B% and you don't need that FOR loop...
10B=0:REPEATB=NOTB:Z=RND(2)-1:COLOUR130+(128+b):COLOUR1+Z*2-(128*B):VDU241-Z:UNTILFALSE
btw, I've got a PiTubeDirect in my BBC Master and it runs at 274MHz. Bit faster than 33 :)
@@YesiPleb In this video (although not in most of mine), I'm running PicoTube - github.com/dp111/PicoTube - rather than PiTubeDirect. This runs on a Pi Pico and not a full Pi. It's slower and only emulates the 6502, but it's plenty fast enough and very cheap!
I thought I'd do that just for a bit of a change.
The final version someone managed to crunch it down was 55 bytes (excluding the mode setup and character) definitions. It made some clever use of SGN and is here (along with all the other versions, in the git history):
github.com/mincebert/3D10PRINT/blob/main/BASIC-CT
Subscribed, neat :)
Games displayed better on a c64 allthough the beeb was far more industrialised