1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-01 16:51:12 +00:00

Add function to clear pixels in c64-bitmap.c.

This commit is contained in:
Janne Johansson 2022-01-06 18:04:34 +00:00
parent bd3fad6bb1
commit 62a1f1cec4
2 changed files with 9 additions and 0 deletions

View File

@ -12,5 +12,8 @@ void bitmap_clear(char bgcol, char fgcol);
/// Plot a single dot in the bitmap /// Plot a single dot in the bitmap
void bitmap_plot(unsigned int x, char y); void bitmap_plot(unsigned int x, char y);
/// Clear a single dot in the bitmap
void bitmap_unplot(unsigned int x, char y);
/// Draw a line on the bitmap using bresenhams algorithm /// Draw a line on the bitmap using bresenhams algorithm
void bitmap_line(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2); void bitmap_line(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2);

View File

@ -50,6 +50,12 @@ void bitmap_plot(unsigned int x, char y) {
*plotter |= bitmap_plot_bit[BYTE0(x)]; *plotter |= bitmap_plot_bit[BYTE0(x)];
} }
void bitmap_unplot(unsigned int x, char y) {
char* plotter = (char*) MAKEWORD( bitmap_plot_yhi[y], bitmap_plot_ylo[y] );
plotter += ( x & $fff8 );
*plotter &= ~(bitmap_plot_bit[BYTE0(x)]);
}
// Draw a line on the bitmap using bresenhams algorithm // Draw a line on the bitmap using bresenhams algorithm
void bitmap_line(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2) { void bitmap_line(unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2) {
unsigned int x = x1; unsigned int x = x1;