diff --git a/core/rend/gl4/gles.cpp b/core/rend/gl4/gles.cpp index 17bd9c7f4..e1f140a76 100644 --- a/core/rend/gl4/gles.cpp +++ b/core/rend/gl4/gles.cpp @@ -758,7 +758,7 @@ static bool RenderFrame() gl4ShaderUniforms.extra_depth_scale = settings.rend.ExtraDepthScale; - DEBUG_LOG(RENDERER, "scale: %f, %f, %f, %f\n", gl4ShaderUniforms.scale_coefs[0], gl4ShaderUniforms.scale_coefs[1], gl4ShaderUniforms.scale_coefs[2], gl4ShaderUniforms.scale_coefs[3]); + //DEBUG_LOG(RENDERER, "scale: %f, %f, %f, %f", gl4ShaderUniforms.scale_coefs[0], gl4ShaderUniforms.scale_coefs[1], gl4ShaderUniforms.scale_coefs[2], gl4ShaderUniforms.scale_coefs[3]); //VERT and RAM fog color constants u8* fog_colvert_bgra=(u8*)&FOG_COL_VERT; diff --git a/core/rend/gles/CustomTexture.cpp b/core/rend/gles/CustomTexture.cpp index 8f062d1b2..59cc12827 100644 --- a/core/rend/gles/CustomTexture.cpp +++ b/core/rend/gles/CustomTexture.cpp @@ -106,7 +106,7 @@ bool CustomTexture::Init() DIR *dir = opendir(textures_path.c_str()); if (dir != NULL) { - printf("Found custom textures directory: %s\n", textures_path.c_str()); + INFO_LOG(RENDERER, "Found custom textures directory: %s", textures_path.c_str()); custom_textures_available = true; closedir(dir); loader_thread.Start(); @@ -176,7 +176,7 @@ void CustomTexture::DumpTexture(u32 hash, int w, int h, GLuint textype, void *te FILE *fp = fopen(path.str().c_str(), "wb"); if (fp == NULL) { - printf("Failed to open %s for writing\n", path.str().c_str()); + WARN_LOG(RENDERER, "Failed to open %s for writing", path.str().c_str()); return; } @@ -228,7 +228,7 @@ void CustomTexture::DumpTexture(u32 hash, int w, int h, GLuint textype, void *te } break; default: - printf("dumpTexture: unsupported picture format %x\n", textype); + WARN_LOG(RENDERER, "dumpTexture: unsupported picture format %x", textype); fclose(fp); free(rows[0]); free(rows); diff --git a/core/rend/gles/gldraw.cpp b/core/rend/gles/gldraw.cpp index 66c208886..2a1b76cd1 100644 --- a/core/rend/gles/gldraw.cpp +++ b/core/rend/gles/gldraw.cpp @@ -765,7 +765,7 @@ void GenSorted(int first, int count) glBufferData(GL_ELEMENT_ARRAY_BUFFER, vidx_sort.size() * sizeof(u32), &vidx_sort[0], GL_STREAM_DRAW); glCheck(); - if (tess_gen) printf("Generated %.2fK Triangles !\n",tess_gen/1000.0); + if (tess_gen) DEBUG_LOG(RENDERER, "Generated %.2fK Triangles !", tess_gen / 1000.0); } } diff --git a/core/rend/gles/gles.cpp b/core/rend/gles/gles.cpp index 9a61ab41e..4f871dd23 100644 --- a/core/rend/gles/gles.cpp +++ b/core/rend/gles/gles.cpp @@ -1816,7 +1816,7 @@ bool RenderFrame() ShaderUniforms.extra_depth_scale = settings.rend.ExtraDepthScale; - //printf("scale: %f, %f, %f, %f\n",ShaderUniforms.scale_coefs[0],ShaderUniforms.scale_coefs[1],ShaderUniforms.scale_coefs[2],ShaderUniforms.scale_coefs[3]); + //DEBUG_LOG(RENDERER, "scale: %f, %f, %f, %f", ShaderUniforms.scale_coefs[0], ShaderUniforms.scale_coefs[1], ShaderUniforms.scale_coefs[2], ShaderUniforms.scale_coefs[3]); //VERT and RAM fog color constants diff --git a/core/rend/gles/gltex.cpp b/core/rend/gles/gltex.cpp index b8d595da8..e83c6a882 100644 --- a/core/rend/gles/gltex.cpp +++ b/core/rend/gles/gltex.cpp @@ -119,22 +119,24 @@ static void dumpRtTexture(u32 name, u32 w, u32 h) { //Texture Cache :) void TextureCacheData::PrintTextureName() { - printf("Texture: %s ",tex?tex->name:"?format?"); + char str[512]; + sprintf(str, "Texture: %s ", tex ? tex->name : "?format?"); if (tcw.VQ_Comp) - printf(" VQ"); + strcat(str, " VQ"); if (tcw.ScanOrder==0) - printf(" TW"); + strcat(str, " TW"); if (tcw.MipMapped) - printf(" MM"); + strcat(str, " MM"); if (tcw.StrideSel) - printf(" Stride"); + strcat(str, " Stride"); - printf(" %dx%d @ 0x%X",8<PL || tex->PL32)) stride=(TEXT_CONTROL&31)*32; //I think this needs +1 ? - //PrintTextureName(); + PrintTextureName(); u32 original_h = h; if (sa_tex > VRAM_SIZE || size == 0 || sa + size > VRAM_SIZE) { @@ -291,7 +293,7 @@ void TextureCacheData::Update() } else { - printf("Warning: invalid texture. Address %08X %08X size %d\n", sa_tex, sa, size); + WARN_LOG(RENDERER, "Warning: invalid texture. Address %08X %08X size %d", sa_tex, sa, size); return; } } @@ -362,7 +364,7 @@ void TextureCacheData::Update() else { //fill it in with a temp color - printf("UNHANDLED TEXTURE\n"); + WARN_LOG(RENDERER, "UNHANDLED TEXTURE"); pb16.init(w, h); memset(pb16.data(), 0x80, w * h * 2); temp_tex_buffer = pb16.data(); @@ -846,7 +848,7 @@ void killtex() } TexCache.clear(); - printf("Texture cache cleared\n"); + INFO_LOG(RENDERER, "Texture cache cleared"); } void rend_text_invl(vram_block* bl) diff --git a/core/rend/gles/imgui_impl_opengl3.cpp b/core/rend/gles/imgui_impl_opengl3.cpp index 4d2936b10..1620c7fda 100644 --- a/core/rend/gles/imgui_impl_opengl3.cpp +++ b/core/rend/gles/imgui_impl_opengl3.cpp @@ -298,13 +298,13 @@ static bool CheckShader(GLuint handle, const char* desc) glGetShaderiv(handle, GL_COMPILE_STATUS, &status); glGetShaderiv(handle, GL_INFO_LOG_LENGTH, &log_length); if ((GLboolean)status == GL_FALSE) - fprintf(stderr, "ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile %s!\n", desc); + WARN_LOG(RENDERER, "ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to compile %s!", desc); if (log_length > 0) { ImVector buf; buf.resize((int)(log_length + 1)); glGetShaderInfoLog(handle, log_length, NULL, (GLchar*)buf.begin()); - fprintf(stderr, "%s\n", buf.begin()); + WARN_LOG(RENDERER, "%s", buf.begin()); } return (GLboolean)status == GL_TRUE; } @@ -316,13 +316,13 @@ static bool CheckProgram(GLuint handle, const char* desc) glGetProgramiv(handle, GL_LINK_STATUS, &status); glGetProgramiv(handle, GL_INFO_LOG_LENGTH, &log_length); if ((GLboolean)status == GL_FALSE) - fprintf(stderr, "ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link %s! (with GLSL '%s')\n", desc, g_GlslVersionString); + WARN_LOG(RENDERER, "ERROR: ImGui_ImplOpenGL3_CreateDeviceObjects: failed to link %s! (with GLSL '%s')", desc, g_GlslVersionString); if (log_length > 0) { ImVector buf; buf.resize((int)(log_length + 1)); glGetProgramInfoLog(handle, log_length, NULL, (GLchar*)buf.begin()); - fprintf(stderr, "%s\n", buf.begin()); + WARN_LOG(RENDERER, "%s", buf.begin()); } return (GLboolean)status == GL_TRUE; } diff --git a/core/sdl/sdl.cpp b/core/sdl/sdl.cpp index 348af0521..d8e206cb4 100644 --- a/core/sdl/sdl.cpp +++ b/core/sdl/sdl.cpp @@ -52,7 +52,7 @@ static void sdl_open_joystick(int index) if (pJoystick == NULL) { - printf("SDL: Cannot open joystick %d\n", index + 1); + INFO_LOG(INPUT, "SDL: Cannot open joystick %d", index + 1); return; } std::shared_ptr gamepad = std::make_shared(index < MAPLE_PORTS ? index : -1, pJoystick); @@ -266,7 +266,7 @@ void sdl_window_create() if (!SDL_GetDisplayDPI(SDL_GetWindowDisplayIndex(window), &ddpi, &hdpi, &vdpi)) screen_dpi = (int)roundf(max(hdpi, vdpi)); - printf("Created SDL Window (%ix%i) and GL Context successfully\n", window_width, window_height); + INFO_LOG(RENDERER, "Created SDL Window (%ix%i) and GL Context successfully", window_width, window_height); } bool gl_init(void* wind, void* disp) diff --git a/core/sdl/sdl_gamepad.h b/core/sdl/sdl_gamepad.h index ea8321d2e..489d10055 100644 --- a/core/sdl/sdl_gamepad.h +++ b/core/sdl/sdl_gamepad.h @@ -49,7 +49,7 @@ public: { _name = SDL_JoystickName(sdl_joystick); sdl_joystick_instance = SDL_JoystickInstanceID(sdl_joystick); - printf("SDL: Opened joystick on port %d: '%s' ", maple_port, _name.c_str()); + INFO_LOG(INPUT, "SDL: Opened joystick on port %d: '%s'", maple_port, _name.c_str()); SDL_JoystickGUID guid = SDL_JoystickGetGUID(sdl_joystick); char buf[33]; SDL_JoystickGetGUIDString(guid, buf, sizeof(buf)); @@ -62,17 +62,17 @@ public: if (_name == "Microsoft X-Box 360 pad") { input_mapper = new Xbox360InputMapping(); - printf("using Xbox 360 mapping\n"); + INFO_LOG(INPUT, "using Xbox 360 mapping"); } else { input_mapper = new DefaultInputMapping(); - printf("using default mapping\n"); + INFO_LOG(INPUT, "using default mapping"); } save_mapping(); } else - printf("using custom mapping '%s'\n", input_mapper->name.c_str()); + INFO_LOG(INPUT, "using custom mapping '%s'", input_mapper->name.c_str()); sdl_haptic = SDL_HapticOpenFromJoystick(sdl_joystick); if (SDL_HapticRumbleInit(sdl_haptic) != 0) { @@ -108,7 +108,7 @@ public: void close() { - printf("SDL: Joystick '%s' on port %d disconnected\n", _name.c_str(), maple_port()); + INFO_LOG(INPUT, "SDL: Joystick '%s' on port %d disconnected", _name.c_str(), maple_port()); if (sdl_haptic != NULL) SDL_HapticClose(sdl_haptic); SDL_JoystickClose(sdl_joystick);