mirror of
https://github.com/Oibaf66/frodo-wii.git
synced 2024-11-29 15:04:23 +01:00
Cleanup old unused stuff and use GUI status string
This commit is contained in:
parent
71a2042205
commit
5d6c55d4c7
@ -202,9 +202,6 @@ C64Display::C64Display(C64 *the_c64) : TheC64(the_c64)
|
|||||||
quit_requested = false;
|
quit_requested = false;
|
||||||
speedometer_string[0] = 0;
|
speedometer_string[0] = 0;
|
||||||
networktraffic_string[0] = 0;
|
networktraffic_string[0] = 0;
|
||||||
this->on_screen_message = NULL;
|
|
||||||
this->on_screen_message_start_time = 0;
|
|
||||||
this->on_screen_message_time = 0;
|
|
||||||
memset(this->text_message, 0, sizeof(this->text_message));
|
memset(this->text_message, 0, sizeof(this->text_message));
|
||||||
this->text_message_idx = 0;
|
this->text_message_idx = 0;
|
||||||
this->entering_text_message = false;
|
this->entering_text_message = false;
|
||||||
@ -409,43 +406,10 @@ SDL_Surface *C64Display::SurfaceFromC64Display()
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void C64Display::display_status_string(char *str, int seconds)
|
|
||||||
{
|
|
||||||
Uint32 time_now = SDL_GetTicks();
|
|
||||||
|
|
||||||
this->on_screen_message = str;
|
|
||||||
this->on_screen_message_start_time = time_now;
|
|
||||||
this->on_screen_message_time = seconds;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draw string into surface using the C64 ROM font
|
* Draw string into surface using the C64 ROM font
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void C64Display::draw_string(SDL_Surface *s, int x, int y, const char *str, uint8 front_color, uint8 back_color)
|
|
||||||
{
|
|
||||||
uint8 *pb = (uint8 *)s->pixels + s->pitch*y + x;
|
|
||||||
char c;
|
|
||||||
while ((c = *str++) != 0) {
|
|
||||||
uint8 *q = TheC64->Char + c*8 + 0x800;
|
|
||||||
uint8 *p = pb;
|
|
||||||
for (int y=0; y<8; y++) {
|
|
||||||
uint8 v = *q++;
|
|
||||||
p[0] = (v & 0x80) ? front_color : back_color;
|
|
||||||
p[1] = (v & 0x40) ? front_color : back_color;
|
|
||||||
p[2] = (v & 0x20) ? front_color : back_color;
|
|
||||||
p[3] = (v & 0x10) ? front_color : back_color;
|
|
||||||
p[4] = (v & 0x08) ? front_color : back_color;
|
|
||||||
p[5] = (v & 0x04) ? front_color : back_color;
|
|
||||||
p[6] = (v & 0x02) ? front_color : back_color;
|
|
||||||
p[7] = (v & 0x01) ? front_color : back_color;
|
|
||||||
p += s->pitch;
|
|
||||||
}
|
|
||||||
pb += 8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draw speedometer
|
* Draw speedometer
|
||||||
*/
|
*/
|
||||||
|
@ -127,7 +127,6 @@ public:
|
|||||||
#if defined(__unix) || defined(GEKKO)
|
#if defined(__unix) || defined(GEKKO)
|
||||||
bool quit_requested;
|
bool quit_requested;
|
||||||
#endif
|
#endif
|
||||||
void display_status_string(char *str, int seconds);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int led_state[4];
|
int led_state[4];
|
||||||
@ -163,14 +162,10 @@ private:
|
|||||||
#ifdef HAVE_SDL
|
#ifdef HAVE_SDL
|
||||||
char speedometer_string[16]; // Speedometer text
|
char speedometer_string[16]; // Speedometer text
|
||||||
char networktraffic_string[80]; // Speedometer text
|
char networktraffic_string[80]; // Speedometer text
|
||||||
void draw_string(SDL_Surface *s, int x, int y, const char *str, uint8 front_color, uint8 back_color);
|
|
||||||
char text_message[80];
|
char text_message[80];
|
||||||
char *text_message_send;
|
char *text_message_send;
|
||||||
int text_message_idx;
|
int text_message_idx;
|
||||||
bool entering_text_message;
|
bool entering_text_message;
|
||||||
char *on_screen_message;
|
|
||||||
Uint32 on_screen_message_start_time;
|
|
||||||
int on_screen_message_time;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __unix
|
#ifdef __unix
|
||||||
|
@ -90,7 +90,7 @@ void Network::InitNetwork()
|
|||||||
/* Try twice */
|
/* Try twice */
|
||||||
if (if_config(myIP, NULL, NULL, true) < 0) {
|
if (if_config(myIP, NULL, NULL, true) < 0) {
|
||||||
if (if_config(myIP, NULL, NULL, true) < 0)
|
if (if_config(myIP, NULL, NULL, true) < 0)
|
||||||
TheC64->TheDisplay->display_status_string((char*)"NO DHCP ANSWER", 1);
|
Gui::gui->status_bar->queueMessage("No DHCP reply");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user