10x Faster Than C64 BASIC? Hare Basic

  Рет қаралды 30,065

8-Bit Show And Tell

8-Bit Show And Tell

Күн бұрын

Hare Basic is a fast, limited instruction set, integer-only basic interpreter (not a compiler) for Commodore 64 and VIC 20, created by Aleksi Eeben and released for free download in May 2024. There's an excellent handbook included, and the distribution disk includes many excellent example programs. I had a lot of fun developing a little game prototype with Hare Basic and found that it was surprisingly fast and easy to use. Join me as I show you what I've learned about the language, as we walk through the code of some of the included example programs, and the small game I wrote with it.
Downloads here:
csdb.dk/release/?id=242880
bit.ly/harebasic
bit.ly/harebasichandbook
8bitshowandtell.com/downloads...
To support 8-Bit Show And Tell:
Become a patron: / 8bitshowandtell
One-time donation: paypal.me/8BitShowAndTell
2nd channel: / @8-bitshowandtell247
Index:
0:00 Playing Descending Doom game prototype
3:20 Hare Basic - a faster BASIC
8:07 BALLOONS demo
15:16 FILLSPEED demo
19:16 RASTER demo
21:31 TIPS: various code snippets
24:28 Descending Doom walkthrough:setup
29:37 Move spaceship
34:31 Move/detect bullet/fire
37:00 Descend the Doom
41:56 Title Screen / Game Won / Lost
43:46 Some final thoughts & info
46:05 Thanks to my patrons!

