mirror of https://github.com/ksherlock/mpw.git
Compare commits
3 Commits
8c911ab83d
...
194c36c89a
Author | SHA1 | Date |
---|---|---|
Kelvin Sherlock | 194c36c89a | |
Kelvin Sherlock | 3e2c02f796 | |
Kelvin Sherlock | 48d869c6e8 |
2
libsane
2
libsane
|
@ -1 +1 @@
|
|||
Subproject commit b12ef7bcd2e1ac8cea52a8cef6cef6b2960f143b
|
||||
Subproject commit 9c2af7c48dcbb58a5af436c295e83643c7f33f8b
|
|
@ -46,7 +46,7 @@ clean :
|
|||
# mpw Link $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
test_sane: o/nan.o o/test_sane.o
|
||||
$(MPW) $(MPWFLAGS) Link $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
$(MPW) $(MPWFLAGS) Link $(LDFLAGS) -o $@ $^ $(LIBS) {CLibraries}CSANELib.o
|
||||
|
||||
% : o/%.o
|
||||
$(MPW) $(MPWFLAGS) Link $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
|
|
@ -270,6 +270,87 @@ void test_fxc2dec(void)
|
|||
num2dec(&df, 1.0625, &d);
|
||||
dump_decimal(&d);
|
||||
// s/b -6 1062500
|
||||
}
|
||||
|
||||
pascal void fp68k_3(void *, void *, unsigned short) = 0xA9EB;
|
||||
|
||||
void test_fx2l(void) {
|
||||
|
||||
long double x;
|
||||
long int l;
|
||||
int i;
|
||||
|
||||
static long double data[] = {
|
||||
1.25,
|
||||
1.5,
|
||||
1.75,
|
||||
2.25,
|
||||
2.5,
|
||||
2.75,
|
||||
-1.25,
|
||||
-1.5,
|
||||
-1.75,
|
||||
-2.25,
|
||||
-2.5,
|
||||
-2.75,
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
x = inf(); // 1.0 / 0.0;
|
||||
fp68k_3(&x, &l, 0x2810);
|
||||
printf("fx2l(inf) = %lx\n", l);
|
||||
|
||||
|
||||
x = -inf(); // -1.0 / 0.0;
|
||||
fp68k_3(&x, &l, 0x2810);
|
||||
printf("fx2l(-inf) = %lx\n", l);
|
||||
|
||||
x = nan(1); // -1.0 / 0.0;
|
||||
fp68k_3(&x, &l, 0x2810);
|
||||
printf("fx2l(nan) = %lx\n", l);
|
||||
|
||||
|
||||
x = 1e21;
|
||||
fp68k_3(&x, &l, 0x2810);
|
||||
printf("fx2l(1e21) = %lx\n", l);
|
||||
|
||||
x = -1e21;
|
||||
fp68k_3(&x, &l, 0x2810);
|
||||
printf("fx2l(-1e21) = %lx\n", l);
|
||||
|
||||
|
||||
|
||||
setround(UPWARD);
|
||||
for (i = 0; i < 12; ++i) {
|
||||
x = data[i];
|
||||
fp68k_3(&x, &l, 0x2810);
|
||||
printf("fx2l(%f) = %ld\n", x, l);
|
||||
}
|
||||
setround(DOWNWARD);
|
||||
for (i = 0; i < 12; ++i) {
|
||||
x = data[i];
|
||||
fp68k_3(&x, &l, 0x2810);
|
||||
printf("fx2l(%f) = %ld\n", x, l);
|
||||
}
|
||||
|
||||
setround(TONEAREST);
|
||||
for (i = 0; i < 12; ++i) {
|
||||
x = data[i];
|
||||
fp68k_3(&x, &l, 0x2810);
|
||||
printf("fx2l(%f) = %ld\n", x, l);
|
||||
}
|
||||
setround(TOWARDZERO);
|
||||
for (i = 0; i < 12; ++i) {
|
||||
x = data[i];
|
||||
fp68k_3(&x, &l, 0x2810);
|
||||
printf("fx2l(%f) = %ld\n", x, l);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
@ -293,6 +374,7 @@ int main(int argc, char **argv)
|
|||
test_nan();
|
||||
|
||||
test_fxc2dec();
|
||||
test_fx2l();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "mm.h"
|
||||
#include "os.h"
|
||||
#include "packages.h"
|
||||
#include "process.h"
|
||||
#include "qd.h"
|
||||
#include "rm.h"
|
||||
#include "sane.h"
|
||||
|
@ -329,6 +330,11 @@ namespace OS {
|
|||
case 0x0020:
|
||||
return MM::TempDisposeHandle();
|
||||
|
||||
case 0x0037:
|
||||
return Process::GetCurrentProcess();
|
||||
|
||||
case 0x003a:
|
||||
return Process::GetProcessInformation();
|
||||
|
||||
default:
|
||||
fprintf(stderr, "OSDispatch: selector %04x not implemented\n",
|
||||
|
|
|
@ -288,6 +288,11 @@ namespace OS
|
|||
if (ext == "sym")
|
||||
return true;
|
||||
break;
|
||||
case 'x':
|
||||
// xcoff object file
|
||||
if (ext == "x")
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue