Some things are nice, like the fast sprite-movements, but most of the stuff is not essential. I am rather glad they put a more streamlined and faster BASIC in the C64, also resulting in more free address space; the result of a bigger BASIC ROM in the C64 would be less BASIC bytes free, and/or less upper RAM available for BASIC to use for machine code, screen or music data, etc.
I watched the first 10 seconds and saw the Ultima V box there. I smiled. Yes, having C128 allowed you to listen to the amazing U5 music (not in C64). I'll watch now the rest.
BASIC 7 was a big reason I got very excited about the C128 in '85. I think I memorized them all from COMPUTE's Gazette articles before I even got one. :)
I quite often used the c128 new basic features, the sprite editor was useful, but what i liked most was playing with the command circle, it has got a pair of parameters that i didnt find in other basics even on amiga various basics i always missed it The first parameter was the angle of rotation of the ellipse and the second parameter was the angle between segments of the circle (an angle of 1 is a perfect circle, and an angle of 90 is a box). So with a for next i enjoyed a lot to draw some sort of abstract figures: 5 Graphic 1,1 10 For n=1 to 180 step 5 20 Circle 1,160.100,160,50, , ,n,45 30 Next n Something like this ("n" is the rotating angle and 45 is the angle between segments, 45 would give an optagon of an ellipse, try to give 36 for a decagon: to obtain a polygon of x sides, just use an n=360/x). If u change line 20 with: 20 Circle1,160,100,100,100, , ,n, 90 then it would draw a rotating diamond (like u did with the box command) Another feature not very well known is that u can even use sort of vector as cohordinates, using a ; (semicolon) as in L ; r where L is the lenght of the segment and r is the angle, so: 5 graphic 1,1 10 for n =1 to 360 step 5 20 draw 1,160,100 to 100 ; n 30 next Would draw a star. You can use this way of writing cohordinates using vectors with other graphics commands like box, circle etc. A nice combination: 5 graphic 1,1 10 for n=1 to 180 step 5 20 circle 1,160,100,160,50, , ,n,15 30 next 40 for n=1 to 360 step 5 50 draw 1,160,100 to 100 ; n 60 next 70 sleep 10 80 graphic 0
Great video! The ELSE command can be in a different line if a BEGIN … BEND block is used: 10 IF I=0 THEN BEGIN 20 : PRINT "THEN BLOCk“ 25 : PRINT "STILL THEN BLOCK“ 30 BEND : ELSE BEGIN 40 : PRINT "ELSE BLOCK" 45 : PRINT "STILL ELSE BLOCK“ 60 BEND
Another great video. Nice to see the 128 getting some love. Basic 7 was such an improvement over Basic 2. So many fond memories of hours spent coding in Basic on my 128.
The C-128 was my first (and only) Commodore computer. There were so many tricks it had that no other Commodore 8-bit machine could do. BASIC 7.0 was great - though much of what it brought to the table in terms of graphical commands were from BASIC 3.5, but even before that - the Super Expender cartridges for the VIC 20 and C-64 had most of those same commands. The function keys with their predefined definitions (F3 = DIRECTORY) were very useful. But what I loved most, and perhaps Robin may go into this if he continues down the 128 path a bit - were all the tricks it had that weren't quite so obvious. Things like redefining what SHIFT-RUN/STOP and HELP did, like an F9 and F10, or programs that would boot and load quickly in C-128 mode and then reboot into C-64 mode and run to take advantage of the burst mode on the 1571 drives. Or, how you could enable the numeric keypad and use it in C-64 mode. Lots of tricks it had hidden. Loved it!
I loved my 128. I remember starting programming tutorial books in C64 mode because that was the first book off my parents bookshelf I grabbed and remember being totally frustrated with the pokes and peeks of trying to do graphics and sound. Then I found the C128 manual that came with the system and never turned back to the C64 mode for programming. I wrote several graphical demos for middle school projects leveraging the sprite editor and graphics commands along with the super easy play command for music. It really was the apex of commodore basic.
When you were talking about IF/THEN was expecting that to lead into a mention of BEGIN/BEND, which allow you to have multiple lines inside both the THEN and ELSE parts of an IF statement. (You would think that they would let you have unconditional statements after a conditional on the same line, but sadly that doesn't work.)
I've never in my life touched a 128, a few friends had one, I was always a little jealous that they could BBS in 80 columns. They were a neat little machine, but the price was pretty high and I held onto the C64 until the Amiga 500 came out and had dropped in price a bit. Funny story; I really wanted a 1581, saved up for it, but it wound up being SO CLOSE to the Amiga price, I got the Amiga instead :)
Best part of Commodore 128 was being a C64, so you, without a C128, had the best part of C128. The other best part of C128 was including a good machine language monitor on ROM, so you can play with it directly.
Trivia: The reason why c128 editor allows 4 lines of basic as one row is because they wanted to give 2 lines of code in 80 col mode, because people are used to 2 lines 😊 the side effect is that the new 160char buffer then of course allows 4 lines in old 40col mode 😊
The C128 BASIC improvements were what got me started in game development. It was so much easier to learn than endless PEEK/POKEs or having to go into full-on assembly code. I had no idea about the Esc codes. All this time I thought Esc was basically unused on the C128!
My first Commodore was a C16, and when I got a C64 I was disappointed that despite being a more powerful machine, I had to use POKEs and PEEKs to do graphics and sound, rather than having actual commands for it -- and also how it lacked any direct command to do a disk directory.
Ah yes, I dealt with that a lot. The 1541 drive comes with a disk, test 1541 or something. It came with a "DOS WEDGE" program, you load that and get a few new commands $ for dir, / for load, like that. Super nice to have
The C64 was really done dirty by Commodore's cheapness to not pay proper license for the version of Basic they included, so they included an ancient version on their most advanced machine at the time.
1: WATFOR77, an enhanced FORTRAN compiler I used in the 80s, had the double ended WHILE / UNTIL loop construct. 2: I would imagine the P parameter to BSAVE is intended to be a mnemonic for Pointer.
Brings back memories of using my c128 I have dragged it out but still not powered it up since the 90,s as I was still supporting some legacy CPM system. Even though I had Amiga by then to play games and office applications.
This is really awesome! Some commands reminds me of the BASIC 3.5 of the C16 which I started to program with in the 80s! It's a wonderful flashback into the 80s including some AH!-effects! Great job, Robin!
The C128's extra features still didn't include my favourite feature from the VIC20's SuperExpander: being able to scroll up and down through a BASIC listing using CTRL+A and CTRL-Z.
Some of these BASIC commands are inherited from BASIC 3.5, which is featured in the 264-series machines (C16, C116, Plus/4, etc...). The WINDOW, TRAP, GRAPHIC, BOX, CIRCLE (and of course MONITOR) are present there too. I was goofing around with the CIRCLE command a few months ago and it turns out that in addition to ellipses, you can draw any N-gon like triangles, squares, pentagons, all the way up to the limits of the screen resolution and integer overflow. It seems that after about 25-sides, the polygon becomes indistinguishable from a circle :)
@@rigues I used the following in BASIC 3.5: 10 GRAPHIC 1,1 20 CIRCLE 1,160,100,88,88,,,,120 This is from my notes, and I forget the proper definition of the last parameter for CIRCLE. It controls the length and angle between adjacent sides in the shape, and I think it is supposed to be used to draw arcs. If you omit it and just specify the co-ordinates, a proper circle is drawn.
Making simply a constant tone sound on a C-64 requires the following commands: POKE 54296,15 (sets the volume to maximum) POKE 54278,128 (sets your Sustain to maximum) POKE 54273,80 (sets your tone's frequency) POKE 54276,17 (activates your tone on Voice 1, using the Triangle waveform) And if you want to turn off the tone, then: POKE 54276,16 Some optional sound POKEs: 54272 (minimum frequency) and 54277 (sets your Attack/Decay)
Very enjoyable. Amazed to still be learning new stuff about the 128 after all these years. Now I’ll have to binge the other videos of yours I’ve missed.
In BASICA (IBM BASIC), as well as GW-BASIC for PC clones, your cursor, as well as the text that you'd write, would be visible in the bitmap screens (probably because even CGA cards had more video RAM than the C-128's VIC II Chip had). Albeit, the cursor in BASICA/GW-BASIC's bitmap screens was in the form of an unblinking block. If you had an EGA card, then you had several additional bitmap "screens", including an 80-column screen that could display 16 colors at once.
I had a C128, loved its BASIC, I made a lot of BASIC programs using sprites and graphics commands for 3D applications and trigonometric functions or 2D graphics functions too. Used a lot escapes sequences for screen editor and new commands for structured programming. The SOUND command for making sounds and of course PLAY for music. Thanks to the Monitor I started to programming in assembler, another cool thing that I discovered playing games in C64 mode was after reset to C128 some of the game code still kept in memory so using Monitor I could discover in some games where the lives were drecemented then changed the instructions for NOPs with some POKES after the game was loaded in C64 mode so that way I had infinites lives lol
Most of the disk commands feels like just new labels on existing commands. I only had a 1541 for my c64 and quickly learned the few "OPEN" commands you really needed in every day use.
This video just reminds me again of the achievements of Commodore post Tramiel. Its unlikely he would have approved such a lavish final 8-bit treatment. Nearly everything else went wrong but this product they got right. Even if its development killed the LCD project (ref: Bill Herd).
The interpreter has more overhead due to the bankswitching it has to do, but you do get a lot of powerfull commands in return which can make at least some programs more efficient (and hence spending less time in the interpreter loop)
Yeah but if you don't need the screen for some time you can go FAST, in 80col mode even permanently. Plus it is much easier to add an assembler routine for things you need to go real fast using MONITOR, and to load and save those routines BLOAD and BSAVE 😊
@@c128stuff not just banking. It has to go through more possible basic command possibilities, and the irq routine does more like that sprite move routine and the split graphic mode.
@@Lofote that irq routine does more, but that isn't that expensive really. More commands matters somewhat, but more during tokenizing. The overhead of reading data from bank 1 and code from bank 0 however is quite significant. Just consider the difference in cycles between an lda (zp),y versus the indirect fetch which the basic interpreter has to use everytime it needs another byte of data or code. I write a fair bit of 128 mode code, and if you can write your code to avoid that indirect fetching scheme, there are significant gains to be had. This is especially true when having to copy around data (screen updates etc).
thank you so much, loved the trip down memory lane!! you mention the 2mhz mode, was that the FAST/SLOW basic command? i thought i used it in normal 40columns, the screen used to go off but it drew my picture at twice the speed. 😀
36:00 or even better just press F3 for DIRECTORY ;)... I believe you didn't list that. By the way you can also customize F keys with the KEY command. 41:30 I am pretty that checking a LOT more opcodes also makes the BASIC much slower, not just banking.
try/catch: Exactly! And the garbage collection known from languages like Java was there already, too, even if it only had to handle strings in Commodore BASIC.😊
12:52 Interesting that yours starts cleared here. My flat 128 always starts with the top full of initialized memory junk so I'd developed a habit of clearing the screen automatically.
I have a Commodore 128. I have JiffyDOS installed. JiffyDOS adds faster disk routines also included the latest patches. You can also lock the Commodore 128 in 64 mode by typing the following statements: BANK 1: POKE 65529,255:POKE 65528,77 Then type SYS 65341. You will be in 64 mode. Now when you reset, it stays in 64 mode, which eliminates the annoyance of having to type GO64 or SYS 65357. The only way to completely exit is to shut down the computer. BASIC 7.0 is a cut above BASIC 2.0. Much easier to program without all those annoying POKE statements.
Glad to hear you're feeling better. Never had much experience with 128s, but this is cool stuff. Thanks for showing us. "Oh great... another mouth to feed" haha poor Bit.
Wish I had has a 128 back then instead of a 20 and 64, but on the other hand, if I had, I would of stuck with the platform longer. My platform becoming hopelessly outdated forced me to jump ship. Now I have a PET, 128, 128D, 64, 20, in multiples... but in 30 years haven't turned a single one on save for the PET once (because there was nothing to wire up.. you just flip the switch). That must of been back in 1995. I don't dare now or I'll probably blow a cap. I went from 20 to 64 Basic to PET Basic to Microsoft Quickbasic on a PC AT to Quickbasic on a Mac to FutureBasic on a Mac and that was the end of it.
Heh.. VDC and being slow.. screen editor is rather optimized for the cpu addressable video ram setup you get with a vic2. If an implementation had been written optimized for VDC, it would have been much faster than it is now, and for as far as text mode is concerned, also faster than vic2 in many cases, especially things like scrolling. It has some very rudimentary but quite usefull acceleration features, which let it do vram to vram copies and vram fills in parallel to the 8502, but those can also be used as a hardware assisted rle decoder for transferring data from system ram to vram faster.
There are some great additions to the BASIC I grew up with! Some the VZ machines already had like auto line numbers and the else command but the screen editor commands would have been so handy, especially inserting blank rows and the sprite editor would have saved a small forest of grid paper! Thanks Robin!
43:00 Regarding the slower BASIC processing on the C-128, for situations where video output isn't critical, there is always the FAST command which blanks the screen and doubles the CPU speed to 2 MHz.
Amazing as usual Robin! Would love some more assembly coding content in case you’re so inclined. Or music! I know you’re a musician, do you make c64 music or mostly guitar stuff?
There is no comparison: BBC BASIC was best 8 bit BASIC I know of, it has procedures/functions (for real structured programming like in Pascal). On C128 v7.0 BASIC you have no procedures nor functions (program functions) and even worse: they maintain original limitation from Microsoft 6502 BASIC: variable names only take 2 characters (the other are ignored, so AA, AA1 and AA2 variables are the same variable). I had a C128, and no BBC computer.
You just happened to bring up my all-time favorite Commodore game, Ultima V!! haha. And I did run it on a 128 as well. Gosh, I loved that game. It was weird how you had to level your characters. You had to encamp and hope an "apparition" appeared, which was Lord British (whom was missing) and he would grant you new levels!
OMG renumber alone would have made me so happy when I was a kid. I wrote long programs and they constantly turned into a mess. But yeah there is a lot of stuff I would have loved. I didn't know about any of this.
Question: are you going to buy a MEGA65 in the future? It could be great to see many video on that retro/modern computer !! It’s a little buggy so you could help them out !
With the sprite, once you edit it, how would you save it? Like i could see writing a basic program, and using that to edit my sprites, but how would i go about saving/restoring the sprite bitmaps to disk? (Nevermind. you cover this at 38:00)
Getting the C=128D with BASIC 7.0 after having the C=Plus/4 with BASIC 3.5, I had a leg up on most of the enhancements, since 3.5 has a lot of the 7.0 commands, like for example: AUTO, RENUMBER, DRAW, CIRCLE, DIR, DLOAD, DSAVE, et cetera.
Great things about the C64: • Graphics • Sprites • Music Things not supported by C64 basic: • Graphics • Sprites • Music Always annoyed the hell out of me
Curious if the renumber command will fix all the numbering within the code? Say if you have a command "goto 145" and 145 is now called 70, will it fix the numbering in the code or will it break the program?
Oh, it's almost like vi 😅 Would be crazy to have this on my spectrum back in the day. Unfortunately it's like reading some amazing news in the newspaper from 30 years before. Today you would program in the modern environment anyways and compile in to the virtual machine.
Don't forget Atari Basic would compile code into P-Code and thus didn't need to be interpreted when running. It would check the syntax and would use abbreviations to cut down on typing (pos. = position , etc.).
I never had a c128 but these are interesting. I wonder why they didn't stick with the same letter combos as vi, as some of these codes match up but maybe that's just coincidence.
The sprdef seems to just store it in memory somewhere? How do you know which VIC bank it is in and it surely can overwrite your basic program if its in same memory? Seems a bit dangerous. Also a programmer would have to get that sprite data out somehow into their program. Is there a command for making e.g. data statements or was it perhaps expected he would know where in memory that was and do a BSAVE onto a disk and just do a BLOAD in the start of your program I guess ? Same with the graphics command, can you control where the bitmap is created?
This is from memory--might not all be accurate... There's a set of eight predefined memory slots for sprite graphics so they won't be disturbed. The main thing the sprite commands by themselves can''t do is "cel animation". From the commands' perspective, the sprites are hardwired to those memory slots; but you can always change the sprite pointers manually. You can BLOAD and BSAVE sprite data to/from that part of memory no problem; also there's "rubber stamp" get/put commands that, if I recall correctly, can go from bitmap to sprites and vice versa. The grabbed graphics data are stored in a string so there''s a limit on size. Whenever you first use a GRAPHIC 1 through 6 command, it moves the BASIC program and start of memory up 9K and there's a predefined space for the bitmap screen (8192-16191) and a second screen memory block in addition to the usual 1024-2023 (allows for independent splitscreens). The VIC chip always uses the first 16KB "bank". It'll stay allocated from then on so you can do something like GRAPHIC 1: GRAPHIC 0 first thing in your program. GRAPHIC CLR deallocates it. But doing either of these after DEF FNs breaks them--whoops. Also there are two 1K color memory blocks (both at 55296 like usual), and the 128-specific memory manager has two settings, one for which the VIC chip sees, and the other what the CPU sees. This allows for fully independent splitscreens with multicolor bitmap mode.
I'm not aware of any way to get C128 BASIC programs to run on the C64. I imagine it'd be possible with a LOT of work to port C128 BASIC to the C64, but you'd end up with very little RAM free. Probably better to use one of the C64 add-on language cartridges such as Simons' BASIC or Super Expander 64 that provide some (but not all) of these features.