Tagged: C64 Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 3:44 pm on April 18, 2018 Permalink | Reply
    Tags: , C64,   

    Categories: Commodore ( 38 )

    Flashing Border Colors on the Commodore 128 in Machine Language 

    In this screencast I’ll show you how to create the iconic flashing borders on Commodore machines. Back in the day, when the system was loading, this was a nice way to indicate that the computer is busy doing something rather than being dead. I’ll show you the principle both in BASIC and in Machine Language on the C128. The VIC-II chip is the same on the C64 though, so this will also work on the Commodore 64.

    The same approach can be used on the Plus/4, however the addresses for the border and background colours are different (decimal 65305, or hex $FF19).

    The VIC-20 is another story, as the border and background colour are changed using the same address (decimal 36879, or hex $900F). This link may help though: http://www.sleepingelephant.com/ipw-web/bulletin/bb/viewtopic.php?t=5905

    As always, enjoy ๐Ÿ™‚





     
  • Jay Versluis 3:42 pm on April 17, 2018 Permalink | Reply
    Tags: , , C64,   

    Categories: Commodore ( 38 )

    Programmatic Loops in Commodore BASIC 

    In this screencast I’ll demonstrate how to use programmatic loops in Commodore BASIC.

    I’ll show you how to use the FOR/NEXT loop (available in all versions of Commodore BASIC), as well as the DO/WHILE loops (available on the Plus/4 and C128).

    Enjoy!





     
  • Jay Versluis 3:29 pm on April 16, 2018 Permalink | Reply
    Tags: , , C64,   

    Categories: Commodore ( 38 )

    Flow Control in Commodore BASIC 

    In this screencast I’ll explain the concept of Flow Control in Commodore BASIC. It’s kind of a video update of a post I did a while ago.

    In essence, it means that we can tell the programme to take a different route in the code depending on a condition that’s met. We’ll explore the IF/THEN and ON… GOTO/GOSUB statements (available on all versions of Commodore BASIC), as well as the expanded IF/THEN/ELSE version (available on the C128 and Plus/4 only).

    In addition, I’ll also show you how to use the BEGIN and BEND clauses that were introduced with the C128.





     
  • Jay Versluis 3:12 pm on April 5, 2018 Permalink | Reply
    Tags: C64   

    Categories: Commodore ( 38 )

    Thoughts about the C64 Mini by Retro Games Ltd 

    In Europe, the brand new C64 Mini has just been released. Although I don’t have one myself, I’ve been following the Indiegogo campaign and have watched several “unboxing reviews” on YouTube. I must admit it’s a neat little machine, and I like the idea of somebody making the Commodore days available to a new generation of users.

    However, I can’t stop thinking “what’s the point of this exercise?”

    Don’t get me wrong, it’s not that I dislike the idea of Commodore BASIC making a re-appearence, or of new Commodore “herdware” being developed. Quite the opposite in fact.

    What I can’t understand is why the hardware needs to be built on an emulator rather than real hardware. Because we HAVE that already, and completely FREE at that. We therefore do not need exotic hardware that’ll quite probably be off the shelf in a matter years.

    I feel that it was different with the C64DTV project, with which Jeri Ellswoth reverse engineered the whole system using a new and combined chipset, basically building a new C64 wit modern components.

    The Mini on the other hand – at least as far as I know – is a down-stripped Linux box which runs a software emulator. It could emulate anything. I might as well run VICE on my modern (and replaceable when broken) laptop, plug in a USB controller and get the same result. For free.

    Why Mini?

    If a company goes through all the trouble to recreate the C64 with modern components, I feel they should recreate the whole thing rather than something we already have access to.ย If it’s all about “some output on the screen”, then an emulator output or dedicated hardware output are arguably the same. And I guess that’s what the Mini project is all about: plug-and-play screen output.

    But what I’d be more interested in is a fully reproduced piece of hardware, something to which I could solder homebrew stuff on the user port, or something I can plug in real floppy drives. I guess a fully recreated system is what I’m asking for, one that looks AND behaves exactly like the old breadbin. A system that lets me POKE a value and set a line on the cartridge port on high. That sort of thing.

    With that in mind, I can’t help but wonder who the target audience of the Mini is. Total geek enthusiasts (like me and thousands of others around the globe) won’t be happy with a compromise. So perhaps it’s newcomers who hadn’t been born when the real Commodore devices were around? I wager that they might not care about pixelated slow and way-too-hard-to-enjoy retro games. Who then is the Mini aimed at?

    Full-sized and Hand-held versions

    A full-sized authentic recreation, as announced in the original crowdfunding campaign, definitely YES. I’m looking forward to that. Likewise, I can see the appeal of a handheld pocket sized version that plays old-school C64 games. Love both of those ideas. Both of these were annouced in the campaign

    But the Mini? I just can’t see the point. If I want to play C64 games like back in the days, I might as well just play them on an emulator, or on authentic nostaliga hardware – with a fully working keyboard all.

    Another question I have is, how did it go from these two models to the Mini in the first place? Whose idea was it, and what was the reasoning behind it?

    Conclusion

    I’m not bemoaning the project, not at all. I just don’t quite understand why we have it, that’s all.

    I give Retro Games 10 out of 10 for the idea, and for seeing it through to release. But I can’t understand the concept of the Mini, or why it was produced at all (since it wasn’t part of the original idea behind this campaign). So only 5 out of 10 for that.

    I’m interested to see the full size version as well as the handheld version. But I can’t see myself buying a Mini at this point.

    Sorry ๐Ÿ™





     
    • Mark Wilson 6:03 pm on April 5, 2018 Permalink | Reply

      “But what Iโ€™d be more interested in is a fully reproduced piece of hardware, something to which I could solder homebrew stuff on the user port, or something I can plug in real floppy drives. I guess a fully recreated system is what Iโ€™m asking for, one that looks AND behaves exactly like the old breadbin. A system that lets me POKE a value and set a line on the cartridge port on high. That sort of thing.”

      Sounds like you want the Ultimate 64, FPGA re-implementation of the C64 from the guy behind the awesome 1541 Ultimate 2… http://www.ultimate64.com

      However, the C64 Mini does look cute, and if they ever fix the god-awful joystick, I’ll probably buy one on that basis alone… ๐Ÿ˜‰

      • Jay Versluis 7:52 pm on April 5, 2018 Permalink | Reply

        Mark! Yowser! That is EXACTLY what I’m looking for – thank you so much for bringing this to my attention! And it’s described on Gideon’s FAQ section so much better than I could put it into words: it’s an implementation rather than an emulation, which is what attracted me to the C64DTV back then.

        Besides, I really like the price point of the Ultimate 64. I bought a couple of (sadly not working) original 64’s on eBay a few years ago, for about $40 each. Today people are asking close to $200 for an old C64 – that’s almost ludicrous. But at the same time it shows the demand that’s out there.

        Thank you so much for the tip – I’ll keep my eye on the Ultimate 64 ๐Ÿ™‚

  • Jay Versluis 12:10 am on April 2, 2018 Permalink | Reply
    Tags: , , C64,   

    Categories: Commodore ( 38 )

    How to print Numbers as Columns in Commodore BASIC 

    In this video I’m demonstrating how to print numbers in evenly spaced columns in Commodore BASIC.

    On the C128 and the Plus/4 we can use a nifty little function called PRINT USING for this, with which we can format the output of any printed text or variable.

    On the C64 and VIC-20 that function doesn’t exist, so we’ll have to convert a numeric value into a string (using the STR$ function), and then determine how long our string is. Following that we’ll have to manually pad our string value with as many spaces as are required. (More …)





     
  • Jay Versluis 10:17 am on April 1, 2018 Permalink | Reply
    Tags: , C64, ,   

    Categories: Commodore ( 38 )

    Sorting an Array on the Commodore 64 

    In this video I’ll demonstrate how to sort a numeric array on the Commodore 64. The same principle works for string arrays, and of course on all other Commodore BASIC computers.

    The technique I’m using here is called Bubble Sort: in effect we’re comparing the first two items in the array, and if the left one is larger than the right one, the values are swapped around. This loop continues until all items in the array have been compared and sorted (hence the smallest items “bubble” to the front of the array, much like the smallest bubbles in a soda float to the top first).

    Here’s the full code I’m building, including the lottery portion. The Bubble Sort code starts in line 200.

    10 x=rnd(-ti)
    20 for i=1 to 6
    30 rn=int(rnd(1)*49)+1
    40 for j=1 to i
    50 if n(j)=rn then 30
    60 next j
    70 n(i)=rn
    80 next i
    100 print:gosub 200
    110 for i=1 to 6
    120 print n(i);
    130 next
    140 print
    199 goto 20
    200 rem bubble sort
    210 for i=5 to 1 step -1
    220 for j=1 to i
    230 x=n(j):y=n(j+1)
    240 if x>y then n(j)=y:n(j+1)=x
    250 next:next
    299 return

    I’ve explained how to build the lottery generator in this code here: https://wpguru.co.uk/2018/03/how-to-generate-lottery-numbers-on-the-commodore-64/

    Happy retro hacking!





     
  • Jay Versluis 12:39 pm on March 31, 2018 Permalink | Reply
    Tags: , C64,   

    Categories: Commodore, Screencast ( 38 )

    How to generate Lottery Numbers on the Commodore 64 

    In this video I’ll demonstrate how to draw random lottery numbers on a Commodore 64. The secret sauce here is not only the RND function to generate random numbers, but also two loops inside each other that prevent the same number from coming up more than once.

    Here’s the lottery generator code:

    10 x=rnd(-ti)
    20 for i=1 to 6
    30 rn=int(rnd(1)*49)+1
    40 for j=1 to i
    50 if n(j)=rn then 30
    60 next j
    70 n(i)=rn
    80 next i
    100 print
    110 for i=1 to 6
    120 print n(i);
    130 next
    140 print
    199 end

    To adapt this listing to match your local lottery, change line 20 to the amount of numbers to be drawn from your pool (6 in my example), and change the value in line 30 to match the size of your pool (49 in my example).

    Any questions, please let me know below.

    Happy retro hacking!





     
  • Jay Versluis 9:45 am on March 29, 2018 Permalink | Reply
    Tags: , C64   

    Categories: Commodore, Screencast ( 38 )

    How to build a Word Splitter on the C64 in Commodore BASIC 

    In this video I’m demonstrating how to build a word splitter on the Commodore 64. We’ll use string functions to parse a sentence and split each word off into an array of words so that they can be analysed later (for example, as part of an adventure game).

    Here’s the code I’m building:

    20 input a$
    30 gosub 100
    40 print:print wd;" words:"
    50 for i=1 to wd
    60 print wd$(i)
    70 next
    99 end
    100 rem word splitter
    110 lt$="":wd=1
    120 for i=1 to len(a$)
    130 lt$=mid$(a$,i,1)
    140 if lt$=" " then wd=wd+1:next
    150 wd$(wd)=wd$(wd)+lt$
    160 next
    199 return

    The interesting part starts in line 100 and onwards, where I’m building a subroutine that deals with the string functions. In line 110 I’m resetting/initialising two of the three important variables: LT$ holds a single letter from the phrase we’re getting in A$, while WD is counting each word we’re splitting out.

    The FOR loop in line 120 parses each letter of the phrase, and if it finds a space character (line 140), the word count is increased. If the letter is not a space, then it’s added to the current word held in WD$(WD). The current word is assembled character by character.

    Apologies for the audio quality, I did this on my laptop while sitting on the balcony, hence sea planes flying overhead can be heard (as well as the neighbours dog and kids).

    Happy hacking ๐Ÿ™‚





     
  • Jay Versluis 9:58 am on March 28, 2018 Permalink | Reply
    Tags: , C64   

    Categories: Commodore, Screencast ( 38 )

    How to build a time of day clock on the Commodore 64 

    In this video I’ll demonstrate how to build a simple clock on the C64. We’ll go through this process step by step, including the built-in TI and TI$ variables, string formatting with LEFT$, RIGHT$ and MID$, as well as screen formatting.

    Here’s the code I’m writing – works in Commodore BASIC v2 and above:

    5 input "qwhat is the current time (hhmm
    ss) ";ti$
    10 print chr$(147):print chr$(5)
    20 a$ = left$(ti$,2)
    25 a$ = a$ +":"
    30 a$ = a$ + mid$(ti$,3,2)
    35 a$ = a$ +":"
    40 a$ = a$ +right$(ti$,2)
    50 gosub 200
    60 print chr$(19)
    70 print "qqqqqqqqqqq]]]]]]]]]]]]]]curre
    nt time"
    80 print "]]]]]]]]]]]]]]]]";
    90 print a$
    100 goto 20
    200 rem print a box
    210 print chr$(19)
    220 print "qqqqqqqqqq]]]]]]]]]]]]]UCCCCC
    CCCCCCCI"
    230 print "]]]]]]]]]]]]]B]]]]]]]]]]]]B"
    240 print "]]]]]]]]]]]]]B]]]]]]]]]]]]B"
    250 print "]]]]]]]]]]]]]JCCCCCCCCCCCCK"
    299 return

    Many of the characters that appear in this listing are cursor control characters and appear in reverse in the video. They either position the cursor or print PETSCII graphics.

    Inspired by David’s video, in which he connects an LCD screen to his C64’s User Port: https://www.youtube.com/watch?v=vV8FbwobrKY





     
  • Jay Versluis 9:51 am on March 27, 2018 Permalink | Reply
    Tags: , C64   

    Categories: Commodore, Screencast ( 38 )

    How to create random YouTube URLs in Commodore BASIC v2 

    In this episode I’ll demonstrate how to create those seemingly random YouTube Video IDs using a Commodore 64.

    Here’s the code I’m writing – works in BASIC v2 and above:

    10 print chr$(14)
    20 gosub 100:x=rnd(-ti):cn=1
    30 a$="https://youtu.be/"
    40 for i=1 to 11
    50 rn=int(rnd(0)*62)+1
    60 a$=a$+yt$(rn)
    70 next
    80 print:print cn;" : ";a$
    85 cn=cn+1
    90 goto 30
    85 cn=cn+1
    90 goto 30
    
    100 rem populate array
    110 dim yt$(62)
    120 i=1
    130 for j=65 to 90
    140 yt$(i)=chr$(j)
    150 i=i+1
    160 next j
    170 for j=193 to 218
    180 yt$(i)=chr$(j)
    190 i=i+1
    200 next j
    210 for j=48 to 57
    220 yt$(i)=chr$(j)
    230 i=i+1
    240 next j
    299 return

    The first line switches to lower case letters (I forgot to show that in the video).

    NOTE: In addition to the upper case and lower case alphabet, and the numbers 0-9, YouTube also use two special characters that I forgot to mention in the video. One is the standard minus sign (-), and the other one is the underscore (_). The Commodore machines cannot produce the latter. For simplicity’s sake, I’ve left both of those out (just though I’d mention it here).

    Inspired by Tom Scott’s video “Will YouTube ever run out of Video IDs” – watch it here: https://www.youtube.com/watch?v=gocwRvLhDf8





     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel