cleanup
This commit is contained in:
@@ -92,10 +92,9 @@ IA_ void scatter(U4 token, const char* anno_str) {
|
||||
aptr[0] = 0;
|
||||
if (anno_str) {
|
||||
char* dest = (char*)aptr;
|
||||
int i = 0;
|
||||
while(i < 8 && anno_str[i]) {
|
||||
int i = 0; while(i < 8 && anno_str[i]) {
|
||||
dest[i] = anno_str[i];
|
||||
i++;
|
||||
i ++;
|
||||
}
|
||||
}
|
||||
anno_arena.used += sizeof(U8);
|
||||
@@ -403,7 +402,6 @@ S8 win_proc(void* hwnd, U4 msg, U8 wparam, S8 lparam)
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
|
||||
if (tape_count > 0) {
|
||||
U8*r anno_ptr = u8_r(anno_arena.start);
|
||||
for (U8 i = delete_idx; i < tape_count - 1; i ++) {
|
||||
@@ -413,7 +411,8 @@ S8 win_proc(void* hwnd, U4 msg, U8 wparam, S8 lparam)
|
||||
tape_arena.used -= sizeof(U4);
|
||||
anno_arena.used -= sizeof(U8);
|
||||
}
|
||||
} else if (wparam == MS_VK_SPACE || wparam == MS_VK_RETURN) {
|
||||
}
|
||||
else if (wparam == MS_VK_SPACE || wparam == MS_VK_RETURN) {
|
||||
// Insert New Token
|
||||
// Shift: insert AFTER cursor | Regular: insert BEFORE cursor
|
||||
B4 is_shift = (ms_get_async_key_state(MS_VK_SHIFT) & 0x8000) != 0;
|
||||
@@ -422,7 +421,7 @@ S8 win_proc(void* hwnd, U4 msg, U8 wparam, S8 lparam)
|
||||
|
||||
if (tape_arena.used + sizeof(U4) <= tape_arena.capacity && anno_arena.used + sizeof(U8) <= anno_arena.capacity) {
|
||||
U8*r anno_ptr = u8_r(anno_arena.start);
|
||||
for (U8 i = tape_count; i > insert_idx; i--) {
|
||||
for (U8 i = tape_count; i > insert_idx; i --) {
|
||||
tape_ptr[i] = tape_ptr[i-1];
|
||||
anno_ptr[i] = anno_ptr[i-1];
|
||||
}
|
||||
@@ -433,7 +432,7 @@ S8 win_proc(void* hwnd, U4 msg, U8 wparam, S8 lparam)
|
||||
tape_ptr[insert_idx] = pack_token(STag_Comment, id2(' ',' '));
|
||||
anno_ptr[insert_idx] = 0;
|
||||
}
|
||||
if (is_shift) cursor_idx++;
|
||||
if (is_shift) cursor_idx ++;
|
||||
tape_arena.used += sizeof(U4);
|
||||
anno_arena.used += sizeof(U8);
|
||||
}
|
||||
@@ -583,7 +582,7 @@ S8 win_proc(void* hwnd, U4 msg, U8 wparam, S8 lparam)
|
||||
|
||||
ms_set_text_color(hdc, 0x00C8C8C8);
|
||||
ms_text_out_a(hdc, 400, 520, "Global Memory (Contiguous Array):", 33);
|
||||
for (int i=0; i<4; i++) {
|
||||
for (int i=0; i < 4; i ++) {
|
||||
char glob_str[32] = "[0]: 00000000";
|
||||
glob_str[1] = '0' + i;
|
||||
u64_to_hex(vm_globals[i], glob_str + 5, 8);
|
||||
@@ -594,7 +593,7 @@ S8 win_proc(void* hwnd, U4 msg, U8 wparam, S8 lparam)
|
||||
// Print Log
|
||||
ms_set_text_color(hdc, 0x00C8C8C8);
|
||||
ms_text_out_a(hdc, 750, 520, "Print Log:", 10);
|
||||
for (int i=0; i<log_count && i<4; i++) {
|
||||
for (int i = 0; i<log_count && i < 4; i ++) {
|
||||
char log_str[32] = "00000000";
|
||||
u64_to_hex(log_buffer[i], log_str, 8);
|
||||
ms_set_text_color(hdc, 0x0094BAA1);
|
||||
|
||||
Reference in New Issue
Block a user