remove extra newlines from switch to glogf()

This commit is contained in:
Dagen Brock 2017-01-20 14:19:07 -06:00
parent 624aefbe08
commit 9906f0187e
8 changed files with 40 additions and 46 deletions

View File

@ -181,7 +181,7 @@ adb_init()
for(i = 0; i < 128; i++) { for(i = 0; i < 128; i++) {
keycode = a2_key_to_ascii[i][0]; keycode = a2_key_to_ascii[i][0];
if(keycode != i) { if(keycode != i) {
glogf("ADB keycode lost/skipped: i=%x: keycode=%x\n", i, keycode); glogf("ADB keycode lost/skipped: i=%x: keycode=%x", i, keycode);
my_exit(1); my_exit(1);
} }
} }
@ -496,12 +496,12 @@ adb_set_config(word32 val0, word32 val1, word32 val2)
new_mouse = val0 >> 4; new_mouse = val0 >> 4;
new_kbd = val0 & 0xf; new_kbd = val0 & 0xf;
if(new_mouse != g_mouse_ctl_addr) { if(new_mouse != g_mouse_ctl_addr) {
glogf("ADB config: mouse from %x to %x!\n", g_mouse_ctl_addr, new_mouse); glogf("ADB config: mouse from %x to %x!", g_mouse_ctl_addr, new_mouse);
adb_error(); adb_error();
g_mouse_ctl_addr = new_mouse; g_mouse_ctl_addr = new_mouse;
} }
if(new_kbd != g_kbd_ctl_addr) { if(new_kbd != g_kbd_ctl_addr) {
glogf("ADB config: kbd from %x to %x!\n", g_kbd_ctl_addr, new_kbd); glogf("ADB config: kbd from %x to %x!", g_kbd_ctl_addr, new_kbd);
adb_error(); adb_error();
g_kbd_ctl_addr = new_kbd; g_kbd_ctl_addr = new_kbd;
} }
@ -564,7 +564,7 @@ void
adb_set_new_mode(word32 val) adb_set_new_mode(word32 val)
{ {
if(val & 0x03) { if(val & 0x03) {
glogf("Disabling keyboard/mouse:%02x!\n", val); glogf("Disabling keyboard/mouse:%02x!", val);
} }
if(val & 0xa2) { if(val & 0xa2) {
@ -1576,8 +1576,7 @@ adb_read_c000()
/* got one */ /* got one */
if((g_kbd_read_no_update++ > 5) && (g_kbd_chars_buffered > 1)) { if((g_kbd_read_no_update++ > 5) && (g_kbd_chars_buffered > 1)) {
/* read 5 times, keys pending, let's move it along */ /* read 5 times, keys pending, let's move it along */
glogf("Read %02x %d times, tossing\n", g_kbd_buf[0], glogf("Read %02x %d times, tossing", g_kbd_buf[0], g_kbd_read_no_update);
g_kbd_read_no_update);
adb_access_c010(); adb_access_c010();
} }
} else { } else {
@ -1663,7 +1662,7 @@ adb_increment_speed()
str = "... 8.0MHz"; str = "... 8.0MHz";
break; break;
} }
glogf("Setting g_limit_speed = %d %s\n", g_limit_speed, str); glogf("Setting g_limit_speed = %d %s", g_limit_speed, str);
} }
void void
@ -1729,7 +1728,7 @@ adb_physical_key_update(int a2code, int is_up)
/* Only process reset requests here */ /* Only process reset requests here */
if(is_up == 0 && a2code == 0x7f && CTRL_DOWN) { if(is_up == 0 && a2code == 0x7f && CTRL_DOWN) {
/* Reset pressed! */ /* Reset pressed! */
glogf("Reset pressed since CTRL_DOWN: %d\n", CTRL_DOWN); glogf("Reset pressed since CTRL_DOWN: %d", CTRL_DOWN);
do_reset(); do_reset();
return; return;
} }
@ -1763,8 +1762,7 @@ adb_physical_key_update(int a2code, int is_up)
break; break;
case 0x07: /* F7 - fast disk emul */ case 0x07: /* F7 - fast disk emul */
g_fast_disk_emul = !g_fast_disk_emul; g_fast_disk_emul = !g_fast_disk_emul;
glogf("g_fast_disk_emul is now %d\n", glogf("g_fast_disk_emul is now %d", g_fast_disk_emul);
g_fast_disk_emul);
break; break;
case 0x08: /* F8 - warp pointer */ case 0x08: /* F8 - warp pointer */
g_warp_pointer = !g_warp_pointer; g_warp_pointer = !g_warp_pointer;
@ -1776,12 +1774,10 @@ adb_physical_key_update(int a2code, int is_up)
case 0x09: /* F9 - swap paddles */ case 0x09: /* F9 - swap paddles */
if(SHIFT_DOWN) { if(SHIFT_DOWN) {
g_swap_paddles = !g_swap_paddles; g_swap_paddles = !g_swap_paddles;
glogf("Swap paddles is now: %d\n", glogf("Swap paddles is now: %d", g_swap_paddles);
g_swap_paddles);
} else { } else {
g_invert_paddles = !g_invert_paddles; g_invert_paddles = !g_invert_paddles;
glogf("Invert paddles is now: %d\n", glogf("Invert paddles is now: %d", g_invert_paddles);
g_invert_paddles);
} }
break; break;
case 0x0a: /* F10 - change a2vid paletter */ case 0x0a: /* F10 - change a2vid paletter */

