Remove trailing whitespace and clean up comments

This commit is contained in:
2025-12-10 13:50:02 -05:00
parent 1870e87a9c
commit 36b54929d0
5 changed files with 64 additions and 81 deletions

View File

@@ -53,9 +53,6 @@ class Keyboard {
// Echo (except backspace)
if (key < 129) {
// Handle newline specially for cleaner output?
// Output.printChar(128) might not do NewLine with my Output implementation unless I updated it?
// My Output implementation (Step 240) does NOT check for 128.
// So I should call println() if 128.
if (key = 128) {
do Output.println();
} else {
@@ -63,8 +60,6 @@ class Keyboard {
}
}
// If key > 129 (arrows etc), printChar might print garbage or square.
// Spec usually implies echoing everything or being selective.
// I'll stick to echoing only standard chars + newline.
return key;
}

View File

@@ -180,14 +180,6 @@ class Output {
let cursorRow = i;
let cursorCol = j;
return;
// Spec says "and erases the character displayed there"?
// Usually moveCursor just moves it. The cursor 'character' itself (black square)
// is typically implemented by blinking or drawing.
// Project 12 spec: "A cursor, implemented as a small filled square, indicates where the next character will be displayed."
// And "erases the character displayed there"? Maybe erases the *cursor* from old location?
// Or erases the *content*? "Erases the character displayed there" usually implies drawing black square (cursor) or clearing it?
// Wait, standard implementation usually just updates coordinates.
// I will assume simple update.
}
/** Displays the given character at the cursor location,

View File

@@ -61,7 +61,6 @@ class Screen {
let address = 16384 + (y * 32) + (x / 16);
let value = Memory.peek(address);
// Calculate 2^(x%16) logic inline or helper?
// x & 15 is x % 16
let mask = powersOfTwo[x & 15];

View File

@@ -19,10 +19,6 @@ class String {
constructor String new(int maxLength) {
if (maxLength = 0) {
let maxLength = 1; // min length 1 for alloc safety?
// Actually spec says allocation of 0 size might happen.
// My Array.new -> Memory.alloc handles 0 size by returning a 1 word block (header-1?? No).
// Let's alloc 0 if needed.
// If maxLength is 0, we can't really store anything.
}
if (maxLength > 0) {
let buffer = Array.new(maxLength);

View File

@@ -10,8 +10,11 @@ class Sys {
/** Performs all the initializations required by the OS. */
function void init() {
// do Memory.poke(8000, 1); // Start
do Memory.init();
// do Memory.poke(8000, 2); // Mem init done
do Math.init();
// do Memory.poke(8000, 3); // Math init done
do Screen.init();
do Output.init();
do Keyboard.init();
@@ -35,10 +38,8 @@ class Sys {
let j = 0;
// Calibration: loop count determines delay.
// On typical VM emulator settings (Fast), ~50-100 loops might be 1ms?
// User requested 2 seconds wait in test.
// "WaitWithInput" sample in Snake used loop for waiting.
// Standard N2T value is roughly 50-100.
while (j < 50) {
let j = j + 1;
}