2013-02-20 23:28:13 -05:00
|
|
|
#ifndef __mpw_sane_h__
|
|
|
|
#define __mpw_sane_h__
|
|
|
|
|
|
|
|
#include <cstdint>
|
2013-07-07 23:41:28 -04:00
|
|
|
#include <string>
|
2013-02-20 23:28:13 -05:00
|
|
|
|
|
|
|
namespace SANE
|
|
|
|
{
|
2013-07-07 23:41:28 -04:00
|
|
|
struct decimal {
|
2015-02-22 19:12:35 -05:00
|
|
|
enum {
|
|
|
|
SIGDIGLEN = 20,
|
|
|
|
};
|
|
|
|
|
|
|
|
int sgn = 0;
|
|
|
|
int exp = 0;
|
2013-07-07 23:41:28 -04:00
|
|
|
std::string sig;
|
2015-02-22 19:12:35 -05: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-07 23:41:28 -04:00
|
|
|
};
|
|
|
|
|
2015-02-22 19:12:35 -05:00
|
|
|
|
2013-07-07 23:41:28 -04:00
|
|
|
void str2dec(const std::string &s, uint16_t &index, decimal &d, uint16_t &vp);
|
|
|
|
|
2013-02-25 17:35:01 -05:00
|
|
|
uint32_t decstr68k(uint16_t trap);
|
2013-02-20 23:28:13 -05:00
|
|
|
uint16_t fp68k(uint16_t trap);
|
|
|
|
}
|
2015-02-22 19:12:35 -05:00
|
|
|
|
2013-02-20 23:28:13 -05:00
|
|
|
#endif
|