mpw/toolbox/sane.h

44 lines
641 B
C
Raw Normal View History

2013-02-21 04:28:13 +00:00
#ifndef __mpw_sane_h__
#define __mpw_sane_h__
#include <cstdint>
2013-07-08 03:41:28 +00:00
#include <string>
2013-02-21 04:28:13 +00:00
namespace SANE
{
2013-07-08 03:41:28 +00:00
struct decimal {
2015-02-23 00:12:35 +00:00
enum {
SIGDIGLEN = 20,
};
int sgn = 0;
int exp = 0;
2013-07-08 03:41:28 +00:00
std::string sig;
2015-02-23 00:12:35 +00:00
static decimal read(uint32_t address);
void write(uint32_t address);
};
struct decform
{
enum {
FLOATDECIMAL = 0,
FIXEDDECIMAL = 1,
};
uint8_t style = 0;
uint16_t digits = 0;
static decform read(uint32_t address);
void write(uint32_t address);
2013-07-08 03:41:28 +00:00
};
2015-02-23 00:12:35 +00:00
2013-07-08 03:41:28 +00:00
void str2dec(const std::string &s, uint16_t &index, decimal &d, uint16_t &vp);
2013-02-25 22:35:01 +00:00
uint32_t decstr68k(uint16_t trap);
2013-02-21 04:28:13 +00:00
uint16_t fp68k(uint16_t trap);
}
2015-02-23 00:12:35 +00:00
2013-02-21 04:28:13 +00:00
#endif