Commodore Banner Exchange
Get a site

Retro64: Commodore 64 programming, repairs and more

Retrocomputing and repairs, C64 and others

MENUMENU
  • Retrocomputers repair
  • Programming
  • Youtube channel
  • Retrotechnologies
  • Game reviews
  • Home computers history
  • Electronics
  • Articoli in italiano
  • Chi sono / About me
  • Contact me
  • Math for programming

Category: Programming

Calculating an approximate value of PI, another method

Programming September 7, 2020
I was having a look at a method of calculating an approximate value of PI without resorting on random numbers.... Read more »
Chaos game: fractals by using random numbers (C64 BASIC)

Chaos game: fractals by using random numbers (C64 BASIC)

Programming September 4, 2020
Again on random numbers. This time, we’ll have a look at how to generate fractals by using random numbers. It... Read more »
Estimating PI using Monte Carlo Method (C64, BASIC)

Estimating PI using Monte Carlo Method (C64, BASIC)

Programming September 3, 2020
OK, it’s not PI day, but I wanted to have a trial at estimating PI using Monte Carlo Method anyway.... Read more »
C64 BASIC: ECM and MCM scrolling routines

C64 BASIC: ECM and MCM scrolling routines

Programming September 2, 2020
I have been still doing experiments with C64 BASIC this week. Again, I have been working on scrolling routines. This... Read more »
Big moving letters with Commodore 64 BASIC

Big moving letters with Commodore 64 BASIC

Programming August 31, 2020
Being bored myself of my usual checkerboard routines, by using their principles I wanted to have a try at something... Read more »
Animations with Commodore 64 BASIC: zooming chessboard

Animations with Commodore 64 BASIC: zooming chessboard

Programming August 19, 2020
A zooming chessboard is a classic on demo coding. Assembler is a must here if you want the effect to... Read more »
Commodore 64 clock using the CIA TOD clock (from “Compute!”)

Commodore 64 clock using the CIA TOD clock (from “Compute!”)

Programming August 2, 2018
I’ve recently typed-in a nice program from Compute! magazine1)Issue 43, December 1983 called “Commodore 64 clock”, by Paul F. Schatz.... Read more »
Commodore 64 SID music programming with BASIC – playing a simple three voices tune (part 2)

Commodore 64 SID music programming with BASIC – playing a simple three voices tune (part 2)

Programming July 30, 2018
On the first part, we have seen a simple technique for programming a three voices tune with BASIC. The program... Read more »
Assembly language: a simple UNNEW (OLD) utility (C64)

Assembly language: a simple UNNEW (OLD) utility (C64)

Programming July 10, 2018
A very classic topic is the ability to recover a BASIC program that has been killed by an unwanted NEW... Read more »
Commodore 64 SID music programming with BASIC – playing a simple three voices tune

Commodore 64 SID music programming with BASIC – playing a simple three voices tune

Programming July 8, 2018
On earlier posts we have seen how to play a single note and how to play a one voice tune... Read more »
How to merge two BASIC programs together (C64)

How to merge two BASIC programs together (C64)

Programming July 8, 2018
Sometimes it may be useful to merge two BASIC programs together. For instance, we may need on the program we... Read more »
Commodore 64 keyboard buffer tricks: deleting and creating BASIC lines from BASIC

Commodore 64 keyboard buffer tricks: deleting and creating BASIC lines from BASIC

Programming July 5, 2018
Let’s have a look at some nice Commodore 64 keyboard buffer tricks. The keyboard buffer is normally used by the... Read more »
Commodore 64 SID music programming with BASIC – playing a simple one voice tune

Commodore 64 SID music programming with BASIC – playing a simple one voice tune

Programming June 12, 2018
Now that we know how to play a single note with Commodore 64 BASIC, why not make something more complex?... Read more »
Commodore 64 SID music programming with BASIC – playing a note

Commodore 64 SID music programming with BASIC – playing a note

Programming June 10, 2018
Although machine language is what we really need for C64 music programming, BASIC may be more than acceptable for some... Read more »
Very basic BASIC: drawing tilted ellipses (Commodore 64)

Very basic BASIC: drawing tilted ellipses (Commodore 64)

Programming April 30, 2018
Following a request by a reader (Kick Off), I have had a quick look at how to draw tilted ellipses.... Read more »
Drawing the United Kingdom flag with BASIC (Commodore 64, Sinclair Spectrum)

Drawing the United Kingdom flag with BASIC (Commodore 64, Sinclair Spectrum)

Programming April 12, 2018
Drawing the United Kingdom flag is an interesting exercise, especially if we want to draw it by using CBM BASIC... Read more »
Very Basic BASIC: making a digital clock program using CBM characters and sprites (C64)

