Commit bb4524c7 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Use log_cb instead of cout/cerr

parent a63aa70f
Pipeline #67660 passed with stages
in 1 minute and 40 seconds
......@@ -38,7 +38,6 @@
#include <string>
#include <algorithm>
#include <iostream>
#include <boost/bind.hpp>
using namespace std;
......@@ -573,4 +572,4 @@ CallbackAsyncSerial::~CallbackAsyncSerial()
#pragma warning(pop)
#endif
#endif // CANNONBOARD
\ No newline at end of file
#endif // CANNONBOARD
......@@ -7,8 +7,11 @@
#include "interface.hpp"
#ifdef CANNONBOARD
#include <libretro.h>
#include "asyncserial.hpp"
retro_log_printf_t log_cb;
// ----------------------------------------------------------------------------
// Dummy Functions for Non-CannonBall Builds
// ----------------------------------------------------------------------------
......@@ -57,7 +60,7 @@ void Interface::init(const std::string& port, unsigned int baud)
}
catch (boost::system::system_error& e)
{
std::cerr << "Error Opening Serial Interface: " << e.what() << std::endl;
log_cb(RETRO_LOG_ERROR, "Error Opening Serial Interface: %s\n", e.what());
}
}
......@@ -81,7 +84,7 @@ void Interface::close()
}
catch (boost::system::system_error& e)
{
std::cerr << "Error Closing Serial Interface: " << e.what() << std::endl;
log_cb(RETRO_LOG_ERROR, "Error Closing Serial Interface: %s\n", e.what());
}
delete serial;
serial = NULL;
......@@ -315,4 +318,4 @@ int Interface::c_sub(int a, int b)
value += BUFFER_SIZE;
return value;
}
#endif
\ No newline at end of file
#endif
......@@ -26,9 +26,6 @@ X More cars seem to be high pitched than on MAME. (Fixed - engine channel setup)
// Use YM2151 Timing
#define TIMER_CODE 1
// Enable Unused code block warnings
//#define UNUSED_WARNINGS 1
using namespace z80_adr;
OSound::OSound()
......@@ -281,12 +278,6 @@ void OSound::process_command()
case sound::MUSIC_LASTWAVE:
init_sound(cmd, DATA_LASTWAVE, channel::YM1);
break;
#ifdef UNUSED_WARNINGS
default:
std::cout << "Missing command: " << cmd << std::endl;
break;
#endif
}
}
}
......@@ -422,14 +413,6 @@ void OSound::process_channel(uint16_t chan_id)
// FM CHANNELS
// ------------------------------------------------------------------------
#ifdef UNUSED_WARNINGS
if (chan[ch::CTRL])
std::cout << "process_channel - unimplemented code 0x167" << std::endl;
if (chan[ch::FLAGS] & BIT_5)
std::cout << "process_channel - unimplemented code 0x21A" << std::endl;
#endif
// 0xF9:
uint8_t reg;
uint8_t chan_index = chan[ch::FM_FLAGS] & 7;
......@@ -493,22 +476,6 @@ void OSound::process_section(uint8_t* chan)
// FM Only Code From Here Onwards
// ------------------------------------------------------------------------
#ifdef UNUSED_WARNINGS
// Not sure, unused?
if (chan[ch::FLAGS] & BIT_5)
{
std::cout << "Warning: process_section - unimplemented code 0x36D!" << std::endl;
return;
}
// Is FM Noise Channel?
if (chan[ch::FLAGS] & BIT_1)
{
std::cout << "Warning: process_section - unimplemented code 2!" << std::endl;
return;
}
#endif
// 0x30d set_note_octave
// Command is an offset into the Note Offset table in ROM.
if (cmd)
......@@ -645,11 +612,6 @@ void OSound::do_command(uint8_t* chan, uint8_t cmd)
pcm_finalize(chan);
return;
#ifdef UNUSED_WARNINGS
default:
std::cout << std::hex << "do_command(...) Unsupported command: " << (int16_t) cmd << " : " << (int16_t) (cmd & 0x3F) << std::endl;
break;
#endif
}
pos++;
......@@ -1234,10 +1196,6 @@ void OSound::read_mod_table(uint8_t* chan)
// Unused special case
else if (table_entry == 0xFC)
{
#ifdef UNUSED_WARNINGS
// Missing code here
std::cout<< "read_mod_table: table_entry 0xFC not supported" << std::endl;
#endif
}
// Increment table position
else
......@@ -1704,8 +1662,6 @@ void OSound::engine_set_pitch(uint16_t& pos, uint8_t* pcm)
uint16_t pitch = roms.z80.read8(pos);
//std::cout << std::hex << pos << std::endl;
// Read pitch from table
if (bc)
{
......@@ -1920,8 +1876,6 @@ void OSound::traffic_process_entry(uint8_t* pcm)
// set_pitch2:
pcm[0x07] = pitch; // Set Pitch
pcm[0x86] = 0x10; // Set Active & Enabled
//std::cout << std::hex << (uint16_t) pitch << std::endl;
}
// Disable Traffic PCM Channel
......@@ -2023,7 +1977,6 @@ void OSound::traffic_read_data(uint8_t* pcm)
{
// Get volume of traffic for channel
uint8_t vol = engine_data[sound::ENGINE_VOL + engine_channel];
//std::cout << std::hex << "ch: " << (int16_t) engine_channel << " vol: " << (int16_t) vol << std::endl;
pcm[0x01] = vol & 7; // Put bottom 3 bits in 01 (pan entry)
pcm[0x00] = vol >> 3; // And remaining 5 bits in 00 (used as vol entry)
pcm[0x01] = vol & 7; // Put bottom 3 bits in 01 (pan entry)
pcm[0x00] = vol >> 3; // And remaining 5 bits in 00 (used as vol entry)
}
......@@ -290,10 +290,6 @@ void OFerrari::logic()
oinputs.brake_adjust = 0xFF;
do_end_seq();
break;
/*default:
std::cout << "Need to finish OFerrari:logic()" << std::endl;
break;*/
}
}
......@@ -344,10 +340,6 @@ void OFerrari::ferrari_normal()
case GS_INIT_MUSIC:
case GS_MUSIC:
return;
/*default:
std::cout << "Need to finish OFerrari:ferrari_normal()" << std::endl;
break;*/
}
}
......@@ -1501,11 +1493,6 @@ void OFerrari::convert_revs_speed(int32_t new_torque, int32_t &d2)
d2 = ((d2 >> 16) * 0x1A90) >> 8;
d2 = (d2 << 16) >> 4;
/*if (!new_torque)
{
std::cout << "convert_revs_speed error!" << std::endl;
}*/
d2 = (d2 / new_torque) * 0x480;
if (d2 < 0) d2 = 0;
......
......@@ -8,8 +8,6 @@
See license.txt for more details.
***************************************************************************/
#include <iostream>
#include "engine/ocrash.hpp"
#include "engine/oinputs.hpp"
#include "engine/ostats.hpp"
......@@ -359,4 +357,4 @@ bool OInputs::is_analog_select()
else
delay3 = DELAY_RESET;
return false;
}
\ No newline at end of file
}
......@@ -132,7 +132,6 @@ void OLevelObjs::setup_sprites(uint32_t z)
return;
}
}
//std::cout << "Need another entry" << std::endl;
}
// Setup Sprite from ROM format for use in game
......@@ -373,10 +372,6 @@ void OLevelObjs::do_sprite_routine()
case 14:
do_thickness_sprite(sprite, outrun.adr.sprite_sand);
break;
/*default:
std::cout << "do_sprite_routine() " << int16_t(sprite->function_holder) << std::endl;
break;*/
}
}
}
......@@ -1057,4 +1052,4 @@ void OLevelObjs::hide_sprite(oentry *sprite)
sprite->z = 0;
sprite->zoom = 0; // Hide the sprite
sprite->control &= ~OSprites::ENABLE; // Disable entry in jump table
}
\ No newline at end of file
}
......@@ -10,7 +10,8 @@
// see: http://www.boost.org/doc/libs/1_52_0/doc/html/boost_propertytree/tutorial.html
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <iostream>
#include <libretro.h>
#include "main.hpp"
#include "config.hpp"
......@@ -21,6 +22,8 @@
#include "engine/ohiscore.hpp"
#include "engine/audio/osoundint.hpp"
extern retro_log_printf_t log_cb;
#ifdef __PSL1GHT__
#define remove std::remove
#endif
......@@ -115,7 +118,7 @@ void Config::save_scores(const std::string &filename)
}
catch (std::exception &e)
{
std::cout << "Error saving hiscores: " << e.what() << "\n";
log_cb(RETRO_LOG_ERROR, "Error saving hiscores: %s\n", e.what());
}
}
......@@ -168,7 +171,7 @@ void Config::save_tiletrial_scores()
}
catch (std::exception &e)
{
std::cout << "Error saving hiscores: " << e.what() << "\n";
log_cb(RETRO_LOG_ERROR, "Error saving hiscores: %s\n", e.what());
}
}
......
......@@ -11,13 +11,14 @@
Copyright (c) 1998-2008 Atari800 development team
***************************************************************************/
#include <iostream>
#include <string.h>
#include "audio.hpp"
#include "frontend/config.hpp" // fps
#include "engine/audio/osoundint.hpp"
#include <libretro.h>
extern retro_log_printf_t log_cb;
#ifdef __PSL1GHT__
#define free std::free
#endif
......@@ -212,7 +213,7 @@ void Audio::load_wav(const char* filename)
{
wavfile.loaded = 0;
resume_audio();
std::cout << "Could not load wav: " << filename << std::endl;
log_cb(RETRO_LOG_ERROR, "Could not load WAV: %s\n", filename);
return;
}
......
......@@ -7,7 +7,6 @@
See license.txt for more details.
***************************************************************************/
#include <iostream>
#include <cstdlib> // abs
#include <string.h>
#include "input.hpp"
......@@ -132,7 +131,6 @@ void Input::handle_key(const int key, const bool is_pressed)
void Input::handle_joy_axis(int wheel_axis, int accel_axis, int brake_axis)
{
// Analog Controls
//std::cout << "Axis: " << (int) evt->axis << " Value: " << (int) evt->value << std::endl;
// Steering
// OutRun requires values between 0x48 and 0xb8.
......@@ -154,7 +152,6 @@ void Input::handle_joy_axis(int wheel_axis, int accel_axis, int brake_axis)
if (std::abs(CENTRE - adjustedw) <= wheel_dead)
adjustedw = CENTRE;
}
//std::cout << "wheel zone : " << wheel_zone << " : " << std::hex << " : " << (int) adjustedw << std::endl;
a_wheel = adjustedw;
// Accelerator [Single Axis]
......
......@@ -5,8 +5,6 @@
See license.txt for more details.
***************************************************************************/
// Error reporting
#include <iostream>
#include <stdlib.h>
#include <string.h>
......@@ -198,7 +196,7 @@ static void config_init(void)
#include <compat/strl.h>
#include <file/file_path.h>
static retro_log_printf_t log_cb;
retro_log_printf_t log_cb;
retro_video_refresh_t video_cb;
static retro_input_poll_t input_poll_cb;
static retro_input_state_t input_state_cb;
......
......@@ -8,8 +8,8 @@
See license.txt for more details.
***************************************************************************/
#include <iostream>
#include <cstddef> // for std::size_t
#include <string>
#include <boost/crc.hpp> // CRC Checking via Boost library.
#include "stdint.hpp"
......@@ -18,6 +18,8 @@
#include <libretro.h>
#include <streams/file_stream.h>
extern retro_log_printf_t log_cb;
extern "C" {
RFILE* rfopen(const char *path, const char *mode);
int rfclose(RFILE* stream);
......@@ -55,7 +57,7 @@ int RomLoader::load(const char* filename, const int offset, const int length, co
RFILE *src = rfopen(path.c_str(), "rb");
if (!src)
{
std::cout << "cannot open rom: " << filename << std::endl;
log_cb(RETRO_LOG_ERROR, "Cannot open ROM: %s\n", filename);
loaded = false;
return 1; // fail
}
......@@ -70,8 +72,7 @@ int RomLoader::load(const char* filename, const int offset, const int length, co
if (expected_crc != result.checksum())
{
std::cout << std::hex <<
filename << " has incorrect checksum.\nExpected: " << expected_crc << " Found: " << result.checksum() << std::endl;
log_cb(RETRO_LOG_ERROR, " has incorrect checksum. Expected: %.2s, Found: %.2s\n", filename, expected_crc, result.checksum());
}
// Interleave file as necessary
......@@ -94,7 +95,7 @@ int RomLoader::load_binary(const char* filename)
RFILE *src = rfopen(filename, "rb");
if (!src)
{
std::cout << "cannot open file: " << filename << std::endl;
log_cb(RETRO_LOG_ERROR, "Cannot open file: %s\n", filename);
loaded = false;
return 1; // fail
}
......
......@@ -12,12 +12,15 @@
See license.txt for more details.
***************************************************************************/
#include <iostream>
#include <libretro.h>
#include "trackloader.hpp"
#include "roms.hpp"
#include "engine/outrun.hpp"
#include "engine/oaddresses.hpp"
extern retro_log_printf_t log_cb;
// ------------------------------------------------------------------------------------------------
// Stage Mapping Data: This is the master table that controls the order of the stages.
//
......@@ -167,7 +170,7 @@ void TrackLoader::init_layout_tracks(bool jap)
// --------------------------------------------------------------------------------------------
if (layout->read32(LayOut::HEADER) != LayOut::EXPECTED_VERSION)
{
std::cout << "Incompatible LayOut Version Detected. Try upgrading CannonBall to the latest version" << std::endl;
log_cb(RETRO_LOG_WARN, "Incompatible LayOut Version Detected. Try upgrading CannonBall to the latest version\n");
init_original_tracks(jap);
return;
}
......@@ -403,4 +406,4 @@ uint32_t TrackLoader::read_heightmap_table(uint16_t entry)
uint32_t TrackLoader::read_scenerymap_table(uint16_t entry)
{
return read32(scenerymap_data, scenerymap_offset + (entry * 4));
}
\ No newline at end of file
}
......@@ -9,8 +9,6 @@
See license.txt for more details.
***************************************************************************/
#include <iostream>
#include "video.hpp"
#include "setup.hpp"
#include "globals.hpp"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment