X-Git-Url: http://git.subgeniuskitty.com/screensavers/.git/blobdiff_plain/7361f6dbacf571e0f26a0eb4e9072c9c27f7cdd2..0eb8595f05f0b78c82a4f1b6c3d4d145267b0ab6:/hacks/NEDsim/NEDsim.c diff --git a/hacks/NEDsim/NEDsim.c b/hacks/NEDsim/NEDsim.c index 01733f1..ad2baaa 100644 --- a/hacks/NEDsim/NEDsim.c +++ b/hacks/NEDsim/NEDsim.c @@ -493,15 +493,11 @@ draw_wordline(struct NEDsim * nedsim, int x, int y) draw_rect_area(nedsim, x, y, WORDLINE_WIDTH, WORDLINE_HEIGHT, False, True, False, False); // Now, draw stripes in the secondary color. - int i; - for (i = 0; i < (WORDLINE_WIDTH/(2*WORDLINE_BITS_PER_STRIPE)); i++) { + for (int i = 0; i < (WORDLINE_WIDTH/(2*WORDLINE_BITS_PER_STRIPE)); i++) { set_color(nedsim, COLOR(secondary)); draw_rect_area(nedsim, (x+(i*(WORDLINE_WIDTH/WORDLINE_BITS_PER_STRIPE))), y, WORDLINE_BITS_PER_STRIPE, WORDLINE_HEIGHT, False, True, False, False); } - - // Finally, draw the lights. - draw_wordline_lights(nedsim, 0, x, y); } // Draw the Program Counter area (but don't populate it yet). @@ -620,8 +616,7 @@ update_display(struct NEDsim * nedsim) // Draw the SC. - int i; - for (i = 0; i < SC_WIDTH; i++) { + for (int i = 0; i < SC_WIDTH; i++) { if ((SC_WIDTH-1-i) == nedsim->nedstate->active_thread->sc) { set_color(nedsim, COLOR(light_on)); } else { @@ -635,7 +630,7 @@ update_display(struct NEDsim * nedsim) // Draw the stack lights. int64_t top_of_stack = ((int64_t)nedsim->nedstate->active_thread->sp) - 1; - for (i = 0; i < nedsim->num_data_rows; i++) { + for (int i = 0; i < nedsim->num_data_rows; i++) { if ((top_of_stack-i) >= 0) { draw_wordline_lights(nedsim, nedsim->nedstate->active_thread->stack[top_of_stack-i], STACK_X_OFFSET, STACK_Y_OFFSET+STACK_LABEL_HEIGHT+i); } else { @@ -651,7 +646,7 @@ update_display(struct NEDsim * nedsim) draw_text(nedsim, stack_size, (STACK_X_OFFSET+(STACK_WIDTH/2)+1), STACK_Y_OFFSET, STACK_WIDTH, STACK_LABEL_HEIGHT, False); // Draw the heap lights. - for (i = 0; i < nedsim->num_data_rows; i++) { + for (int i = 0; i < nedsim->num_data_rows; i++) { draw_wordline_lights(nedsim, ram_r_word(nedsim->nedstate, HEAP_START_ADDRESS+(i*BPW)), HEAP_X_OFFSET, HEAP_Y_OFFSET+HEAP_LABEL_HEIGHT+i); } }