View File

@ -23,6 +23,7 @@
#include "defc.h" #include "defc.h"
#include <time.h> #include <time.h>
#include "glog.h"
#ifdef _WIN32 #ifdef _WIN32
# include <windows.h> # include <windows.h>
# include <mmsystem.h> # include <mmsystem.h>
@ -115,8 +116,7 @@ micro_sleep(double dtime)
Timer.tv_sec = 0; Timer.tv_sec = 0;
Timer.tv_usec = (dtime * 1000000.0); Timer.tv_usec = (dtime * 1000000.0);
if( (ret = select(0, 0, 0, 0, &Timer)) < 0) { if( (ret = select(0, 0, 0, 0, &Timer)) < 0) {
fprintf(stderr, "micro_sleep (select) ret: %d, errno: %d\n", glogf("micro_sleep (select) ret: %d, errno: %d", ret, errno);
ret, errno);
return -1; return -1;
} }
#endif #endif

View File

@ -725,7 +725,7 @@ config_parse_option(char *buf, int pos, int len, int line)
} }
// find "name" as first contiguous string // find "name" as first contiguous string
glogf("...parse_option: line %d, len:%d \"%s\"\n", line, len, &buf[pos]); glogf("...parse_option: line %d, len:%d \"%s\"", line, len, &buf[pos]);
// printf("...parse_option: line %d, %p,%p = %s (%s) len:%d\n", line, &buf[pos], buf, &buf[pos], buf, len); // printf("...parse_option: line %d, %p,%p = %s (%s) len:%d\n", line, &buf[pos], buf, &buf[pos], buf, len);
@ -889,7 +889,7 @@ config_load_roms()
return; return;
} }
glogf("Read: %d bytes of ROM\n", ret); glogf("Read: %d bytes of ROM", ret);
if(ret != len) { if(ret != len) {
fatal_printf("errno: %d\n", errno); fatal_printf("errno: %d\n", errno);
g_config_control_panel = 1; g_config_control_panel = 1;
@ -1274,7 +1274,7 @@ config_write_config_gsplus_file()
int slot, drive; int slot, drive;
int i; int i;
glogf("Writing configuration file to %s\n", g_config_gsplus_name); glogf("Writing configuration file to %s", g_config_gsplus_name);
fconf = fopen(g_config_gsplus_name, "w+"); fconf = fopen(g_config_gsplus_name, "w+");
if(fconf == 0) { if(fconf == 0) {
@ -1540,7 +1540,7 @@ insert_disk(int slot, int drive, const char *name, int ejected, int force_size,
if(buf_2img[0] == '2' && buf_2img[1] == 'I' && buf_2img[2] == 'M' && if(buf_2img[0] == '2' && buf_2img[1] == 'I' && buf_2img[2] == 'M' &&
buf_2img[3] == 'G') { buf_2img[3] == 'G') {
/* It's a 2IMG disk */ /* It's a 2IMG disk */
glogf("Image named %s is in 2IMG format\n", dsk->name_ptr); glogf("Image named %s is in 2IMG format", dsk->name_ptr);
image_identified = 1; image_identified = 1;
if(buf_2img[12] == 0) { if(buf_2img[12] == 0) {
@ -1555,7 +1555,7 @@ insert_disk(int slot, int drive, const char *name, int ejected, int force_size,
} }
if((buf_2img[17] & 1) && (dsk->image_type == DSK_TYPE_DOS33)) { if((buf_2img[17] & 1) && (dsk->image_type == DSK_TYPE_DOS33)) {
dsk->vol_num = buf_2img[16]; dsk->vol_num = buf_2img[16];
glogf("Setting DOS 3.3 vol num to %d\n", dsk->vol_num); glogf("Setting DOS 3.3 vol num to %d", dsk->vol_num);
} }
// Some 2IMG archives have the size byte reversed // Some 2IMG archives have the size byte reversed
size = (buf_2img[31] << 24) + (buf_2img[30] << 16) + size = (buf_2img[31] << 24) + (buf_2img[30] << 16) +
@ -1579,7 +1579,7 @@ insert_disk(int slot, int drive, const char *name, int ejected, int force_size,
(buf_2img[0x42] << 8) + buf_2img[0x43]; (buf_2img[0x42] << 8) + buf_2img[0x43];
if((size >= (exp_size + 0x54)) && (tmp == exp_size)) { if((size >= (exp_size + 0x54)) && (tmp == exp_size)) {
/* It's diskcopy since data size field matches */ /* It's diskcopy since data size field matches */
glogf("Image named %s is in Mac diskcopy format\n", dsk->name_ptr); glogf("Image named %s is in Mac diskcopy format", dsk->name_ptr);
image_identified = 1; image_identified = 1;
dsk->image_start += 0x54; dsk->image_start += 0x54;
dsk->image_size = exp_size; dsk->image_size = exp_size;
@ -1652,7 +1652,7 @@ insert_disk(int slot, int drive, const char *name, int ejected, int force_size,
nibs = len; nibs = len;
} }
if(size != 35*len) { if(size != 35*len) {
glogf("Disk 5.25 error: size is %d, not 140K. Will try to mount anyway\n", size, 35*len); glogf("Disk 5.25 error: size is %d, not 140K. Will try to mount anyway", size, 35*len);
} }
for(i = 0; i < 35; i++) { for(i = 0; i < 35; i++) {
iwm_move_to_track(dsk, 4*i); iwm_move_to_track(dsk, 4*i);
@ -1740,7 +1740,7 @@ eject_disk(Disk *dsk)
iwm_flush_disk_to_unix(dsk); iwm_flush_disk_to_unix(dsk);
glogf("Ejecting disk: %s\n", dsk->name_ptr); glogf("Ejecting disk: %s", dsk->name_ptr);
/* Free all memory, close file */ /* Free all memory, close file */

View File

@ -757,7 +757,7 @@ void debug_init()
{ {
if (g_dbg_enable_port > 0) { if (g_dbg_enable_port > 0) {
// g_dbg_enable_port should be enabled by // g_dbg_enable_port should be enabled by
glogf("Debug port enabled on: %d\n", g_dbg_enable_port); glogf("Debug port enabled on: %d", g_dbg_enable_port);
debug_setup_socket(); debug_setup_socket();
debug_server_poll(); debug_server_poll();
debug_wait_hello(); debug_wait_hello();

View File

@ -266,7 +266,7 @@ joystick_init()
{ {
int i; int i;
if( SDL_Init( SDL_INIT_JOYSTICK ) < 0 ) { if( SDL_Init( SDL_INIT_JOYSTICK ) < 0 ) {
glogf( "SDL could not initialize joystick! SDL Error: %s\n", SDL_GetError() ); glogf( "SDL could not initialize joystick! SDL Error: %s", SDL_GetError() );
} else { } else {
glog("SDL2 joystick initialized"); glog("SDL2 joystick initialized");
} }
@ -278,7 +278,7 @@ joystick_init()
// @todo: add multiple controller support // @todo: add multiple controller support
gGameController = SDL_JoystickOpen( 0 ); gGameController = SDL_JoystickOpen( 0 );
if( gGameController == NULL ) { if( gGameController == NULL ) {
glogf( "Warning: Unable to open game controller! SDL Error: %s\n", SDL_GetError() ); glogf( "Warning: Unable to open game controller! SDL Error: %s", SDL_GetError() );
} }
} }
g_joystick_native_type = 2; g_joystick_native_type = 2;

View File

@ -300,7 +300,7 @@ dev_video_init_sdl()
// Check that the window was successfully created // Check that the window was successfully created
if (window == NULL) { if (window == NULL) {
// In the case that the window could not be made... // In the case that the window could not be made...
glogf("Could not create window: %s\n", SDL_GetError()); glogf("Could not create window: %s", SDL_GetError());
//@todo die, i guess //@todo die, i guess
} else { } else {
glog("SDL2 graphics initialized"); glog("SDL2 graphics initialized");
@ -633,7 +633,7 @@ void make_next_screenshot_filename()
// workaround is this horrible hack of saving the bmp -> load bmp -> save png // workaround is this horrible hack of saving the bmp -> load bmp -> save png
void x_take_screenshot() { void x_take_screenshot() {
make_next_screenshot_filename(); make_next_screenshot_filename();
glogf("Taking screenshot - %s\n", screenshot_filename); glogf("Taking screenshot - %s", screenshot_filename);
SDL_Surface *sshot = SDL_CreateRGBSurface(0, BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); SDL_Surface *sshot = SDL_CreateRGBSurface(0, BASE_WINDOW_WIDTH, X_A2_WINDOW_HEIGHT, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
SDL_LockSurface(sshot); SDL_LockSurface(sshot);
int read = SDL_RenderReadPixels(renderer, NULL, SDL_PIXELFORMAT_ARGB8888, sshot->pixels, sshot->pitch); int read = SDL_RenderReadPixels(renderer, NULL, SDL_PIXELFORMAT_ARGB8888, sshot->pixels, sshot->pitch);

View File

@ -85,7 +85,7 @@ sound_write_sdl(int real_samps, int size)
SDL_UnlockAudio(); SDL_UnlockAudio();
} }
if(g_sound_paused && (g_playbuf_buffered > 0)) { if(g_sound_paused && (g_playbuf_buffered > 0)) {
glogf("Unpausing sound, %d buffered\n",g_playbuf_buffered); glogf("Unpausing sound, %d buffered",g_playbuf_buffered);
g_sound_paused = 0; g_sound_paused = 0;
SDL_PauseAudio(0); SDL_PauseAudio(0);
} }
@ -178,8 +178,7 @@ sound_init_device_sdl()
goto snd_error; goto snd_error;
g_playbuf_buffered = 0; g_playbuf_buffered = 0;
glogf("Sound shared memory size=%d\n", glogf("Sound shared memory size=%d", SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE);
SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE);
g_sound_shm_addr = malloc(SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE); g_sound_shm_addr = malloc(SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE);
memset(g_sound_shm_addr,0,SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE); memset(g_sound_shm_addr,0,SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE);

View File

@ -746,7 +746,7 @@ void my_exit(int ret)
end_screen(); end_screen();
imagewriter_close(); imagewriter_close();
printer_close(); printer_close();
glogf("exiting (ret=%d)\n",ret); glogf("exiting (ret=%d)",ret);
fatalExit(ret); fatalExit(ret);
} }
@ -894,8 +894,7 @@ memory_ptr_init()
*/ */
g_memory_ptr = memalloc_align(mem_size, 256, &g_memory_alloc_ptr); g_memory_ptr = memalloc_align(mem_size, 256, &g_memory_alloc_ptr);
glogf("RAM size is 0 - %06x (%.2fMB)\n", mem_size, glogf("RAM size is 0 - %06x (%.2fMB)", mem_size, (double)mem_size/(1024.0*1024.0));
(double)mem_size/(1024.0*1024.0));
} }
// OG Added memory_ptr_shut // OG Added memory_ptr_shut
@ -1331,7 +1330,7 @@ void setup_gsplus_file(char *outname, int maxlen, int ok_if_missing, int can_cre
strcpy(outname, &(local_path[0])); strcpy(outname, &(local_path[0]));
strncat(outname, *cur_name_ptr, 255-strlen(outname)); strncat(outname, *cur_name_ptr, 255-strlen(outname));
if(!ok_if_missing) { // ?? if(!ok_if_missing) { // ??
glogf("Trying '%s'\n", outname); glogf("Trying '%s'", outname);
} }
ret = stat(outname, &stat_buf); ret = stat(outname, &stat_buf);
if(ret == 0) { if(ret == 0) {
@ -1357,7 +1356,7 @@ void setup_gsplus_file(char *outname, int maxlen, int ok_if_missing, int can_cre
fatal_printf(" %s\n", *path_ptr++); fatal_printf(" %s\n", *path_ptr++);
} }
*/ */
glogf("Could not find required file \"%s\" !!!\n", *name_ptr); glogf("Could not find required file \"%s\" !!!", *name_ptr);
if (strcmp(*name_ptr, "ROM")) { if (strcmp(*name_ptr, "ROM")) {
glog(" IIgs will likely hang now!"); glog(" IIgs will likely hang now!");
glog(" Get an Apple IIgs firmware ROM image from somewhere like:"); glog(" Get an Apple IIgs firmware ROM image from somewhere like:");