2013-02-06 23:44:12 -05:00
|
|
|
#ifndef __mpw_toolbox_h__
|
|
|
|
#define __mpw_toolbox_h__
|
|
|
|
|
2013-02-12 22:35:15 -05:00
|
|
|
#include <string>
|
|
|
|
|
2013-02-16 18:51:28 -05:00
|
|
|
#include <cstdint>
|
|
|
|
#include <cstdio>
|
|
|
|
|
2013-02-07 19:21:47 -05:00
|
|
|
namespace ToolBox
|
|
|
|
{
|
2013-02-16 18:51:28 -05:00
|
|
|
extern bool Trace;
|
|
|
|
|
|
|
|
template<typename... Args>
|
|
|
|
inline void Log(const char *format, Args... args)
|
|
|
|
{
|
|
|
|
if (Trace) fprintf(stderr, format, args...);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-02-07 19:21:47 -05:00
|
|
|
void dispatch(uint16_t trap);
|
2013-02-12 22:35:15 -05:00
|
|
|
|
|
|
|
|
2013-02-17 01:18:00 -05:00
|
|
|
std::string ReadCString(uint32_t address, bool fname = false);
|
|
|
|
std::string ReadPString(uint32_t address, bool fname = false);
|
2013-02-17 18:08:39 -05:00
|
|
|
|
|
|
|
std::string ReadString(uint32_t address, uint32_t length);
|
|
|
|
|
2013-02-13 22:16:05 -05:00
|
|
|
bool WritePString(uint32_t address, const std::string &s);
|
|
|
|
|
2013-02-07 19:21:47 -05:00
|
|
|
}
|
|
|
|
|
2013-02-06 23:44:12 -05:00
|
|
|
|
|
|
|
#endif
|