How do I change the color of text in C64?

How Do I Change the Color of Text in C64?

The Commodore 64, commonly referred to as the C64, is a iconic 8-bit personal computer that was widely popular in the 1980s. With its vibrant display and robust programming capabilities, the C64 allowed users to create a wide range of programs, including text-based applications. Changing the color of text on the C64 is a common task that can be accomplished using a combination of basic programming concepts and the C64’s graphics capabilities. In this article, we’ll explore the different methods to change the color of text in C64 and discuss the best practices for getting the desired results.

Basic Text Colors

The C64 has a limited color palette, with a total of eight colors available for use in text mode. The colors are defined by a value between 0 and 7, with each color having a specific attribute such as light blue (#0), dark blue (#7), light green (#5), and dark green (#4). To change the color of text in the C64, you’ll need to use a command that specifies the desired color.

Using the PRINT Command

One way to change the color of text in the C64 is by using the PRINT command. This command allows you to print text to the screen, along with the option to specify a color for the text. The syntax for using the PRINT command is as follows:

PRINT <text>;COL <color>

Where <text> is the text you want to print and <color> is the color you want to use. For example, the following code would print the text "Hello World!" in light blue color:

PRINT "Hello World!";COL 0

This will print the text in the default font and style, with the specified color. You can use any color value between 0 and 7 to achieve the desired result.

Using the SETCOLOR Command

Another way to change the color of text in the C64 is by using the SETP COLOR command. This command allows you to set the color for the next block of text you print to the screen. The syntax for using the SETP COLOR command is as follows:

SETP COLOR <color>

Where <color> is the color you want to use. Once you’ve set the color using this command, you can print text using the PRINT command as usual. For example:

SETP COLOR 1 // Set the color to dark blue
PRINT "Hello World! " // Print the text in dark blue color
SETP COLOR 0 // Reset the color to the default (light blue)

Extended Color Mode

The C64 also supports extended color mode, which allows you to use 16 different colors instead of the standard 8 colors. To enable extended color mode, you’ll need to use the ENABL command. Here’s an example:

ENABL
SETP COLOR 15 // Set the color to purple (16th color)
PRINT "Hello World! " // Print the text in purple color

Resetting the Color

Finally, if you want to reset the color to its default value (light blue) after printing text, you can use the RESET command. For example:

SETP COLOR 1 // Set the color to dark blue
PRINT "Hello World! " // Print the text in dark blue color
RESET // Reset the color to the default (light blue)

Tips and Tricks

Here are a few tips and tricks to keep in mind when working with text colors on the C64:

• Always use the SETP COLOR command before printing text to set the desired color.
• You can use the RESET command to reset the color to its default value (light blue) after printing text.
• Experiment with different color values to find the one that works best for your program.
• Don’t forget to disable extended color mode when you’re finished using it, to avoid any potential conflicts.

Conclusion

Changing the color of text on the C64 is a relatively simple task that requires basic programming concepts and knowledge of the C64’s graphics capabilities. By using the PRINT and SETP COLOR commands, you can easily change the color of text in the C64 and enhance your programming experience. With the tips and tricks provided in this article, you’re ready to start creating programs that showcase your creativity and imagination.

Additional Resources

Here are a few additional resources to help you get started with programming the C64:

  • C64 Programming Tutorials: This website provides a comprehensive collection of programming tutorials and guides for the C64.
  • C64 Programmers Manual: This document provides a detailed reference for the C64’s programming features and capabilities.
  • C64 Emulator: This emulator allows you to run C64 programs on your computer, giving you a taste of the retro computing experience.

We hope this article has provided a helpful overview of how to change the color of text on the C64. Remember to always experiment with different colors and techniques to create unique and engaging programs!

Your friends have asked us these questions - Check out the answers!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top