Very Basic BASIC: making a digital clock program using CBM characters and sprites (C64)

Programming April 11, 2018
One of my readers (Crispin) has kindly requested a simple digital clock program for the Commodore 64 (in BASIC V2).... Read more »
Plotting graphics on sprites – drawing a filled circle with BASIC V2 (C64)

Plotting graphics on sprites – drawing a filled circle with BASIC V2 (C64)

Programming April 7, 2018
Sprites are much more than movable objects intended for games. For example, sprites can be used to set up a... Read more »
Very basic BASIC: plotting characters on screen (C64 and VIC-20)

Very basic BASIC: plotting characters on screen (C64 and VIC-20)

Programming April 5, 2018
As we all know, CBM BASIC V2 does not support printing characters on screen starting from a given x, y... Read more »
User defined characters – a really simple font editor (BASIC, Machine Language – C64)

User defined characters – a really simple font editor (BASIC, Machine Language – C64)

Programming April 2, 2018
Creating user defined characters on the Commodore 64 is not that easy from BASIC V2. Binary numbers – which can... Read more »

VIC-II graphics, accessing ROM font images from different banks (C64)

Programming April 1, 2018
The Commodore 64 has 64K of RAM memory and the VIC-II graphic chip can access all of it, but in... Read more »
Very basic BASIC: drawing circles the old way (C64)

Very basic BASIC: drawing circles the old way (C64)

Programming March 30, 2018
On a C64, drawing circles is quite difficult using BASIC V2, not only for speed problems, but also because a... Read more »
Handling sprites collisions and scrolling from BASIC: coding a simple “game” (C64)

Handling sprites collisions and scrolling from BASIC: coding a simple “game” (C64)

Programming March 26, 2018
This article is intended as a companion to my previous article “Programming sprites on the Commodore 64, a simple tutorial... Read more »
Plotting a 3D function with Simons’ BASIC and BASIC 2.0 (C64)

Plotting a 3D function with Simons’ BASIC and BASIC 2.0 (C64)

Programming March 19, 2018
Some time ago I noticed on Youtube a nice Sinclair Spectrum BASIC program that plots a 3D function. Since I... Read more »
Very basic BASIC: formatting numbers and updating information on screen

Very basic BASIC: formatting numbers and updating information on screen

Programming March 15, 2018
While writing a simple C64 BASIC “game”, I came across some little issues dealing with formatting numbers and updating information... Read more »
Taking the square of a 16 bit number, a simple technique using 6502 assembly

Taking the square of a 16 bit number, a simple technique using 6502 assembly

Programming March 3, 2018
If we need a fast square of an 8 bit number, we just have to create a simple table of... Read more »
Another look at 3D graphics: fast hidden faces removal (back-face culling)

Another look at 3D graphics: fast hidden faces removal (back-face culling)

Programming February 27, 2018
While doing even very simple 3D graphics, the need of a better rendering of images will soon arise. Wireframe 3D... Read more »
An introduction to vector-based graphics on the Commodore 64 – Rotating simple 3D objects (assembly language)

An introduction to vector-based graphics on the Commodore 64 – Rotating simple 3D objects (assembly language)

Programming February 16, 2018
Vector-based graphics or 3D graphics is quite common today. On old 8 bit computers it was not very common instead,... Read more »
Assembly math: 6502 8 bit fast multiply routine. 16 bit multiply without bit shifting.

Assembly math: 6502 8 bit fast multiply routine. 16 bit multiply without bit shifting.

Programming February 10, 2018
On my last post I had presented an 8 bit fast multiply routine. Actually, it was limited to a narrower range... Read more »
Optimizing the assembly program “Sphere” – More tips on fixed point math. A fast 8 bit multiply routine.

Optimizing the assembly program “Sphere” – More tips on fixed point math. A fast 8 bit multiply routine.

Programming February 4, 2018
Fixed point math can be quite useful for fast computations involving decimal numbers. We have seen some examples in this... Read more »
The Mandelbrot set – a C64 assembly program to draw it fast, using integer math – part 2

The Mandelbrot set – a C64 assembly program to draw it fast, using integer math – part 2

Programming February 2, 2018
In the first part of this article I have presented a Commodore 64 program to draw the Mandelbrot set coded in... Read more »
The Mandelbrot set – a C64 assembly program to draw it fast, using integer math – part 1

The Mandelbrot set – a C64 assembly program to draw it fast, using integer math – part 1

Programming February 2, 2018
The Mandelbrot set, like most fractals, requires a lot of computations to be drawn. That’s why most programs on the... Read more »
Commodore 64 BASIC 8×8 Mandelbrot set: faster version

Commodore 64 BASIC 8×8 Mandelbrot set: faster version

