mpw/toolbox/toolbox.h

35 lines
608 B
C
Raw Normal View History

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