Compare commits

..

40 Commits

Author SHA1 Message Date
8893395878 Small bug
All checks were successful
CI / Typos (push) Successful in 8s
CI / Build (push) Successful in 43s
CI / Clippy (push) Successful in 1m0s
2025-03-05 21:33:17 -08:00
cf60d6734a Comments
All checks were successful
CI / Typos (push) Successful in 13s
CI / Clippy (push) Successful in 32s
CI / Build (push) Successful in 1m15s
2025-03-04 19:41:22 -08:00
32070e9af4 Write README 2025-03-04 19:41:22 -08:00
1bd27128ae Dead code 2025-03-04 19:41:22 -08:00
1160c5d143 Remove cpuid checks 2025-03-04 19:41:22 -08:00
f24af6f800 Quick drop and lose condition 2025-03-04 19:41:22 -08:00
f7aa9c6e35 Reorganize 2025-03-04 19:41:22 -08:00
88ed908faa Add noise to rng 2025-03-04 19:41:22 -08:00
9fc8654e7b Update TODO 2025-03-04 19:41:22 -08:00
903b2d7ead Fix arrow keys 2025-03-04 19:41:22 -08:00
bf202a42ba Minor refactor 2025-03-04 19:41:22 -08:00
1db789889c Remove unused start() args 2025-03-04 19:41:22 -08:00
e3bdce6065 Minimal interrupts, prevent deadlocks 2025-03-04 19:41:22 -08:00
18113a3f4b Minor build tweak 2025-03-04 19:41:22 -08:00
8078438d3c Do not publish hash 2025-03-04 19:41:22 -08:00
921f68a081 Clear filled rows 2025-03-04 19:41:22 -08:00
57a634d4ee Controls and collisions 2025-03-04 19:41:22 -08:00
23bb3e1153 Fix rotation 2025-03-04 19:41:22 -08:00
428fca40ae Manifest tweaks 2025-03-04 19:41:22 -08:00
1309ee7489 Random generation 2025-03-04 19:41:16 -08:00
5022c840de Minor cleanup 2025-03-04 19:41:16 -08:00
ab5f2b200c TODO 2025-03-04 19:41:16 -08:00
8fb04f9ad0 Added falling tetrominos 2025-03-04 19:41:16 -08:00
a8e8c1fcac Initialize PIC 2025-03-04 19:41:16 -08:00
4131baa1a5 IDT tweaks 2025-03-04 19:41:16 -08:00
c19af78ae2 Added workflow? 2025-03-04 19:41:16 -08:00
9c515cfab0 Added IDT 2025-03-04 19:41:16 -08:00
db859ddeb8 README 2025-03-04 19:41:16 -08:00
eda305e402 Update toolchain 2025-03-04 19:41:16 -08:00
c03c996a48 Added qemu-gdb target 2025-03-04 19:41:16 -08:00
b8cd346b0a Reorganize 2025-03-04 19:41:11 -08:00
622f6d1791 Basic tetris board 2025-03-04 19:41:10 -08:00
59df532105 Added VGA graphics 2025-03-04 19:41:10 -08:00
fa2ff36610 Macro cleanup 2025-03-04 19:41:10 -08:00
d6e8bb8859 message 2025-03-04 19:41:10 -08:00
8f71fa0771 Remove logger 2025-03-04 19:41:10 -08:00
fc93078d3f Format 2025-03-04 19:41:10 -08:00
9cebf49862 Rename crate 2025-03-04 19:41:10 -08:00
db99e90198 Added serial driver 2025-03-04 19:41:10 -08:00
8378376385 Remove everything 2025-03-04 19:41:03 -08:00

View File

@ -97,12 +97,28 @@ impl TetrisBoard {
/// Get the value of the cell at the given position.
/// Returns [`None`] if (x, y) exceeds the board's bounds.
pub fn get_cell(&self, x: usize, y: usize) -> Option<&TetrisCell> {
if y >= TetrisBoard::BOARD_HEIGHT {
return None;
}
if x >= TetrisBoard::BOARD_WIDTH {
return None;
}
return self.board.get(y * TetrisBoard::BOARD_WIDTH + x);
}
/// Get a mutable reference to the cell at the given position.
/// Returns [`None`] if (x, y) exceeds the board's bounds.
pub fn get_cell_mut(&mut self, x: usize, y: usize) -> Option<&mut TetrisCell> {
if y >= TetrisBoard::BOARD_HEIGHT {
return None;
}
if x >= TetrisBoard::BOARD_WIDTH {
return None;
}
return self.board.get_mut(y * TetrisBoard::BOARD_WIDTH + x);
}
}