Programming January 24, 2018
Today I have had a look at the BASIC program that has been presented in this article. I was looking... Read more »
Drawing the Mandelbrot set – Coding fractals with Commodore 64 BASIC and Freebasic

Drawing the Mandelbrot set – Coding fractals with Commodore 64 BASIC and Freebasic

Programming January 24, 2018
Fractals are commonly referred to as images which are obtained by performing several calculations. One property that sets those images... Read more »
Sprite multiplexing, a simple implementation using Commodore 64 BASIC V2

Sprite multiplexing, a simple implementation using Commodore 64 BASIC V2

Programming December 26, 2017
The Commodore 64 graphics chip VIC-II offers 8 hardware sprites. This number is not that impressive, but as C64 sprites... Read more »
Programming sprites on the Commodore 64, a simple tutorial using BASIC V2

Programming sprites on the Commodore 64, a simple tutorial using BASIC V2

Programming December 8, 2017
Programming sprites on the Commodore 64 is quite simple, even with Commodore BASIC V2 (the built-in BASIC interpreter). The Commodore... Read more »
Machine language for the Commodore 64, 128, and other Commodore computers (book review)

Machine language for the Commodore 64, 128, and other Commodore computers (book review)

Programming December 2, 2017
“Machine language for the Commodore 64, 128 and other Commodore computers” is a machine language course written by the world-famous... Read more »
Zooming a square with Commodore 64 BASIC – a simple 2D realtime zoomer using sprites

Zooming a square with Commodore 64 BASIC – a simple 2D realtime zoomer using sprites

Programming November 30, 2017
Coding a zoomer on a vintage computer is something that usually asks for machine language. And even with that language,... Read more »
3D Graphics: rotating a cube with Freebasic (PC) and Simons’ BASIC (C64)

3D Graphics: rotating a cube with Freebasic (PC) and Simons’ BASIC (C64)

Programming November 25, 2017
3D graphics is what games are all about today. At the time the Commodore 64 and other 8 bit computers... Read more »
Old BASIC interpreters era: is there anything left for today’s PCs? An introduction to Freebasic.

Old BASIC interpreters era: is there anything left for today’s PCs? An introduction to Freebasic.

Programming November 17, 2017
Most 8 bit computers were equipped with a BASIC interpreter directly available in ROM. Microsoft BASIC was the most common... Read more »
Commodore 64: breaking the 38K RAM barrier from BASIC. Creating an additional 4K BASIC variables storage area.

Commodore 64: breaking the 38K RAM barrier from BASIC. Creating an additional 4K BASIC variables storage area.

Programming November 15, 2017
Although the Commodore 64 comes with 64K RAM of memory, not all of this amount of memory is available right... Read more »
Color bars for movement: a simple perspective scrolling with Commodore 64 BASIC

Color bars for movement: a simple perspective scrolling with Commodore 64 BASIC

Programming October 15, 2017
Several Commodore 64 games use color bars to achieve the illusion of a moving landscape. Even other platforms such as... Read more »
Very basic BASIC – simple tips for entering strings with INPUT (Commodore 64 BASIC)

Very basic BASIC – simple tips for entering strings with INPUT (Commodore 64 BASIC)

Programming October 15, 2017
When using Commodore 64 BASIC V2, you more than often realize that even performing very simple tasks, like entering strings,... Read more »
Commodore VIC 20 BASIC programming: scrolling chessboard

Commodore VIC 20 BASIC programming: scrolling chessboard

Programming October 7, 2017
Although the available BASIC RAM memory on an unexpanded Commodore VIC 20 is quite limited, it is still possible to... Read more »
6502 assembly math: division – a simple algorithm using powers of two

6502 assembly math: division – a simple algorithm using powers of two

Programming September 21, 2017
There are several routines available on the web that perform integer division in 6502 assembly language. Still, I wanted to... Read more »
A 35000 characters string with Commodore 64 BASIC

A 35000 characters string with Commodore 64 BASIC

Programming September 8, 2017
Commodore 64 BASIC strings are limited to 255 characters. But, that doesn’t mean you can’t put a bigger string on... Read more »
Line drawing routines programming: a different approach. 6502/6510 assembly implementation on the Commodore 64

Line drawing routines programming: a different approach. 6502/6510 assembly implementation on the Commodore 64

Programming September 2, 2017
Drawing lines is a classic topic on computer graphics programming. You will usually find explanations dealing with algorithms derived from... Read more »
Playing SID tunes with a slow speed: Monty on the Run BASIC player

Playing SID tunes with a slow speed: Monty on the Run BASIC player

Programming August 22, 2017
Sometimes while doing SID music covers I wish I had a way of playing SID tunes with a slow speed.... Read more »
An introduction to 6502 math:  addiction, subtraction and more

An introduction to 6502 math: addiction, subtraction and more

Programming August 20, 2017
Numbers can be fun, and talking about 6502 CPU math is just another way to look at topics we already... Read more »
The perspective drawing of a sphere coded in 6502 assembly language

The perspective drawing of a sphere coded in 6502 assembly language

Programming August 12, 2017
Perspective drawing has always been fascinating to me. I will never stop being amazed at the wonder of seeing a... Read more »
A simple text scroller coded in assemby language for the Commodore 64

A simple text scroller coded in assemby language for the Commodore 64

Programming August 4, 2017
I have coded a very simple text scroller that uses most of the concepts explained on this article. I hope... Read more »
Commodore 64 BASIC 2.0 garbage collection, strings assignments in loops

Commodore 64 BASIC 2.0 garbage collection, strings assignments in loops

Programming July 25, 2017
Strings assignments inside loops are very likely to create garbage. Even when a new string is assigned to an already... Read more »
“Hi-res” bitmap graphics with Commodore 64 BASIC 2.0, fast screen clearing routine

“Hi-res” bitmap graphics with Commodore 64 BASIC 2.0, fast screen clearing routine

Programming July 21, 2017
Bitmap graphics with Commodore 64 BASIC 2.0 is not easy, but it is possible. The problem is the lack of... Read more »
6502 assembly language: a quick overview with Commodore 64 programming examples

6502 assembly language: a quick overview with Commodore 64 programming examples

Programming July 16, 2017
This article is a little overview of 6502 Assembly Language, intended for those with little knowledge of 6502/6510 assembly or... Read more »
Coding a simple smooth text scroller with Commodore 64 BASIC, working with string variables

Coding a simple smooth text scroller with Commodore 64 BASIC, working with string variables

Programming July 10, 2017
Text scrollers are quite common on the Commodore 64, due to the ability of the VIC-II chip to perform fine... Read more »
Garbage collection on Commodore 64 BASIC, how to handle it

Garbage collection on Commodore 64 BASIC, how to handle it

Programming July 1, 2017
One important part of a BASIC interpreter is string handling. This can be done in two ways: either by using static strings or... Read more »
C64 BASIC scrolling chessboards: horizontal scroll

C64 BASIC scrolling chessboards: horizontal scroll

Programming June 13, 2017
I have recently given another go on my experiments on Commodore 64 BASIC programming. I like doing graphics even without... Read more »
A bigger scrolling chessboard with Commodore 64 BASIC

A bigger scrolling chessboard with Commodore 64 BASIC

Programming October 21, 2016
Commodore 64 BASIC can be very fun, even if it lacks commands. In this article I explained my way of creating a... Read more »
Coding a scrolling chessboard with Commodore 64 BASIC

Coding a scrolling chessboard with Commodore 64 BASIC

Programming October 18, 2016
You can achieve nice effects like a scrolling chessboard on the Commodore 64 even with BASIC. The VIC-II is really... Read more »
The Commodore 64 BASIC WAIT statement explained

The Commodore 64 BASIC WAIT statement explained

Programming October 13, 2016
Commodore BASIC WAIT statement is maybe the most difficult BASIC statement to understand. It’s very difficult to explain for sure,... Read more »
Simple but effective Commodore 64 BASIC coding

Simple but effective Commodore 64 BASIC coding

Programming October 12, 2016
Commodore 64 BASIC is known for its lack of commands and instructions. On the start-up screen message, it is said... Read more »

Ultimi Articoli

  • 6 months ago

    Calculating an approximate value of PI, another method

  • Chaos game: fractals by using random numbers (C64 BASIC)
    6 months ago

    Chaos game: fractals by using random numbers (C64 BASIC)

  • Estimating PI using Monte Carlo Method (C64, BASIC)
    6 months ago

    Estimating PI using Monte Carlo Method (C64, BASIC)

  • C64 BASIC: ECM and MCM scrolling routines
    6 months ago

    C64 BASIC: ECM and MCM scrolling routines

  • C64 3D: wonderful 3D Commodore logo by AGPX
    6 months ago

    C64 3D: wonderful 3D Commodore logo by AGPX

6502 assembly math: division - a simple algorithm using powers of two

There are several routines available on the web that perform integer division in 6502 assembly langu ...

Commodore 64 SID music programming with BASIC – playing a simple three voices tune (part 2)

On the first part, we have seen a simple technique for programming a three voices tune with BASIC. T ...

Coding a simple smooth text scroller with Commodore 64 BASIC, working with string variables

Text scrollers are quite common on the Commodore 64, due to the ability of the VIC-II chip to perfor ...


Commodore Banner Exchange

Create a website and earn with Altervista - Disclaimer - Report Abuse - Privacy Policy - Customize advertising tracking