mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-16 18:30:37 +00:00
Updated tetris to C types.
This commit is contained in:
parent
d29a935507
commit
7f9fd7b46a
@ -1,17 +1,17 @@
|
||||
// SID registers for random number generation
|
||||
const word* SID_VOICE3_FREQ = $d40e;
|
||||
const byte* SID_VOICE3_FREQ_LOW = $d40e;
|
||||
const byte* SID_VOICE3_FREQ_HIGH = $d40f;
|
||||
const byte* SID_VOICE3_CONTROL = $d412;
|
||||
const byte SID_CONTROL_NOISE = $80;
|
||||
const byte SID_CONTROL_PULSE = $40;
|
||||
const byte SID_CONTROL_SAWTOOTH = $20;
|
||||
const byte SID_CONTROL_TRIANGLE = $10;
|
||||
const byte SID_CONTROL_TEST = $08;
|
||||
const byte SID_CONTROL_RING = $04;
|
||||
const byte SID_CONTROL_SYNC = $02;
|
||||
const byte SID_CONTROL_GATE = $01;
|
||||
const byte* SID_VOICE3_OSC = $d41b;
|
||||
const char* SID_VOICE3_FREQ_LOW = $d40e;
|
||||
const char* SID_VOICE3_FREQ_HIGH = $d40f;
|
||||
const char* SID_VOICE3_CONTROL = $d412;
|
||||
const char SID_CONTROL_NOISE = $80;
|
||||
const char SID_CONTROL_PULSE = $40;
|
||||
const char SID_CONTROL_SAWTOOTH = $20;
|
||||
const char SID_CONTROL_TRIANGLE = $10;
|
||||
const char SID_CONTROL_TEST = $08;
|
||||
const char SID_CONTROL_RING = $04;
|
||||
const char SID_CONTROL_SYNC = $02;
|
||||
const char SID_CONTROL_GATE = $01;
|
||||
const char* SID_VOICE3_OSC = $d41b;
|
||||
|
||||
// Initialize SID voice 3 for random number generation
|
||||
void sid_rnd_init() {
|
||||
@ -21,7 +21,7 @@ void sid_rnd_init() {
|
||||
|
||||
// Get a random number from the SID voice 3,
|
||||
// Must be initialized with sid_rnd_init()
|
||||
inline byte sid_rnd() {
|
||||
inline char sid_rnd() {
|
||||
return *SID_VOICE3_OSC;
|
||||
}
|
||||
|
||||
|
@ -1,18 +1,18 @@
|
||||
import "tetris-sprites"
|
||||
|
||||
byte[256] SIN = kickasm {{
|
||||
char[256] SIN = kickasm {{
|
||||
.var AMPL = 200-21
|
||||
.for(var i=0; i<256; i++) {
|
||||
.byte 51+AMPL/2+sin(toRadians([i*360]/256))*AMPL/2
|
||||
}
|
||||
}};
|
||||
|
||||
byte* SIN_SPRITE = $2800;
|
||||
char* SIN_SPRITE = $2800;
|
||||
kickasm(pc SIN_SPRITE) {{
|
||||
.fill $40, $ff
|
||||
}}
|
||||
|
||||
byte sin_idx = 0;
|
||||
char sin_idx = 0;
|
||||
|
||||
void main() {
|
||||
vicSelectGfxBank(PLAYFIELD_SCREEN_1);
|
||||
@ -21,10 +21,10 @@ void main() {
|
||||
|
||||
*SPRITES_ENABLE = $ff;
|
||||
|
||||
byte xpos = 24;
|
||||
byte ypos = 50;
|
||||
for(byte s:4..7) {
|
||||
byte s2 = s*2;
|
||||
char xpos = 24;
|
||||
char ypos = 50;
|
||||
for(char s:4..7) {
|
||||
char s2 = s*2;
|
||||
SPRITES_XPOS[s2] = xpos;
|
||||
SPRITES_YPOS[s2] = ypos;
|
||||
SPRITES_COLS[s] = s-3;
|
||||
@ -41,8 +41,8 @@ void main() {
|
||||
void loop() {
|
||||
while(true) {
|
||||
do {} while (*RASTER!=$ff);
|
||||
byte idx = sin_idx;
|
||||
for(byte s:4..7) {
|
||||
char idx = sin_idx;
|
||||
for(char s:4..7) {
|
||||
SPRITES_YPOS[s*2] = SIN[idx];
|
||||
idx += 10;
|
||||
}
|
||||
|
@ -2,55 +2,55 @@
|
||||
// Memory Layout and Shared Data
|
||||
|
||||
// Address of the first screen
|
||||
const byte* PLAYFIELD_SCREEN_1 = $0400;
|
||||
const char* PLAYFIELD_SCREEN_1 = $0400;
|
||||
// Address of the second screen
|
||||
const byte* PLAYFIELD_SCREEN_2 = $2c00;
|
||||
const char* PLAYFIELD_SCREEN_2 = $2c00;
|
||||
// Screen Sprite pointers on screen 1
|
||||
const byte* PLAYFIELD_SPRITE_PTRS_1 = (PLAYFIELD_SCREEN_1+SPRITE_PTRS);
|
||||
const char* PLAYFIELD_SPRITE_PTRS_1 = (PLAYFIELD_SCREEN_1+SPRITE_PTRS);
|
||||
// Screen Sprite pointers on screen 2
|
||||
const byte* PLAYFIELD_SPRITE_PTRS_2 = (PLAYFIELD_SCREEN_2+SPRITE_PTRS);
|
||||
const char* PLAYFIELD_SPRITE_PTRS_2 = (PLAYFIELD_SCREEN_2+SPRITE_PTRS);
|
||||
// Address of the original playscreen chars
|
||||
const byte* PLAYFIELD_SCREEN_ORIGINAL = $1800;
|
||||
const char* PLAYFIELD_SCREEN_ORIGINAL = $1800;
|
||||
// Address of the original playscreen colors
|
||||
const byte* PLAYFIELD_COLORS_ORIGINAL = $1c00;
|
||||
const char* PLAYFIELD_COLORS_ORIGINAL = $1c00;
|
||||
// Address of the sprites covering the playfield
|
||||
const byte* PLAYFIELD_SPRITES = $2000;
|
||||
const char* PLAYFIELD_SPRITES = $2000;
|
||||
// Address of the charset
|
||||
const byte* PLAYFIELD_CHARSET = $2800;
|
||||
const char* PLAYFIELD_CHARSET = $2800;
|
||||
|
||||
// The size of the playfield
|
||||
const byte PLAYFIELD_LINES = 22;
|
||||
const byte PLAYFIELD_COLS = 10;
|
||||
const char PLAYFIELD_LINES = 22;
|
||||
const char PLAYFIELD_COLS = 10;
|
||||
|
||||
// The playfield. 0 is empty non-zero is color.
|
||||
// The playfield is layed out line by line, meaning the first 10 bytes are line 1, the next 10 line 2 and so forth,
|
||||
byte[PLAYFIELD_LINES*PLAYFIELD_COLS] playfield;
|
||||
char[PLAYFIELD_LINES*PLAYFIELD_COLS] playfield;
|
||||
|
||||
// Pointer to the current piece in the current orientation. Updated each time current_orientation is updated.
|
||||
byte* current_piece_gfx;
|
||||
char* current_piece_gfx;
|
||||
|
||||
// The char of the current piece
|
||||
byte current_piece_char;
|
||||
char current_piece_char;
|
||||
|
||||
// Position of top left corner of current moving piece on the playfield
|
||||
byte current_xpos;
|
||||
byte current_ypos;
|
||||
char current_xpos;
|
||||
char current_ypos;
|
||||
|
||||
// The screen currently being rendered to. $00 for screen 1 / $20 for screen 2.
|
||||
byte render_screen_render = $20;
|
||||
char render_screen_render = $20;
|
||||
// The screen currently to show next to the user. $00 for screen 1 / $20 for screen 2.
|
||||
byte render_screen_show = 0;
|
||||
char render_screen_show = 0;
|
||||
// The screen currently being showed to the user. $00 for screen 1 / $20 for screen 2.
|
||||
volatile byte render_screen_showing = 0;
|
||||
volatile char render_screen_showing = 0;
|
||||
|
||||
// Current score in BCD-format
|
||||
dword score_bcd = 0;
|
||||
unsigned long score_bcd = 0;
|
||||
// Current number of cleared lines in BCD-format
|
||||
word lines_bcd = 0;
|
||||
unsigned int lines_bcd = 0;
|
||||
// Current level BCD-format
|
||||
byte level_bcd = 0;
|
||||
char level_bcd = 0;
|
||||
// Current level in normal (non-BCD) format
|
||||
byte level = 0;
|
||||
char level = 0;
|
||||
// Is the game over?
|
||||
byte game_over = 0;
|
||||
char game_over = 0;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// The tetris pieces
|
||||
|
||||
// The T-piece
|
||||
align($40) byte[4*4*4] PIECE_T = {
|
||||
align($40) char[4*4*4] PIECE_T = {
|
||||
0, 0, 0, 0,
|
||||
1, 1, 1, 0,
|
||||
0, 1, 0, 0,
|
||||
@ -25,7 +25,7 @@ align($40) byte[4*4*4] PIECE_T = {
|
||||
};
|
||||
|
||||
// The S-piece
|
||||
align($40) byte[4*4*4] PIECE_S = {
|
||||
align($40) char[4*4*4] PIECE_S = {
|
||||
0, 0, 0, 0,
|
||||
0, 1, 1, 0,
|
||||
1, 1, 0, 0,
|
||||
@ -49,7 +49,7 @@ align($40) byte[4*4*4] PIECE_S = {
|
||||
};
|
||||
|
||||
// The Z-piece
|
||||
align($40) byte[4*4*4] PIECE_Z = {
|
||||
align($40) char[4*4*4] PIECE_Z = {
|
||||
0, 0, 0, 0,
|
||||
1, 1, 0, 0,
|
||||
0, 1, 1, 0,
|
||||
@ -73,7 +73,7 @@ align($40) byte[4*4*4] PIECE_Z = {
|
||||
};
|
||||
|
||||
// The L-piece
|
||||
align($40) byte[4*4*4] PIECE_L = {
|
||||
align($40) char[4*4*4] PIECE_L = {
|
||||
0, 0, 0, 0,
|
||||
1, 1, 1, 0,
|
||||
1, 0, 0, 0,
|
||||
@ -97,7 +97,7 @@ align($40) byte[4*4*4] PIECE_L = {
|
||||
};
|
||||
|
||||
// The J-piece
|
||||
align($40) byte[4*4*4] PIECE_J = {
|
||||
align($40) char[4*4*4] PIECE_J = {
|
||||
0, 0, 0, 0,
|
||||
1, 1, 1, 0,
|
||||
0, 0, 1, 0,
|
||||
@ -121,7 +121,7 @@ align($40) byte[4*4*4] PIECE_J = {
|
||||
};
|
||||
|
||||
// The O-piece
|
||||
align($40) byte[4*4*4] PIECE_O = {
|
||||
align($40) char[4*4*4] PIECE_O = {
|
||||
0, 0, 0, 0,
|
||||
0, 1, 1, 0,
|
||||
0, 1, 1, 0,
|
||||
@ -145,7 +145,7 @@ align($40) byte[4*4*4] PIECE_O = {
|
||||
};
|
||||
|
||||
// The I-piece
|
||||
align($40) byte[4*4*4] PIECE_I = {
|
||||
align($40) char[4*4*4] PIECE_I = {
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
1, 1, 1, 1,
|
||||
@ -172,11 +172,11 @@ align($40) byte[4*4*4] PIECE_I = {
|
||||
word[] PIECES = { (word)PIECE_T, (word)PIECE_S, (word)PIECE_Z, (word)PIECE_J, (word)PIECE_O, (word)PIECE_I, (word)PIECE_L };
|
||||
|
||||
// The chars to use for the different pieces - when inside the playing area
|
||||
byte[] PIECES_CHARS = { $65, $66, $a6, $66, $65, $65, $a6 };
|
||||
char[] PIECES_CHARS = { $65, $66, $a6, $66, $65, $65, $a6 };
|
||||
|
||||
// The chars to use for the different pieces - when outside the playing area (eg. the next area).
|
||||
byte[] PIECES_NEXT_CHARS = { $63, $64, $a4, $64, $63, $63, $a4 };
|
||||
char[] PIECES_NEXT_CHARS = { $63, $64, $a4, $64, $63, $63, $a4 };
|
||||
|
||||
// The initial X/Y for each piece
|
||||
byte[] PIECES_START_X = { 4, 4, 4, 4, 4, 4, 4 };
|
||||
byte[] PIECES_START_Y = { 1, 1, 1, 1, 1, 0, 1 };
|
||||
char[] PIECES_START_X = { 4, 4, 4, 4, 4, 4, 4 };
|
||||
char[] PIECES_START_Y = { 1, 1, 1, 1, 1, 0, 1 };
|
@ -6,48 +6,48 @@ import "tetris-data"
|
||||
import "tetris-pieces"
|
||||
|
||||
// Pointers to the playfield address for each playfield line
|
||||
byte*[PLAYFIELD_LINES] playfield_lines;
|
||||
char*[PLAYFIELD_LINES] playfield_lines;
|
||||
|
||||
// Indixes into the playfield for each playfield line
|
||||
byte[PLAYFIELD_LINES+1] playfield_lines_idx;
|
||||
char[PLAYFIELD_LINES+1] playfield_lines_idx;
|
||||
|
||||
// The index of the next moving piece. (0-6)
|
||||
byte next_piece_idx = 0;
|
||||
char next_piece_idx = 0;
|
||||
|
||||
// The current moving piece. Points to the start of the piece definition.
|
||||
byte* current_piece = 0;
|
||||
char* current_piece = 0;
|
||||
|
||||
// The curent piece orientation - each piece have 4 orientations (00/$10/$20/$30).
|
||||
// The orientation chooses one of the 4 sub-graphics of the piece.
|
||||
byte current_orientation = 0;
|
||||
char current_orientation = 0;
|
||||
|
||||
// The speed of moving down the piece when soft-drop is not activated
|
||||
// This array holds the number of frames per move by level (0-29). For all levels 29+ the value is 1.
|
||||
const byte[] MOVEDOWN_SLOW_SPEEDS = { 48, 43, 38, 33, 28, 23, 18, 13, 8, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 };
|
||||
const char[] MOVEDOWN_SLOW_SPEEDS = { 48, 43, 38, 33, 28, 23, 18, 13, 8, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 };
|
||||
|
||||
// The rate of moving down the current piece (number of frames between moves if movedown is not forced)
|
||||
byte current_movedown_slow = 48;
|
||||
char current_movedown_slow = 48;
|
||||
|
||||
// The rate of moving down the current piece fast (number of frames between moves if movedown is not forced)
|
||||
const byte current_movedown_fast = 10;
|
||||
const char current_movedown_fast = 10;
|
||||
|
||||
// Counts up to the next movedown of current piece
|
||||
byte current_movedown_counter = 0;
|
||||
char current_movedown_counter = 0;
|
||||
|
||||
// Base Score values for removing 0-4 lines (in BCD)
|
||||
// These values are added to score_add_bcd for each level gained.
|
||||
const dword[] SCORE_BASE_BCD = { $0000, $0040, $0100, $0300, $1200 };
|
||||
const unsigned long[] SCORE_BASE_BCD = { $0000, $0040, $0100, $0300, $1200 };
|
||||
|
||||
// Score values for removing 0-4 lines (in BCD)
|
||||
// These values are updated based on the players level and the base values from SCORE_BASE_BCD
|
||||
dword[5] score_add_bcd;
|
||||
unsigned long[5] score_add_bcd;
|
||||
|
||||
// Initialize play data tables
|
||||
void play_init() {
|
||||
// Initialize the playfield line pointers;
|
||||
byte idx = 0;
|
||||
byte* pli = playfield;
|
||||
for(byte j:0..PLAYFIELD_LINES-1) {
|
||||
char idx = 0;
|
||||
char* pli = playfield;
|
||||
for(char j:0..PLAYFIELD_LINES-1) {
|
||||
playfield_lines[j] = pli;
|
||||
playfield_lines_idx[j] = idx;
|
||||
pli += PLAYFIELD_COLS;
|
||||
@ -58,7 +58,7 @@ void play_init() {
|
||||
// Set initial speed of moving down a tetromino
|
||||
current_movedown_slow = MOVEDOWN_SLOW_SPEEDS[level];
|
||||
// Set the initial score add values
|
||||
for(byte b: 0..4) {
|
||||
for(char b: 0..4) {
|
||||
score_add_bcd[b] = SCORE_BASE_BCD[b];
|
||||
}
|
||||
|
||||
@ -67,8 +67,8 @@ void play_init() {
|
||||
// Perform any movement of the current piece
|
||||
// key_event is the next keyboard_event() og $ff if no keyboard event is pending
|
||||
// Returns a byte signaling whether rendering is needed. (0 no render, >0 render needed)
|
||||
byte play_movement(byte key_event) {
|
||||
byte render = 0;
|
||||
char play_movement(char key_event) {
|
||||
char render = 0;
|
||||
render += play_move_down(key_event);
|
||||
if(game_over!=0) {
|
||||
return render;
|
||||
@ -80,10 +80,10 @@ byte play_movement(byte key_event) {
|
||||
|
||||
// Move down the current piece
|
||||
// Return non-zero if a render is needed
|
||||
byte play_move_down(byte key_event) {
|
||||
char play_move_down(byte key_event) {
|
||||
// Handle moving down current piece
|
||||
++current_movedown_counter;
|
||||
byte movedown = 0;
|
||||
char movedown = 0;
|
||||
// As soon as space is pressed move down once
|
||||
if(key_event==KEY_SPACE) {
|
||||
movedown++;
|
||||
@ -107,7 +107,7 @@ byte play_move_down(byte key_event) {
|
||||
// Lock current piece
|
||||
play_lock_current();
|
||||
// Check for any lines and remove them
|
||||
byte removed = play_remove_lines();
|
||||
char removed = play_remove_lines();
|
||||
// Tally up the score
|
||||
play_update_score(removed);
|
||||
// Spawn a new piece
|
||||
@ -121,7 +121,7 @@ byte play_move_down(byte key_event) {
|
||||
|
||||
// Move left/right or rotate the current piece
|
||||
// Return non-zero if a render is needed
|
||||
byte play_move_leftright(byte key_event) {
|
||||
char play_move_leftright(char key_event) {
|
||||
// Handle keyboard events
|
||||
if(key_event==KEY_COMMA) {
|
||||
if(play_collision(current_xpos-1,current_ypos,current_orientation)==COLLISION_NONE) {
|
||||
@ -139,9 +139,9 @@ byte play_move_leftright(byte key_event) {
|
||||
|
||||
// Rotate the current piece based on key-presses
|
||||
// Return non-zero if a render is needed
|
||||
byte play_move_rotate(byte key_event) {
|
||||
char play_move_rotate(char key_event) {
|
||||
// Handle keyboard events
|
||||
byte orientation = $80;
|
||||
char orientation = $80;
|
||||
if(key_event==KEY_Z) {
|
||||
orientation = (current_orientation-$10)&$3f;
|
||||
} else if(key_event==KEY_X) {
|
||||
@ -158,26 +158,26 @@ byte play_move_rotate(byte key_event) {
|
||||
}
|
||||
|
||||
// No collision
|
||||
const byte COLLISION_NONE = 0;
|
||||
const char COLLISION_NONE = 0;
|
||||
// Playfield piece collision (cell on top of other cell on the playfield)
|
||||
const byte COLLISION_PLAYFIELD = 1;
|
||||
const char COLLISION_PLAYFIELD = 1;
|
||||
// Bottom collision (cell below bottom of the playfield)
|
||||
const byte COLLISION_BOTTOM = 2;
|
||||
const char COLLISION_BOTTOM = 2;
|
||||
// Left side collision (cell beyond the left side of the playfield)
|
||||
const byte COLLISION_LEFT = 4;
|
||||
const char COLLISION_LEFT = 4;
|
||||
// Right side collision (cell beyond the right side of the playfield)
|
||||
const byte COLLISION_RIGHT = 8;
|
||||
const char COLLISION_RIGHT = 8;
|
||||
|
||||
// Test if there is a collision between the current piece moved to (x, y) and anything on the playfield or the playfield boundaries
|
||||
// Returns information about the type of the collision detected
|
||||
byte play_collision(byte xpos, byte ypos, byte orientation) {
|
||||
byte* piece_gfx = current_piece + orientation;
|
||||
byte i = 0;
|
||||
byte yp = ypos;
|
||||
for(byte l:0..3) {
|
||||
byte* playfield_line = playfield_lines[yp];
|
||||
byte xp = xpos;
|
||||
for(byte c:0..3) {
|
||||
char play_collision(char xpos, char ypos, char orientation) {
|
||||
char* piece_gfx = current_piece + orientation;
|
||||
char i = 0;
|
||||
char yp = ypos;
|
||||
for(char l:0..3) {
|
||||
char* playfield_line = playfield_lines[yp];
|
||||
char xp = xpos;
|
||||
for(char c:0..3) {
|
||||
if(piece_gfx[i++]!=0) {
|
||||
if(yp>=PLAYFIELD_LINES) {
|
||||
// Below the playfield bottom
|
||||
@ -205,12 +205,12 @@ byte play_collision(byte xpos, byte ypos, byte orientation) {
|
||||
|
||||
// Lock the current piece onto the playfield
|
||||
void play_lock_current() {
|
||||
byte i = 0;
|
||||
byte yp = current_ypos;
|
||||
for(byte l:0..3) {
|
||||
byte* playfield_line = playfield_lines[yp];
|
||||
byte xp = current_xpos;
|
||||
for(byte c:0..3) {
|
||||
char i = 0;
|
||||
char yp = current_ypos;
|
||||
for(char l:0..3) {
|
||||
char* playfield_line = playfield_lines[yp];
|
||||
char xp = current_xpos;
|
||||
for(char c:0..3) {
|
||||
if(current_piece_gfx[i++]!=0) {
|
||||
playfield_line[xp] = current_piece_char;
|
||||
}
|
||||
@ -224,7 +224,7 @@ void play_lock_current() {
|
||||
// Moves the next piece into the current and spawns a new next piece
|
||||
void play_spawn_current() {
|
||||
// Move next piece into current
|
||||
byte current_piece_idx = next_piece_idx;
|
||||
char current_piece_idx = next_piece_idx;
|
||||
current_piece = PIECES[current_piece_idx];
|
||||
current_piece_char = PIECES_CHARS[current_piece_idx];
|
||||
current_orientation = 0;
|
||||
@ -237,7 +237,7 @@ void play_spawn_current() {
|
||||
|
||||
// Spawn a new next piece
|
||||
// Pick a random piece (0-6)
|
||||
byte piece_idx = 7;
|
||||
char piece_idx = 7;
|
||||
while(piece_idx==7) {
|
||||
piece_idx = sid_rnd()&7;
|
||||
}
|
||||
@ -249,17 +249,17 @@ void play_spawn_current() {
|
||||
// Utilizes two cursors on the playfield - one reading cells and one writing cells
|
||||
// Whenever a full line is detected the writing cursor is instructed to write to the same line once more.
|
||||
// Returns the number of lines removed
|
||||
byte play_remove_lines() {
|
||||
char play_remove_lines() {
|
||||
// Start both cursors at the end of the playfield
|
||||
byte r = PLAYFIELD_LINES*PLAYFIELD_COLS-1;
|
||||
byte w = PLAYFIELD_LINES*PLAYFIELD_COLS-1;
|
||||
char r = PLAYFIELD_LINES*PLAYFIELD_COLS-1;
|
||||
char w = PLAYFIELD_LINES*PLAYFIELD_COLS-1;
|
||||
|
||||
byte removed = 0;
|
||||
char removed = 0;
|
||||
// Read all lines and rewrite them
|
||||
for(byte y:0..PLAYFIELD_LINES-1) {
|
||||
byte full = 1;
|
||||
for(byte x:0..PLAYFIELD_COLS-1) {
|
||||
byte c = playfield[r--];
|
||||
for(char y:0..PLAYFIELD_LINES-1) {
|
||||
char full = 1;
|
||||
for(char x:0..PLAYFIELD_COLS-1) {
|
||||
char c = playfield[r--];
|
||||
if(c==0) {
|
||||
full = 0;
|
||||
}
|
||||
@ -281,10 +281,10 @@ byte play_remove_lines() {
|
||||
}
|
||||
|
||||
// Update the score based on the number of lines removed
|
||||
void play_update_score(byte removed) {
|
||||
void play_update_score(char removed) {
|
||||
if(removed!=0){
|
||||
byte lines_before = <lines_bcd&$f0;
|
||||
dword add_bcd = score_add_bcd[removed];
|
||||
char lines_before = <lines_bcd&$f0;
|
||||
unsigned long add_bcd = score_add_bcd[removed];
|
||||
|
||||
asm { sed }
|
||||
lines_bcd += removed;
|
||||
@ -292,7 +292,7 @@ void play_update_score(byte removed) {
|
||||
asm { cld }
|
||||
|
||||
// If line 10-part updated increase the level
|
||||
byte lines_after = <lines_bcd&$f0;
|
||||
char lines_after = <lines_bcd&$f0;
|
||||
if(lines_before!=lines_after) {
|
||||
play_increase_level();
|
||||
}
|
||||
@ -317,7 +317,7 @@ void play_increase_level() {
|
||||
}
|
||||
// Increase the score values gained
|
||||
asm { sed }
|
||||
for(byte b: 0..4) {
|
||||
for(char b: 0..4) {
|
||||
score_add_bcd[b] += SCORE_BASE_BCD[b];
|
||||
}
|
||||
asm { cld }
|
||||
|
@ -9,7 +9,7 @@ kickasm(pc PLAYFIELD_CHARSET, resource "playfield-screen.imap") {{
|
||||
.import binary "playfield-screen.imap"
|
||||
}}
|
||||
|
||||
const byte PLAYFIELD_SCREEN_ORIGINAL_WIDTH=32;
|
||||
const char PLAYFIELD_SCREEN_ORIGINAL_WIDTH=32;
|
||||
kickasm(pc PLAYFIELD_SCREEN_ORIGINAL, resource "playfield-screen.iscr", resource "playfield-extended.col" ) {{
|
||||
// Load chars for the screen
|
||||
.var screen = LoadBinary("playfield-screen.iscr")
|
||||
@ -27,13 +27,13 @@ kickasm(pc PLAYFIELD_COLORS_ORIGINAL, resource "playfield-screen.col") {{
|
||||
}}
|
||||
|
||||
// The color #1 to use for the pieces for each level
|
||||
byte[] PIECES_COLORS_1 = {
|
||||
char[] PIECES_COLORS_1 = {
|
||||
BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED,
|
||||
BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED,
|
||||
BLUE, GREEN, PURPLE, BLUE, RED, LIGHT_GREEN, RED, BLUE, LIGHT_BLUE, RED
|
||||
};
|
||||
// The color #2 to use for the pieces for each level
|
||||
byte[] PIECES_COLORS_2 = {
|
||||
char[] PIECES_COLORS_2 = {
|
||||
CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE,
|
||||
CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE,
|
||||
CYAN, LIGHT_GREEN, PINK, LIGHT_GREEN, LIGHT_GREEN, LIGHT_BLUE, DARK_GREY, PURPLE, RED, ORANGE
|
||||
@ -41,8 +41,8 @@ byte[] PIECES_COLORS_2 = {
|
||||
|
||||
// Pointers to the screen address for rendering each playfield line
|
||||
// The lines for screen 1 is aligned with $80 and screen 2 with $40 - so XOR'ing with $40 gives screen 2 lines.
|
||||
align($80) byte*[PLAYFIELD_LINES] screen_lines_1;
|
||||
align($40) byte*[PLAYFIELD_LINES] screen_lines_2;
|
||||
align($80) char*[PLAYFIELD_LINES] screen_lines_1;
|
||||
align($40) char*[PLAYFIELD_LINES] screen_lines_2;
|
||||
|
||||
// Initialize rendering
|
||||
void render_init() {
|
||||
@ -60,9 +60,9 @@ void render_init() {
|
||||
render_screen_original(PLAYFIELD_SCREEN_2);
|
||||
|
||||
// Initialize the screen line pointers;
|
||||
byte* li_1 = PLAYFIELD_SCREEN_1 + 2*40 + 16;
|
||||
byte* li_2 = PLAYFIELD_SCREEN_2 + 2*40 + 16;
|
||||
for(byte i:0..PLAYFIELD_LINES-1) {
|
||||
char* li_1 = PLAYFIELD_SCREEN_1 + 2*40 + 16;
|
||||
char* li_2 = PLAYFIELD_SCREEN_2 + 2*40 + 16;
|
||||
for(char i:0..PLAYFIELD_LINES-1) {
|
||||
screen_lines_1[i] = li_1;
|
||||
screen_lines_2[i] = li_2;
|
||||
li_1 += 40;
|
||||
@ -76,7 +76,7 @@ void render_init() {
|
||||
|
||||
// Update $D018 to show the current screen (used for double buffering)
|
||||
void render_show() {
|
||||
byte d018val = 0;
|
||||
char d018val = 0;
|
||||
if(render_screen_show==0) {
|
||||
d018val = toD018(PLAYFIELD_SCREEN_1, PLAYFIELD_CHARSET);
|
||||
} else {
|
||||
@ -96,24 +96,24 @@ void render_screen_swap() {
|
||||
|
||||
// Show the current score
|
||||
void render_score() {
|
||||
byte* screen;
|
||||
char* screen;
|
||||
if(render_screen_render==0) {
|
||||
screen = PLAYFIELD_SCREEN_1;
|
||||
} else {
|
||||
screen = PLAYFIELD_SCREEN_2;
|
||||
}
|
||||
|
||||
byte* score_bytes = (byte*)(&score_bcd);
|
||||
word score_offset = 40*$05 + $1c;
|
||||
char* score_bytes = (byte*)(&score_bcd);
|
||||
unsigned int score_offset = 40*$05 + $1c;
|
||||
render_bcd( screen, score_offset, score_bytes[2], 0);
|
||||
render_bcd( screen, score_offset+2, score_bytes[1], 0);
|
||||
render_bcd( screen, score_offset+4, score_bytes[0], 0);
|
||||
|
||||
word lines_offset = 40*$01 + $16;
|
||||
unsigned int lines_offset = 40*$01 + $16;
|
||||
render_bcd( screen, lines_offset, >lines_bcd, 1);
|
||||
render_bcd( screen, lines_offset+1, <lines_bcd, 0);
|
||||
|
||||
word level_offset = 40*19 + $1f;
|
||||
unsigned int level_offset = 40*19 + $1f;
|
||||
render_bcd( screen, level_offset, level_bcd, 0);
|
||||
|
||||
}
|
||||
@ -123,9 +123,9 @@ void render_score() {
|
||||
// - offset: offset on the screen
|
||||
// - bcd: The BCD-value to render
|
||||
// - only_low: if non-zero only renders the low digit
|
||||
void render_bcd(byte* screen, word offset, byte bcd, byte only_low) {
|
||||
const byte ZERO_CHAR = 53;
|
||||
byte* screen_pos = screen+offset;
|
||||
void render_bcd(char* screen, unsigned int offset, char bcd, char only_low) {
|
||||
const char ZERO_CHAR = 53;
|
||||
char* screen_pos = screen+offset;
|
||||
if(only_low==0) {
|
||||
*screen_pos++ = ZERO_CHAR + (bcd >> 4);
|
||||
}
|
||||
@ -134,13 +134,13 @@ void render_bcd(byte* screen, word offset, byte bcd, byte only_low) {
|
||||
|
||||
// Copy the original screen data to the passed screen
|
||||
// Also copies colors to $d800
|
||||
void render_screen_original(byte* screen) {
|
||||
byte SPACE = 0;
|
||||
byte* oscr = PLAYFIELD_SCREEN_ORIGINAL+32*2;
|
||||
byte* ocols = PLAYFIELD_COLORS_ORIGINAL+32*2;
|
||||
byte* cols = COLS;
|
||||
for(byte y:0..24) {
|
||||
byte x=0;
|
||||
void render_screen_original(char* screen) {
|
||||
char SPACE = 0;
|
||||
char* oscr = PLAYFIELD_SCREEN_ORIGINAL+32*2;
|
||||
char* ocols = PLAYFIELD_COLORS_ORIGINAL+32*2;
|
||||
char* cols = COLS;
|
||||
for(char y:0..24) {
|
||||
char x=0;
|
||||
do {
|
||||
*screen++ = SPACE;
|
||||
*cols++ = BLACK;
|
||||
@ -159,10 +159,10 @@ void render_screen_original(byte* screen) {
|
||||
// Render the static playfield on the screen (all pieces already locked into place)
|
||||
void render_playfield() {
|
||||
// Do not render the top 2 lines.
|
||||
byte i = PLAYFIELD_COLS*2;
|
||||
for(byte l:2..PLAYFIELD_LINES-1) {
|
||||
byte* screen_line = screen_lines_1[render_screen_render+l];
|
||||
for(byte c:0..PLAYFIELD_COLS-1) {
|
||||
char i = PLAYFIELD_COLS*2;
|
||||
for(char l:2..PLAYFIELD_LINES-1) {
|
||||
char* screen_line = screen_lines_1[render_screen_render+l];
|
||||
for(char c:0..PLAYFIELD_COLS-1) {
|
||||
*(screen_line++) = playfield[i++];
|
||||
}
|
||||
}
|
||||
@ -171,14 +171,14 @@ void render_playfield() {
|
||||
// Render the current moving piece at position (current_xpos, current_ypos)
|
||||
// Ignores cases where parts of the tetromino is outside the playfield (sides/bottom) since the movement collision routine prevents this.
|
||||
void render_moving() {
|
||||
byte i = 0;
|
||||
byte ypos = current_ypos;
|
||||
for(byte l:0..3) {
|
||||
char i = 0;
|
||||
char ypos = current_ypos;
|
||||
for(char l:0..3) {
|
||||
if(ypos>1) {
|
||||
byte* screen_line = screen_lines_1[render_screen_render+ypos];
|
||||
byte xpos = current_xpos;
|
||||
for(byte c:0..3) {
|
||||
byte current_cell = current_piece_gfx[i++];
|
||||
char* screen_line = screen_lines_1[render_screen_render+ypos];
|
||||
char xpos = current_xpos;
|
||||
for(char c:0..3) {
|
||||
char current_cell = current_piece_gfx[i++];
|
||||
if(current_cell!=0) {
|
||||
screen_line[xpos] = current_piece_char;
|
||||
}
|
||||
@ -195,8 +195,8 @@ void render_moving() {
|
||||
void render_next() {
|
||||
|
||||
// Find the screen area
|
||||
word next_area_offset = 40*12 + 24 + 4;
|
||||
byte* screen_next_area;
|
||||
unsigned int next_area_offset = 40*12 + 24 + 4;
|
||||
char* screen_next_area;
|
||||
if(render_screen_render==0) {
|
||||
screen_next_area = PLAYFIELD_SCREEN_1+next_area_offset;
|
||||
} else {
|
||||
@ -204,11 +204,11 @@ void render_next() {
|
||||
}
|
||||
|
||||
// Render the next piece
|
||||
byte* next_piece_gfx = PIECES[next_piece_idx];
|
||||
byte next_piece_char = PIECES_NEXT_CHARS[next_piece_idx];
|
||||
for(byte l:0..3) {
|
||||
for(byte c:0..3) {
|
||||
byte cell = *next_piece_gfx++;
|
||||
char* next_piece_gfx = PIECES[next_piece_idx];
|
||||
char next_piece_char = PIECES_NEXT_CHARS[next_piece_idx];
|
||||
for(char l:0..3) {
|
||||
for(char c:0..3) {
|
||||
char cell = *next_piece_gfx++;
|
||||
if(cell!=0) {
|
||||
*screen_next_area = next_piece_char;
|
||||
} else {
|
||||
|
@ -24,9 +24,9 @@ kickasm(pc PLAYFIELD_SPRITES, resource "playfield-sprites.png") {{
|
||||
void sprites_init() {
|
||||
*SPRITES_ENABLE = %00001111;
|
||||
*SPRITES_EXPAND_X = *SPRITES_EXPAND_Y = *SPRITES_MC = 0;
|
||||
byte xpos = 24+15*8;
|
||||
for(byte s:0..3) {
|
||||
byte s2 = s*2;
|
||||
char xpos = 24+15*8;
|
||||
for(char s:0..3) {
|
||||
char s2 = s*2;
|
||||
SPRITES_XPOS[s2] = xpos;
|
||||
SPRITES_COLS[s] = BLACK;
|
||||
xpos = xpos+24;
|
||||
@ -34,17 +34,17 @@ void sprites_init() {
|
||||
}
|
||||
|
||||
// The Y-position of the first sprite row
|
||||
const byte SPRITES_FIRST_YPOS = 49;
|
||||
const char SPRITES_FIRST_YPOS = 49;
|
||||
// The line of the first IRQ
|
||||
const byte IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS + 19;
|
||||
const char IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS + 19;
|
||||
// The raster line of the next IRQ
|
||||
volatile byte irq_raster_next = IRQ_RASTER_FIRST;
|
||||
volatile char irq_raster_next = IRQ_RASTER_FIRST;
|
||||
// Y-pos of the sprites on the next IRQ
|
||||
volatile byte irq_sprite_ypos = SPRITES_FIRST_YPOS + 21;
|
||||
volatile char irq_sprite_ypos = SPRITES_FIRST_YPOS + 21;
|
||||
// Index of the sprites to show on the next IRQ
|
||||
volatile byte irq_sprite_ptr = toSpritePtr(PLAYFIELD_SPRITES) + 3;
|
||||
volatile char irq_sprite_ptr = toSpritePtr(PLAYFIELD_SPRITES) + 3;
|
||||
// Counting the 10 IRQs
|
||||
volatile byte irq_cnt = 0;
|
||||
volatile char irq_cnt = 0;
|
||||
|
||||
// Setup the IRQ
|
||||
void sprites_irq_init() {
|
||||
@ -77,18 +77,18 @@ interrupt(hardware_clobber) void sprites_irq() {
|
||||
// Clear decimal flag (because it is used by the score algorithm)
|
||||
asm { cld }
|
||||
// Place the sprites
|
||||
byte ypos = irq_sprite_ypos;
|
||||
char ypos = irq_sprite_ypos;
|
||||
SPRITES_YPOS[0] = ypos;
|
||||
SPRITES_YPOS[2] = ypos;
|
||||
SPRITES_YPOS[4] = ypos;
|
||||
SPRITES_YPOS[6] = ypos;
|
||||
|
||||
// Wait for the y-position before changing sprite pointers
|
||||
volatile byte raster_sprite_gfx_modify = irq_raster_next+1;
|
||||
volatile char raster_sprite_gfx_modify = irq_raster_next+1;
|
||||
do {
|
||||
} while(*RASTER<raster_sprite_gfx_modify);
|
||||
|
||||
byte ptr = irq_sprite_ptr;
|
||||
char ptr = irq_sprite_ptr;
|
||||
if(render_screen_showing==0) {
|
||||
PLAYFIELD_SPRITE_PTRS_1[0] = ptr++;
|
||||
PLAYFIELD_SPRITE_PTRS_1[1] = ptr;
|
||||
|
@ -31,8 +31,8 @@ void main() {
|
||||
render_show();
|
||||
// Scan keyboard events
|
||||
keyboard_event_scan();
|
||||
byte key_event = keyboard_event_get();
|
||||
byte render = 0;
|
||||
char key_event = keyboard_event_get();
|
||||
char render = 0;
|
||||
if(game_over==0) {
|
||||
render = play_movement(key_event);
|
||||
} else {
|
||||
|
@ -4030,7 +4030,7 @@ main: {
|
||||
lax.z ypos
|
||||
axs #-[$18]
|
||||
stx.z ypos
|
||||
// for(byte s:4..7)
|
||||
// for(char s:4..7)
|
||||
// [30] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [31] if((byte) main::s#1!=(byte) 8) goto main::@1 -- vbuyy_neq_vbuc1_then_la1
|
||||
@ -4094,7 +4094,7 @@ loop: {
|
||||
// [44] (byte) loop::idx#1 ← (byte) loop::idx#2 + (byte) $a -- vbuxx=vbuxx_plus_vbuc1
|
||||
txa
|
||||
axs #-[$a]
|
||||
// for(byte s:4..7)
|
||||
// for(char s:4..7)
|
||||
// [45] (byte) loop::s#1 ← ++ (byte) loop::s#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z s
|
||||
// [46] if((byte) loop::s#1!=(byte) 8) goto loop::@4 -- vbuz1_neq_vbuc1_then_la1
|
||||
@ -4214,7 +4214,7 @@ sprites_init: {
|
||||
lax.z xpos
|
||||
axs #-[$18]
|
||||
stx.z xpos
|
||||
// for(byte s:0..3)
|
||||
// for(char s:0..3)
|
||||
// [69] (byte) sprites_init::s#1 ← ++ (byte) sprites_init::s#2 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [70] if((byte) sprites_init::s#1!=(byte) 4) goto sprites_init::@1 -- vbuyy_neq_vbuc1_then_la1
|
||||
|
@ -24816,7 +24816,7 @@ render_next: {
|
||||
bne !+
|
||||
inc.z screen_next_area+1
|
||||
!:
|
||||
// for(byte c:0..3)
|
||||
// for(char c:0..3)
|
||||
// [123] (byte) render_next::c#1 ← ++ (byte) render_next::c#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [124] if((byte) render_next::c#1!=(byte) 4) goto render_next::@4 -- vbuxx_neq_vbuc1_then_la1
|
||||
@ -24832,7 +24832,7 @@ render_next: {
|
||||
bcc !+
|
||||
inc.z screen_next_area+1
|
||||
!:
|
||||
// for(byte l:0..3)
|
||||
// for(char l:0..3)
|
||||
// [126] (byte) render_next::l#1 ← ++ (byte) render_next::l#7 -- vbuz1=_inc_vbuz1
|
||||
inc.z l
|
||||
// [127] if((byte) render_next::l#1!=(byte) 4) goto render_next::@3 -- vbuz1_neq_vbuc1_then_la1
|
||||
@ -24895,7 +24895,7 @@ render_moving: {
|
||||
// ypos++;
|
||||
// [136] (byte) render_moving::ypos#1 ← ++ (byte) render_moving::ypos#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z ypos
|
||||
// for(byte l:0..3)
|
||||
// for(char l:0..3)
|
||||
// [137] (byte) render_moving::l#1 ← ++ (byte) render_moving::l#4 -- vbuz1=_inc_vbuz1
|
||||
inc.z l
|
||||
// [138] if((byte) render_moving::l#1!=(byte) 4) goto render_moving::@1 -- vbuz1_neq_vbuc1_then_la1
|
||||
@ -24958,7 +24958,7 @@ render_moving: {
|
||||
// xpos++;
|
||||
// [149] (byte) render_moving::xpos#1 ← ++ (byte) render_moving::xpos#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z xpos
|
||||
// for(byte c:0..3)
|
||||
// for(char c:0..3)
|
||||
// [150] (byte) render_moving::c#1 ← ++ (byte) render_moving::c#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [151] if((byte) render_moving::c#1!=(byte) 4) goto render_moving::@4 -- vbuxx_neq_vbuc1_then_la1
|
||||
@ -25025,7 +25025,7 @@ render_playfield: {
|
||||
!:
|
||||
// [160] (byte) render_playfield::i#1 ← ++ (byte) render_playfield::i#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z i
|
||||
// for(byte c:0..PLAYFIELD_COLS-1)
|
||||
// for(char c:0..PLAYFIELD_COLS-1)
|
||||
// [161] (byte) render_playfield::c#1 ← ++ (byte) render_playfield::c#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z c
|
||||
// [162] if((byte) render_playfield::c#1!=(const byte) PLAYFIELD_COLS-(byte) 1+(byte) 1) goto render_playfield::@2 -- vbuz1_neq_vbuc1_then_la1
|
||||
@ -25033,7 +25033,7 @@ render_playfield: {
|
||||
cmp.z c
|
||||
bne __b2
|
||||
// render_playfield::@3
|
||||
// for(byte l:2..PLAYFIELD_LINES-1)
|
||||
// for(char l:2..PLAYFIELD_LINES-1)
|
||||
// [163] (byte) render_playfield::l#1 ← ++ (byte) render_playfield::l#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z l
|
||||
// [164] if((byte) render_playfield::l#1!=(const byte) PLAYFIELD_LINES-(byte) 1+(byte) 1) goto render_playfield::@1 -- vbuz1_neq_vbuc1_then_la1
|
||||
@ -25326,7 +25326,7 @@ play_collision: {
|
||||
// xp++;
|
||||
// [218] (byte) play_collision::xp#1 ← ++ (byte) play_collision::xp#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z xp
|
||||
// for(byte c:0..3)
|
||||
// for(char c:0..3)
|
||||
// [219] (byte) play_collision::c#1 ← ++ (byte) play_collision::c#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [220] if((byte) play_collision::c#1!=(byte) 4) goto play_collision::@10 -- vbuxx_neq_vbuc1_then_la1
|
||||
@ -25336,7 +25336,7 @@ play_collision: {
|
||||
// yp++;
|
||||
// [221] (byte) play_collision::yp#1 ← ++ (byte) play_collision::yp#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z yp
|
||||
// for(byte l:0..3)
|
||||
// for(char l:0..3)
|
||||
// [222] (byte) play_collision::l#1 ← ++ (byte) play_collision::l#6 -- vbuz1=_inc_vbuz1
|
||||
inc.z l
|
||||
// [223] if((byte) play_collision::l#1!=(byte) 4) goto play_collision::@9 -- vbuz1_neq_vbuc1_then_la1
|
||||
@ -25965,7 +25965,7 @@ play_increase_level: {
|
||||
lda score_add_bcd+3,y
|
||||
adc SCORE_BASE_BCD+3,y
|
||||
sta score_add_bcd+3,y
|
||||
// for(byte b: 0..4)
|
||||
// for(char b: 0..4)
|
||||
// [336] (byte) play_increase_level::b#1 ← ++ (byte) play_increase_level::b#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [337] if((byte) play_increase_level::b#1!=(byte) 5) goto play_increase_level::@5 -- vbuxx_neq_vbuc1_then_la1
|
||||
@ -26052,7 +26052,7 @@ play_remove_lines: {
|
||||
// playfield[w--] = c;
|
||||
// [349] (byte) play_remove_lines::w#1 ← -- (byte) play_remove_lines::w#4 -- vbuxx=_dec_vbuxx
|
||||
dex
|
||||
// for(byte x:0..PLAYFIELD_COLS-1)
|
||||
// for(char x:0..PLAYFIELD_COLS-1)
|
||||
// [350] (byte) play_remove_lines::x#1 ← ++ (byte) play_remove_lines::x#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z x
|
||||
// [351] if((byte) play_remove_lines::x#1!=(const byte) PLAYFIELD_COLS-(byte) 1+(byte) 1) goto play_remove_lines::@2 -- vbuz1_neq_vbuc1_then_la1
|
||||
@ -26078,7 +26078,7 @@ play_remove_lines: {
|
||||
// [355] phi (byte) play_remove_lines::w#11 = (byte) play_remove_lines::w#1 [phi:play_remove_lines::@4/play_remove_lines::@5->play_remove_lines::@6#1] -- register_copy
|
||||
// play_remove_lines::@6
|
||||
__b6:
|
||||
// for(byte y:0..PLAYFIELD_LINES-1)
|
||||
// for(char y:0..PLAYFIELD_LINES-1)
|
||||
// [356] (byte) play_remove_lines::y#1 ← ++ (byte) play_remove_lines::y#8 -- vbuz1=_inc_vbuz1
|
||||
inc.z y
|
||||
// [357] if((byte) play_remove_lines::y#1!=(const byte) PLAYFIELD_LINES-(byte) 1+(byte) 1) goto play_remove_lines::@1 -- vbuz1_neq_vbuc1_then_la1
|
||||
@ -26171,7 +26171,7 @@ play_lock_current: {
|
||||
// xp++;
|
||||
// [372] (byte) play_lock_current::xp#1 ← ++ (byte) play_lock_current::xp#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z xp
|
||||
// for(byte c:0..3)
|
||||
// for(char c:0..3)
|
||||
// [373] (byte) play_lock_current::c#1 ← ++ (byte) play_lock_current::c#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [374] if((byte) play_lock_current::c#1!=(byte) 4) goto play_lock_current::@7 -- vbuxx_neq_vbuc1_then_la1
|
||||
@ -26181,7 +26181,7 @@ play_lock_current: {
|
||||
// yp++;
|
||||
// [375] (byte) play_lock_current::yp#1 ← ++ (byte) play_lock_current::yp#2 -- vbuz1=_inc_vbuz1
|
||||
inc.z yp
|
||||
// for(byte l:0..3)
|
||||
// for(char l:0..3)
|
||||
// [376] (byte) play_lock_current::l#1 ← ++ (byte) play_lock_current::l#6 -- vbuz1=_inc_vbuz1
|
||||
inc.z l
|
||||
// [377] if((byte) play_lock_current::l#1!=(byte) 4) goto play_lock_current::@6 -- vbuz1_neq_vbuc1_then_la1
|
||||
@ -26610,7 +26610,7 @@ play_init: {
|
||||
lax.z idx
|
||||
axs #-[PLAYFIELD_COLS]
|
||||
stx.z idx
|
||||
// for(byte j:0..PLAYFIELD_LINES-1)
|
||||
// for(char j:0..PLAYFIELD_LINES-1)
|
||||
// [464] (byte) play_init::j#1 ← ++ (byte) play_init::j#2 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [465] if((byte) play_init::j#1!=(const byte) PLAYFIELD_LINES-(byte) 1+(byte) 1) goto play_init::@1 -- vbuyy_neq_vbuc1_then_la1
|
||||
@ -26649,7 +26649,7 @@ play_init: {
|
||||
sta score_add_bcd+2,y
|
||||
lda SCORE_BASE_BCD+3,y
|
||||
sta score_add_bcd+3,y
|
||||
// for(byte b: 0..4)
|
||||
// for(char b: 0..4)
|
||||
// [471] (byte) play_init::b#1 ← ++ (byte) play_init::b#2 -- vbuxx=_inc_vbuxx
|
||||
inx
|
||||
// [472] if((byte) play_init::b#1!=(byte) 5) goto play_init::@3 -- vbuxx_neq_vbuc1_then_la1
|
||||
@ -26765,7 +26765,7 @@ sprites_init: {
|
||||
lax.z xpos
|
||||
axs #-[$18]
|
||||
stx.z xpos
|
||||
// for(byte s:0..3)
|
||||
// for(char s:0..3)
|
||||
// [495] (byte) sprites_init::s#1 ← ++ (byte) sprites_init::s#2 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [496] if((byte) sprites_init::s#1!=(byte) 4) goto sprites_init::@1 -- vbuyy_neq_vbuc1_then_la1
|
||||
@ -26892,7 +26892,7 @@ render_init: {
|
||||
bcc !+
|
||||
inc.z li_2+1
|
||||
!:
|
||||
// for(byte i:0..PLAYFIELD_LINES-1)
|
||||
// for(char i:0..PLAYFIELD_LINES-1)
|
||||
// [517] (byte) render_init::i#1 ← ++ (byte) render_init::i#2 -- vbuyy=_inc_vbuyy
|
||||
iny
|
||||
// [518] if((byte) render_init::i#1!=(const byte) PLAYFIELD_LINES-(byte) 1+(byte) 1) goto render_init::@1 -- vbuyy_neq_vbuc1_then_la1
|
||||
@ -27062,7 +27062,7 @@ render_screen_original: {
|
||||
cpx #$28
|
||||
bne __b4
|
||||
// render_screen_original::@5
|
||||
// for(byte y:0..24)
|
||||
// for(char y:0..24)
|
||||
// [545] (byte) render_screen_original::y#1 ← ++ (byte) render_screen_original::y#6 -- vbuz1=_inc_vbuz1
|
||||
inc.z y
|
||||
// [546] if((byte) render_screen_original::y#1!=(byte) $19) goto render_screen_original::@1 -- vbuz1_neq_vbuc1_then_la1
|
||||
|
Loading…
x
Reference in New Issue
Block a user