void K3NGdisplay::update(){ // update the screen with changes that are pending in screen_buffer_pending for (int x = 0;x < (display_columns*display_rows);x++){ if (screen_buffer_live[x] != screen_buffer_pending[x]){ // do we have a new character to put on the screen ? lcd.setCursor(Xposition(x),Yposition(x)); if (screen_buffer_attributes_pending[x] & ATTRIBUTE_BLINK){ // does this character have the blink attribute if (current_blink_state){ lcd.print(screen_buffer_pending[x]); } else { lcd.print(' '); } } else { lcd.print(screen_buffer_pending[x]); } screen_buffer_live[x] = screen_buffer_pending[x]; screen_buffer_attributes_live[x] = screen_buffer_attributes_pending[x]; } else { // not a new character, do we have live character on the screen to blink? if (last_blink_state != current_blink_state){ if (screen_buffer_attributes_live[x] & ATTRIBUTE_BLINK){ lcd.setCursor(Xposition(x),Yposition(x)); if (current_blink_state){ lcd.print(screen_buffer_live[x]); } else { lcd.print(' '); } } } } } last_blink_state = current_blink_state; }
void xapi_swinpos(void *d) { int x,y; char *t0= (char*)d; char *t1; x=0;y=0; if ((t1=strchr(t0,'x')) && ++t1) { x=atoi(t0); y=atoi(t1); remote_printf(100,"positioning window to %ix%i",x,y); Xposition(x,y); } else { remote_printf(421,"invalid position argument (example 200x100)"); } }
void K3NGdisplay::redraw(){ // redraw the screen with the current screen_buffer_live for (int x = 0;x < (display_columns*display_rows);x++){ lcd.setCursor(Xposition(x),Yposition(x)); if (screen_buffer_attributes_live[x] & ATTRIBUTE_BLINK){ // does this character have the blink attribute if (current_blink_state){ lcd.print(screen_buffer_live[x]); } else { lcd.print(' '); } } else { lcd.print(screen_buffer_live[x]); } } }