mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-25 20:32:25 +00:00
Nuw using #include<> in test files where possible.
This commit is contained in:
parent
5ff8fce61d
commit
8c5500822c
@ -151,7 +151,7 @@ fragment NAME_START : [a-zA-Z_];
|
||||
fragment NAME_CHAR : [a-zA-Z0-9_];
|
||||
|
||||
// Strings and chars - with special handling of imports
|
||||
SYSTEMFILE : '<' [a-zA-Z0-9_./\\]+ '>' { if(importEnter) { importEnter=false; cParser.loadCFile(getText(), true); } } ;
|
||||
SYSTEMFILE : '<' [a-zA-Z0-9_./\\\-]+ '>' { if(importEnter) { importEnter=false; cParser.loadCFile(getText(), true); } } ;
|
||||
STRING : '"' ('\\"' | ~'"')* '"' [z]?([ps][mu]?)?[z]? { if(importEnter) { importEnter=false; cParser.loadCFile(getText(), false); } } ;
|
||||
CHAR : '\'' ('\\'['"rfn] | ~'\'' ) '\'';
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -429,8 +429,8 @@ public class KickCLexer extends Lexer {
|
||||
"\u0096\u0134\2\u0136\2\u0138\2\u013a\u0097\u013c\u0098\u013e\u0099\u0140"+
|
||||
"\u009a\u0142\2\u0144\2\u0146\u009b\u0148\u009c\u014a\u009d\4\2\3\24\4"+
|
||||
"\2uuww\7\2dfkknnuuyy\4\2DDdd\3\2\62\63\3\2\62;\5\2\62;CHch\5\2C\\aac|"+
|
||||
"\6\2\62;C\\aac|\7\2\60;C\\^^aac|\3\2$$\3\2||\4\2rruu\4\2ooww\7\2$$))h"+
|
||||
"hpptt\3\2))\6\2\13\f\17\17\"\"\u00a2\u00a2\4\2\f\f\17\17\4\2--//\2\u06a3"+
|
||||
"\6\2\62;C\\aac|\7\2/;C\\^^aac|\3\2$$\3\2||\4\2rruu\4\2ooww\7\2$$))hhp"+
|
||||
"ptt\3\2))\6\2\13\f\17\17\"\"\u00a2\u00a2\4\2\f\f\17\17\4\2--//\2\u06a3"+
|
||||
"\2\4\3\2\2\2\2\6\3\2\2\2\2\b\3\2\2\2\2\n\3\2\2\2\2\f\3\2\2\2\2\16\3\2"+
|
||||
"\2\2\2\20\3\2\2\2\2\22\3\2\2\2\2\24\3\2\2\2\2\26\3\2\2\2\2\30\3\2\2\2"+
|
||||
"\2\32\3\2\2\2\2\34\3\2\2\2\2\36\3\2\2\2\2 \3\2\2\2\2\"\3\2\2\2\2$\3\2"+
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Simple single-color (320x200) bitmap routines
|
||||
#include "string"
|
||||
#include <string>
|
||||
|
||||
// The adddress of the bitmap screen (used for colors)
|
||||
byte* bitmap_screen;
|
||||
|
@ -4,7 +4,7 @@
|
||||
// (J) https://www.c64-wiki.com/wiki/C64DTV_Programming_Guide
|
||||
// (H) http://dtvhacking.cbm8bit.com/dtv_wiki/images/d/d9/Dtv_registers_full.txt
|
||||
|
||||
#include "c64.kc"
|
||||
#include <c64.kc>
|
||||
|
||||
// Feature enables or disables the extra C64 DTV features
|
||||
byte* const DTV_FEATURE = $d03f;
|
||||
|
@ -16,7 +16,7 @@
|
||||
// |7. | #%01111111 (127/$7f) | STOP ($ )| q ($11)|COMMODR($ )| SPACE ($20)| 2 ($32)|CONTROL($ )| <- ($1f)| 1 ($31)|
|
||||
// +----+----------------------+------------+------------+------------+------------+------------+------------+------------+------------+
|
||||
|
||||
#include "c64.kc"
|
||||
#include <c64>
|
||||
|
||||
// Keyboard Codes for all 63 keys.
|
||||
// Keyboard Codes are %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7).
|
||||
|
@ -12,7 +12,7 @@
|
||||
// In practice a good method is to wait until the raster is beyond plexFreeNextYpos() and then call plexShowSprite(). Repeat until all 32 sprites have been shown.
|
||||
// TODO: Let the caller specify the number of sprites to use (or add PLEX_ENABLE[PLEX_COUNT])
|
||||
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
// The number of sprites in the multiplexer
|
||||
const char PLEX_COUNT = 32;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "stdlib"
|
||||
#include "string"
|
||||
#include <stdlib>
|
||||
#include <string>
|
||||
|
||||
byte* print_screen = $0400;
|
||||
byte* print_line_cursor = print_screen;
|
||||
|
@ -4,8 +4,8 @@
|
||||
// Uses the approximation sin(x) = x - x^/6 + x^/128
|
||||
// Optimization possibility: Use symmetries when generating sinustables. wavelength%2==0 -> mirror symmetry over PI, wavelength%4==0 -> mirror symmetry over PI/2.
|
||||
|
||||
#include "division.kc"
|
||||
#include "multiply.kc"
|
||||
#include <division>
|
||||
#include <multiply>
|
||||
|
||||
// PI*2 in u[4.28] format
|
||||
const dword PI2_u4f28 = $6487ed51;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Table-based implementation of integer square sqr() and square root sqrt()
|
||||
|
||||
#include "stdlib"
|
||||
#include <stdlib>
|
||||
|
||||
// The number of squares to pre-calculate. Limits what values sqr() can calculate and the result of sqrt()
|
||||
byte NUM_SQUARES = 0xff;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// C standard library stdlib.h
|
||||
// Implementation of functions found int C stdlib.h / stdlib.c
|
||||
#include "string"
|
||||
#include <string>
|
||||
|
||||
// Top of the heap used by malloc()
|
||||
unsigned char* HEAP_TOP = 0xa000;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// C standard library time.h
|
||||
// Functions to get and manipulate date and time information.
|
||||
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
// Type suitable for storing the processor time.
|
||||
typedef unsigned long clock_t;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
byte* const SCREEN = $400;
|
||||
byte* const BITMAP = $2000;
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Coded by Richard-William Loerakker
|
||||
// Original Source https://bcaorganizer.blogspot.com/p/c-program-for_21.html?fbclid=IwAR0iL8pYcCqhCPa6LmtQ9qej-YonYVepY2cBegYRIWO0l8RPeOnTVniMAac
|
||||
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
byte* const SCREEN = $400;
|
||||
byte* const BITMAP = $2000;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Illustrates problem with bitmap-draw.kc line()
|
||||
// Reported by Janne Johansson
|
||||
|
||||
#include "c64.kc"
|
||||
#include "bitmap-draw.kc"
|
||||
#include <c64>
|
||||
#include <bitmap-draw>
|
||||
|
||||
byte* const SCREEN = $400;
|
||||
byte* const BITMAP = $2000;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Shows that bitmap2.kc line() does not have the same problem as bitmap-draw.kc
|
||||
// See bitmap-line-anim-1.kc
|
||||
|
||||
#include "c64.kc"
|
||||
#include "bitmap2.kc"
|
||||
#include <c64>
|
||||
#include <bitmap2>
|
||||
|
||||
byte* const SCREEN = $400;
|
||||
byte* const BITMAP = $2000;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
|
||||
// Plots simple plots
|
||||
#include "c64"
|
||||
#include "bitmap2"
|
||||
#include <c64>
|
||||
#include <bitmap2>
|
||||
|
||||
byte* BITMAP = 0x2000;
|
||||
byte* SCREEN = 0x0400;
|
||||
|
@ -1,9 +1,9 @@
|
||||
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
|
||||
// Plots a fullscreen elipsis
|
||||
#include "c64"
|
||||
#include "sinus"
|
||||
#include "multiply"
|
||||
#include "bitmap2"
|
||||
#include <c64>
|
||||
#include <sinus>
|
||||
#include <multiply>
|
||||
#include <bitmap2>
|
||||
|
||||
byte* BITMAP = 0x2000;
|
||||
byte* SCREEN = 0x0400;
|
||||
|
@ -1,9 +1,9 @@
|
||||
// Tests the simple bitmap plotter - and counts plots per frame in an IRQ
|
||||
// Plots a spiral
|
||||
#include "c64"
|
||||
#include "sinus"
|
||||
#include "multiply"
|
||||
#include "bitmap2"
|
||||
#include <c64>
|
||||
#include <sinus>
|
||||
#include <multiply>
|
||||
#include <bitmap2>
|
||||
|
||||
byte* BITMAP = 0x2000;
|
||||
byte* SCREEN = 0x0400;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Tests the simple bitmap plotter
|
||||
// Plots a few lines using the bresenham line algorithm
|
||||
#include "c64"
|
||||
#include "bitmap2"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <bitmap2>
|
||||
#include <print>
|
||||
|
||||
byte* BITMAP = 0x2000;
|
||||
byte* SCREEN = 0x0400;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Tests the different standard C types
|
||||
|
||||
#include "print"
|
||||
#include <print>
|
||||
|
||||
void main() {
|
||||
print_cls();
|
||||
|
@ -1,5 +1,5 @@
|
||||
// C64DTV 8bpp charmode stretcher
|
||||
#include "c64dtv.kc"
|
||||
#include <c64dtv>
|
||||
|
||||
// Plane with the screen
|
||||
byte* const SCREEN = $7c00;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// C64DTV 8bpp charmode stretcher
|
||||
#include "c64dtv.kc"
|
||||
#include <c64dtv>
|
||||
|
||||
// Plane with all pixels
|
||||
byte* const CHUNKY = $8000;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Fill a box on the screen using the blitter
|
||||
|
||||
#include "c64dtv.kc"
|
||||
#include <c64dtv>
|
||||
|
||||
byte* const SCREEN = $400;
|
||||
const byte SRCA[] = "camelot rules!";
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "c64dtv.kc"
|
||||
#include <c64dtv>
|
||||
|
||||
byte* const SCREEN = $400;
|
||||
const byte SRCA[] = { 'c', 'a', 'm', 'e', 'l', 'o', 't', '!', ' '};
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Test C64DTV v2 256-colors and the 16-color redefinable palette
|
||||
|
||||
#include "c64dtv.kc"
|
||||
#include <c64dtv>
|
||||
|
||||
void main() {
|
||||
asm { sei }
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Interactive Explorer for C64DTV Screen Modes
|
||||
#include "c64dtv.kc"
|
||||
#include "print.kc"
|
||||
#include "keyboard.kc"
|
||||
#include "bitmap-draw.kc"
|
||||
#include <c64dtv>
|
||||
#include <print>
|
||||
#include <keyboard>
|
||||
#include <bitmap-draw>
|
||||
|
||||
void main() {
|
||||
asm { sei } // Disable normal interrupt (prevent keyboard reading glitches and allows to hide basic/kernal)
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Exploring C64DTV Screen Modes
|
||||
#include "c64dtv.kc"
|
||||
#include "print.kc"
|
||||
#include "keyboard.kc"
|
||||
#include "bitmap-draw.kc"
|
||||
#include <c64dtv>
|
||||
#include <print>
|
||||
#include <keyboard>
|
||||
#include <bitmap-draw>
|
||||
|
||||
void main() {
|
||||
asm { sei } // Disable normal interrupt (prevent keyboard reading glitches and allows to hide basic/kernal)
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Counting cycles using a CIA timer
|
||||
|
||||
#include "c64"
|
||||
#include "time"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <time>
|
||||
#include <print>
|
||||
|
||||
byte* const SCREEN = 0x0400;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Setup and run a simple CIA-timer
|
||||
|
||||
#include "c64"
|
||||
#include "time"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <time>
|
||||
#include <print>
|
||||
|
||||
byte* const SCREEN = 0x0400;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
// Clears start screen throwing around the letters (by turning them into sprites)
|
||||
#include "stdlib"
|
||||
#include "sqr"
|
||||
#include "atan2"
|
||||
#include "multiply"
|
||||
#include "c64"
|
||||
#include <stdlib>
|
||||
#include <sqr>
|
||||
#include <atan2>
|
||||
#include <multiply>
|
||||
#include <c64>
|
||||
|
||||
// Generate debug code (raster time usage etc.)
|
||||
const bool DEBUG = false;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Display MEDUSA PETSCII by Buzz_clik
|
||||
// https://csdb.dk/release/?id=178673
|
||||
|
||||
#include "c64"
|
||||
#include "string"
|
||||
#include <c64>
|
||||
#include <string>
|
||||
|
||||
char MEDUSA_SCREEN[1000] = kickasm(resource "medusas.prg" ) {{
|
||||
.var fileScreen = LoadBinary("medusas.prg", BF_C64FILE)
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
|
||||
#include "c64"
|
||||
#include "string"
|
||||
#include "keyboard"
|
||||
#include "time"
|
||||
#include "print"
|
||||
#include "fastmultiply"
|
||||
#include <c64>
|
||||
#include <string>
|
||||
#include <keyboard>
|
||||
#include <time>
|
||||
#include <print>
|
||||
#include <fastmultiply>
|
||||
|
||||
// The prototype BOB (a 3x3 char image with a bob image in the upper 2x2 chars)
|
||||
// The chars are layout as follows with data in chars 0, 1, 3, 4 initially
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Pre-calculated bobs inside a charset (pre-moved to all x/y-combinations)
|
||||
#include "c64"
|
||||
#include "string"
|
||||
#include "keyboard"
|
||||
#include "time"
|
||||
#include "print"
|
||||
#include "fastmultiply"
|
||||
#include <c64>
|
||||
#include <string>
|
||||
#include <keyboard>
|
||||
#include <time>
|
||||
#include <print>
|
||||
#include <fastmultiply>
|
||||
|
||||
// The prototype BOB (a 3x3 char image with a bob image in the upper 2x2 chars)
|
||||
// The chars are layout as follows with data in chars 0, 1, 3, 4 initially
|
||||
|
@ -1,9 +1,9 @@
|
||||
// Same animation using a multiplexer
|
||||
#include "c64"
|
||||
#include "multiplexer"
|
||||
#include "fastmultiply"
|
||||
#include "string"
|
||||
#include "keyboard"
|
||||
#include <c64>
|
||||
#include <multiplexer>
|
||||
#include <fastmultiply>
|
||||
#include <string>
|
||||
#include <keyboard>
|
||||
|
||||
// The BOB sprite
|
||||
align(0x1000) char SPRITE[] = kickasm(resource "smiley.png") {{
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Show a few simple splines using the splines library
|
||||
|
||||
#include "splines"
|
||||
#include "bitmap2"
|
||||
#include "time"
|
||||
#include "print"
|
||||
#include "fastmultiply"
|
||||
#include "c64"
|
||||
#include <bitmap2>
|
||||
#include <time>
|
||||
#include <print>
|
||||
#include <fastmultiply>
|
||||
#include <c64>
|
||||
|
||||
char* const PRINT_SCREEN = 0x0400;
|
||||
char* const BITMAP_SCREEN = 0x5c00;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Put a 2x2 font into sprites and show it on screen
|
||||
#include "c64"
|
||||
#include "multiplexer"
|
||||
#include <c64>
|
||||
#include <multiplexer>
|
||||
|
||||
char * const CHARSET_DEFAULT = 0x1000;
|
||||
char * const SPRITES = 0x3000;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Tetris Game for the Commodore 64
|
||||
// A sprite multiplexer covering the playfield with a black layer to allow for 3 single-pixel colors
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
#include "tetris-data"
|
||||
|
||||
kickasm(pc PLAYFIELD_SPRITES, resource "playfield-sprites.png") {{
|
||||
|
@ -2,8 +2,8 @@
|
||||
// The tetris game tries to match NES tetris gameplay pretty closely
|
||||
// Source: https://meatfighter.com/nintendotetrisai/
|
||||
|
||||
#include "c64"
|
||||
#include "keyboard"
|
||||
#include <c64>
|
||||
#include <keyboard>
|
||||
#include "sid"
|
||||
#include "tetris-data"
|
||||
#include "tetris-render"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "c64.kc"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <print>
|
||||
|
||||
byte* SCREEN = $0400;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Each function of the kernal is a no-args function
|
||||
// The functions are placed in the SYSCALLS table surrounded by JMP and NOP
|
||||
|
||||
#include "string"
|
||||
#include <string>
|
||||
|
||||
#pragma link("xmega65.ld")
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "print.kc"
|
||||
#include <print>
|
||||
byte* const BGCOL = $d021;
|
||||
const byte GREEN = 5;
|
||||
const byte RED = 2 ;
|
||||
|
@ -2,9 +2,9 @@
|
||||
// See http://bsvi.ru/uploads/CORDIC--_10EBA/cordic.pdf
|
||||
|
||||
#include "font-hex"
|
||||
#include "atan2"
|
||||
#include "c64"
|
||||
#include "print"
|
||||
#include <atan2>
|
||||
#include <c64>
|
||||
#include <print>
|
||||
|
||||
byte* const CHARSET = 0x2000;
|
||||
byte* const SCREEN = 0x2800;
|
||||
|
@ -2,8 +2,8 @@
|
||||
// See http://bsvi.ru/uploads/CORDIC--_10EBA/cordic.pdf
|
||||
|
||||
#include "font-hex"
|
||||
#include "atan2"
|
||||
#include "c64"
|
||||
#include <atan2>
|
||||
#include <c64>
|
||||
|
||||
byte* const CHARSET = 0x2000;
|
||||
byte* const SCREEN = 0x2800;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Find atan2(x, y) using the CORDIC method
|
||||
// See http://bsvi.ru/uploads/CORDIC--_10EBA/cordic.pdf
|
||||
#include "font-hex"
|
||||
#include "atan2"
|
||||
#include "c64"
|
||||
#include <atan2>
|
||||
#include <c64>
|
||||
|
||||
byte* const CHARSET = 0x2000;
|
||||
byte* const SCREEN = 0x2800;
|
||||
|
@ -2,8 +2,8 @@
|
||||
// See http://bsvi.ru/uploads/CORDIC--_10EBA/cordic.pdf
|
||||
|
||||
#include "font-hex"
|
||||
#include "c64"
|
||||
#include "atan2"
|
||||
#include <c64>
|
||||
#include <atan2>
|
||||
|
||||
|
||||
byte* const CHARSET = 0x2000;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Tests problem writing/reading joystick encountered by Danny Spijksma
|
||||
// https://www.protovision.games/hardw/build4player.php?language=en&fbclid=IwAR1MJLgQjOU0zVa0ax2aNeGa-xVbE9IGY9zC6b6eInTV4HQzoUAoCPoXu14
|
||||
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
char* const SCREEN = 0x0400;
|
||||
void main() {
|
||||
(*CIA2_PORT_B) &= 0x7f;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Show default font on screen
|
||||
|
||||
#include "string"
|
||||
#include <string>
|
||||
|
||||
byte* SCREEN = 0x0400;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Based on facebook post from
|
||||
*/
|
||||
|
||||
#include "print"
|
||||
#include <print>
|
||||
|
||||
void main () {
|
||||
print_cls();
|
||||
|
@ -2,8 +2,8 @@
|
||||
// Based on:
|
||||
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
|
||||
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
|
||||
#include "c64"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <print>
|
||||
|
||||
// The rotated point - updated by calling rotate_matrix()
|
||||
signed char* xr = $f0;
|
||||
|
@ -2,8 +2,8 @@
|
||||
// Based on:
|
||||
// - C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
|
||||
// - Codebase64 Article http://codebase64.org/doku.php?id=base:3d_rotation
|
||||
#include "c64"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <print>
|
||||
|
||||
// The rotated point - updated by calling rotate()
|
||||
signed char* xr = $f0;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "c64.kc"
|
||||
#include "bitmap-draw.kc"
|
||||
#include <c64>
|
||||
#include <bitmap-draw>
|
||||
|
||||
char* const SCREEN = $400;
|
||||
char* const BITMAP = $2000;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Allows analysis of the CHARGEN ROM font
|
||||
#include "c64.kc"
|
||||
#include "keyboard.kc"
|
||||
#include <c64>
|
||||
#include <keyboard>
|
||||
|
||||
char* SCREEN = $400;
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
// - http://codebase64.org/doku.php?id=base:seriously_fast_multiplication
|
||||
// - http://codebase64.org/doku.php?id=magazines:chacking16
|
||||
|
||||
#include "print.kc"
|
||||
#include <print>
|
||||
|
||||
signed char vals[] = {-95, -64, -32, -16, 0, 16, 32, 64, 95};
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Ported to KickC by Jesper Gravgaard.
|
||||
// Original source https://github.com/cc65/cc65/blob/master/samples/fire.c
|
||||
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
#include "sid"
|
||||
|
||||
unsigned char* SCREEN1 = 0x3800;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Creates a 2x2 font from the system CHARGEN font and compress it by identifying identical chars
|
||||
|
||||
#include "c64"
|
||||
#include "string"
|
||||
#include <c64>
|
||||
#include <string>
|
||||
|
||||
char* const SCREEN = 0x0400;
|
||||
char* const FONT_ORIGINAL = 0x2000;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "print"
|
||||
#include <print>
|
||||
void main() {
|
||||
print_str("hello world!");
|
||||
print_ln();
|
||||
|
@ -1,5 +1,5 @@
|
||||
// A raster IRQ that opens the top/bottom border.
|
||||
#include "c64.kc"
|
||||
#include <c64>
|
||||
|
||||
char* const GHOST_BYTE = $3fff;
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
// To execute the program succesfully you must mount the D64 disk image and execute the kernalload.PRG program
|
||||
#pragma link("kernalload.ld")
|
||||
|
||||
#include "string"
|
||||
#include "c64"
|
||||
#include <string>
|
||||
#include <c64>
|
||||
|
||||
// Sprite file
|
||||
#pragma data_seg(Sprite)
|
||||
|
@ -1,6 +1,6 @@
|
||||
// A simple usage of the flexible sprite multiplexer routine
|
||||
#include "c64"
|
||||
#include "multiplexer"
|
||||
#include <c64>
|
||||
#include <multiplexer>
|
||||
|
||||
// Location of screen & sprites
|
||||
char* SCREEN = $400;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// A simple SID music player playing music in the main loop.
|
||||
#include "c64.kc"
|
||||
#include <c64>
|
||||
|
||||
char* const MUSIC = $1000;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// A simple SID music player using RASTER IRQ
|
||||
#include "c64.kc"
|
||||
#include <c64>
|
||||
|
||||
char* const MUSIC = $1000;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Code by Scan of Desire (Richard-William Loerakker)
|
||||
// Sample from ART OF NOISE: MOMENTS IN LOVE
|
||||
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
const unsigned int SAMPLE_SIZE = 0x6100;
|
||||
char SAMPLE[SAMPLE_SIZE] = kickasm(resource "moments_sample.bin") {{ .import binary "moments_sample.bin" }};
|
||||
|
@ -6,8 +6,8 @@
|
||||
// Ported to KickC by Jesper Gravgaard.
|
||||
// Original source https://github.com/cc65/cc65/blob/master/samples/plasma.c
|
||||
|
||||
#include "c64"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <print>
|
||||
#include "sid"
|
||||
|
||||
unsigned char* const SCREEN1 = $2800;
|
||||
|
@ -4,8 +4,8 @@
|
||||
// Ported to KickC by Jesper Gravgaard.
|
||||
// Original source https://github.com/cc65/cc65/blob/master/samples/plasma.c
|
||||
|
||||
#include "c64"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <print>
|
||||
#include "sid"
|
||||
|
||||
char* const SCREEN1 = 0x2800;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "c64.kc"
|
||||
#include <c64>
|
||||
|
||||
void main() {
|
||||
asm {
|
||||
|
@ -1,9 +1,9 @@
|
||||
// 2D rotattion of 8 sprites
|
||||
|
||||
#include "c64"
|
||||
#include "fastmultiply"
|
||||
#include "time"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <fastmultiply>
|
||||
#include <time>
|
||||
#include <print>
|
||||
|
||||
char* SCREEN = $0400;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "c64.kc"
|
||||
#include "sinus.kc"
|
||||
#include "string.kc"
|
||||
#include <c64>
|
||||
#include <sinus>
|
||||
#include <string>
|
||||
|
||||
char* SCREEN = $400;
|
||||
char* LOGO = $2000;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "c64.kc"
|
||||
#include "string"
|
||||
#include <c64>
|
||||
#include <string>
|
||||
|
||||
char* SCREEN = $400;
|
||||
char* LOGO = $2000;
|
||||
|
@ -1,9 +1,9 @@
|
||||
// Generate a big sinus and plot it on a bitmap
|
||||
|
||||
#include "c64.kc"
|
||||
#include "sinus.kc"
|
||||
#include "string.kc"
|
||||
#include "bitmap2.kc"
|
||||
#include <c64>
|
||||
#include <sinus>
|
||||
#include <string>
|
||||
#include <bitmap2>
|
||||
|
||||
char* SCREEN = $400;
|
||||
char* BITMAP = $2000;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
#include "basic-floats"
|
||||
#include "print"
|
||||
#include <print>
|
||||
|
||||
const char sinlen_x = 221;
|
||||
const char sintab_x[221];
|
||||
|
@ -4,7 +4,7 @@
|
||||
// Uses principles from C=Hacking #16 https://codebase64.org/doku.php?id=magazines:chacking16
|
||||
// Utilizes the fact that a*b = ((a+b)/2)^2 - ((a-b)/2)^2
|
||||
|
||||
#include "print"
|
||||
#include <print>
|
||||
|
||||
void main() {
|
||||
print_cls();
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Shows a font where each char contains the number of the char (00-ff)
|
||||
#include "c64"
|
||||
#include "string"
|
||||
#include <c64>
|
||||
#include <string>
|
||||
#include "font-hex"
|
||||
|
||||
byte* SCREEN = 0x0400;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Test minimization of constants
|
||||
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
void main() {
|
||||
byte* const PLAYFIELD_CHARSET = $2800;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "print.kc"
|
||||
#include <print>
|
||||
|
||||
byte txt[] = "camelot";
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// A minimal working raster hardware IRQ with clobber-based register savings
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
void main() {
|
||||
asm { sei }
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Test interrupt routine using a variable between calls (irq_idx)
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
byte* const SCREEN = $0400;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// A minimal working IRQ
|
||||
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
// Setup the IRQ routine
|
||||
void main() {
|
||||
|
@ -5,8 +5,8 @@
|
||||
// Press "C" to enter pressed state (increaded bgcol) - and "SPACE" to leave presssed state again.
|
||||
// Holding SPACE will sometimes trigger the pressed state when normal interrupts are enabled (green border)
|
||||
// but never when they are disabled (red border)
|
||||
#include "keyboard.kc"
|
||||
#include "c64.kc"
|
||||
#include <keyboard>
|
||||
#include <c64>
|
||||
|
||||
void main() {
|
||||
*BORDERCOL = GREEN;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Animated lines drawn on a single color bitmap
|
||||
#include "c64.kc"
|
||||
#include "division.kc"
|
||||
#include <c64>
|
||||
#include <division>
|
||||
|
||||
byte* BITMAP = $a000;
|
||||
byte* SCREEN = $8800;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Linear table generator
|
||||
// Work in progress towards a sinus generator
|
||||
#include "division.kc"
|
||||
#include "print.kc"
|
||||
#include <division>
|
||||
#include <print>
|
||||
|
||||
void main() {
|
||||
word lintab1[20];
|
||||
|
@ -8,7 +8,7 @@
|
||||
// 2.8212026 23111.2917 23111
|
||||
// -1.7417939 -14268.77563 -14269
|
||||
|
||||
#include "multiply"
|
||||
#include <multiply>
|
||||
|
||||
void main() {
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Program where loop-head optimization produces wrong return value
|
||||
// Reported by Richard-William Loerakker
|
||||
|
||||
#include "c64"
|
||||
#include "multiply"
|
||||
#include <c64>
|
||||
#include <multiply>
|
||||
|
||||
void main() {
|
||||
dword result = mul16u(4,123);
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Experiments with malloc() - a byte array
|
||||
|
||||
#include "stdlib"
|
||||
#include <stdlib>
|
||||
|
||||
byte* BYTES = malloc(0x100);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Experiments with malloc() - a word array
|
||||
|
||||
#include "stdlib"
|
||||
#include <stdlib>
|
||||
|
||||
word* WORDS = malloc(0x200);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Test memcpy - copy charset and screen using memcpy() from stdlib string
|
||||
|
||||
#include "c64"
|
||||
#include "string"
|
||||
#include <c64>
|
||||
#include <string>
|
||||
|
||||
byte* const CHARSET = 0x2000;
|
||||
byte* const SCREEN = 0x0400;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Test memcpy on strings (
|
||||
|
||||
#include "string"
|
||||
#include <string>
|
||||
|
||||
char* const SCREEN = 0x0400;
|
||||
const char CAMELOT[] = "camelot";
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Experiments with malloc()
|
||||
|
||||
#include "stdlib"
|
||||
#include <stdlib>
|
||||
|
||||
void main() {
|
||||
unsigned char* buf1 = malloc(100);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "print"
|
||||
#include "time"
|
||||
#include <print>
|
||||
#include <time>
|
||||
|
||||
|
||||
unsigned int last_time;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "benchcommon"
|
||||
#include "c64"
|
||||
#include <c64>
|
||||
|
||||
char* const SCREEN1 = 0xE000;
|
||||
char* const SCREEN2 = 0xE400;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "benchcommon"
|
||||
#include "print"
|
||||
#include <print>
|
||||
|
||||
byte* const rom = (byte*)0xe000;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "print"
|
||||
#include <print>
|
||||
#include "benchcommon"
|
||||
|
||||
const unsigned int COUNT = 16384;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "print"
|
||||
#include <print>
|
||||
|
||||
byte* RASTER = $d012;
|
||||
byte* BORDERCOL = $d020;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Minimal test of mul8u
|
||||
|
||||
#include "multiply"
|
||||
#include <multiply>
|
||||
|
||||
void main() {
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// A simple usage of the flexible sprite multiplexer routine
|
||||
#include "c64"
|
||||
#include "multiplexer"
|
||||
#include <c64>
|
||||
#include <multiplexer>
|
||||
// Location of screen & sprites
|
||||
char* SCREEN = 0x0400;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Failing number type resolving in ternary operator
|
||||
// Currently fails in the ternary operator with number-issues if integer literal is not specified!
|
||||
|
||||
#include "stdlib"
|
||||
#include <stdlib>
|
||||
|
||||
void SolveMaze(char *maze, word width, word height) {
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Plasma based on the distance/angle to the screen center
|
||||
|
||||
#include "c64"
|
||||
#include "stdlib"
|
||||
#include "string"
|
||||
#include "sqr"
|
||||
#include "atan2"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <stdlib>
|
||||
#include <string>
|
||||
#include <sqr>
|
||||
#include <atan2>
|
||||
#include <print>
|
||||
#include "sid"
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "print"
|
||||
#include <print>
|
||||
|
||||
byte msg[] = "hello world! ";
|
||||
byte msg2[] = "hello c64! ";
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Test the write through to RAM when writing to VIC/CIA/colorram
|
||||
|
||||
#include "c64"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <print>
|
||||
|
||||
void main() {
|
||||
// Avoid interrupts
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Test the functionality of the C64 processor port ($00/$01)
|
||||
// Tests by setting the value of the processor port - and then printing out values of $00/$01/$a000/$d000/$e000
|
||||
|
||||
#include "c64"
|
||||
#include "print"
|
||||
#include <c64>
|
||||
#include <print>
|
||||
|
||||
char* const BASIC_ROM = $a000;
|
||||
char* const KERNAL_ROM = $e000;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user