Tag: C128

Kom igång med C128 Assembler

Idag finns en hel del produkter för att utveckla program till Commodore 64 eller 128 på en modern PC, vilket är betydligt enklare än att göra det direkt på målmaskinen. Följ dessa steg för att komma igång med Assembler i Commodore 128. 1. Ladda hem Vice. Vice emulerar de flesta Commodore-maskinerna, vilket förutom C64/C128 även […]

Read More

Linjär interpolering

Jag använder min Commodore 128 för detta exempel, eftersom jag vill komma åt den höga upplösningen i 80-kolumnsläget, men koden är körbar även på C64, Vic 20 och Pet, med reservation för radbryten och annat. Jag använder alltså en skärm som rymmer 80 tecken per rad, och kan representera talen 0 till och med 80 […]

Read More

Commodore 128 bitmap graphics 2/2

Part 1. Part 2. On the Commodore 128, the screen is divided into characters. Each character consists of eight eight-pixel lines (bytes), which make a total of 64 pixels per character. Each pixel pair represent one of four available colors in multicolor mode. This can be demonstrated using this simple code: 10 GRAPHIC 3, 1 […]

Read More

Commodore 128 bitmap graphics 1/2

Part 1. Part 2. When Commodore 128 vector graphics can’t provide the desired details, there is an option to do bitmap graphics. The 128 have a built in command for creating pixel perfect graphics called  SPRSAV. You can create a pattern using the built-in editor (SPRDEF)… …and transfer the data into a string variable, and […]

Read More

Commodore 128 vector graphics

The Commodore 128 have a rich API for making colorful vector graphics. The low resolution (160×200) color mode allows you to make the classic “Forrest Gump” smiley using these five lines of code: 10 COLOR 0, 13 : REM GREY BACKGROUND 20 COLOR 4, 13 : REM GREY BORDER 30 COLOR 1, 1 : REM […]

Read More

Skalning av vektorgrafik på Commodore 128

Genom kommandot SCALE kan man skala vektorgrafiken, alltså den grafik som skapas med kommandon som DRAW, CIRCLE och BOX – inte sprite-grafik eller text. När man arbetar med högupplöst grafik utan skalning är skärmen 320 pixlar bred och 200 pixlar hög. Detta program skapar en stor ellips som tar upp nästan hela skärmen. 10 GRAPHIC […]

Read More

Making music in Basic 7.0 part 4

Apart from PLAY, the commands that are available for making sounds and music are TEMPO, ENVELOPE, SOUND and FILTER. TEMPO lets you control playback speed. The slowest is 1 and the fastest is 255. ENVELOPE lets you modify the ten predefined instruments. You set the instruments using the T control character (0 to 9). The […]

Read More

Making music in Basic 7.0 part 2

The synthesizer control characters (V, O, T, U and X) always take one integer argument and always affect all the rest of the notes that are played. V stands for Voice and is the key to polyphonic music. Since polyphonic music is achieved by playing notes in different voices, you will use V a lot. […]

Read More

Making music in Basic 7.0 part 1

In Commodore Basic 7, music is made using the PLAY command. PLAY takes one string, and that string contains the notations that you want the Commodore 128 to play. The string “CDE” will play the note C, and then the note D and finally then note E. PLAY “CDE” Possible notes are C, D, E, […]

Read More

Plotting graphics

The Commodore 128 has a nice API for setting graphics mode and plotting graphics, that can be used in 40 column mode. The GRAPHIC command takes a mode (0 to 5) and a “clear screen flag”, and changes the current graphics mode. 0 is the 40 column text mode and 1 is the high resolution […]

Read More

Let’s make the screen flash!

This program will make the screen flash on the Commodore 128, and it will also run on the Commodore 64. The background color of the screen is stored at D021 (53281), so this effect is accomplished by manipulating the value at that address, multiple times. This program cannot be written in Basic, because the Basic […]

Read More

Collision detection

A nice and quick way to create two filled sprites (sprite 1 and 2) is to enter the monitor and type: F 0E00 0E3E FF F 0E3F 0E7E FF Of course you can fill both at once, but this the above code nicely declares the two memory areas I am using in this example. Now, […]

Read More

Poking graphics on the C128

The skills of using PEEK, POKE and logical operators that I write about for the Commodore PET here, can be used to create graphics on the Commodore 128, in 40-column mode. Before you begin, you might want to clear the screen using the SCNCLR command. Odd name, I know. The C128 has a built in […]

Read More

Some cool software for the C128: GEOS

So CP/M is the text based disk operating system for the Commodore 128. You could buy a window based operating on disk called GEOS (Graphic Environment Operating System). GEOS was available for some of the Commodore machines and the Apple II. GEOS is not “smashing” either, but it solved some problems that text based systems […]

Read More

Basic data management

If you want to do this on a real Commodore 128, you will need a blank floppy disk, and if you are doing this from an emulator, you will need a blank floppy image. I have created a blank d64 image from the Vice emulator. To do that, click File, Attach disk image, and Drive […]

Read More

The sprite engine

One of the built in applications in the C128 is the sprite editor. Enter it by typing SPRDEF. Choose a sprite number, use the cursor keys to move the cursor and numeric keys to draw. 1 will delete a pixel, 2 will draw with the first color. In multicolor mode, you can also use 3 […]

Read More

Manipulate a byte

When you get a tweet like this thrown at you, the only thing to do is to take another visit to the wonderful world of the C128 monitor. Let’s say that we were to make a program using assembler. We will store it at address 4096. Enter the machine code monitor by typing MONITOR, and […]

Read More

The built-in machine code monitor

The Commodore 128 features a few built in applications and one Easter egg. The egg is a list of the engineers that built the machine, with the word “hardware” intentionally misspelled as “herdware” after 8-bit computer designer Bil Herd. To reveal the egg, type this: SYS 32800,123,45,6 The Commodore 128 tries to boot from floppy […]

Read More

Hidden stuff in the C128

Here is some of the hidden stuff in my favorite computer, the Commodore 128. There is a bug in the Basic interpretation that shows up when you tries to do an arithmetic calculation using a string. This is what’s supposed to happen: When you add an integer to a string, the interpretator should say that […]

Read More