diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java b/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java index 6296c7abe..09a952d91 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass0GenerateStatementSequence.java @@ -1566,6 +1566,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitorf(x) = >(( x * x )/4) -byte[512] align($100) mulf_sqr1_hi; +byte align($100) mulf_sqr1_hi[512]; // g(x) = >((( x - 255) * ( x - 255 ))/4) -byte[512] align($100) mulf_sqr2_hi; +byte align($100) mulf_sqr2_hi[512]; // Initialize the mulf_sqr multiplication tables with f(x)=int(x*x/4) void mulf_init() { diff --git a/src/main/kc/stdlib/keyboard.kc b/src/main/kc/stdlib/keyboard.kc index d8353aa47..105e28de6 100644 --- a/src/main/kc/stdlib/keyboard.kc +++ b/src/main/kc/stdlib/keyboard.kc @@ -88,7 +88,7 @@ const byte KEY_RUNSTOP = $3f; // Keycodes for each screen code character from $00-$3f. // Chars that do not have an unmodified keycode return $3f (representing RUN/STOP). -const byte[] keyboard_char_keycodes = { +const byte keyboard_char_keycodes[] = { /*@*/KEY_AT, /*a*/KEY_A, /*b*/KEY_B, /*c*/KEY_C, /*d*/KEY_D, /*e*/KEY_E, /*f*/KEY_F, /*g*/KEY_G, /*h*/KEY_H, /*i*/KEY_I, /*j*/KEY_J, /*k*/KEY_K, /*l*/KEY_L, /*m*/KEY_M, /*n*/KEY_N, /*o*/KEY_O, /*p*/KEY_P, /*q*/KEY_Q, /*r*/KEY_R, /*s*/KEY_S, /*t*/KEY_T, /*u*/KEY_U, /*v*/KEY_V, /*w*/KEY_W, @@ -100,10 +100,10 @@ const byte[] keyboard_char_keycodes = { }; // Keyboard row bitmask as expected by CIA#1 Port A when reading a specific keyboard matrix row (rows are numbered 0-7) -byte[8] keyboard_matrix_row_bitmask = { %11111110, %11111101, %11111011, %11110111, %11101111, %11011111, %10111111, %01111111 }; +byte keyboard_matrix_row_bitmask[8] = { %11111110, %11111101, %11111011, %11110111, %11101111, %11011111, %10111111, %01111111 }; // Keyboard matrix column bitmasks for a specific keybooard matrix column when reading the keyboard. (columns are numbered 0-7) -byte[8] keyboard_matrix_col_bitmask = { %00000001, %00000010, %00000100, %00001000, %00010000, %00100000, %01000000, %10000000 }; +byte keyboard_matrix_col_bitmask[8] = { %00000001, %00000010, %00000100, %00001000, %00010000, %00100000, %01000000, %10000000 }; // Initialize keyboard reading by setting CIA#$ Data Direction Registers void keyboard_init() { @@ -142,7 +142,7 @@ byte keyboard_get_keycode(byte ch) { } // Keyboard event buffer. Contains keycodes for key presses/releases. Presses are represented by the keycode. Releases by keycode | $40. The buffer is filled by keyboard_scan() -byte[8] keyboard_events; +byte keyboard_events[8]; // Keyboard event buffer size. The number of events currently in the event buffer byte keyboard_events_size = 0; // Current keyboard modifiers (left shift, right shift, ctrl, commodore) @@ -158,7 +158,7 @@ const byte KEY_MODIFIER_COMMODORE = 8; // Any shift is pressed const byte KEY_MODIFIER_SHIFT = KEY_MODIFIER_LSHIFT|KEY_MODIFIER_RSHIFT; // The values scanned values for each row. Set by keyboard_scan() and used by keyboard_get_event() -byte[8] keyboard_scan_values; +byte keyboard_scan_values[8]; // Scans the entire matrix to determine which keys have been pressed/depressed. // Generates keyboard events into the event buffer. Events can be read using keyboard_event_get(). diff --git a/src/main/kc/stdlib/multiplexer.kc b/src/main/kc/stdlib/multiplexer.kc index fb72a9988..3608bf6a4 100644 --- a/src/main/kc/stdlib/multiplexer.kc +++ b/src/main/kc/stdlib/multiplexer.kc @@ -18,19 +18,19 @@ import "c64" const byte PLEX_COUNT = 32; // The x-positions of the multiplexer sprites ($000-$1ff) -word[PLEX_COUNT] PLEX_XPOS; +word PLEX_XPOS[PLEX_COUNT]; // The y-positions of the multiplexer sprites. -byte[PLEX_COUNT] PLEX_YPOS; +byte PLEX_YPOS[PLEX_COUNT]; // The sprite pointers for the multiplexed sprites -byte[PLEX_COUNT] PLEX_PTR; +byte PLEX_PTR[PLEX_COUNT]; // The address of the sprite pointers on the current screen (screen+$3f8). byte* PLEX_SCREEN_PTR = $400+$3f8; // Indexes of the plex-sprites sorted by sprite y-position. Each call to plexSort() will fix the sorting if changes to the Y-positions have ruined it. -byte[PLEX_COUNT] PLEX_SORTED_IDX; +byte PLEX_SORTED_IDX[PLEX_COUNT]; // Variables controlling the showing of sprites @@ -115,7 +115,7 @@ inline byte plexShowNextYpos() { } // Contains the Y-position where each sprite is free again. PLEX_FREE_YPOS[s] holds the Y-position where sprite s is free to use again. -byte[8] PLEX_FREE_YPOS; +byte PLEX_FREE_YPOS[8]; // The index of the sprite that is free next. Since sprites are used round-robin this moves forward each time a sprite is shown. byte plex_free_next = 0; diff --git a/src/main/kc/stdlib/print.kc b/src/main/kc/stdlib/print.kc index 95cde4f8b..03f6b3504 100644 --- a/src/main/kc/stdlib/print.kc +++ b/src/main/kc/stdlib/print.kc @@ -93,7 +93,7 @@ void print_word(word w) { } // Digits used for storing the decimal word -char[6] decimal_digits; +char decimal_digits[6]; // Print a byte as DECIMAL void print_byte_decimal(byte b) { @@ -120,7 +120,7 @@ void print_dword(dword dw) { } // Digits used for storing the decimal word -char[11] decimal_digits_long; +char decimal_digits_long[11]; // Print a dword as DECIMAL void print_dword_decimal(dword w) { @@ -145,7 +145,7 @@ void print_sdword(signed dword dw) { print_dword((dword)dw); } -const byte[] print_hextab = "0123456789abcdef"z; +const byte print_hextab[] = "0123456789abcdef"z; // Print a byte as HEX void print_byte(byte b) { diff --git a/src/main/kc/stdlib/stdlib.kc b/src/main/kc/stdlib/stdlib.kc index 9e69afc3d..d761ff5a7 100644 --- a/src/main/kc/stdlib/stdlib.kc +++ b/src/main/kc/stdlib/stdlib.kc @@ -55,16 +55,16 @@ unsigned int* bsearch16u(unsigned int key, unsigned int* items, char num) { // The different supported radix enum RADIX { BINARY=2, OCTAL=8, DECIMAL=10, HEXADECIMAL=16 }; // The digits used for numbers -char[] DIGITS = "0123456789abcdef"z; +char DIGITS[] = "0123456789abcdef"z; // Values of binary digits -unsigned int[] RADIX_BINARY_VALUES = { 0b1000000000000000, 0b0100000000000000, 0b0010000000000000, 0b0001000000000000, 0b0000100000000000, 0b0000010000000000, 0b0000001000000000, 0b0000000100000000, 0b0000000010000000, 0b0000000001000000, 0b0000000000100000, 0b0000000000010000, 0b0000000000001000, 0b0000000000000100, 0b0000000000000010 }; +unsigned int RADIX_BINARY_VALUES[] = { 0b1000000000000000, 0b0100000000000000, 0b0010000000000000, 0b0001000000000000, 0b0000100000000000, 0b0000010000000000, 0b0000001000000000, 0b0000000100000000, 0b0000000010000000, 0b0000000001000000, 0b0000000000100000, 0b0000000000010000, 0b0000000000001000, 0b0000000000000100, 0b0000000000000010 }; // Values of octal digits -unsigned int[] RADIX_OCTAL_VALUES = { 0x8000, 0x1000, 0x200, 0x40, 0x8 }; +unsigned int RADIX_OCTAL_VALUES[] = { 0x8000, 0x1000, 0x200, 0x40, 0x8 }; // Values of decimal digits -unsigned int[] RADIX_DECIMAL_VALUES = { 10000, 1000, 100, 10 }; +unsigned int RADIX_DECIMAL_VALUES[] = { 10000, 1000, 100, 10 }; // Values of hexadecimal digits -unsigned int[] RADIX_HEXADECIMAL_VALUES = { 0x1000, 0x100, 0x10 }; +unsigned int RADIX_HEXADECIMAL_VALUES[] = { 0x1000, 0x100, 0x10 }; // Converts unsigned number value to a string representing it in RADIX format. // If the leading digits are zero they are not included in the string. @@ -122,13 +122,13 @@ unsigned int utoa_append(char *buffer, unsigned int value, unsigned int sub){ } // Values of binary digits -unsigned long[] RADIX_BINARY_VALUES_LONG = { 0b10000000000000000000000000000000, 0b01000000000000000000000000000000, 0b00100000000000000000000000000000, 0b00010000000000000000000000000000, 0b00001000000000000000000000000000, 0b00000100000000000000000000000000, 0b00000010000000000000000000000000, 0b00000001000000000000000000000000, 0b00000000100000000000000000000000, 0b00000000010000000000000000000000, 0b00000000001000000000000000000000, 0b00000000000100000000000000000000, 0b00000000000010000000000000000000, 0b00000000000001000000000000000000, 0b00000000000000100000000000000000, 0b00000000000000010000000000000000, 0b00000000000000001000000000000000, 0b00000000000000000100000000000000, 0b00000000000000000010000000000000, 0b00000000000000000001000000000000, 0b00000000000000000000100000000000, 0b00000000000000000000010000000000, 0b00000000000000000000001000000000, 0b00000000000000000000000100000000, 0b00000000000000000000000010000000, 0b00000000000000000000000001000000, 0b00000000000000000000000000100000, 0b00000000000000000000000000010000, 0b00000000000000000000000000001000, 0b00000000000000000000000000000100, 0b00000000000000000000000000000010 }; +unsigned long RADIX_BINARY_VALUES_LONG[] = { 0b10000000000000000000000000000000, 0b01000000000000000000000000000000, 0b00100000000000000000000000000000, 0b00010000000000000000000000000000, 0b00001000000000000000000000000000, 0b00000100000000000000000000000000, 0b00000010000000000000000000000000, 0b00000001000000000000000000000000, 0b00000000100000000000000000000000, 0b00000000010000000000000000000000, 0b00000000001000000000000000000000, 0b00000000000100000000000000000000, 0b00000000000010000000000000000000, 0b00000000000001000000000000000000, 0b00000000000000100000000000000000, 0b00000000000000010000000000000000, 0b00000000000000001000000000000000, 0b00000000000000000100000000000000, 0b00000000000000000010000000000000, 0b00000000000000000001000000000000, 0b00000000000000000000100000000000, 0b00000000000000000000010000000000, 0b00000000000000000000001000000000, 0b00000000000000000000000100000000, 0b00000000000000000000000010000000, 0b00000000000000000000000001000000, 0b00000000000000000000000000100000, 0b00000000000000000000000000010000, 0b00000000000000000000000000001000, 0b00000000000000000000000000000100, 0b00000000000000000000000000000010 }; // Values of octal digits -unsigned long[] RADIX_OCTAL_VALUES_LONG = { 0x40000000, 0x8000000, 0x1000000, 0x200000, 0x40000, 0x8000, 0x1000, 0x200, 0x40, 0x8 }; +unsigned long RADIX_OCTAL_VALUES_LONG[] = { 0x40000000, 0x8000000, 0x1000000, 0x200000, 0x40000, 0x8000, 0x1000, 0x200, 0x40, 0x8 }; // Values of decimal digits -unsigned long[] RADIX_DECIMAL_VALUES_LONG = { 1000000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10 }; +unsigned long RADIX_DECIMAL_VALUES_LONG[] = { 1000000000, 100000000, 10000000, 1000000, 100000, 10000, 1000, 100, 10 }; // Values of hexadecimal digits -unsigned long[] RADIX_HEXADECIMAL_VALUES_LONG = { 0x10000000, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10 }; +unsigned long RADIX_HEXADECIMAL_VALUES_LONG[] = { 0x10000000, 0x1000000, 0x100000, 0x10000, 0x1000, 0x100, 0x10 }; // Converts unsigned number value to a string representing it in RADIX format. // If the leading digits are zero they are not included in the string. diff --git a/src/test/kc/complex/prebob/vogel-bobs.kc b/src/test/kc/complex/prebob/vogel-bobs.kc index 8decdbe70..5667dbaae 100644 --- a/src/test/kc/complex/prebob/vogel-bobs.kc +++ b/src/test/kc/complex/prebob/vogel-bobs.kc @@ -114,7 +114,7 @@ char* RENDERBOB_CLEANUP[NUM_BOBS]; char** renderBobCleanupNext; // *40 Table unsigned int[0x20] MUL40 = { ((unsigned int)i)*40 }; -unsigned int[0x20] MUL40; +unsigned int MUL40[0x20]; // Initialize the tables used by renderBob() void renderBobInit() {