Пікірлер: 191
@AleksiEeben
@AleksiEeben Ай бұрын
Optimizing the level generator, lines 120-140: Use bit 7 of RND instead of bit 0 to remove the need for multiplication, and use variables instead of literals: 120 e=128:d=32:fori=1024to1823:rnd:a=aande:a=a+d:pokei,a:next 130 140 => 53 jiffies, 2.4x faster than original Or use bits 15 and 7 of RND, variables instead of literals, and finally do GO6 (16-bit poke) to poke two pieces of 'doom' at once: 120 e=32896:d=8224:forz=1024to1823step2:rnd:a=aande:a=a+d:go6:next 130 140 => 29 jiffies, 4.4x faster :) Thanks for the coverage, Robin! These shows are always great fun to watch :)
@8_Bit
@8_Bit Ай бұрын
Nice optimizations! Thanks for Hare Basic, it's really fun.
@botoxedballsack7391
@botoxedballsack7391 Ай бұрын
Helluva great tool u've made. Mesmerizing such a thing is even possible.
@luispieri640
@luispieri640 Ай бұрын
@AleksiEeben amazing speed! A good txt converter to c64 that do not add spaces and let the c64 basic output compatible with Hare?
@Commodore128Mode3
@Commodore128Mode3 29 күн бұрын
Aleksi: Any chance of doing a C-128 mode version of Hare BASIC? If any BASIC needs to be a "HARE" faster, it's the C-128 mode on a Commodore 128! ;)
@chromosundrift
@chromosundrift 29 күн бұрын
@@luispieri640 sounds like a great side project for someone. Would you remap variables like ab and ac to a free single letter somehow? Thinking about it, you would have to assume some features were not used or this translation could become very difficult! Maybe a starting point would be a kind of lint where you detect if the source program was translatable in principle. Rewriting expressions feels like CS homework!
@MurderMostFowl
@MurderMostFowl Ай бұрын
I love that Hare BASIC coexists so nicely with C64 basic, seems like it is almost being a library of sorts
@DaveF.
@DaveF. Ай бұрын
Oh - that's *cool* - I keep banging on about how amazing the BBC Basic is because it has a built-in inline assembler. Never even considered you could have a BASIC interpreter with another hi-performance basic interpreter built-in. Very, very cool idea.
@mikegarland4500
@mikegarland4500 Ай бұрын
You made a fully functioning game just to "test out Hare BASIC". Gotta admire that as well. Can't wait to try it out at the first opportunity I get.
@BillAnt
@BillAnt Ай бұрын
I remember back in the day using the BLITZ! compiler for basic programs which made a faster tokenized code. Of course it made it a little bigger due to the interpreter.
@EgonOlsen71
@EgonOlsen71 Ай бұрын
So basically, it has the same limitations as one of those popular micro-compilers from back in the days but replaces the compilation with an interpreter. Interesting approach.
@mikegarland4500
@mikegarland4500 Ай бұрын
Nothing wrong with liking your own game. I think it's a testament to how fun it is that you do like it. Don't know how many times I would play Space Invaders back in the day and just spend a lot of time at the start just whittling away at those blocks near the bottom. Used to drive my brother crazy.. "Why are you doing that??!! Shoot the aliens!" Now I have a whole game dedicated to that!! Thanks.
@rodoherty1
@rodoherty1 Ай бұрын
I've been following an excellent 6502 tutorial on board-b's channel and it's given me some confidence to starting watching your wonderful channel again. I'm usually completely lost when I watch your videos but I have a morsel of confidence now so here I am again.
@TheSimTetuChannel
@TheSimTetuChannel Ай бұрын
"If you don't think it's fun, that's fine. Go do something else!" And here I was believing the answer to life the universe and everything was 42.
@Okurka.
@Okurka. Ай бұрын
42 isn't the answer to life the universe and everything. It's the answer to the ULTIMATE QUESTION of life, the universe, and everything.
@Gooberslot
@Gooberslot Ай бұрын
They fact that you can mix Hare Basic and regular basic is awesome. The no white space thing is much less so.
@MyAmazingUsername
@MyAmazingUsername Ай бұрын
Every space wastes 1 byte plus interpretation time slowdown.
@hammondeggsmusic
@hammondeggsmusic Ай бұрын
The documentation really captures the retro feel - it just needs to be photocopied a few times to really get that look heh.
@stefankrause5138
@stefankrause5138 Ай бұрын
"It's Tetris - but with a military touch" - The New York Times
@johntrevy1
@johntrevy1 Ай бұрын
You should have called your game "DoomScrolling"
@noland65
@noland65 Ай бұрын
That's occupied already (for the PETSCII domain).… ;-)
@andrewgillham1907
@andrewgillham1907 Ай бұрын
Hare Basic looks pretty interesting and definitely fast for basic. I was kind of hoping to see “10 Print” make an appearance. 😀 Your game prototype looks fun. I tend to like those “falling things create pressure” kind of games. At least up until they are way too fast to play.
@alex.germany
@alex.germany Ай бұрын
Same here 😊
@Sataaa
@Sataaa Ай бұрын
Oh man, I was about to comment this but instead looked for the comment of someone else saying it: I wanted to see the "10 print" in this as well! I thought about how it would be a curious RND call with AAND1 again, it was going to be fun! But it was a very fun video as well anyway! Thanks Robin
@chromosundrift
@chromosundrift 29 күн бұрын
It would have to be a few lines long right?
@martsmiscmix
@martsmiscmix Ай бұрын
What a neat idea - the concept reminds me somewhat of "RISC" versus "CISC" - we now have a kind of "RISBAS", if you see what I mean. I especially like the way it "dovetails" with conventional C64 Basic. I'm definitely going to investigate ...
@donnierussellii4659
@donnierussellii4659 Ай бұрын
I'd really like to see a Hare Basic version of Centipede. If no sprites were used, your game makes it seem easier than I would have thought.
@8_Bit
@8_Bit Ай бұрын
Yes, I bet a fantastic version of Centipede could be made with this.
@weedmanwestvancouverbc9266
@weedmanwestvancouverbc9266 Ай бұрын
You can add a custom character set to make changing mushrooms as you shoot them
@project23
@project23 Ай бұрын
Really amazing project! It reignites my desire to tinker around in basic again. Thank you for the quick rundown of features and demos. Descending Doom seems like a really cool base to flesh out a wonderful addition to C64 shareware and a great example of Hare Basic's capabilities.
@CanadianRetroThings
@CanadianRetroThings Ай бұрын
No white space is not a bad habit, it is efficient. Especially if you learned BASIC on something with around 4K of memory where every white space takes up precious space.
@da5idnz
@da5idnz Ай бұрын
This really is the next evolution of Commodore Basic. Just imagine if we'd had this back in the 80s? Much easier to use than Simon's Basic or LOGO.
@MMSZoli
@MMSZoli Ай бұрын
Simons BASIC added what was really missing from V2.0: graphics, sound, sprite commands, next to disc handling. The first three made the C64 great (or even epic), but you could not touch it without register level programming in BASIC. Unfortunately even the later releases did not added these commands. You can download for C64 the V3.5 BASIC, just 3.5 KB extra, but makes the programming much more fun, with even structured programming commands.
@chromosundrift
@chromosundrift Ай бұрын
Whenever I see a new 8-Bit Show and Tell video appear it makes me feel happy!
@penfold7800
@penfold7800 18 күн бұрын
Nice to see that BASIC, and it's concept, isn't dead. I thought from the name, that you had actually found something useful from the Haresoft company of back in the day. Glad I didn't miss out on it then.
@TobyDeshane
@TobyDeshane Ай бұрын
I think it'd be pretty cool if the descending lines were actually dripping slime, or something. :)
@LanceHall
@LanceHall Ай бұрын
I see a cave crawler game. Maybe when the columns hit the floor they spread left or right. Or you have some limited vertical range and you can shoot a column off and it hits the ground and implodes and fades away or melts if they are ice columns with collectable gold nuggets (and dynamite sticks) embedded. You get the nuggets before being entombed in ice. If successful you move onto other caves with bats and monsters protecting nuggets.
@markperreira5889
@markperreira5889 Ай бұрын
Wow! That is a very elegant approach to integrate a lightning speed basic within commodore basic. I wish it supported the PET/CBM!
@luispieri640
@luispieri640 Ай бұрын
Amazing Video Robin! We want more Hare Basic games/tutorials!
@falksweden
@falksweden Ай бұрын
1336 views. I just had to watch it immediately. 😁
@db21362
@db21362 27 күн бұрын
Reminds me of "back in the day" when I hacked up "quick print" routines from the original basic ML routines, though this is obviously a full-features product rather than hacking. Even that made a massive improvement (mostly as I had no error checking at all and different calls for integer and string). Yet another opportunity to be famous wasted (lol). Well done to Aleski and thankyou for sharing this with us. I'll have to check it out.
@warrenbullock3165
@warrenbullock3165 Ай бұрын
Thank you, I’m creating a BASIC game and can use this. I really enjoy your videos.
@Hounddoggy33
@Hounddoggy33 27 күн бұрын
This game was so fun, Robin! I almost beat it on my first try :) Wish we had this in Compute's Gazette back in the day!
@acestapp1884
@acestapp1884 Ай бұрын
Wow a 60FPS clear screen! Will wonders never cease!
@MichaelDoornbos
@MichaelDoornbos Ай бұрын
23:50 it’s an LFSR, the feedback loops needs something to feed back. All zeros won’t XOR to something other than themself. Hence getting stuck. If you use the correct number and location of the TAPs (which commodore BASIC does) you can generally avoid the stuck in all 1s state. 33:35 that would make a good band name
@AleksiEeben
@AleksiEeben Ай бұрын
Hare Basic RND is 16-bit "798" Xorshift (by George Marsaglia, John Metcalf, Veikko Sariola) from codebase64. The algo outputs numbers in the range $0001-$ffff, and stalls if the seed if set to $0000. Hare takes the number and EOR's it by $ffff to get numbers in the range $0000-$fffe, which is more handy: The programmer can then extract smaller ranges by doing an AND with a (power-of-two - 1), ie. 3, 7, 15, 31, 63, etc. (The point being in these smaller ranges we usually want to include 0.) Hare also checks if someone has accidentally (or on purpose) set the seed in memory to zero, and turns it to $0001. Takes a few extra cycles, but guarantees that the RND won't stall even if tampered with :) CBM BASIC random is very slow... What is in Hare I believe is sufficiently good, and speed is a plus! If non-deterministic randomness is needed, the output could be EOR'd with CIA timer low byte or user joystick inputs, or a dummy random number could be created every frame in the game loop, etc.
@RetroCave-wr9tl
@RetroCave-wr9tl Ай бұрын
I remember the time making an accidental raster line in BASIC. It was just one line and pressing any key would make the line scroll. As soon as I saw the raster demo with bunch of lines I realized how fast this was.
@commodoresixfour7478
@commodoresixfour7478 Ай бұрын
Very Nice!
@willllbert1
@willllbert1 Ай бұрын
Thanks for such a great video and a simple but fun game!!
@HPPalmtopTube
@HPPalmtopTube 9 күн бұрын
If only I had tools like this available when I was coding BASIC on my C64 back when I was a kid... :)
@Commodore128Mode3
@Commodore128Mode3 29 күн бұрын
"Descending Doom"! That would be a fantastic title for a movie! Another great episode Robin! You have a fantastic way of making going through code line-by-line interesting. Your game in a way reminds me very much of the very popular "Astrosmash!" game for Intellivision in the 1980s! I must admit, Descending Doom looks like fun! The mark of a good game is that it is fun in spite of not having fancy graphics. There are too many junk games in this world with awesome graphics. Thanks Robin!
@RickinBaltimore
@RickinBaltimore Ай бұрын
So if this is Hare Basic, does that mean the standard is Tortoise Basic?
@Okurka.
@Okurka. Ай бұрын
The tortoise beat the hare, though.
@SM-rn3xy
@SM-rn3xy Ай бұрын
There is a bug in the Balloons example (8 to 15 mins). It initializes C to 0 in line 10 then without using it sets it to 53286+A in line 40 as part of the setup loop. It then gopes on to use it from the unintended starting valuie.
@cybermodo
@cybermodo Ай бұрын
Unusual and cool concept. I have regards for very simplified BASICs ( like subset of V2), exactly because it may run much faster (having , for example, static string handling and purely integer arithmetic). But even more important - it might be easier to create a very efficient compiler for such little BASIC! So, next very good step for this Hare project might be producing neat compiler, that gives small and even faster machine code! And so we can have everything, the best of all worlds! Why shouldn't we? :) One more thing I noticed - AMOS Basic for Amiga has some small and very fast internal BASIC interpreter called AMAL (animation language), executed from AMOS strings. Something like this existed in Oasis Lightning BASIC/Forth for C64, I think it was also called AMAL. This Hare thing reminds me on that concept, just using regular BASIC listing for the code.
@rickhager7684
@rickhager7684 Ай бұрын
It's like shooting down the spikes at the end of a Tempest level :)
@pjcnet
@pjcnet 26 күн бұрын
I'm amazed it's that fast from an interpreter, I expected it to compile the code first. He should make a compiler too, although not sure if it could be that much faster. If only this was around back in the day.
@manicsorceress2181
@manicsorceress2181 Ай бұрын
Great video. But I still miss a video about Simons Basic or the much improved TSB (Tuned Simons Basic). How can you ignore that?
@endwigast5212
@endwigast5212 Ай бұрын
Robin ignores a lot of stuff, such as Vision BASIC. Not sure why.
@miselzivanovic2181
@miselzivanovic2181 Ай бұрын
I guess it's not retro enough (anymore)... Just kidding... Maybe it'll be here sooner or later. Not everyone is having REU to run Vision Basic on real HW (fact that could reduce audience, but also make people get REU and start with Vision Basic) But then, I assume most of us are just using VICE or other emulators and REU is suddenly not a problem. TSB, that's some nice piece of good entertainment. Yes, I would love to see both on this channel too. Robin is always having good ideas 💡 and I am sure he'll come up with something (again, sooner or later)... We, RetroPeople, are mostly used to waiting, just to bad life isn't eternal 😁
@manicsorceress2181
@manicsorceress2181 Ай бұрын
The best thing about TSB (Tuned Simons Basic) is that the developer is still working on it and making fixes and improvements. He is a very nice guy from Germany who likes to help and explain things.
@jandjrandr
@jandjrandr 5 күн бұрын
I always thought that there were significant inefficiencies in the stock BASIC interpreter. This vindicates my opinion. Thank you for sharing this and thanks @AleksiEeben for making such an amazing interpreter.
@Anth369
@Anth369 Ай бұрын
33:05 - this is super cool!
@theyamo7219
@theyamo7219 Ай бұрын
To be honest, I would have been all over a game like this back in the day for my old TRS-80
@10MARC
@10MARC Ай бұрын
Neat stuff for sure! It really does seem zippity fast,!
@chromosundrift
@chromosundrift Ай бұрын
I get it! The Tortoise and the Hare. Bunny Basic was obviously the first hop in that direction.
@BG101UK
@BG101UK Ай бұрын
21:40 I guess Line 77 should read "SCROLL UP (VIC 20)" ☺
@8_Bit
@8_Bit Ай бұрын
I suspect you're right!
@AleksiEeben
@AleksiEeben 29 күн бұрын
After 30 years of using real text editors, it's almost impossible to remember pressing return on every line when copying lines in the C-64 screen editor :D
@NovaLand
@NovaLand Ай бұрын
I'd do power-ups like wizball style, giving you the features of the fire button like single-step, auto-fire and so on...
@giuseppe74921
@giuseppe74921 28 күн бұрын
Super interesting video to watch, as always. I would have loved if C=ommodore had optimized C128 basic a bit, with true fast integers variables and other possible small things
@8_Bit
@8_Bit 27 күн бұрын
Yeah, they really focused on adding loads of features to C128 BASIC, but didn't seem to look at optimization at all. Except of course many of the new commands did speed things up by eliminating many POKEs in certain programs. But yes, true integers would have been great.
@R.Daneel
@R.Daneel Ай бұрын
Might I recommend a slight change to the fire button for your game - have it cancel the current shot as well. I noticed a bullet travelling all the way to the top of the screen on a clear column can take a bit. A cancel button would let you abort that shot and perhaps avoid imminent doom. Sorry if it already works like that - I couldn't tell :-)
@Ashe_S_
@Ashe_S_ Ай бұрын
I, too, almost got lost in the thought of living after video memory (of the c64)
@csbruce
@csbruce Ай бұрын
The main things that need to be optimized in Commodore BASIC are to use addresses instead of or in addition to line numbers in GOTOs, etc.; to use addresses instead of names for variable references; to use tokenized binary representations of numbers instead of parsing them at runtime; and to have a special, optimized representation of binary numbers 0-65535 in the floating-point encoding, such as with exponent = $00. Use these integers directly for simple operations like reference and addition, and convert them to general floating point for non-trivial operations or integer overflows.
@cairsahrstjoseph996
@cairsahrstjoseph996 23 күн бұрын
Not sure how it would slow things down, but with a little adjustment to the character set, you might design some mean looking little faces for the lowest or leading block of each column, and they look meaner as they get closer. Also instead of "Game Over" I would suggest "Thou Art Doomed" or something in keeping with the theme.
@DavidYoud
@DavidYoud Ай бұрын
That's a really compelling BASIC, and looks like it would be fun to create with. Maybe I'll take it for a spin and implement Conway's Game of Life, see how much faster it would be. I looked at the PDF and see that instead of arrays, you just peek/poke memory. The GO4/GO5 you showed makes me think that maybe smooth vertical scrolling would be possible?
@8_Bit
@8_Bit Ай бұрын
Yes, I wonder if fast (max) 256 element arrays could be implemented in Hare Basic somehow, with it being up to the user to reserve the memory. And yes, I think smooth scrolling could be achieved with GO4/5, maybe not a rock solid 50 Hz (or especially) 60 Hz, but even with a frame stutter here or there it would be way better than CBM BASIC.
@matthiasstppuhn514
@matthiasstppuhn514 Ай бұрын
Some time ago I ran into "Vision Basic". This s a paid program, but you get a nice paper manual with it. It will need a REU (in future versions possibly also GEORAM would do). It works on VICE in case you don't have a real C64 with a REU. I wonder how your game would do with that? From my experience you can load a classic basic program - and like here you also need to take few adjustments [ "clr" the vars at start ]. Like here there are some math-quirks, like doing math as a 1$ calculator ==> 2+2*2 gives 8. What I love most is : You have quite extended command set and you can mix assembly code with Basic.
@cooltaylor1015
@cooltaylor1015 27 күн бұрын
I'd love to play a game like that on Atari 2600. Maybe something based on Centipede. But with no centipedes. Just more and more mushrooms, descending upon you.
@HelloKittyFanMan
@HelloKittyFanMan Ай бұрын
OK, what error message would we get in Hare if we try to assign a reserved variable, like zee, let's say?
@ReneSchickbauer
@ReneSchickbauer Ай бұрын
Video idea: There is a way to upload code to the 1541 floppy and execute it, then get back the results to the C64. I dimly remember seeing that used to speed up calculating fractals. And i'm pretty sure a disk copy program used that so you can duplicate between two floppy drives while using the C64 for something else. Maybe you could go into details how that works?
@Hounddoggy33
@Hounddoggy33 27 күн бұрын
I was thinking about buying two of those Hyperkin Atari joysticks. Are they as good as the original CX40's? Cheers from Ottawa!
@8_Bit
@8_Bit 27 күн бұрын
I really like them, yeah. They're a lot like CX40s but a bit more comfortable, have a longer cord (almost too long), and seem to be a bit better constructed. So yeah, I recommend them especially if the price is still reasonable like when I bought mine a few years ago.
@mikekopack6441
@mikekopack6441 Ай бұрын
I would have thought Paddles would be a better controller for that sort of game. Just my $0.02
@TheXJ12
@TheXJ12 25 күн бұрын
12:35 "R is the base register" but I don't see any use of it. Even more, I removed both occurrences of it (on Vice emulator) and the "Balloons" program seems to work just the same !
@8_Bit
@8_Bit 25 күн бұрын
Looks like you're right; that must have been leftover code from when this example was being developed and I didn't notice it wasn't being used. Good catch!
@Clancydaenlightened
@Clancydaenlightened Ай бұрын
9:50 so it's like turbobasic on Atari XL Where it's effectively a ram resident patch for the normal basic in ROM.... Replacing the inefficient stock basic routines and adding extra features
@randysmith7094
@randysmith7094 Ай бұрын
I'm looking at the random number benchmark sample and it doesn't seem entirely fair. Basic has to define the range 0-65534 and that is Hare's RND default code. If you specify a range like A=AAND255 then it's about three times slower. If you add a function like PRINTA; then it becomes only about twice as fast as BASIC.
@AleksiEeben
@AleksiEeben 29 күн бұрын
True. Here's a coin toss benchmark, perhaps a bit more fair: 0 printchr$(147)"coin toss rnd benchmark" 1 ti$="000000":a=usr(3):h=ti 2 ti$="000000":gosub5:c=ti:goto100 3 n=0:fori=1to1000:rnd:a=aand1:ifa=1thenn+ 4 next:print"hare got"n"tails":return 5 n=0:fori=1to1000:ifrnd(1)
@networkg
@networkg Ай бұрын
It would sure be nice to see a comparison of modern Commodore languages. Vision Basic is my current favorite. Yes, you need a VICE emulator or a REU to program with it, but it is blazing fast and can compile stand-alone programs that can run on a stock C64.
@endwigast5212
@endwigast5212 Ай бұрын
Don't hold your breath waiting. Robin is purposely staying away from Vision BASIC for some reason. Thankfully, there are other KZbinrs willing to cover it.
@networkg
@networkg Ай бұрын
@@endwigast5212 I am just learning Vision Basic. I was able to create a fairly fast one line maze : 10 R=RND AND 1:ADD R=R+205:?CHR R; DO 10,920 Short and fast, although I am sure that Vision can go faster. I hope Robin will get around to covering it, he is a fantastic teacher and his explanation of how it works would be fantastic I am sure.
@stephenwhite506
@stephenwhite506 20 күн бұрын
It would be interesting to see where Hare Basic fits into Noel's Retro Lab's bench marking spreadsheet. Search for his video "Is this the FASTEST and CHEAPEST 8-Bit Computer Ever?" and see the link in the video description "BASIC benchmarck page". The simple basic code is in the "BASIC benchmark" tab. 10 FOR i=1 TO 10 20 s=0 30 FOR j=1 TO 1000 40 s=s+j 50 NEXT j 60 PRINT "."; 70 NEXT i 80 PRINT s CBM basic does it in 40 seconds. VIC20 in 37 seconds.
@DonVintaggio
@DonVintaggio Ай бұрын
0:47 reminds me more of Phoenix
@bluerizlagirl
@bluerizlagirl Ай бұрын
Wow! That's a bit of a coincidence! I started writing a simplified (only 16-bit integer maths and limited string handling) BASIC compiler on the BBC Micro, with a syntax intentionally compatible enough to allow code to be entered in the existing BASIC editor and run in its interpreter. It compiled to an intermediate code for a dedicated virtual machine designed "in parallel" with the language; for instance, FOR and NEXT had their own single opcodes in the VM. Long variable names were supported, too; as, once the symbol table has been built up, variable names only need to be searched for at compile time, as reading a variable's value gets translated to a fixed-location memory read based on wherever the variable actually is stored. The VM was basically stack-based, but with an optimisation to save a stack push and pull when a value was specified as a right-side operand. Each instruction could potentially exist in three addressing modes: Stack (ADD on its own adds the top two numbers on the stack and leaves the total on top of the stack), Immediate (USE #&0123 places &0123 on top of the stack) or Memory (SUB &0404 subtracts the contents of address &0404 from the number on top of the stack and leaves the difference where it was). USE #&0004 places &0004 on top of the stack, USE &0424 places the contents of address &0424 on top of the stack, GET takes an operand or the value on top of the stack and places the contents of that location on top of the stack, PUT takes a value as an immediate operand, memory address or from the stack; an address from the stack; and stores the value there. PAF does the same but the other way around, Address First, for situations where the operands naturally fall that way round. It needs some more instructions adding to the VM, and I need to do more work on the instruction parser, but I think I might pick it up again now there's obviously a bit of competition in town!
@TheXJ12
@TheXJ12 25 күн бұрын
Forth ? HP RPL ?
@HelloKittyFanMan
@HelloKittyFanMan Ай бұрын
Hey, Robin, you may have missed a good opportunity to make that "2023" video... _on time..._ but I'd still really love to see what you would do with that anyway! Late is still better than none in many cases, right? Please make that; I guarantee you that I'll watch it!
@AiOinc1
@AiOinc1 Ай бұрын
Can you imagine releasing a programming language and same day someone makes a game for it
@twofour8127
@twofour8127 Ай бұрын
I'd really like to see you do a video on Simons Basic.
@endwigast5212
@endwigast5212 Ай бұрын
Robin ignores a lot of stuff, such as Vision BASIC. So don't hold your breath waiting.
@adam1984pl
@adam1984pl 16 күн бұрын
It would be nice to see a Pac-man game written in this Basic.
@MurderMostFowl
@MurderMostFowl Ай бұрын
Here’s an Idea for “Descending Doom” scoring: Have the game award more points for blocks that are destroyed in higher rows. I think this will incentivize players to take more risky actions and make it more challenging. ( of course I realize you don’t current keep score so you’d have to do that too… maybe eliminate the top row ) A subtle indication the row is about to drop much also be worth it to develop.
@Brian-vs9sd
@Brian-vs9sd 28 күн бұрын
Hi Robin. Thanks for the video. Have you tried Vision Basic yet?
@8_Bit
@8_Bit 27 күн бұрын
I haven't. I did sort-of consider buying it when it was on sale a while ago but the high cost of shipping to Canada put me off again. I think I read a newer version is coming out in a while, maybe I'll look at it then. Hare Basic appealed to me because 1) it's written by someone I've respected for many years 2) it's free 3) it's light-weight 4) it's very effective 5) it was really easy to learn 6) it co-exists with CBM BASIC really nicely 7) it works on VIC-20 and C64 8) it has no extra requirements (beyond extra RAM on VIC-20 which I already have)
@Brian-vs9sd
@Brian-vs9sd 27 күн бұрын
@@8_Bit Great points. I decided to bite the bullet and yes the shipping to Australia was crazy. Once again thanks for the great video.
@lcmoura
@lcmoura 28 күн бұрын
Hello, is there any emulator in Windows or Linux for people that don't have the Commodore hardware?
@8_Bit
@8_Bit 27 күн бұрын
Yes, look up VICE Emulator, it's very good.
@while_coyote
@while_coyote Ай бұрын
You should have the the button cause a bomb that blows up a radius around the ship.
@computer_toucher
@computer_toucher Ай бұрын
Of course a CNCD member creates a blazingly fast BASIC thing. Those demoscene people are usually pretty hardcore optimizers, whether it's code, graphics or music :)
@f3liscatus
@f3liscatus Ай бұрын
You should probably check E for an underflow condition in line 400. Yes, the game will most certainly have been lost before E wraps around, but you never know! 😉
@NemanjaVuj
@NemanjaVuj Ай бұрын
This is a very interesting and novel concept: high level and mid level basic interpreters working together. I fear, however, that it will have less impact than it would have if it came some years ago. Nowadays it will undoubtedly be compared to languages such as XC=Basic (3.1 already) and Vision Basic, which are much more powerful AND compile to significantly faster stand alone code AND can easily integrate machine language routines.
@endwigast5212
@endwigast5212 Ай бұрын
Your words are falling on deaf ears. Robin won't ever review Vision BASIC, probably because it costs money.
@victorwidell9751
@victorwidell9751 Ай бұрын
No labyrinth oneliner demo?
@hotkeymuc
@hotkeymuc Ай бұрын
Scary: The KZbin algorithm suggested as the next video: "Solution 42" - a 4k C64 demo which mentions the 2023 screen address thing! 🙀
@8_Bit
@8_Bit Ай бұрын
I didn't know about Solution 42 until yesterday when a commenter mentioned it, so I watched it and left a comment on that video. That coincidence alone amazed me! Is that enough to make the algorithm suggest that video as related??
@TheGreatAtario
@TheGreatAtario Ай бұрын
You could obviate the need for that string of "IFC=0THEN…"/"IFC=1THEN…" lines with judicious use of GOTOs
@petersoumanis5494
@petersoumanis5494 28 күн бұрын
So I'm assuming this can't run on SuperCPU since this is a different kernel and SuperCPU has its own ?
@8_Bit
@8_Bit 27 күн бұрын
I haven't tested it on my real SuperCPU but it works fine on the VICE SuperCPU emulator. Hare Basic just patches various BASIC/C64 vectors as far as I know, so it's compatible with SuperCPU and probably other well-behaved peripherals.
@Lion_McLionhead
@Lion_McLionhead Ай бұрын
That might make a good VT100 game.
@relaxxxrrr
@relaxxxrrr Ай бұрын
Has anyone gotten this to work on the vic20 (VICE)? It seems to just lock up on the SYS40960.
@8_Bit
@8_Bit Ай бұрын
You'll need to enable all RAM expansion on it, I think. The extra 3K and all four 8K banks for +35K RAM, 40K total.
@8_Bit
@8_Bit Ай бұрын
If you mean TheVIC20 "maxi" then I think rename the file to something like HareBasic_35k.d64 and it should work. Check the manual for TheC64 / TheVIC20 if that doesn't work.
@relaxxxrrr
@relaxxxrrr Ай бұрын
@@8_Bit Yes, thanks. 35K flag works. Put it in a cjm file,"X:vic,pal,fullheight,35k".
@battlemode
@battlemode Ай бұрын
Bit of an offtopic comment I'm afraid but how on earth have you kept your C64 so clean and neat? Mine is all yellowed with age! It still functions though, as do both of my original ZX Spectrum computers I still have from when I was a kid in the 1980s. Wonderfully durable machines, despite their cheap production costs back then!
@8_Bit
@8_Bit 29 күн бұрын
Besides cleaning it occasionally, I haven't done anything special with it. Might mostly be luck of the draw; the yellowing of the plastic apparently depends quite a bit on the mix of chemicals used and this 64 case must have been made on a day when they had the mix perfect.
@battlemode
@battlemode 29 күн бұрын
Ah gotcha! Thanks for the info, and great video on Hare Basic too, very interesting
@64jcl
@64jcl Ай бұрын
How much memory is left to code after Hare Basic is loaded?
@8_Bit
@8_Bit Ай бұрын
Hare Basic lives up in the $Cxxx area of RAM, so all regular C64 BASIC memory is still available.
@HelloKittyFanMan
@HelloKittyFanMan Ай бұрын
So the reason you put quotation marks around "repurposed" is that "go" really isn't a command in the 64; only in the 128 in 128 mode and the 65 in 65 mode? Or is there a different reason you used quotes; and if so, then what is that? And what would this be like if you ran it in 128 mode? Will you try to compile a video of odd experiments you can try with this? Like... try making a BASIC program that used all originally Commodore-compatible commands and tokens (so you won't get a syntax error, etc. when you try what I'm about to say next), and then run it on both Hare and pure Commodore (so run it again without loading Hare).
@up2tech
@up2tech 29 күн бұрын
Sorry the website is in DK = Denmark. I suspect the guy is Danish :)
@britlion
@britlion Ай бұрын
I'm surprised you didn't do RND, then do B=AAND128 rather than setting the 1 bit and multiplying by 128, which has to be a relatively slow routine compared to a simple AND. Assuming that all the bits in the RND are equally capable of being 1 or 0 of course, but they should be.
@chrisdixon5241
@chrisdixon5241 Ай бұрын
Very impressive work! "I think it's cool and that's all that matters" :) absolutely, your channel your rules but I have to say you're not the only one that thinks it's cool! So we're in the 16 bits of unused space... that explains a lot about the world today. I guess we only have until 2040 before we'll overwrite the sprite pointers and the universe will vanish? :D
@knur-soft
@knur-soft Ай бұрын
i remember playing something similar to your game on a "brick game" which were popular in former eastern bloc countries.
@soothcoder
@soothcoder Ай бұрын
Hey that multiply of b in your program must be slow - could just bit shift the 1 or 0 left.
@jakubkrcma
@jakubkrcma Ай бұрын
👍
@weedmanwestvancouverbc9266
@weedmanwestvancouverbc9266 Ай бұрын
You should dig into the code a bit on this to tell everyone how it works
@chromosundrift
@chromosundrift Ай бұрын
The graphics I imagine is oozing, dripping bacterial void.
@antivanti
@antivanti Ай бұрын
Game is pretty much Tapper on steroids 😊
@wishusknight3009
@wishusknight3009 Ай бұрын
I couldn't help but think the winning screen should have said "You Are Winner!" in reference to "Big Rigs: Over the Road Racing" Edit, it actually says "You're Winner!"
@AndyHewco
@AndyHewco Ай бұрын
HARE basic looks ace. Thanks Robin. I will definately check this out and I wonder if I could put my Vic 20 machine cide character sprite routine into this? Hmmmm. BTW, is there a speed advantage of putting if statements like so.... 440 ifc=1thenfori=1to40:rem statements 450 ifc=1thennext 460 rem next section Over the use of goto, as I remember your previous video of commodore basic having to look for the line number you're gotoing and that can be slow to do. If hare any better with goto or is it the same? I guess this is another way to do those types of lines if goto isn't a greater penalty... 440 ifc=1then460 450 fori=1to40:rem stuff 455 next 460 rem next section Timing various things in hare basic might make an interesting follow up video?
@8_Bit
@8_Bit Ай бұрын
A well-placed GOTO like you suggest probably would be faster; I did a lot of gameplay iteration on this code and then never did do a final optimize/cleanup pass on it before I made the video, so a lot of this code likely has plenty of room to improve. In a sense, that's a feature, that the game is able to run so fast without me even having to squeeze every last bit of performance out of it is pretty amazing!
@AndyHewco
@AndyHewco Ай бұрын
@@8_Bit the game came out well, I like the tidying up aspects of games too. You've got a mix of space invaders and blitz. Would love to see you come back to it with an updated version.
@AleksiEeben
@AleksiEeben Ай бұрын
CBM BASIC scans forward from the current line if GOTO/GOSUB target line msb is higher than the current line number's, otherwise it scans from the start of basic text. First, I did the same in Hare, but ran into some trouble with nested GOSUB's that do more GOSUB's on the first line of the subroutine: Hare doesn't always care what the current line number is, and although that was easy to fix, the fix made both GOSUB and RETURN (and FOR/NEXT...) more than a dozen cycles slower. So I ditched that. In Hare Basic, any time critical subroutines should thus be placed near the start of the program. However, if there's many repeated GOSUB's (or GOTO's) to the same line number, those are always cached and super fast. FOR/NEXT infinite loop is also super fast, so instead of GOTO, you may want to place your main loop in one: 5 REM Scans for line 50000 only once and keeps it 'cached' (50000 in a variable is even faster) 10FORI=0TO1STEP0:GOSUB50000 20GETA:IFA0THENI=2:REM Break out of loop 30NEXT 5 REM Scans for both line 50000 and line 10 every time, slower if there's a lot of lines 10GOSUB50000 20GETA:IFA=0THEN10 Note: I=2 is used to break out of the loop. If you're in a subroutine, you can also break out of a loop by a GOTO, as the next RETURN flushes the pending FOR from stack. If you're not in a subroutine, then you may create a stack yoyo 😅
@G.B...
@G.B... Ай бұрын
This looks and feels something like "high-level assembly" to me. The ability to use both vanilla and Hare Basic in the same program is certainly a good idea. Hare Basic somewhat reminds me the old and forgotten G-Pascal, in the sense it doesn't support real variables (but otherwise G-Pascal makes way less compromises, and it's compiled). Just out of curiosity, I did a few tests and it seems G-Pascal is about two times faster than Hare Basic, which is a great score for Hare Basic, considering it is interpreted. If the program uses Go System Calls extensively Hare Basic is about ten times faster - but I don't think this is a fair comparison since using Go System Calls basically means you run ML code, plus you can't use Go System Calls to do anything you want.
@rotordave81
@rotordave81 Ай бұрын
What a great concept. This could be used in university courses as a precursor tutorial to machine language. We used SPIM (MIPS simulation), why not use VICE with Hare BASIC then TMP in such subjects? Much more intuitive. You didn't credit yourself in the main game screen. And what's that imposter font at 45:15? ;) Great game concept too. A power-up element might be a fun addition.
@8_Bit
@8_Bit Ай бұрын
Hah, I've been using that low-rent font occasionally in videos for a few months now, and I think you may be the first to comment on it :) Power-ups could be fun. Maybe a special block could occasionally show up on screen for a moment.
@mikegarland4500
@mikegarland4500 Ай бұрын
I can see the potential for lots of variation in this one.
99.8% Compatible? The C64 Mode of the Commodore 128
1:02:11
8-Bit Show And Tell
Рет қаралды 28 М.
MS DOS Tunes | Medieval Melodies
38:19
Luckiesttuna
Рет қаралды 2,7 М.
Универ. 13 лет спустя - ВСЕ СЕРИИ ПОДРЯД
9:07:11
Комедии 2023
Рет қаралды 5 МЛН
A pack of chips with a surprise 🤣😍❤️ #demariki
00:14
Demariki
Рет қаралды 43 МЛН
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 2,4 МЛН
Just try to use a cool gadget 😍
00:33
123 GO! SHORTS
Рет қаралды 84 МЛН
The Z80 CPU - 1976 to 2024
18:49
Al's Geek Lab
Рет қаралды 26 М.
38911 Bytes Free? Commodore 64's BASIC RAM
29:57
8-Bit Show And Tell
Рет қаралды 36 М.
One-Line Bouncing Ball: Commodore 64 BASIC
42:34
8-Bit Show And Tell
Рет қаралды 59 М.
How Machine Language Works
19:48
The 8-Bit Guy
Рет қаралды 940 М.
C64 Round Up: June 2024 - Tony, Breadbox, Timo's Castle & More!
19:45
RetroGamerNation
Рет қаралды 6 М.
Cracking a C64 Game From Cassette: Livingstone, I Presume?
35:36
8-Bit Show And Tell
Рет қаралды 43 М.
Pentium Pro, was it a lemon ?
24:27
RetroBytes
Рет қаралды 69 М.
The Forbidden and Forgotten UMC Green 486 CPU
15:46
vswitchzero
Рет қаралды 89 М.
DC Fast 🏃‍♂️ Mobile 📱 Charger
0:42
Tech Official
Рет қаралды 485 М.
i like you subscriber ♥️♥️ #trending #iphone #apple #iphonefold
0:14
MacBook Air Японский Прикол!
0:42
Sergey Delaisy
Рет қаралды 569 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 45 МЛН
APPLE совершила РЕВОЛЮЦИЮ!
0:39
ÉЖИ АКСЁНОВ
Рет қаралды 2,4 МЛН
Нашел еще 70+ нововведений в iOS 18!
11:04