Subversion Repositories Shiroi

Rev

Rev 9 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 11
Line 1... Line 1...
1
/* $Id: math.c 9 2024-08-28 16:35:27Z nishi $ */
1
/* $Id: math.c 11 2024-08-29 02:49:47Z nishi $ */
2
 
2
 
3
#include "math.h"
3
#include "math.h"
4
 
4
 
5
#include "io.h"
5
#include "io.h"
6
 
6
 
Line 65... Line 65...
65
	for(i = 0; i < 4; i++){
65
	for(i = 0; i < 4; i++){
66
		outp(fpu_stack, b & 0xff);
66
		outp(fpu_stack, b & 0xff);
67
		b = b >> 8;
67
		b = b >> 8;
68
	}
68
	}
69
	outp(fpu_command, AM_DOUBLE | AM_DIV);
69
	outp(fpu_command, AM_DOUBLE | AM_DIV);
-
 
70
	while(!(inp(fpu_command) & 1));
70
	unsigned long r = 0;
71
	unsigned long r = 0;
71
	for(i = 0; i < 4; i++){
72
	for(i = 0; i < 4; i++){
72
		r = r << 8;
73
		r = r << 8;
73
		r |= inp(fpu_stack);
74
		r |= inp(fpu_stack);
74
	}
75
	}
Line 84... Line 85...
84
	for(i = 0; i < 4; i++){
85
	for(i = 0; i < 4; i++){
85
		outp(fpu_stack, b & 0xff);
86
		outp(fpu_stack, b & 0xff);
86
		b = b >> 8;
87
		b = b >> 8;
87
	}
88
	}
88
	outp(fpu_command, AM_DOUBLE | AM_MUL);
89
	outp(fpu_command, AM_DOUBLE | AM_MUL);
-
 
90
	while(!(inp(fpu_command) & 1));
89
	long r = 0;
91
	long r = 0;
90
	for(i = 0; i < 4; i++){
92
	for(i = 0; i < 4; i++){
91
		r = r << 8;
93
		r = r << 8;
92
		r |= inp(fpu_stack);
94
		r |= inp(fpu_stack);
93
	}
95
	}