Make git diff --check happy

This commit is contained in:
Ilari Liusvaara 2011-09-15 22:56:33 +03:00
parent c38c4f207f
commit 4f3f8ac79f
31 changed files with 195 additions and 200 deletions

View file

@ -44,7 +44,7 @@ namespace
uint32_t _magic = 403703808; uint32_t _magic = 403703808;
uint8_t* magic = reinterpret_cast<uint8_t*>(&_magic); uint8_t* magic = reinterpret_cast<uint8_t*>(&_magic);
dscr.set_palette(magic[2], magic[1], magic[0]); dscr.set_palette(magic[2], magic[1], magic[0]);
struct lua_render_context lrc; struct lua_render_context lrc;
render_queue rq; render_queue rq;
lrc.left_gap = dlb; lrc.left_gap = dlb;
@ -77,7 +77,7 @@ namespace
} }
void gameinfo(const std::string& gamename, const std::list<std::pair<std::string, std::string>>& void gameinfo(const std::string& gamename, const std::list<std::pair<std::string, std::string>>&
authors, double gametime, const std::string& rerecords) throw(std::bad_alloc, authors, double gametime, const std::string& rerecords) throw(std::bad_alloc,
std::runtime_error) std::runtime_error)
{ {
//We don't have place for this info and thus ignore it. //We don't have place for this info and thus ignore it.

View file

@ -256,9 +256,9 @@ void avidumper::print_summary(std::ostream& str)
uint64_t global_a2frames = raw_samples / 2; uint64_t global_a2frames = raw_samples / 2;
double global_a2length = raw_samples / (2.0 * audio_native_sampling_rate); double global_a2length = raw_samples / (2.0 * audio_native_sampling_rate);
std::ostringstream s2; std::ostringstream s2;
s2 << "Quantity |This segment |All segments |" << std::endl; s2 << "Quantity |This segment |All segments |" << std::endl;
s2 << "----------------+---------------------+---------------------+" << std::endl; s2 << "----------------+---------------------+---------------------+" << std::endl;
s2 << "Segment number | " << fmtint(local_segno, 10) << "| N/A|" << std::endl; s2 << "Segment number | " << fmtint(local_segno, 10) << "| N/A|" << std::endl;
@ -275,7 +275,7 @@ void avidumper::print_summary(std::ostream& str)
s2 << "A2/V desync | N/A| " s2 << "A2/V desync | N/A| "
<< fmtdbl(global_a2length - global_vlength, 10) << "|" << std::endl; << fmtdbl(global_a2length - global_vlength, 10) << "|" << std::endl;
s2 << "----------------+---------------------+---------------------+" << std::endl; s2 << "----------------+---------------------+---------------------+" << std::endl;
str << s2.str(); str << s2.str();
} }
@ -314,7 +314,7 @@ void avidumper::on_frame_threaded(const uint32_t* data, uint16_t width, uint16_t
} }
this_is_keyframe = (segment_frames == 0 || segment_frames - segment_last_keyframe >= keyframe_interval); this_is_keyframe = (segment_frames == 0 || segment_frames - segment_last_keyframe >= keyframe_interval);
if(this_is_keyframe) { if(this_is_keyframe) {
memcpy(&tframe[0], data, 4 * static_cast<size_t>(width) * height); memcpy(&tframe[0], data, 4 * static_cast<size_t>(width) * height);
segment_last_keyframe = segment_frames; segment_last_keyframe = segment_frames;
@ -365,7 +365,7 @@ void avidumper::on_end() throw(std::bad_alloc, std::runtime_error)
frame_cond.notify_all(); frame_cond.notify_all();
frame_mutex.unlock(); frame_mutex.unlock();
frame_thread->join(); frame_thread->join();
flush_audio_to(audio_put_ptr); flush_audio_to(audio_put_ptr);
fixup_avi_header_and_close(); fixup_avi_header_and_close();
if(sox_open) { if(sox_open) {
@ -549,7 +549,7 @@ void avidumper::open_and_write_avi_header(uint16_t width, uint16_t height, uint3
throw std::runtime_error("Can't open output AVI file"); throw std::runtime_error("Can't open output AVI file");
std::vector<uint8_t> aviheader; std::vector<uint8_t> aviheader;
uint32_t usecs_per_frame = static_cast<uint32_t>(1000000ULL * fps_d / fps_n); uint32_t usecs_per_frame = static_cast<uint32_t>(1000000ULL * fps_d / fps_n);
/* AVI main chunk header. */ /* AVI main chunk header. */
/* The tentative AVI header size of 336 doesn't include the video data, so we need to fix it up later. */ /* The tentative AVI header size of 336 doesn't include the video data, so we need to fix it up later. */
append(aviheader, str("RIFF"), ptr(fixup_avi_size), u32(336), str("AVI ")); append(aviheader, str("RIFF"), ptr(fixup_avi_size), u32(336), str("AVI "));

View file

@ -96,7 +96,7 @@ struct avi_frame
{ {
/** /**
* Constructor. * Constructor.
* *
* parameter _flags: Flags for frame. * parameter _flags: Flags for frame.
* parameter _type: AVI type for frame (big-endian!). * parameter _type: AVI type for frame (big-endian!).
* parameter _offset: Offset of frame from start of MOVI. * parameter _offset: Offset of frame from start of MOVI.
@ -106,7 +106,7 @@ struct avi_frame
/** /**
* Write the index entry for frame. * Write the index entry for frame.
* *
* parameter buf: Buffer to write to. * parameter buf: Buffer to write to.
*/ */
void write(uint8_t* buf); void write(uint8_t* buf);
@ -184,7 +184,7 @@ public:
/** /**
* Dump a frame (new segment starts if needed). Pixel byte order is BGRx. * Dump a frame (new segment starts if needed). Pixel byte order is BGRx.
* *
* parameter data: The frame data. * parameter data: The frame data.
* parameter width: Width of frame. * parameter width: Width of frame.
* parameter height: Height of frame. * parameter height: Height of frame.
@ -198,7 +198,7 @@ public:
/** /**
* Dump an audio sample * Dump an audio sample
* *
* parameter left: Signed sample for left channel (-32768 - 327678). * parameter left: Signed sample for left channel (-32768 - 327678).
* parameter right: Signed sample for right channel (-32768 - 327678). * parameter right: Signed sample for right channel (-32768 - 327678).
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
@ -216,14 +216,14 @@ void on_end() throw(std::bad_alloc, std::runtime_error);
/** /**
* Causes current thread to become encode thread. Do not call this, the code internally uses it. * Causes current thread to become encode thread. Do not call this, the code internally uses it.
* *
* returns: Return status for the thread. * returns: Return status for the thread.
*/ */
int encode_thread(); int encode_thread();
/** /**
* Set capture errored flag. * Set capture errored flag.
* *
* parameter err: The error message. * parameter err: The error message.
*/ */
void set_capture_error(const char* err) throw(); void set_capture_error(const char* err) throw();

View file

@ -15,7 +15,7 @@ class av_snooper
public: public:
/** /**
* Create new A/V snooper. * Create new A/V snooper.
* *
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
av_snooper() throw(std::bad_alloc); av_snooper() throw(std::bad_alloc);
@ -27,7 +27,7 @@ public:
/** /**
* Dump a frame. * Dump a frame.
* *
* parameter _frame: The frame to dump. * parameter _frame: The frame to dump.
* parameter fps_n: Current fps numerator. * parameter fps_n: Current fps numerator.
* parameter fps_d: Current fps denomerator. * parameter fps_d: Current fps denomerator.
@ -39,7 +39,7 @@ public:
/** /**
* Dump a frame. * Dump a frame.
* *
* parameter _frame: The frame to dump. * parameter _frame: The frame to dump.
* parameter fps_n: Current fps numerator. * parameter fps_n: Current fps numerator.
* parameter fps_d: Current fps denomerator. * parameter fps_d: Current fps denomerator.
@ -49,7 +49,7 @@ public:
/** /**
* Dump a sample. * Dump a sample.
* *
* parameter l: Left channel sample. * parameter l: Left channel sample.
* parameter r: Right channel sample. * parameter r: Right channel sample.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
@ -59,7 +59,7 @@ public:
/** /**
* Dump a sample. * Dump a sample.
* *
* parameter l: Left channel sample. * parameter l: Left channel sample.
* parameter r: Right channel sample. * parameter r: Right channel sample.
* parameter win: Graphics system handle. * parameter win: Graphics system handle.
@ -68,7 +68,7 @@ public:
/** /**
* End dump. * End dump.
* *
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Error dumping sample. * throws std::runtime_error: Error dumping sample.
*/ */
@ -76,14 +76,14 @@ public:
/** /**
* End dump. * End dump.
* *
* parameter win: Graphics system handle. * parameter win: Graphics system handle.
*/ */
static void end(window* win) throw(); static void end(window* win) throw();
/** /**
* Notify game information. * Notify game information.
* *
* parameter gamename: Name of the game. * parameter gamename: Name of the game.
* parameter authors: Authors of the run. * parameter authors: Authors of the run.
* parameter gametime: Game time. * parameter gametime: Game time.
@ -96,7 +96,7 @@ public:
/** /**
* Notify game information. * Notify game information.
* *
* parameter gamename: Name of the game. * parameter gamename: Name of the game.
* parameter authors: Authors of the run. * parameter authors: Authors of the run.
* parameter gametime: Game time. * parameter gametime: Game time.
@ -114,7 +114,7 @@ public:
/** /**
* Is there dump in progress? * Is there dump in progress?
* *
* returns: True if dump is in progress, false if not. * returns: True if dump is in progress, false if not.
*/ */
static bool dump_in_progress() throw(); static bool dump_in_progress() throw();
@ -141,14 +141,14 @@ public:
/** /**
* Add a notifier. * Add a notifier.
* *
* parameter notifier: New notifier to add. * parameter notifier: New notifier to add.
*/ */
static void add_dump_notifier(dump_notification& notifier) throw(std::bad_alloc); static void add_dump_notifier(dump_notification& notifier) throw(std::bad_alloc);
/** /**
* Remove a notifier. * Remove a notifier.
* *
* parameter notifier: Existing notifier to remove. * parameter notifier: Existing notifier to remove.
*/ */
static void remove_dump_notifier(dump_notification& notifier) throw(); static void remove_dump_notifier(dump_notification& notifier) throw();

View file

@ -154,7 +154,7 @@ void command::invokeC(const std::string& cmd, window* win) throw()
rcmd = cmd2.substr(1, split - 1); rcmd = cmd2.substr(1, split - 1);
if(rcmd.length() > 0 && rcmd[0] != '*') { if(rcmd.length() > 0 && rcmd[0] != '*') {
//This may be an alias. //This may be an alias.
std::string aname = cmd2.substr(1); std::string aname = cmd2.substr(1);
if(aliases.count(aname)) { if(aliases.count(aname)) {
//Yup. //Yup.
out(win) << aname << " is an alias for: " << std::endl; out(win) << aname << " is an alias for: " << std::endl;
@ -226,7 +226,7 @@ std::string command::get_short_help() throw(std::bad_alloc)
{ {
return "No description available"; return "No description available";
} }
std::string command::get_long_help() throw(std::bad_alloc) std::string command::get_long_help() throw(std::bad_alloc)
{ {
return "No help available on command " + commandname; return "No help available on command " + commandname;

View file

@ -15,7 +15,7 @@ class command
public: public:
/** /**
* Register a new command. * Register a new command.
* *
* parameter cmd: The command to register. * parameter cmd: The command to register.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -28,7 +28,7 @@ public:
/** /**
* Invoke a command. * Invoke a command.
* *
* parameter arguments: Arguments to command. * parameter arguments: Arguments to command.
* parameter window: Handle to graphics system. * parameter window: Handle to graphics system.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
@ -38,7 +38,7 @@ public:
/** /**
* Look up and invoke a command. The command will undergo alias expansion and recursion checking. * Look up and invoke a command. The command will undergo alias expansion and recursion checking.
* *
* parameter cmd: Command to exeucte. * parameter cmd: Command to exeucte.
* parameter window: Handle to graphics system. * parameter window: Handle to graphics system.
*/ */
@ -48,7 +48,7 @@ public:
* Get short help for command. * Get short help for command.
*/ */
virtual std::string get_short_help() throw(std::bad_alloc); virtual std::string get_short_help() throw(std::bad_alloc);
/** /**
* Get long help for command. * Get long help for command.
*/ */
@ -67,28 +67,28 @@ class tokensplitter
public: public:
/** /**
* Create a new splitter. * Create a new splitter.
* *
* parameter _line: The line to start splitting. * parameter _line: The line to start splitting.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
tokensplitter(const std::string& _line) throw(std::bad_alloc); tokensplitter(const std::string& _line) throw(std::bad_alloc);
/** /**
* Is there more coming? * Is there more coming?
* *
* returns: True if there is more, false otherwise. * returns: True if there is more, false otherwise.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
operator bool() throw(); operator bool() throw();
/** /**
* Get the next token. * Get the next token.
* *
* returns: The next token from line. If there is no more tokens, returns "". * returns: The next token from line. If there is no more tokens, returns "".
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
operator std::string() throw(std::bad_alloc); operator std::string() throw(std::bad_alloc);
/** /**
* Get all that is remaining. * Get all that is remaining.
* *
* returns: All remaining parts of line as-is. * returns: All remaining parts of line as-is.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */

View file

@ -8,5 +8,3 @@ Roman released his font and software as freeware: "All of my works you find her
cp437.hex is conversion from CP437.F16 from font comes from ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip cp437.hex is conversion from CP437.F16 from font comes from ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
* The package is (c) by Joseph Gil * The package is (c) by Joseph Gil
* The individual fonts are public domain. * The individual fonts are public domain.

View file

@ -21,8 +21,7 @@ void add_glyph(uint32_t codepoint, const std::string& appearence)
} }
if(!glyph_offsets.count(appearence)) { if(!glyph_offsets.count(appearence)) {
if(appearence.find_first_not_of("0123456789ABCDEFabcdef") < appearence.length()) { if(appearence.find_first_not_of("0123456789ABCDEFabcdef") < appearence.length()) {
std::cerr << "Invalid font representation (invalid hex char)." std::cerr << "Invalid font representation (invalid hex char)." << std::endl;
<< std::endl;
std::cerr << "Faulty representation: '" << appearence << "'." << std::endl; std::cerr << "Faulty representation: '" << appearence << "'." << std::endl;
exit(1); exit(1);
} }
@ -56,7 +55,7 @@ uint32_t keyhash(uint32_t key, uint32_t item, uint32_t mod)
uint32_t b = 0; uint32_t b = 0;
uint32_t c = item; uint32_t c = item;
a=a-b; a=a-c; a=a^(c >> 13); a=a-b; a=a-c; a=a^(c >> 13);
b=b-c; b=b-a; b=b^(a << 8); b=b-c; b=b-a; b=b^(a << 8);
c=c-a; c=c-b; c=c^(b >> 13); c=c-a; c=c-b; c=c^(b >> 13);
a=a-b; a=a-c; a=a^(c >> 12); a=a-b; a=a-c; a=a^(c >> 12);
b=b-c; b=b-a; b=b^(a << 16); b=b-c; b=b-a; b=b^(a << 16);

View file

@ -21,7 +21,7 @@ uint32_t keyhash(uint32_t key, uint32_t item, uint32_t mod)
uint32_t b = 0; uint32_t b = 0;
uint32_t c = item; uint32_t c = item;
a=a-b; a=a-c; a=a^(c >> 13); a=a-b; a=a-c; a=a^(c >> 13);
b=b-c; b=b-a; b=b^(a << 8); b=b-c; b=b-a; b=b^(a << 8);
c=c-a; c=c-b; c=c^(b >> 13); c=c-a; c=c-b; c=c^(b >> 13);
a=a-b; a=a-c; a=a^(c >> 12); a=a-b; a=a-c; a=a^(c >> 12);
b=b-c; b=b-a; b=b^(a << 16); b=b-c; b=b-a; b=b^(a << 16);

View file

@ -30,7 +30,7 @@ namespace
target_infinite = false; target_infinite = false;
target_fps = nominal_rate; target_fps = nominal_rate;
} }
bool is_set() throw() bool is_set() throw()
{ {
return !target_nominal; return !target_nominal;
@ -56,7 +56,7 @@ namespace
target_infinite = false; target_infinite = false;
target_nominal = false; target_nominal = false;
} }
virtual std::string get() throw(std::bad_alloc) virtual std::string get() throw(std::bad_alloc)
{ {
if(target_nominal) if(target_nominal)
@ -67,7 +67,7 @@ namespace
return o.str(); return o.str();
} }
} }
} targetfps; } targetfps;
} }

View file

@ -14,7 +14,7 @@
/** /**
* \brief Set the nominal framerate * \brief Set the nominal framerate
* *
* Sets the nominal frame rate. Framerate limiting tries to maintain the nominal framerate when there is no other * Sets the nominal frame rate. Framerate limiting tries to maintain the nominal framerate when there is no other
* explict framerate to maintain. * explict framerate to maintain.
*/ */
@ -22,27 +22,27 @@ void set_nominal_framerate(double fps) throw();
/** /**
* \brief Get the current realized framerate. * \brief Get the current realized framerate.
* *
* Returns the current realized framerate. * Returns the current realized framerate.
* *
* \return The framerate the system is currently archiving. * \return The framerate the system is currently archiving.
*/ */
double get_framerate() throw(); double get_framerate() throw();
/** /**
* \brief ACK frame start. * \brief ACK frame start.
* *
* Acknowledge frame start for timing purposes. * Acknowledge frame start for timing purposes.
* *
* \param msec Current time. * \param msec Current time.
*/ */
void ack_frame_tick(uint64_t msec) throw(); void ack_frame_tick(uint64_t msec) throw();
/** /**
* \brief Obtain how long to wait for next frame. * \brief Obtain how long to wait for next frame.
* *
* Computes the number of milliseconds to wait for next frame. * Computes the number of milliseconds to wait for next frame.
* *
* \param msec Current time. * \param msec Current time.
* \return Number of more milliseconds to wait. * \return Number of more milliseconds to wait.
*/ */

View file

@ -12,9 +12,9 @@
/** /**
* \brief Fixup command according to key polarity. * \brief Fixup command according to key polarity.
* *
* Takes in a raw command and returns the command that should be actually executed given the key polarity. * Takes in a raw command and returns the command that should be actually executed given the key polarity.
* *
* \param cmd Raw command. * \param cmd Raw command.
* \param polarity Polarity (True => Being pressed, False => Being released). * \param polarity Polarity (True => Being pressed, False => Being released).
* \return The fixed command, "" if no command should be executed. * \return The fixed command, "" if no command should be executed.
@ -25,10 +25,10 @@ std::string fixup_command_polarity(std::string cmd, bool polarity) throw(std::ba
/** /**
* \brief Keyboard mapper. * \brief Keyboard mapper.
* *
* This class handles internals of mapping events from keyboard buttons and pseudo-buttons. The helper class T has * This class handles internals of mapping events from keyboard buttons and pseudo-buttons. The helper class T has
* to have the following: * to have the following:
* *
* unsigned T::mod_str(const std::string& mod): Translate modifiers set mod into modifier mask. * unsigned T::mod_str(const std::string& mod): Translate modifiers set mod into modifier mask.
* typedef T::internal_keysymbol: Key symbol to match against. Needs to have == operator available. * typedef T::internal_keysymbol: Key symbol to match against. Needs to have == operator available.
* T::internal_keysymbol key_str(const std::string& keyname): Translate key name to key to match against. * T::internal_keysymbol key_str(const std::string& keyname): Translate key name to key to match against.
@ -43,9 +43,9 @@ class keymapper
public: public:
/** /**
* \brief Bind a key. * \brief Bind a key.
* *
* Binds a key, erroring out if binding would conflict with existing one. * Binds a key, erroring out if binding would conflict with existing one.
* *
* \param mod Modifier set to require to be pressed. * \param mod Modifier set to require to be pressed.
* \param modmask Modifier set to take into account. * \param modmask Modifier set to take into account.
* \param keyname Key to bind the action to. * \param keyname Key to bind the action to.
@ -79,9 +79,9 @@ public:
/** /**
* \brief Unbind a key. * \brief Unbind a key.
* *
* Unbinds a key, erroring out if binding does not exist.. * Unbinds a key, erroring out if binding does not exist..
* *
* \param mod Modifier set to require to be pressed. * \param mod Modifier set to require to be pressed.
* \param modmask Modifier set to take into account. * \param modmask Modifier set to take into account.
* \param keyname Key to bind the action to. * \param keyname Key to bind the action to.
@ -105,9 +105,9 @@ public:
/** /**
* \brief Map key symbol from keyboard + polarity into a command. * \brief Map key symbol from keyboard + polarity into a command.
* *
* Takes in symbol from keyboard and polarity. Outputs command to run. * Takes in symbol from keyboard and polarity. Outputs command to run.
* *
* \param sym Symbol from keyboard (with its mods). * \param sym Symbol from keyboard (with its mods).
* \param polarity True if key is being pressed, false if being released. * \param polarity True if key is being pressed, false if being released.
* \return The command to run. "" if none. * \return The command to run. "" if none.
@ -130,7 +130,7 @@ public:
/** /**
* \brief Dump list of bindigns as messages to specified graphics handle. * \brief Dump list of bindigns as messages to specified graphics handle.
* *
* \param win The graphics system handle. * \param win The graphics system handle.
* \throws std::bad_alloc Not enough memory. * \throws std::bad_alloc Not enough memory.
*/ */

View file

@ -52,10 +52,10 @@ struct moviefile generate_movie_template(std::vector<std::string> cmdline, loade
throw std::runtime_error("Bad author name, one of full or nickname must be present"); throw std::runtime_error("Bad author name, one of full or nickname must be present");
movie.authors.push_back(std::make_pair(full, nick)); movie.authors.push_back(std::make_pair(full, nick));
} }
} }
return movie; return movie;
} }
@ -80,7 +80,7 @@ int main(int argc, char** argv)
} }
window win; window win;
init_lua(&win); init_lua(&win);
win.out() << "BSNES version: " << bsnes_core_version << std::endl; win.out() << "BSNES version: " << bsnes_core_version << std::endl;
win.out() << "lsnes version: lsnes rr" << lsnes_version << std::endl; win.out() << "lsnes version: lsnes rr" << lsnes_version << std::endl;
win.out() << "Command line is: "; win.out() << "Command line is: ";
@ -112,14 +112,14 @@ int main(int argc, char** argv)
set_nominal_framerate(322445.0/6448.0); set_nominal_framerate(322445.0/6448.0);
else if(r.region == REGION_NTSC) else if(r.region == REGION_NTSC)
set_nominal_framerate(10738636.0/178683.0); set_nominal_framerate(10738636.0/178683.0);
out(&win) << "--- Internal memory mappings ---" << std::endl; out(&win) << "--- Internal memory mappings ---" << std::endl;
dump_region_map(&win); dump_region_map(&win);
out(&win) << "--- End of Startup --- " << std::endl; out(&win) << "--- End of Startup --- " << std::endl;
try { try {
moviefile movie; moviefile movie;
bool loaded = false; bool loaded = false;
for(auto i = cmdline.begin(); i != cmdline.end(); i++) for(auto i = cmdline.begin(); i != cmdline.end(); i++)
if(i->length() > 0 && (*i)[0] != '-') { if(i->length() > 0 && (*i)[0] != '-') {
movie = moviefile(*i); movie = moviefile(*i);
loaded = true; loaded = true;

View file

@ -125,7 +125,7 @@ bool get_boolean_argument(lua_State* LS, unsigned argindex, const char* fname)
lua_render_context* lua_render_ctx = NULL; lua_render_context* lua_render_ctx = NULL;
controls_t* lua_input_controllerdata = NULL; controls_t* lua_input_controllerdata = NULL;
namespace namespace
{ {
lua_State* L; lua_State* L;
bool recursive_flag = false; bool recursive_flag = false;

View file

@ -39,7 +39,7 @@ namespace
return 1; return 1;
} }
} movie_readonly; } movie_readonly;
class lua_movie_set_readwrite : public lua_function class lua_movie_set_readwrite : public lua_function
{ {
public: public:

View file

@ -363,7 +363,7 @@ namespace
} }
done = 1; done = 1;
} }
//Do button action. //Do button action.
void do_button_action(unsigned ui_id, unsigned button, short newstate, bool do_xor = false) void do_button_action(unsigned ui_id, unsigned button, short newstate, bool do_xor = false)
{ {
@ -535,7 +535,7 @@ namespace
x << "ERROR: Emulator core version mismatch!" << std::endl x << "ERROR: Emulator core version mismatch!" << std::endl
<< "\tThis version: " << bsnes_core_version << std::endl << "\tThis version: " << bsnes_core_version << std::endl
<< "\tFile is from: " << _movie.coreversion << std::endl; << "\tFile is from: " << _movie.coreversion << std::endl;
throw std::runtime_error(x.str()); throw std::runtime_error(x.str());
} else } else
out(win) << "WARNING: Emulator core version mismatch!" << std::endl out(win) << "WARNING: Emulator core version mismatch!" << std::endl
<< "\tThis version: " << bsnes_core_version << std::endl << "\tThis version: " << bsnes_core_version << std::endl
@ -556,14 +556,14 @@ namespace
newmovie = movb.get_movie(); newmovie = movb.get_movie();
else else
newmovie.load(_movie.rerecords, _movie.projectid, _movie.input); newmovie.load(_movie.rerecords, _movie.projectid, _movie.input);
if(will_load_state) { if(will_load_state) {
std::vector<unsigned char> tmp; std::vector<unsigned char> tmp;
tmp.resize(_movie.movie_state.size()); tmp.resize(_movie.movie_state.size());
memcpy(&tmp[0], &_movie.movie_state[0], tmp.size()); memcpy(&tmp[0], &_movie.movie_state[0], tmp.size());
newmovie.restore_state(tmp, true); newmovie.restore_state(tmp, true);
} }
//Negative return. //Negative return.
rrdata::read_base(_movie.projectid); rrdata::read_base(_movie.projectid);
rrdata::add_internal(); rrdata::add_internal();
@ -589,7 +589,7 @@ namespace
system_corrupt = true; system_corrupt = true;
throw; throw;
} }
//Okay, copy the movie data. //Okay, copy the movie data.
our_movie = _movie; our_movie = _movie;
if(!our_movie.is_savestate || lmode == LOAD_STATE_MOVIE) { if(!our_movie.is_savestate || lmode == LOAD_STATE_MOVIE) {
@ -652,7 +652,7 @@ namespace
out(win) << "Rerecords " << _movie.rerecords << " length " << x.str() << " (" out(win) << "Rerecords " << _movie.rerecords << " length " << x.str() << " ("
<< _movie.get_frame_count() << " frames)" << std::endl; << _movie.get_frame_count() << " frames)" << std::endl;
} }
if(_movie.gamename != "") if(_movie.gamename != "")
out(win) << "Game Name: " << _movie.gamename << std::endl; out(win) << "Game Name: " << _movie.gamename << std::endl;
for(size_t i = 0; i < _movie.authors.size(); i++) for(size_t i = 0; i < _movie.authors.size(); i++)
@ -855,7 +855,7 @@ class my_interface : public SNES::Interface
} }
av_snooper::frame(ls, fps_n, fps_d, win); av_snooper::frame(ls, fps_n, fps_d, win);
} }
void audio_sample(int16_t l_sample, int16_t r_sample) void audio_sample(int16_t l_sample, int16_t r_sample)
{ {
uint16_t _l = l_sample; uint16_t _l = l_sample;
@ -1125,7 +1125,7 @@ namespace
throw std::runtime_error("Filename required"); throw std::runtime_error("Filename required");
mark_pending_save(args, SAVE_STATE); mark_pending_save(args, SAVE_STATE);
} }
std::string get_short_help() throw(std::bad_alloc) { return "Save state"; } std::string get_short_help() throw(std::bad_alloc) { return "Save state"; }
std::string get_long_help() throw(std::bad_alloc) std::string get_long_help() throw(std::bad_alloc)
{ {
@ -1229,7 +1229,7 @@ namespace
"Shows the run authors\n"; "Shows the run authors\n";
} }
} getauthorc; } getauthorc;
class repainter : public command class repainter : public command
{ {
public: public:
@ -1442,7 +1442,7 @@ namespace
prev_mouse_mask = _b; prev_mouse_mask = _b;
} }
} mousebuttonh; } mousebuttonh;
class button_action : public command class button_action : public command
{ {
public: public:

View file

@ -8,7 +8,7 @@
/** /**
* \brief Recognize "foo", "foo (anything)" and "foo\t(anything)". * \brief Recognize "foo", "foo (anything)" and "foo\t(anything)".
* *
* \param haystack The string to search. * \param haystack The string to search.
* \param needle The string to find. * \param needle The string to find.
* \return True if found, false if not. * \return True if found, false if not.
@ -48,9 +48,9 @@ void set_random_seed() throw(std::bad_alloc);
/** /**
* \brief Load a ROM. * \brief Load a ROM.
* *
* Given commandline arguments, load a ROM. * Given commandline arguments, load a ROM.
* *
* \param cmdline The command line. * \param cmdline The command line.
* \param win Handle to send the messages to. * \param win Handle to send the messages to.
* \return The loaded ROM set. * \return The loaded ROM set.
@ -62,7 +62,7 @@ struct loaded_rom load_rom_from_commandline(std::vector<std::string> cmdline, wi
/** /**
* \brief Dump listing of regions to graphics system messages. * \brief Dump listing of regions to graphics system messages.
* *
* \param win Handle to send the messages to. * \param win Handle to send the messages to.
* \throws std::bad_alloc Not enough memory. * \throws std::bad_alloc Not enough memory.
*/ */
@ -70,7 +70,7 @@ void dump_region_map(window* win) throw(std::bad_alloc);
/** /**
* \brief Return printing stream. * \brief Return printing stream.
* *
* \param win Handle to graphics system. * \param win Handle to graphics system.
* \return Stream. If win is NULL, this is std::cout. Otherwise it is win->out(). * \return Stream. If win is NULL, this is std::cout. Otherwise it is win->out().
* \throws std::bad_alloc Not enough memory. * \throws std::bad_alloc Not enough memory.
@ -79,14 +79,14 @@ std::ostream& out(window* win) throw(std::bad_alloc);
/** /**
* \brief Fatal error. * \brief Fatal error.
* *
* Fatal error. If win is non-NULL, it calls win->fatal_error(). Otherwise just immediately quits with error. * Fatal error. If win is non-NULL, it calls win->fatal_error(). Otherwise just immediately quits with error.
*/ */
void fatal_error(window* win) throw(); void fatal_error(window* win) throw();
/** /**
* \brief Get path to config directory. * \brief Get path to config directory.
* *
* \param win Graphics system handle. * \param win Graphics system handle.
* \return The config directory path. * \return The config directory path.
* \throw std::bad_alloc Not enough memory. * \throw std::bad_alloc Not enough memory.

View file

@ -218,7 +218,7 @@ controls_t movie::get_controls() throw()
return c; //End of movie. return c; //End of movie.
for(size_t i = 0; i < TOTAL_CONTROLS; i++) { for(size_t i = 0; i < TOTAL_CONTROLS; i++) {
uint32_t polls = pollcounters[i] & 0x7FFFFFFF; uint32_t polls = pollcounters[i] & 0x7FFFFFFF;
uint32_t index = (changes > polls) ? polls : changes - 1; uint32_t index = (changes > polls) ? polls : changes - 1;
c(i) = movie_data[current_frame_first_subframe + index](i); c(i) = movie_data[current_frame_first_subframe + index](i);
} }
return c; return c;
@ -270,7 +270,7 @@ void movie::next_frame() throw(std::bad_alloc)
//Increment the current frame counter and subframe counter. Note that first subframe is undefined for //Increment the current frame counter and subframe counter. Note that first subframe is undefined for
//frame 0 and 0 for frame 1. //frame 0 and 0 for frame 1.
if(current_frame) if(current_frame)
current_frame_first_subframe = current_frame_first_subframe + current_frame_first_subframe = current_frame_first_subframe +
count_changes(current_frame_first_subframe); count_changes(current_frame_first_subframe);
else else
current_frame_first_subframe = 0; current_frame_first_subframe = 0;
@ -313,7 +313,7 @@ short movie::next_input(unsigned controlindex) throw(std::bad_alloc, std::logic_
//Otherwise find the last valid frame of input. //Otherwise find the last valid frame of input.
uint32_t changes = count_changes(current_frame_first_subframe); uint32_t changes = count_changes(current_frame_first_subframe);
uint32_t polls = (pollcounters[controlindex]++) & 0x7FFFFFFF; uint32_t polls = (pollcounters[controlindex]++) & 0x7FFFFFFF;
uint32_t index = (changes > polls) ? polls : changes - 1; uint32_t index = (changes > polls) ? polls : changes - 1;
//debuglog << "Frame=" << current_frame << " Subframe=" << polls << " control=" << controlindex << " value=" << movie_data[current_frame_first_subframe + index](controlindex) << " fetchrow=" << current_frame_first_subframe + index << std::endl << std::flush; //debuglog << "Frame=" << current_frame << " Subframe=" << polls << " control=" << controlindex << " value=" << movie_data[current_frame_first_subframe + index](controlindex) << " fetchrow=" << current_frame_first_subframe + index << std::endl << std::flush;
return movie_data[current_frame_first_subframe + index](controlindex); return movie_data[current_frame_first_subframe + index](controlindex);
} else { } else {

View file

@ -226,7 +226,7 @@ public:
/** /**
* \brief Get reset status for current frame. * \brief Get reset status for current frame.
* *
* \return -1 if current frame doesn't have a reset. Otherwise number of cycles to wait for delayed reset (0 is * \return -1 if current frame doesn't have a reset. Otherwise number of cycles to wait for delayed reset (0 is
* immediate reset). * immediate reset).
*/ */
@ -239,7 +239,7 @@ public:
/** /**
* \brief Get how manyth poll in the frame next poll would be. * \brief Get how manyth poll in the frame next poll would be.
* *
* \return Poll number. * \return Poll number.
*/ */
unsigned next_poll_number(); unsigned next_poll_number();
@ -283,7 +283,7 @@ class movie_logic
public: public:
/** /**
* \brief Create new bridge. * \brief Create new bridge.
* *
* \param m The movie to manipulate. * \param m The movie to manipulate.
*/ */
movie_logic(movie& m) throw(); movie_logic(movie& m) throw();
@ -300,21 +300,21 @@ public:
/** /**
* \brief Notify about new frame starting. * \brief Notify about new frame starting.
* *
* \return Reset status for the new frame. * \return Reset status for the new frame.
*/ */
long new_frame_starting(bool dont_poll) throw(std::bad_alloc, std::runtime_error); long new_frame_starting(bool dont_poll) throw(std::bad_alloc, std::runtime_error);
/** /**
* \brief Poll for input. * \brief Poll for input.
* *
* \return Value for polled input. * \return Value for polled input.
*/ */
short input_poll(bool port, unsigned dev, unsigned id) throw(std::bad_alloc, std::runtime_error); short input_poll(bool port, unsigned dev, unsigned id) throw(std::bad_alloc, std::runtime_error);
/** /**
* \brief Called when movie code needs new controls snapshot. * \brief Called when movie code needs new controls snapshot.
* *
* \param subframe True if this is for subframe update, false if for frame update. * \param subframe True if this is for subframe update, false if for frame update.
*/ */
virtual controls_t update_controls(bool subframe) throw(std::bad_alloc, std::runtime_error) = 0; virtual controls_t update_controls(bool subframe) throw(std::bad_alloc, std::runtime_error) = 0;

View file

@ -313,7 +313,7 @@ void moviefile::save(const std::string& movie, unsigned compression) throw(std::
} }
write_authors_file(w, authors); write_authors_file(w, authors);
write_input(w, input, port1, port2); write_input(w, input, port1, port2);
w.commit(); w.commit();
} }
@ -398,4 +398,3 @@ rom_type gametype_romtype(gametype_t type)
return ROMTYPE_NONE; return ROMTYPE_NONE;
}; };
} }

