The Commodore 64 - a technical perspective

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] few computers have had a greater impact on the history of computers than the commodore 64. released in august 1982 by commodore business machines it ended up as the best-selling computer of all time with somewhere between 15 and 17 million units sold [Music] among the myriad of home computers that were released during the early 1980s the commodore 64 evidently had a winning formula something nobody could have predicted in advance now on paper it didn't seem particularly different from any of the other home computers at the time it had 64 kilobytes of memory had 16 colors that were somewhat limited it had hardware sprites and it used the cheap and aging mod 6502 asset cpu and it had a three voiced synthesizer chip in this regard the computer hardly seemed different for many of its competitors such as the zx spectrum or the later amstrad cpc so why was it so successful more than 10 000 commercial software titles were made for this computer with new releases popping up almost weekly even today the game library for this computer is vast and the legacy of these games have influenced the gaming industry in more ways than one even people who aren't interested in computers have probably heard about the commodore 64 and might be familiar with some of its fabulous titles however where there are commercial titles there will always be pirates the commodore 64 quickly grew a cracking scene people who use their technical skills to bypass copy protection and then distributed the cracked games through old school methods such as regular mail and copy parties now it was customary for these crackers to add a small intro to their cracked game presenting the name of the group of people who had performed the deed usually with some flashy graphics and great sound over time these visually appealing crack trolls quickly became more elaborate using elegant programming and hardware tricks to present increasingly advanced features in fact several of these effects were discoveries bugs in the graphics chip that were uncovered and exploited by groups of coders soon the intros themselves became the goal of these groups who now started competing with each other in order to show off their superior skills with time these intros grew in length and became standalone applications the demo was born these various groups would meet up at demo parties and compete in official competitions and their rivalry was fierce i say was but the truth is that the commodore 64 demo scene is still very much live today now i know this because i do participate in these competitions [Music] 40 years later the commodore 64 has without doubt the most active community of any old computer in 2021 alone there were more than 3 000 new releases for this platform games demos music and graphics people attend demo parties groups engage in friendly competition and generally try to impress each other by creating new and never-before-seen demo effects even though the hardware hasn't changed in 40 years people still find new and strange ways to tweak the machine to make it do things that it seemingly shouldn't be able to do the first demo that was made for the commodore was arguably the season's greetings christmas demo from commodore itself back in 1983. with its crude graphics and basic sound the developers made something that utilized the new hardware in a way they thought it should be used today the highly advanced effects that people have managed to squeeze out of this old bread bin would have blown anyone away back in 1983. all of the effects that i'm showing here are from modern demos and all of them should be impossible to do on this one megahertz computer so i'd like to return to my early question why is the commodore 64 still so successful and by many regarded as a perfect computer [Music] i personally believe that it all boils down to a couple of seemingly insignificant but vital design choices if you have a look at the palette of almost any other computer from this era such as the zx spectrum the bbc micro or the visa 200 you'll quickly notice that they are all saturated red green blue purple white and perhaps even more vivid versions of red green blue and purple while modern artists still release impressive graphics for these computers they are severely restricted by the somewhat extreme colors the commodore on the other hand had an ace up its sleeve not one not two but three shades of grey five if you count black and white in addition to this the color palette itself is a bit more washed out than the garish colors of the bbc or the zx spectrum it seems as if our human eyes simply agree with images that are less saturated and nowhere is this more evident than what is produced by the commodore 64 artists themselves [Music] the viktor chip or the video interface chip is the gpu of the computer and is responsible for the video output it's got a lot of quirks but it's surprisingly versatile the vic 2 chip provides eight glorious pixels of hardware scrolling in both horizontal and vertical direction which is a feature that is quite painful to implement if you don't have it in hardware hardware scrolling is essential for scrolling in games but also moving around all of that fancy text in addition to this the viktor chip serves you 8 hardware sprites that are completely independent from the rest of the output and can be positioned at any given point on the screen independent of the background early on codis realized that it was possible to trick this chip into doing various things that the designers hadn't intended stretching bending manipulating and even crushing the output to produce seemingly impossible effects in addition to this the viktor chip can only see 16 kilobytes of data at the same time but you are able to change where it sees what this made it possible to rapidly change the video output without moving around large amounts of data remember speed is essential on a one megahertz computer [Music] the sound interface device or the sid chip is perhaps the most iconic part of the commodore 64. while some of the earlier computers such as the ibm pc only had a single one-bit beeper as their internal sound output others used a dedicated synthesizer such as the general instrument ay3-89110 now this chip had a distinct old-fashioned 8-bit sound to it and was used in a variety of systems such as the zx spectrum and the amstrad cpc however commodore decided to design its own synthesizer chip from the ground up and managed to produce an exemplary piece of hardware the 6581 or 8580 or simply the sid with high performance frequency control the sid could boast three separate programmable audio oscillators four different waveforms programmable filters ring modulators and individual attack decay sustain release volume controls for each channel the sid chip produced an entirely quintessential sound of the 1980s while this next topic applies to most fields of creativity you shouldn't underestimate the insane effects of creative limitations with modern technology it would be easy to implement everything that a commodore 64 could do in unity or even javascript with millions of colors infinite ram and the speediest of multicore cpus from tsmc you should in theory be able to produce vastly better code and art so why don't you having a one megahertz processor with only 64 kilobytes of memory and 16 colors will force you to think about your design choices the placement of every single pixel matters and both the size and speed of your code is essential and you are quickly guided through a narrow field of creativity or frustration let's have a deeper look at the anatomy of the commodore 64. first of all it uses the mos 6502 cpu which was developed in 1975 by the wonderful truck pedal the cpu has 3510 transistors and operates around 1 megahertz it was intended as a cheaper option for the motorola 6800 and is therefore more limited in fact the cpu only has a single common register the accumulator together with two index registers the program counter the stack register and the cpu status register its 16-bit address bus is able to access 65 535 bytes of memory where the first 256 bytes are designated as the zero page or special memory that allow you to make up for some of the shortcomings of the cpu you'd think that it would be rather painful to cut for a cpu with only one register but you'd be wrong remember that creative limitation having only a single accumulator makes the instruction set clear and easy to use in fact in spite of all its shortcomings i personally feel that programming for the cpu is a wonderful experience we'll definitely encounter some 6502 assembly code later in this video series as the name implies the computer has 64 kilobytes of addressable memory ignoring the built-in basic which i'll totally disregard almost all the memory is available to the programmer with a couple of exceptions since there isn't any overarching operating system you are in absolute control code and data are mixed together and aren't distinguished in any meaningful way however a major feature of the commodore 64 is that the video ram is shared with regular ram on the upside it means that you can quickly update this screen by manipulating ram directly the downside is obvious you have less memory available for your code and data since it needs to be shared with whatever you intend it to display on the screen since space is limited any application will need to constantly rearrange the puzzle that is the memory layout moving code blocks around deciding which parts can be overwritten and making sure the data is sufficiently compressed it sounds like hard work but it's actually fun hard work now the api of the commodore 64 is quite simplistic in its layout remember those unavailable memory locations that's where the api resides it works like this you change your byte in a specific memory location say address d20 and the computer will change the border color to the color associated with the number you just typed in change another byte in memory and you might switch from text mode to graphics mode the viktor chip of the commodore 64 provides the computer with two graphics modes bitmap mode for displaying images and text mode for text but also graphics we'll get to that part later let's start by exploring the text mode in text mode this screen is divided into 25 columns with 40 rows of single byte cells this means the entire screen in text mode takes up 1000 bytes when disregarding colors each cell will contain a single character selected from a font which also has to reside somewhere in rom or memory since the cells only take up the byte of memory the font itself is restricted to 256 characters by simply changing a byte in ram where the screen data is located you can switch between characters for colors there's another thousand byte fixed position in memory that controls the color data and by changing a value in color ram that corresponds to the text cell you can replace the text color into any of the 16 available colors in a single cell the background color is shared among all the characters on this screen if you're expecting to be able to freely distribute your pixels in any modern sense you're in bad luck a raw bitmap of 320 by 200 with 16 colors would take up 32 000 bytes of data or 50 percent of the entire capacity of the computer while some computers most notably the bbc micro and amstrad went for this rather overkill approach it basically renders the computer useless for nice looking games and demos so instead the commodore went with a hybrid approach practically a high-res 320 by 200 image on the commodore exists only in a single bit plane where each pixel is represented as a single bit and one byte now represents 8 pixels therefore the entire bitmap data only takes up 8 000 bytes instead of 32 000. this screen is still divided up into the familiar 40 times 25 grid and the rule of the text coloring still holds true you can add color to each cell by accessing the same color location as in text mode you'll quickly notice that no cell ever contains more than two colors while this limitation might seem harrowing and perhaps it is people are still able to produce excellent art in this mode although it requires some patience and planning [Music] in 160 x 200 multi-color mode you can use one extra color herself in addition to using a global background color but the horizontal resolution is now halved nevertheless this is usually the preferred mode for commodore artists and the myriad of unbelievable art created by the community is hard to ignore here too you can see the color restrictions at hand you won't be able to find more than four colors per cell while the bitmap mode is suitable for showing off your pixel art skills most games tend to avoid this mode because of the heavy penalties of pushing around bitmap data updating the entire screen would require moving around 8 000 bytes which is basically impossible to do in a single frame [Music] this is where the strength of the text mode becomes apparent remember that in text mode changing a single cell requires only a single byte in comparison with bitmap modes 8 bytes this means that you can fill the entire screen using only a thousand bytes which is actually possible to do within a single frame while the commodore 64 boots up using the standard petsky rom font you are perfectly allowed to change this font by moving the character set pointer of the vic chip since the font consists of 256 8 byte characters it really isn't a font at all but rather tile graphics in other words if you're able to fit your entire image into a set of 256 characters or about 25 percent of the original bitmap size then you can use text mode however this is where compression and reusability becomes a factor images can be designed to reuse data and a smart design will be able to minimize the use of characters in order to maximize the size of your image since you can change the font data in real time all instances of this specific character will be updated in real time on the screen you can even pack several frames of video data into a single character set this is such an example of a video that contains two frames per character set in a total of 12 character sets providing 24 glorious frames in total finally you can mix and mash these various methods together and a big part of the commodore 64 demo scene is all about coming up with novel ideas that nobody has seen before democenors will often go to great lengths to both improve and add lots of design to the respective parts before a demo is released it's actually not uncommon for the very best to sometimes spend hundreds of hours on a single demo effect if you are a democena or you have experience with programming for the commodore 64 then none of these topics should be new to you but if you are unfamiliar with this old hardware it might seem a daunting task to be able to create anything at all for this quirky computer this is exactly the challenges these turbo rascal video series will try to tackle in an easily digestible manner turbo rascal also includes an abundance of example files and tutorial projects covering almost all of the topics touched upon in this video programming for the commodore 64 has never been more accessible in the next episode i'll hopefully start introducing turbo rascal's syntax error by going through the various tutorials that i included with the ide if you are interested in learning about how to code for the commodore 64 in the best way possible do check out turborascul.com and finally thanks for watching this video [Music] you
Info
Channel: Nicolaas Groeneboom
Views: 8,926
Rating: undefined out of 5
Keywords:
Id: L2NdJkTVzvk
Channel Id: undefined
Length: 20min 57sec (1257 seconds)
Published: Mon Jan 24 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.