3: 2009-11-20 (金) 03:01:20 hideyosi  |
現: 2024-01-08 (月) 12:58:57 lina  |
| | + | TITLE:x |
| | *これはなにか? [#o78e6234] | | *これはなにか? [#o78e6234] |
| | hideyosiが、ASKAをLinuxに移植しようともくろんであれやこれやと弄くりまわした時の記録です。こんな文章でもどなたかのご参考くらいにはなるかもしれないと思い、恥を忍んで公開しています。 | | hideyosiが、ASKAをLinuxに移植しようともくろんであれやこれやと弄くりまわした時の記録です。こんな文章でもどなたかのご参考くらいにはなるかもしれないと思い、恥を忍んで公開しています。 |
| | 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, |
| | 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, |
| | 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, |
| | #include <string.h> | | #include <string.h> |
| | #include "module.h" | | #include "module.h" |
| | + | |
| | //現在ではディレクトリの検索などはしていないので、単純に""や<>をはずすだけ | | //現在ではディレクトリの検索などはしていないので、単純に""や<>をはずすだけ |
| | string Module::MakeFullPath(string& p){ | | string Module::MakeFullPath(string& p){ |
| | #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) |
| | return st.st_size; | | return st.st_size; |
| | } | | } |
| | + | |
| | //現在ではディレクトリの検索などはしていないので、単純に""や<>をはずすだけ | | //現在ではディレクトリの検索などはしていないので、単純に""や<>をはずすだけ |
| | string Module::MakeFullPath(string& p){ | | string Module::MakeFullPath(string& p){ |
| | | | |
| | 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)); |
| | -よーし。これでいいかな。コンパイル。 | | -よーし。これでいいかな。コンパイル。 |
| | | | |
| | 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 ); |
| | -さーて、こんどこそ大丈夫かな。 | | -さーて、こんどこそ大丈夫かな。 |
| | | | |
| | 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, ""); |
| | -いよーし!!。これでコンパイル、完了!!! | | -いよーし!!。これでコンパイル、完了!!! |
| | CPPFLAGS = | | CPPFLAGS = |
| | PGNAME = aska.exe | | PGNAME = aska.exe |
| | + | |
| | # | | # |
| | # SRC Directory | | # SRC Directory |
| | CPPFLAGS = | | CPPFLAGS = |
| | PGNAME = aska | | PGNAME = aska |
| | + | |
| | # | | # |
| | # SRC Directory | | # SRC Directory |
| | 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; |
| | 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'; |
| | return 0; // 1行終了(DOS) | | return 0; // 1行終了(DOS) |
| | } | | } |
| | + | |
| | if(*lpMdlPos == 0x0A || *lpMdlPos == 0x0D){ | | if(*lpMdlPos == 0x0A || *lpMdlPos == 0x0D){ |
| | *buf = '\0'; | | *buf = '\0'; |
| | return 0; // 1行終了(UNIX or MAC) | | return 0; // 1行終了(UNIX or MAC) |
| | } | | } |
| | + | |
| | *(buf++) = *(lpMdlPos++); | | *(buf++) = *(lpMdlPos++); |
| | } | | } |