View file

@ -310,7 +310,7 @@ void lcscreen::load(const std::vector<char>& data) throw(std::bad_alloc, std::ru
if(!user_memory) if(!user_memory)
throw std::runtime_error("Can't load to non-user memory"); throw std::runtime_error("Can't load to non-user memory");
const uint8_t* data2 = reinterpret_cast<const uint8_t*>(&data[0]); const uint8_t* data2 = reinterpret_cast<const uint8_t*>(&data[0]);
if(data.size() < 2) if(data.size() < 2)
throw std::runtime_error("Corrupt saved screenshot data"); throw std::runtime_error("Corrupt saved screenshot data");
uint32_t _width = static_cast<uint32_t>(data2[0]) * 256 + static_cast<uint32_t>(data2[1]); uint32_t _width = static_cast<uint32_t>(data2[0]) * 256 + static_cast<uint32_t>(data2[1]);
if(_width > 1 && data.size() % (2 * _width) != 2) if(_width > 1 && data.size() % (2 * _width) != 2)

View file

@ -14,7 +14,7 @@ struct lcscreen
{ {
/** /**
* \brief Create new screen from bsnes output data. * \brief Create new screen from bsnes output data.
* *
* \param mem The output buffer from bsnes. * \param mem The output buffer from bsnes.
* \param hires True if in hires mode (512-wide lines instead of 256-wide). * \param hires True if in hires mode (512-wide lines instead of 256-wide).
* \param interlace True if in interlace mode. * \param interlace True if in interlace mode.
@ -30,7 +30,7 @@ struct lcscreen
void load(const std::vector<char>& data) throw(std::bad_alloc, std::runtime_error); void load(const std::vector<char>& data) throw(std::bad_alloc, std::runtime_error);
void save(std::vector<char>& data) throw(std::bad_alloc); void save(std::vector<char>& data) throw(std::bad_alloc);
void save_png(const std::string& file) throw(std::bad_alloc, std::runtime_error); void save_png(const std::string& file) throw(std::bad_alloc, std::runtime_error);
/** /**
* \brief Destructor. * \brief Destructor.
*/ */
@ -74,7 +74,7 @@ struct screen
{ {
/** /**
* \brief Create new screen * \brief Create new screen
* *
* Creates screen. The screen dimensions are initially 0x0. * Creates screen. The screen dimensions are initially 0x0.
*/ */
screen() throw(); screen() throw();
@ -83,12 +83,12 @@ struct screen
* \brief Destructor. * \brief Destructor.
*/ */
~screen() throw(); ~screen() throw();
/** /**
* \brief Set the screen to use specified backing memory. * \brief Set the screen to use specified backing memory.
* *
* Sets the backing memory for screen. The specified memory is not freed if screen is reallocated or destroyed. * Sets the backing memory for screen. The specified memory is not freed if screen is reallocated or destroyed.
* *
* \param _memory The memory buffer. * \param _memory The memory buffer.
* \param _width Width of screen. * \param _width Width of screen.
* \param _height Height of screen. * \param _height Height of screen.
@ -98,12 +98,12 @@ struct screen
*/ */
void set(uint32_t* _memory, uint32_t _width, uint32_t _height, uint32_t _originx, uint32_t _originy, void set(uint32_t* _memory, uint32_t _width, uint32_t _height, uint32_t _originx, uint32_t _originy,
uint32_t _pitch) throw(); uint32_t _pitch) throw();
/** /**
* \brief Set new size for screen, reallocating backing memory. * \brief Set new size for screen, reallocating backing memory.
* *
* Sets the size of the screen. The memory is freed if screen is reallocated or destroyed. * Sets the size of the screen. The memory is freed if screen is reallocated or destroyed.
* *
* \param _width Width of screen. * \param _width Width of screen.
* \param _height Height of screen. * \param _height Height of screen.
* \param _originx X coordinate for origin. * \param _originx X coordinate for origin.
@ -116,10 +116,10 @@ struct screen
/** /**
* \brief Paint low-color screen into screen. * \brief Paint low-color screen into screen.
* *
* Paints low-color screen into screen. The upper-left of image will be at origin. Scales the image by given factors. * Paints low-color screen into screen. The upper-left of image will be at origin. Scales the image by given factors.
* If the image does not fit with specified scale factors, it is clipped. * If the image does not fit with specified scale factors, it is clipped.
* *
* \param scr The screen to paint. * \param scr The screen to paint.
* \param hscale Horizontal scale factor. * \param hscale Horizontal scale factor.
* \param vscale Vertical scale factor. * \param vscale Vertical scale factor.
@ -128,7 +128,7 @@ struct screen
/** /**
* \brief Get pointer into specified row. * \brief Get pointer into specified row.
* *
* \param row Number of row (must be less than height). * \param row Number of row (must be less than height).
*/ */
uint32_t* rowptr(uint32_t row) throw(); uint32_t* rowptr(uint32_t row) throw();
@ -180,9 +180,9 @@ struct screen
/** /**
* \brief Set the palette shifts. * \brief Set the palette shifts.
* *
* Sets the palette shifts, converting the existing image. * Sets the palette shifts, converting the existing image.
* *
* \param rshift Shift for red component. * \param rshift Shift for red component.
* \param gshift Shift for green component. * \param gshift Shift for green component.
* \param bshift Shift for blue component. * \param bshift Shift for blue component.
@ -191,9 +191,9 @@ struct screen
/** /**
* \brief Return a color value. * \brief Return a color value.
* *
* Returns color value with specified (r,g,b) values (scale 0-255). * Returns color value with specified (r,g,b) values (scale 0-255).
* *
* \param r Red component. * \param r Red component.
* \param g Green component. * \param g Green component.
* \param b Blue component. * \param b Blue component.
@ -232,7 +232,7 @@ struct render_object
/** /**
* \brief Draw the object. * \brief Draw the object.
* *
* \param scr The screen to draw it on. * \param scr The screen to draw it on.
*/ */
virtual void operator()(struct screen& scr) throw() = 0; virtual void operator()(struct screen& scr) throw() = 0;
@ -245,9 +245,9 @@ struct render_queue
{ {
/** /**
* \brief Add object to render queue. * \brief Add object to render queue.
* *
* Adds new object to render queue. The object must be allocated by new. * Adds new object to render queue. The object must be allocated by new.
* *
* \param obj The object to add * \param obj The object to add
* \throws std::bad_alloc Not enough memory. * \throws std::bad_alloc Not enough memory.
*/ */
@ -255,18 +255,18 @@ struct render_queue
/** /**
* \brief Apply all objects in order. * \brief Apply all objects in order.
* *
* Applies all objects in the queue in order, freeing them in progress. * Applies all objects in the queue in order, freeing them in progress.
* *
* \param scr The screen to apply queue to. * \param scr The screen to apply queue to.
*/ */
void run(struct screen& scr) throw(); void run(struct screen& scr) throw();
/** /**
* \brief Clear the queue. * \brief Clear the queue.
* *
* Frees all objects in the queue. * Frees all objects in the queue.
* *
*/ */
void clear() throw(); void clear() throw();
@ -280,7 +280,7 @@ private:
/** /**
* \brief Read font data for glyph. * \brief Read font data for glyph.
* *
* \param codepoint Code point of glyph. * \param codepoint Code point of glyph.
* \param x X position to render into. * \param x X position to render into.
* \param y Y position to render into. * \param y Y position to render into.
@ -295,7 +295,7 @@ std::pair<uint32_t, size_t> find_glyph(uint32_t codepoint, int32_t x, int32_t y,
/** /**
* \brief Render text into screen. * \brief Render text into screen.
* *
* \param _x The x position to render to (relative to origin). * \param _x The x position to render to (relative to origin).
* \param _y The y position to render to (relative to origin). * \param _y The y position to render to (relative to origin).
* \param _text The text to render. * \param _text The text to render.

View file

@ -720,7 +720,7 @@ namespace
void load_index_file(const std::string& filename) throw(std::bad_alloc, std::runtime_error) void load_index_file(const std::string& filename) throw(std::bad_alloc, std::runtime_error)
{ {
std::istream& s = open_file_relative(filename, ""); std::istream& s = open_file_relative(filename, "");
try { try {
std::list<index_entry> partial_index; std::list<index_entry> partial_index;
std::string line; std::string line;

10
rom.hpp
View file

@ -412,7 +412,7 @@ std::vector<char> save_core_state() throw(std::bad_alloc);
* \brief Restore core state from buffer. * \brief Restore core state from buffer.
* *
* Loads core state from buffer. * Loads core state from buffer.
* *
* \param buf The buffer containing the state. * \param buf The buffer containing the state.
* \throws std::runtime_error Loading state failed. * \throws std::runtime_error Loading state failed.
*/ */
@ -420,9 +420,9 @@ void load_core_state(const std::vector<char>& buf) throw(std::runtime_error);
/** /**
* \brief Read index file. * \brief Read index file.
* *
* Read index of ROMs and add ROMs found to content-searchable storage. * Read index of ROMs and add ROMs found to content-searchable storage.
* *
* \param filename The filename of index file. * \param filename The filename of index file.
* \throws std::bad_alloc Not enough memory. * \throws std::bad_alloc Not enough memory.
* \throws std::runtime_error Loading index failed. * \throws std::runtime_error Loading index failed.
@ -431,9 +431,9 @@ void load_index_file(const std::string& filename) throw(std::bad_alloc, std::run
/** /**
* \brief Lookup absolute filename by hash. * \brief Lookup absolute filename by hash.
* *
* Search all indices, looking for file with specified SHA-256 (specifying hash of "" results ""). * Search all indices, looking for file with specified SHA-256 (specifying hash of "" results "").
* *
* \param hash The hash of file. * \param hash The hash of file.
* \return Absolute filename. * \return Absolute filename.
* \throws std::bad_alloc Not enough memory. * \throws std::bad_alloc Not enough memory.

View file

@ -35,7 +35,7 @@ bool rrdata::instance::operator<(const struct instance& i) const throw()
for(unsigned j = 0; j < RRDATA_BYTES; j++) for(unsigned j = 0; j < RRDATA_BYTES; j++)
if(bytes[j] < i.bytes[j]) if(bytes[j] < i.bytes[j])
return true; return true;
else if(bytes[j] > i.bytes[j]) else if(bytes[j] > i.bytes[j])
return false; return false;
return false; return false;
} }
@ -135,7 +135,7 @@ namespace
char buf2[3]; char buf2[3];
unsigned bias; unsigned bias;
if(count == 1) { if(count == 1) {
opcode = 0x00; opcode = 0x00;
bias = 1; bias = 1;
} else if(count < 258) { } else if(count < 258) {
opcode = 0x20; opcode = 0x20;

View file

@ -17,7 +17,7 @@ public:
bool operator==(const struct instance& i) const throw(); bool operator==(const struct instance& i) const throw();
const struct instance operator++(int) throw(); const struct instance operator++(int) throw();
const struct instance& operator++() throw(); const struct instance& operator++() throw();
}; };
static void read_base(const std::string& project) throw(std::bad_alloc); static void read_base(const std::string& project) throw(std::bad_alloc);

View file

@ -32,7 +32,7 @@ namespace
"Set setting to a new value. Omit <value> to set to ''\n"; "Set setting to a new value. Omit <value> to set to ''\n";
} }
} set_setting; } set_setting;
class unset_command : public command class unset_command : public command
{ {
public: public:
@ -78,7 +78,7 @@ namespace
"Show value of setting\n"; "Show value of setting\n";
} }
} get_setting; } get_setting;
class shsettings_command : public command class shsettings_command : public command
{ {
public: public:

View file

@ -13,7 +13,7 @@ class setting
public: public:
/** /**
* Create new setting. * Create new setting.
* *
* parameter name: Name of the setting. * parameter name: Name of the setting.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -26,7 +26,7 @@ public:
/** /**
* Set the setting to special blank state. Not all settings can be blanked. * Set the setting to special blank state. Not all settings can be blanked.
* *
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Blanking this setting is not allowed (currently). * throws std::runtime_error: Blanking this setting is not allowed (currently).
*/ */
@ -34,7 +34,7 @@ public:
/** /**
* Look up setting and try to blank it. * Look up setting and try to blank it.
* *
* parameter name: Name of setting to blank. * parameter name: Name of setting to blank.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Blanking this setting is not allowed (currently). Or setting does not exist. * throws std::runtime_error: Blanking this setting is not allowed (currently). Or setting does not exist.
@ -43,24 +43,24 @@ public:
/** /**
* Is this setting set (not blanked)? * Is this setting set (not blanked)?
* *
* returns: True if setting is not blanked, false if it is blanked. * returns: True if setting is not blanked, false if it is blanked.
*/ */
virtual bool is_set() throw() = 0; virtual bool is_set() throw() = 0;
/** /**
* Look up a setting and see if it is set (not blanked)? * Look up a setting and see if it is set (not blanked)?
* *
* parameter name: Name of setting to check. * parameter name: Name of setting to check.
* returns: True if setting is not blanked, false if it is blanked. * returns: True if setting is not blanked, false if it is blanked.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Setting does not exist. * throws std::runtime_error: Setting does not exist.
*/ */
static bool is_set(const std::string& name) throw(std::bad_alloc, std::runtime_error); static bool is_set(const std::string& name) throw(std::bad_alloc, std::runtime_error);
/** /**
* Set value of setting. * Set value of setting.
* *
* parameter value: New value for setting. * parameter value: New value for setting.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Setting the setting to this value is not allowed (currently). * throws std::runtime_error: Setting the setting to this value is not allowed (currently).
@ -69,7 +69,7 @@ public:
/** /**
* Look up setting and set it. * Look up setting and set it.
* *
* parameter name: Name of the setting. * parameter name: Name of the setting.
* parameter value: New value for setting. * parameter value: New value for setting.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
@ -79,7 +79,7 @@ public:
/** /**
* Get the value of setting. * Get the value of setting.
* *
* returns: The setting value. * returns: The setting value.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -87,7 +87,7 @@ public:
/** /**
* Look up setting an get value of it. * Look up setting an get value of it.
* *
* returns: The setting value. * returns: The setting value.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Setting does not exist. * throws std::runtime_error: Setting does not exist.
@ -96,7 +96,7 @@ public:
/** /**
* Print all settings and values. * Print all settings and values.
* *
* parameter win: The graphics system handle. * parameter win: The graphics system handle.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -113,7 +113,7 @@ class numeric_setting : public setting
public: public:
/** /**
* Create a new numeric setting. * Create a new numeric setting.
* *
* parameter sname: Name of the setting. * parameter sname: Name of the setting.
* parameter minv: Minimum value for the setting. * parameter minv: Minimum value for the setting.
* parameter maxv: Maximum value for the setting. * parameter maxv: Maximum value for the setting.
@ -131,7 +131,7 @@ public:
bool is_set() throw(); bool is_set() throw();
/** /**
* Set the value of setting. Accepts only numeric values. * Set the value of setting. Accepts only numeric values.
* *
* parameter value: New value. * parameter value: New value.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Invalid value. * throws std::runtime_error: Invalid value.
@ -139,14 +139,14 @@ public:
void set(const std::string& value) throw(std::bad_alloc, std::runtime_error); void set(const std::string& value) throw(std::bad_alloc, std::runtime_error);
/** /**
* Gets the value of the setting. * Gets the value of the setting.
* *
* returns: Value of setting as string. * returns: Value of setting as string.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
std::string get() throw(std::bad_alloc); std::string get() throw(std::bad_alloc);
/** /**
* Get the value of setting as numeric. * Get the value of setting as numeric.
* *
* returns: Value of the setting as numeric. * returns: Value of the setting as numeric.
*/ */
operator int32_t() throw(); operator int32_t() throw();
@ -164,7 +164,7 @@ class boolean_setting : public setting
public: public:
/** /**
* Create a new boolean setting. * Create a new boolean setting.
* *
* parameter sname: Name of the setting. * parameter sname: Name of the setting.
* parameter dflt: Default (initial) value for the setting. * parameter dflt: Default (initial) value for the setting.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
@ -180,10 +180,10 @@ public:
bool is_set() throw(); bool is_set() throw();
/** /**
* Set the value of setting. * Set the value of setting.
* *
* The following values are accepted as true: true, yes, on, 1, enable and enabled. * The following values are accepted as true: true, yes, on, 1, enable and enabled.
* The following values are accepted as false: false, no, off, 0, disable and disabled. * The following values are accepted as false: false, no, off, 0, disable and disabled.
* *
* parameter value: New value. * parameter value: New value.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Invalid value. * throws std::runtime_error: Invalid value.
@ -191,14 +191,14 @@ public:
void set(const std::string& value) throw(std::bad_alloc, std::runtime_error); void set(const std::string& value) throw(std::bad_alloc, std::runtime_error);
/** /**
* Gets the value of the setting. * Gets the value of the setting.
* *
* returns: Value of setting as string. * returns: Value of setting as string.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
std::string get() throw(std::bad_alloc); std::string get() throw(std::bad_alloc);
/** /**
* Get the value of setting as boolean. * Get the value of setting as boolean.
* *
* returns: Value of the setting as boolean. * returns: Value of the setting as boolean.
*/ */
operator bool() throw(); operator bool() throw();

View file

@ -494,7 +494,7 @@ namespace
0x082777777ULL, //From left. 0x082777777ULL, //From left.
0x844777777ULL //From up&left. 0x844777777ULL //From up&left.
}; };
void hat_transition(uint32_t& ov, uint32_t& v, bool& polarity, bool& more) void hat_transition(uint32_t& ov, uint32_t& v, bool& polarity, bool& more)
{ {
uint32_t t1 = transpack[ov]; uint32_t t1 = transpack[ov];
@ -568,7 +568,7 @@ keymapper_helper_sdl::translated_event keymapper_helper_sdl::translate_event(SDL
k.device = SDL_DEV_JOYBUTTON; k.device = SDL_DEV_JOYBUTTON;
k.joybutton = static_cast<uint32_t>(e.jbutton.which) * 256 + static_cast<uint32_t>(e.jbutton.button); k.joybutton = static_cast<uint32_t>(e.jbutton.which) * 256 + static_cast<uint32_t>(e.jbutton.button);
return translated_event(k, (e.type == SDL_JOYBUTTONDOWN)); return translated_event(k, (e.type == SDL_JOYBUTTONDOWN));
} else if(e.type == SDL_KEYDOWN || e.type == SDL_KEYUP) { } else if(e.type == SDL_KEYDOWN || e.type == SDL_KEYUP) {
keysymbol k; keysymbol k;
k.device = SDL_DEV_KEYBOARD; k.device = SDL_DEV_KEYBOARD;
@ -929,7 +929,7 @@ namespace
sampledup_inc = 64081; sampledup_inc = 64081;
sampledup_mod = 2 * real_rate + 64081; sampledup_mod = 2 * real_rate + 64081;
} }
void audiocb(void* dummy, Uint8* stream, int len) void audiocb(void* dummy, Uint8* stream, int len)
{ {
static uint16_t lprev = 32768; static uint16_t lprev = 32768;
@ -1198,7 +1198,7 @@ namespace
ptr[i] = b ? bordercolor : 0; ptr[i] = b ? bordercolor : 0;
} }
} }
} }
} }
} }
@ -1518,19 +1518,19 @@ window::window()
SDL_AudioSpec* desired = new SDL_AudioSpec(); SDL_AudioSpec* desired = new SDL_AudioSpec();
SDL_AudioSpec* obtained = new SDL_AudioSpec(); SDL_AudioSpec* obtained = new SDL_AudioSpec();
desired->freq = 44100; desired->freq = 44100;
desired->format = AUDIO_S16SYS; desired->format = AUDIO_S16SYS;
desired->channels = 2; desired->channels = 2;
desired->samples = 8192; desired->samples = 8192;
desired->callback = audiocb; desired->callback = audiocb;
desired->userdata = NULL; desired->userdata = NULL;
if(SDL_OpenAudio(desired, obtained) < 0) { if(SDL_OpenAudio(desired, obtained) < 0) {
message("Audio can't be initialized, audio playback disabled"); message("Audio can't be initialized, audio playback disabled");
return; return;
} }
//Fill the parameters. //Fill the parameters.
calculate_sampledup(obtained->freq); calculate_sampledup(obtained->freq);
format = obtained->format; format = obtained->format;
@ -1587,7 +1587,7 @@ void window::message(const std::string& msg) throw(std::bad_alloc)
system_log << forlog << std::endl; system_log << forlog << std::endl;
msg2 = msg2.substr(s + 1); msg2 = msg2.substr(s + 1);
} }
} }
if(locked_mode && messagebuffer_first_show + maxmessages < messagebuffer_next_seq) if(locked_mode && messagebuffer_first_show + maxmessages < messagebuffer_next_seq)
messagebuffer_first_show = messagebuffer_next_seq - maxmessages; messagebuffer_first_show = messagebuffer_next_seq - maxmessages;
@ -1654,7 +1654,7 @@ void window::notify_screen_update(bool full) throw()
if(console_mode) { if(console_mode) {
draw_rectangle(reinterpret_cast<uint8_t*>(hwsurf->pixels), hwsurf->pitch, 2, 2, win_w - 2, draw_rectangle(reinterpret_cast<uint8_t*>(hwsurf->pixels), hwsurf->pitch, 2, 2, win_w - 2,
win_h - 28, bordercolor, 2); win_h - 28, bordercolor, 2);
draw_rectangle(reinterpret_cast<uint8_t*>(hwsurf->pixels), hwsurf->pitch, 2, win_h - 26, draw_rectangle(reinterpret_cast<uint8_t*>(hwsurf->pixels), hwsurf->pitch, 2, win_h - 26,
win_w - 2, win_h - 2, bordercolor, 2); win_w - 2, win_h - 2, bordercolor, 2);
} else { } else {
draw_rectangle(reinterpret_cast<uint8_t*>(hwsurf->pixels), hwsurf->pitch, 2, 2, screen_w + 10, draw_rectangle(reinterpret_cast<uint8_t*>(hwsurf->pixels), hwsurf->pitch, 2, 2, screen_w + 10,
@ -1680,7 +1680,7 @@ void window::notify_screen_update(bool full) throw()
memset(reinterpret_cast<uint8_t*>(hwsurf->pixels) + i * hwsurf->pitch + 24, 0, memset(reinterpret_cast<uint8_t*>(hwsurf->pixels) + i * hwsurf->pitch + 24, 0,
4 * screen_w); 4 * screen_w);
for(uint32_t i = 0; i < current_screen->height; i++) for(uint32_t i = 0; i < current_screen->height; i++)
memcpy(reinterpret_cast<uint8_t*>(hwsurf->pixels) + (i + 6) * hwsurf->pitch + 24, memcpy(reinterpret_cast<uint8_t*>(hwsurf->pixels) + (i + 6) * hwsurf->pitch + 24,
reinterpret_cast<uint8_t*>(current_screen->memory) + current_screen->pitch * i, reinterpret_cast<uint8_t*>(current_screen->memory) + current_screen->pitch * i,
4 * current_screen->width); 4 * current_screen->width);
} else { } else {
@ -2049,4 +2049,3 @@ void window::set_window_compensation(uint32_t xoffset, uint32_t yoffset, uint32_
vc_hscl = hscl; vc_hscl = hscl;
vc_vscl = vscl; vc_vscl = vscl;
} }

View file

@ -34,7 +34,7 @@ public:
/** /**
* Adds a messages to mesage queue to be shown. * Adds a messages to mesage queue to be shown.
* *
* parameter msg: The messages to add (split by '\n'). * parameter msg: The messages to add (split by '\n').
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -42,9 +42,9 @@ public:
/** /**
* Get output stream printing into message queue. * Get output stream printing into message queue.
* *
* Note that lines printed there should be terminated by '\n'. * Note that lines printed there should be terminated by '\n'.
* *
* returns: The output stream. * returns: The output stream.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -53,7 +53,7 @@ public:
/** /**
* Displays a modal message, not returning until the message is acknowledged. Keybindings are not available, but * Displays a modal message, not returning until the message is acknowledged. Keybindings are not available, but
* should quit be generated somehow, modal message will be closed and command callback triggered. * should quit be generated somehow, modal message will be closed and command callback triggered.
* *
* parameter msg: The message to show. * parameter msg: The message to show.
* parameter confirm: If true, ask for Ok/cancel type input. * parameter confirm: If true, ask for Ok/cancel type input.
* returns: If confirm is true, true if ok was chosen, false if cancel was chosen. Otherwise always false. * returns: If confirm is true, true if ok was chosen, false if cancel was chosen. Otherwise always false.
@ -68,7 +68,7 @@ public:
/** /**
* Bind a key. * Bind a key.
* *
* parameter mod: Set of modifiers. * parameter mod: Set of modifiers.
* parameter modmask: Modifier mask (set of modifiers). * parameter modmask: Modifier mask (set of modifiers).
* parameter keyname: Name of key or pseudo-key. * parameter keyname: Name of key or pseudo-key.
@ -81,7 +81,7 @@ public:
/** /**
* Unbind a key. * Unbind a key.
* *
* parameter mod: Set of modifiers. * parameter mod: Set of modifiers.
* parameter modmask: Modifier mask (set of modifiers). * parameter modmask: Modifier mask (set of modifiers).
* parameter keyname: Name of key or pseudo-key. * parameter keyname: Name of key or pseudo-key.
@ -93,7 +93,7 @@ public:
/** /**
* Dump bindings into this window. * Dump bindings into this window.
* *
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
void dumpbindings() throw(std::bad_alloc); void dumpbindings() throw(std::bad_alloc);
@ -101,42 +101,42 @@ public:
/** /**
* Processes inputs. If in non-modal mode (normal mode without pause), this returns quickly. Otherwise it waits * Processes inputs. If in non-modal mode (normal mode without pause), this returns quickly. Otherwise it waits
* for modal mode to exit. * for modal mode to exit.
* *
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
void poll_inputs() throw(std::bad_alloc); void poll_inputs() throw(std::bad_alloc);
/** /**
* Get emulator status area * Get emulator status area
* *
* returns: Emulator status area. * returns: Emulator status area.
*/ */
std::map<std::string, std::string>& get_emustatus() throw(); std::map<std::string, std::string>& get_emustatus() throw();
/** /**
* Notify that the screen has been updated. * Notify that the screen has been updated.
* *
* parameter full: Do full refresh if true. * parameter full: Do full refresh if true.
*/ */
void notify_screen_update(bool full = false) throw(); void notify_screen_update(bool full = false) throw();
/** /**
* Set the screen to use as main surface. * Set the screen to use as main surface.
* *
* parameter scr: The screen to use. * parameter scr: The screen to use.
*/ */
void set_main_surface(screen& scr) throw(); void set_main_surface(screen& scr) throw();
/** /**
* Enable/Disable pause mode. * Enable/Disable pause mode.
* *
* parameter enable: Enable pause if true, disable otherwise. * parameter enable: Enable pause if true, disable otherwise.
*/ */
void paused(bool enable) throw(); void paused(bool enable) throw();
/** /**
* Wait specified number of milliseconds (polling for input). * Wait specified number of milliseconds (polling for input).
* *
* parameter msec: Number of ms to wait. * parameter msec: Number of ms to wait.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -149,14 +149,14 @@ public:
/** /**
* Enable or disable sound. * Enable or disable sound.
* *
* parameter enable: Enable sounds if true, otherwise disable sounds. * parameter enable: Enable sounds if true, otherwise disable sounds.
*/ */
void sound_enable(bool enable) throw(); void sound_enable(bool enable) throw();
/** /**
* Input audio sample (at 32040.5Hz). * Input audio sample (at 32040.5Hz).
* *
* parameter left: Left sample. * parameter left: Left sample.
* parameter right: Right sample. * parameter right: Right sample.
*/ */
@ -165,11 +165,11 @@ public:
/** /**
* Set window main screen compensation parameters. This is used for mouse click reporting. * Set window main screen compensation parameters. This is used for mouse click reporting.
* *
* parameter xoffset: X coordinate of origin. * parameter xoffset: X coordinate of origin.
* parameter yoffset: Y coordinate of origin. * parameter yoffset: Y coordinate of origin.
* parameter hscl: Horizontal scaling factor. * parameter hscl: Horizontal scaling factor.
* parameter vscl: Vertical scaling factor. * parameter vscl: Vertical scaling factor.
*/ */
void set_window_compensation(uint32_t xoffset, uint32_t yoffset, uint32_t hscl, uint32_t vscl); void set_window_compensation(uint32_t xoffset, uint32_t yoffset, uint32_t hscl, uint32_t vscl);
private: private:
@ -180,7 +180,7 @@ private:
/** /**
* Get number of msec since some undetermined epoch. * Get number of msec since some undetermined epoch.
* *
* returns: The number of milliseconds. * returns: The number of milliseconds.
*/ */
uint64_t get_ticks_msec() throw(); uint64_t get_ticks_msec() throw();

28
zip.hpp
View file

@ -45,7 +45,7 @@ public:
/** /**
* Get name of current member. * Get name of current member.
* *
* returns: Name of member. * returns: Name of member.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -56,7 +56,7 @@ public:
/** /**
* Get name of current member. * Get name of current member.
* *
* returns: Name of member. * returns: Name of member.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -67,7 +67,7 @@ public:
/** /**
* Are these two iterators the same? * Are these two iterators the same?
* *
* parameter i: The another iterator * parameter i: The another iterator
* returns: True if iterators are the same, false otherwise. * returns: True if iterators are the same, false otherwise.
*/ */
@ -78,7 +78,7 @@ public:
/** /**
* Are these two iterators diffrent? * Are these two iterators diffrent?
* *
* paramer i: The another iterator * paramer i: The another iterator
* returns: True if iterators are diffrent, false otherwise. * returns: True if iterators are diffrent, false otherwise.
*/ */
@ -89,7 +89,7 @@ public:
/** /**
* Advance iterator one step. * Advance iterator one step.
* *
* returns: The old value of iterator. * returns: The old value of iterator.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -102,7 +102,7 @@ public:
/** /**
* Regress iterator one step. * Regress iterator one step.
* *
* returns: The old value of iterator. * returns: The old value of iterator.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -115,7 +115,7 @@ public:
/** /**
* Advance iterator one step. * Advance iterator one step.
* *
* returns: Reference to this iterator. * returns: Reference to this iterator.
*/ */
iterator_class<T, V>& operator++() throw() iterator_class<T, V>& operator++() throw()
@ -126,7 +126,7 @@ public:
/** /**
* Regress iterator one step. * Regress iterator one step.
* *
* returns: Reference to this iterator. * returns: Reference to this iterator.
*/ */
iterator_class<T, V>& operator--() throw() iterator_class<T, V>& operator--() throw()
@ -151,7 +151,7 @@ public:
/** /**
* Opens specified ZIP archive for reading. * Opens specified ZIP archive for reading.
* *
* parameter zipfile: The name of ZIP file to open. * parameter zipfile: The name of ZIP file to open.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
* throws std::runtime_error: Can't open the ZIP file. * throws std::runtime_error: Can't open the ZIP file.
@ -182,7 +182,7 @@ public:
/** /**
* Starting iterator * Starting iterator
* *
* returns: The iterator pointing to first name. * returns: The iterator pointing to first name.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -190,7 +190,7 @@ public:
/** /**
* Ending iterator (one past the end). * Ending iterator (one past the end).
* *
* returns: The iterator pointing to one past the last name. * returns: The iterator pointing to one past the last name.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -198,7 +198,7 @@ public:
/** /**
* Starting reverse iterator * Starting reverse iterator
* *
* returns: The iterator pointing to last name and acting in reverse. * returns: The iterator pointing to last name and acting in reverse.
* throws std::bad_alloc: Not enough memory. * throws std::bad_alloc: Not enough memory.
*/ */
@ -213,7 +213,7 @@ public:
/** /**
* Check if member with specified name exists. * Check if member with specified name exists.
* *
* parameter name: The name of the member to check * parameter name: The name of the member to check
* returns: True if specified member exists, false otherwise. * returns: True if specified member exists, false otherwise.
*/ */
@ -268,7 +268,7 @@ std::vector<char> read_file_relative(const std::string& name, const std::string&
/** /**
* Resolves the final file path that open_file_relative/read_file_relative would open. * Resolves the final file path that open_file_relative/read_file_relative would open.
* *
* parameter name: As in open_file_relative * parameter name: As in open_file_relative
* parameter referencing_path: As in open_file_relative * parameter referencing_path: As in open_file_relative
* returns: The file absolute path. * returns: The file absolute path.