3: 2009-11-20 (金) 03:01:20 hideyosi[4] [5] | 現: 2024-01-08 (月) 12:58:57 lina[4] [6] | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | TITLE:x | ||
*これはなにか? [#o78e6234] | *これはなにか? [#o78e6234] | ||
hideyosiが、ASKAをLinuxに移植しようともくろんであれやこれやと弄くりまわした時の記録です。こんな文章でもどなたかのご参考くらいにはなるかもしれないと思い、恥を忍んで公開しています。 | hideyosiが、ASKAをLinuxに移植しようともくろんであれやこれやと弄くりまわした時の記録です。こんな文章でもどなたかのご参考くらいにはなるかもしれないと思い、恥を忍んで公開しています。 | ||
Line 166: | Line 167: | ||
module.h:11: io.h: ?????????????????????? | module.h:11: io.h: ?????????????????????? | ||
~/aska/ensrc$ | ~/aska/ensrc$ | ||
+ | |||
~/aska/ensrc$ gcc -O2 -c module.cpp | ~/aska/ensrc$ gcc -O2 -c module.cpp | ||
In file included from module.cpp:2: | In file included from module.cpp:2: | ||
module.h:11: io.h: ?????????????????????? | module.h:11: io.h: ?????????????????????? | ||
~/aska/ensrc$ | ~/aska/ensrc$ | ||
+ | |||
~/aska/ensrc$ gcc -O2 -c parser.cpp | ~/aska/ensrc$ gcc -O2 -c parser.cpp | ||
In file included from parser.h:21, | In file included from parser.h:21, | ||
Line 177: | Line 178: | ||
module.h:11: io.h: ?????????????????????? | module.h:11: io.h: ?????????????????????? | ||
~/aska/ensrc$ | ~/aska/ensrc$ | ||
+ | |||
~/aska/ensrc$ gcc -O2 -c generator.cpp | ~/aska/ensrc$ gcc -O2 -c generator.cpp | ||
In file included from generator.h:21, | In file included from generator.h:21, | ||
Line 183: | Line 184: | ||
module.h:11: io.h: ?????????????????????? | module.h:11: io.h: ?????????????????????? | ||
~/aska/ensrc$ | ~/aska/ensrc$ | ||
+ | |||
~/aska/ensrc$ gcc -O2 -c module.cpp | ~/aska/ensrc$ gcc -O2 -c module.cpp | ||
In file included from module.cpp:2: | In file included from module.cpp:2: | ||
module.h:11: io.h: ?????????????????????? | module.h:11: io.h: ?????????????????????? | ||
~/aska/ensrc$ | ~/aska/ensrc$ | ||
+ | |||
~/aska/ensrc$ gcc -O2 -c main.cpp | ~/aska/ensrc$ gcc -O2 -c main.cpp | ||
In file included from parser.h:21, | In file included from parser.h:21, | ||
Line 344: | Line 345: | ||
#include <string.h> | #include <string.h> | ||
#include "module.h" | #include "module.h" | ||
+ | |||
//現在ではディレクトリの検索などはしていないので、単純に""や<>をはずすだけ | //現在ではディレクトリの検索などはしていないので、単純に""や<>をはずすだけ | ||
string Module::MakeFullPath(string& p){ | string Module::MakeFullPath(string& p){ | ||
Line 356: | Line 357: | ||
#include <string.h> | #include <string.h> | ||
#include "module.h" | #include "module.h" | ||
+ | |||
#include <sys/stat.h> | #include <sys/stat.h> | ||
int filelength (int fd) | int filelength (int fd) | ||
Line 367: | Line 368: | ||
return st.st_size; | return st.st_size; | ||
} | } | ||
+ | |||
//現在ではディレクトリの検索などはしていないので、単純に""や<>をはずすだけ | //現在ではディレクトリの検索などはしていないので、単純に""や<>をはずすだけ | ||
string Module::MakeFullPath(string& p){ | string Module::MakeFullPath(string& p){ | ||
Line 395: | Line 396: | ||
45行目 strcat(buf, ltoa(param.ndisp, buf2, 10)); | 45行目 strcat(buf, ltoa(param.ndisp, buf2, 10)); | ||
+ | |||
68行目 strcat(buf, ltoa(param.scale, buf2, 10)); | 68行目 strcat(buf, ltoa(param.scale, buf2, 10)); | ||
+ | |||
79行目 strcat(buf, ltoa(param.ndisp, buf2, 10)); | 79行目 strcat(buf, ltoa(param.ndisp, buf2, 10)); | ||
''↓'' | ''↓'' | ||
45行目 strcat(buf, sprintf(buf2,"%ld",param.ndisp)); | 45行目 strcat(buf, sprintf(buf2,"%ld",param.ndisp)); | ||
+ | |||
68行目 strcat(buf, sprintf(buf2,"%ld",param.ndisp)); | 68行目 strcat(buf, sprintf(buf2,"%ld",param.ndisp)); | ||
+ | |||
79行目 strcat(buf, sprintf(buf2,"%ld",param.ndisp)); | 79行目 strcat(buf, sprintf(buf2,"%ld",param.ndisp)); | ||
-よーし。これでいいかな。コンパイル。 | -よーし。これでいいかな。コンパイル。 | ||
Line 416: | Line 417: | ||
45行目 sprintf(buf2,"%ld",param.ndisp);strcat(buf,buf2 ); | 45行目 sprintf(buf2,"%ld",param.ndisp);strcat(buf,buf2 ); | ||
+ | |||
68行目 sprintf(buf2,"%ld",param.ndisp);strcat(buf,buf2 ); | 68行目 sprintf(buf2,"%ld",param.ndisp);strcat(buf,buf2 ); | ||
+ | |||
79行目 sprintf(buf2,"%ld",param.ndisp);strcat(buf,buf2 ); | 79行目 sprintf(buf2,"%ld",param.ndisp);strcat(buf,buf2 ); | ||
-さーて、こんどこそ大丈夫かな。 | -さーて、こんどこそ大丈夫かな。 | ||
Line 432: | Line 433: | ||
510行目 strcpy(buf, buf1); strcat(buf, ","); strcat(buf, itoa(x, buf2, 10)); | 510行目 strcpy(buf, buf1); strcat(buf, ","); strcat(buf, itoa(x, buf2, 10)); | ||
+ | |||
554行目 strcat(buf, ","); strcat(buf, itoa(x, buf1, 10)); | 554行目 strcat(buf, ","); strcat(buf, itoa(x, buf1, 10)); | ||
+ | |||
722行目 OutputMASM("#local", "equ", itoa(sysvarlocalvalue, buf, 10), ""); | 722行目 OutputMASM("#local", "equ", itoa(sysvarlocalvalue, buf, 10), ""); | ||
''↓'' | ''↓'' | ||
510行目 strcpy(buf, buf1); strcat(buf, ","); sprintf(buf2,"%d",x);strcat(buf, buf2); | 510行目 strcpy(buf, buf1); strcat(buf, ","); sprintf(buf2,"%d",x);strcat(buf, buf2); | ||
+ | |||
554行目 strcat(buf, ","); sprintf(buf1,"%d",x);strcat(buf, buf1); | 554行目 strcat(buf, ","); sprintf(buf1,"%d",x);strcat(buf, buf1); | ||
+ | |||
722行目 sprintf(buf,"%d",sysvarlocalvalue);OutputMASM("#local", "equ", buf, ""); | 722行目 sprintf(buf,"%d",sysvarlocalvalue);OutputMASM("#local", "equ", buf, ""); | ||
-いよーし!!。これでコンパイル、完了!!! | -いよーし!!。これでコンパイル、完了!!! | ||
Line 468: | Line 469: | ||
CPPFLAGS = | CPPFLAGS = | ||
PGNAME = aska.exe | PGNAME = aska.exe | ||
+ | |||
# | # | ||
# SRC Directory | # SRC Directory | ||
Line 480: | Line 481: | ||
CPPFLAGS = | CPPFLAGS = | ||
PGNAME = aska | PGNAME = aska | ||
+ | |||
# | # | ||
# SRC Directory | # SRC Directory | ||
Line 590: | Line 591: | ||
HRESULT Module::ReadLine(LPSTR buf){ | HRESULT Module::ReadLine(LPSTR buf){ | ||
int i; | int i; | ||
+ | |||
if(lpMdlPos == NULL) return 3; | if(lpMdlPos == NULL) return 3; | ||
if(lpMdlPos >= (LPSTR)lpMdlAdr + dwMdlSize) return 1; | if(lpMdlPos >= (LPSTR)lpMdlAdr + dwMdlSize) return 1; | ||
Line 609: | Line 610: | ||
HRESULT Module::ReadLine(LPSTR buf){ | HRESULT Module::ReadLine(LPSTR buf){ | ||
int i; | int i; | ||
+ | |||
if(lpMdlPos == NULL) return 3; | if(lpMdlPos == NULL) return 3; | ||
if(lpMdlPos >= (LPSTR)lpMdlAdr + dwMdlSize) return 1; | if(lpMdlPos >= (LPSTR)lpMdlAdr + dwMdlSize) return 1; | ||
for(i = 0; i < 1023; i++){ | for(i = 0; i < 1023; i++){ | ||
// if(*lpMdlPos == 0x0D && *(lpMdlPos+1) == 0x0A){ | // if(*lpMdlPos == 0x0D && *(lpMdlPos+1) == 0x0A){ | ||
+ | |||
if(*lpMdlPos == 0x0D && *(lpMdlPos+1) == 0x0A){ | if(*lpMdlPos == 0x0D && *(lpMdlPos+1) == 0x0A){ | ||
*buf = '\0'; | *buf = '\0'; | ||
Line 620: | Line 621: | ||
return 0; // 1行終了(DOS) | return 0; // 1行終了(DOS) | ||
} | } | ||
+ | |||
if(*lpMdlPos == 0x0A || *lpMdlPos == 0x0D){ | if(*lpMdlPos == 0x0A || *lpMdlPos == 0x0D){ | ||
*buf = '\0'; | *buf = '\0'; | ||
Line 626: | Line 627: | ||
return 0; // 1行終了(UNIX or MAC) | return 0; // 1行終了(UNIX or MAC) | ||
} | } | ||
+ | |||
*(buf++) = *(lpMdlPos++); | *(buf++) = *(lpMdlPos++); | ||
} | } |
(This host) = http://osask.net