Various cleanup

This commit is contained in:
simon.kagstrom 2009-01-11 18:14:13 +00:00
parent c037db50c2
commit e50680a4b8
4 changed files with 9 additions and 9 deletions

View File

@ -129,7 +129,7 @@ private:
char speedometer_string[16]; // Speedometer text
void draw_string(SDL_Surface *s, int x, int y, const char *str, uint8 front_color, uint8 back_color);
#endif
#ifdef __unix
void draw_led(int num, int state); // Draw one LED
static void pulse_handler(...); // LED error blinking

View File

@ -11,6 +11,7 @@
#include <SDL.h>
// Display surface
SDL_Surface *screen = NULL;
SDL_Surface *real_screen = NULL;
@ -47,7 +48,7 @@ enum {
3 V U H B 8 G Y 7
4 N O K M 0 J I 9
5 , @ : . - L P +
6 / ^ = SHR HOM ; * <EFBFBD>
6 / ^ = SHR HOM ; * £
7 R/S Q C= SPC 2 CTL <- 1
*/
@ -154,9 +155,6 @@ void C64Display::NewPrefs(Prefs *prefs)
void C64Display::Update(void)
{
// Update display
SDL_Rect srcrect, dstrect;
if (ThePrefs.DisplayOption == 0) {
const int x_border = (DISPLAY_X - FULL_DISPLAY_X / 2) / 2;
const int y_border = (DISPLAY_Y - FULL_DISPLAY_Y / 2) / 2;
@ -182,9 +180,10 @@ void C64Display::Update(void)
}
}
else {
SDL_Rect srcrect = {0, 0, DISPLAY_X, DISPLAY_Y};
SDL_Rect dstrect = {0, 0, FULL_DISPLAY_X, FULL_DISPLAY_Y};
/* Stretch */
srcrect = (SDL_Rect){0, 0, DISPLAY_X, DISPLAY_Y};
dstrect = (SDL_Rect){0, 0, FULL_DISPLAY_X, FULL_DISPLAY_Y};
SDL_SoftStretch(screen, &srcrect, real_screen, &dstrect);
}
SDL_Flip(real_screen);

View File

@ -8,7 +8,7 @@ REVISION = 1
CXX = g++
LIBS = -L/usr/lib -lSDL -lSDL_ttf -lSDL_mixer -lSDL_image
CFLAGS = -g -fomit-frame-pointer -Wall -Wno-unused -Wno-format -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_SDL -fno-strength-reduce -DREGPARAM="__attribute__((regparm(3)))" -I./ -DFRODO_HPUX_REV=0 -DKBD_LANG=0
CFLAGS = -g -Wall -Wno-unused -Wno-format -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DHAVE_SDL -I./ -DFRODO_HPUX_REV=0 -DKBD_LANG=0
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@

View File

@ -22,6 +22,8 @@ void DigitalRenderer::init_sound(void)
int tmp;
unsigned long format;
sndbufsize = 512;
ready = false;
devfd = open("/dev/dsp", O_WRONLY);
if (devfd < 0)
@ -118,7 +120,6 @@ void DigitalRenderer::EmulateLine(void)
int datalen = sndbufsize;
to_output -= datalen;
calc_buffer(sound_buffer, datalen * 2);
write(devfd, sound_buffer, datalen * 2);
}
}