From db433fa64e82925f18410a825308f20a6c49bc1209b6061754c5340c3cf0f57f Mon Sep 17 00:00:00 2001 From: Gabriel Lorenzo Date: Wed, 5 Mar 2003 16:52:17 +0000 Subject: [PATCH] signals rulando :D --- dlls/src/dinmem/win32/dinmem.vcproj | 2 +- dlls/src/edivstd/edivstd.c | 29 ++++++-- dlls/src/edivstd/win32/edivstd.vcproj | 7 +- dlls/src/file/win32/file.vcproj | 2 +- dlls/src/graphics/win32/graphics.vcproj | 2 +- dlls/src/input/win32/input.vcproj | 2 +- dlls/src/math/win32/math.vcproj | 2 +- dlls/src/strings/win32/strings.vcproj | 2 +- dlls/src/text/win32/text.vcproj | 2 +- ediv/CHANGE_LOG.txt | 12 ++++ ediv/bin/ROBOTS.PRG | 4 ++ ediv/bin/signal2.prg | 81 +++++++++++++++++++++++ ediv/src/ediv/compiler.c | 4 +- ediv/src/ediv/config.c | 4 +- ediv/src/ediv/dll_load.c | 2 +- ediv/src/ediv/ediv.c | 4 +- ediv/src/ediv/lower.c | 2 +- ediv/src/shared/shared.h | 2 +- ediv/src/stub/inte.c | 9 ++- ediv/src/visual c/ediv_ws.suo | Bin 19456 -> 15360 bytes ediv/src/visual c/encrypt/encrypt.vcproj | 2 +- 21 files changed, 148 insertions(+), 28 deletions(-) create mode 100644 ediv/bin/signal2.prg diff --git a/dlls/src/dinmem/win32/dinmem.vcproj b/dlls/src/dinmem/win32/dinmem.vcproj index b799139..3c688d8 100644 --- a/dlls/src/dinmem/win32/dinmem.vcproj +++ b/dlls/src/dinmem/win32/dinmem.vcproj @@ -41,7 +41,7 @@ GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/dinmem.pdb" SubSystem="2" - ImportLibrary="$(OutDir)/dinmem.lib" + ImportLibrary="" TargetMachine="1"/> diff --git a/dlls/src/edivstd/edivstd.c b/dlls/src/edivstd/edivstd.c index 7280761..49a5077 100644 --- a/dlls/src/edivstd/edivstd.c +++ b/dlls/src/edivstd/edivstd.c @@ -32,6 +32,7 @@ #else #error ¡adapta las rutinas de timer a Linux! #endif +#include #include @@ -41,6 +42,21 @@ int last_type ; int last_proc ; +int DEBUG_PROCESOS(FUNCTION_PARAMS) +{ + int i,n; + FILE* f; + f=fopen("procs.txt","a"); + fprintf(f,"\n--- COMIENZO ---\n"); + for(i=0;i<*fp->num_procs;i++) { + n=fp->procs_s[fp->proc_orden[i]].id; + fprintf(f,"(%d) ID: %d TYPE: %d TIPO: %d STATUS: %d ORDEN: %d\n",i,n,reserved("process_type",n),fp->procs_s[fp->proc_orden[i]].tipo,reserved("status",n),fp->procs_s[fp->proc_orden[i]].orden); + } + fprintf(f,"\n--- FIN ---\n"); + fclose(f); + return 0; +} + int ExportaFuncs(EXPORTAFUNCS_PARAMS) { @@ -164,6 +180,8 @@ int ExportaFuncs(EXPORTAFUNCS_PARAMS) FUNCTION("signal",2,eDIV_Signal); FUNCTION("let_me_alone",0,eDIV_Let_Me_Alone); + FUNCTION("debug_procesos",0,DEBUG_PROCESOS); + ENTRYPOINT( first_load ) ; ENTRYPOINT(frame); @@ -251,9 +269,10 @@ int eDiv_DefineRegion(FUNCTION_PARAMS) void signal_tree(int proc, int signal, FUNCTION_PARAMS) { int id2; + reserved("status",proc)=signal; if(id2=local("son",proc)) { signal_tree(id2,signal,fp); - reserved("status",id2)=signal; + //reserved("status",id2)=signal; } while(local("bigbro",id2)) { proc=local("bigbro",id2); @@ -266,19 +285,19 @@ int eDIV_Signal(FUNCTION_PARAMS) int signal=getparm(); int proc=getparm(); char tree=FALSE; - + +// assert(0); if(signal>=100) { signal-=100; tree=TRUE; } signal++; - /* Si se le pasa un ID */ if(procimem_max) { reserved("status",proc)=signal; - if(tree && (proc=reserved("son",proc))) + if(tree && (proc=local("son",proc))) signal_tree(proc,signal,fp); } /* Si se le pasa un type */ @@ -287,7 +306,7 @@ int eDIV_Signal(FUNCTION_PARAMS) for(i=0;i<*fp->num_procs;i++) { if(fp->procs_s[fp->proc_orden[i]].tipo==proc) { reserved("status",fp->procs_s[fp->proc_orden[i]].id)=signal; - if(tree && (p=reserved("son",fp->procs_s[fp->proc_orden[i]].id))) + if(tree && (p=local("son",fp->procs_s[fp->proc_orden[i]].id))) signal_tree(fp->procs_s[fp->proc_orden[i]].id,signal,fp); } } diff --git a/dlls/src/edivstd/win32/edivstd.vcproj b/dlls/src/edivstd/win32/edivstd.vcproj index 4362934..0c5a15e 100644 --- a/dlls/src/edivstd/win32/edivstd.vcproj +++ b/dlls/src/edivstd/win32/edivstd.vcproj @@ -12,7 +12,7 @@ @@ -40,12 +40,13 @@ GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/edivstd.pdb" SubSystem="2" - ImportLibrary="$(OutDir)/edivstd.lib" + ImportLibrary="" TargetMachine="1"/> + Name="VCPostBuildEventTool" + CommandLine="copy Debug\edivstd.dll ..\..\..\..\ediv\bin\dll"/> diff --git a/dlls/src/graphics/win32/graphics.vcproj b/dlls/src/graphics/win32/graphics.vcproj index 3ef73aa..9f9d2d6 100644 --- a/dlls/src/graphics/win32/graphics.vcproj +++ b/dlls/src/graphics/win32/graphics.vcproj @@ -41,7 +41,7 @@ GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/graphics.pdb" SubSystem="2" - ImportLibrary="$(OutDir)/graphics.lib" + ImportLibrary="" TargetMachine="1"/> diff --git a/dlls/src/input/win32/input.vcproj b/dlls/src/input/win32/input.vcproj index 12ab80a..9664d64 100644 --- a/dlls/src/input/win32/input.vcproj +++ b/dlls/src/input/win32/input.vcproj @@ -41,7 +41,7 @@ GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/input.pdb" SubSystem="2" - ImportLibrary="$(OutDir)/input.lib" + ImportLibrary="" TargetMachine="1"/> diff --git a/dlls/src/math/win32/math.vcproj b/dlls/src/math/win32/math.vcproj index 107e938..f5b18a5 100644 --- a/dlls/src/math/win32/math.vcproj +++ b/dlls/src/math/win32/math.vcproj @@ -40,7 +40,7 @@ GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/math.pdb" SubSystem="2" - ImportLibrary="$(OutDir)/math.lib" + ImportLibrary="" TargetMachine="1"/> diff --git a/dlls/src/strings/win32/strings.vcproj b/dlls/src/strings/win32/strings.vcproj index 801a491..a1373dc 100644 --- a/dlls/src/strings/win32/strings.vcproj +++ b/dlls/src/strings/win32/strings.vcproj @@ -39,7 +39,7 @@ GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/strings.pdb" SubSystem="2" - ImportLibrary="$(OutDir)/strings.lib" + ImportLibrary="" TargetMachine="1"/> diff --git a/dlls/src/text/win32/text.vcproj b/dlls/src/text/win32/text.vcproj index c03b583..c51408c 100644 --- a/dlls/src/text/win32/text.vcproj +++ b/dlls/src/text/win32/text.vcproj @@ -40,7 +40,7 @@ GenerateDebugInformation="TRUE" ProgramDatabaseFile="$(OutDir)/text.pdb" SubSystem="2" - ImportLibrary="$(OutDir)/text.lib" + ImportLibrary="" TargetMachine="1"/> diff --git a/ediv/CHANGE_LOG.txt b/ediv/CHANGE_LOG.txt index ea880d7..c352dd7 100644 --- a/ediv/CHANGE_LOG.txt +++ b/ediv/CHANGE_LOG.txt @@ -1,3 +1,15 @@ +05/03/2003 +---------- + * Hay algún fallo cuando se elimina un proceso, tiene que ver con la + eliminación de procesos de procs_s y proc_orden y la creación y + ejecución de nuevos procesos (probad a rular robots.prg y pasaros el + primer nivel, os dará un error "redefinición del tipo de proceso" cuando + intentéis mover el personaje). (Er_Makina) + +04/03/2003 +---------- + * signal() arreglado, ya funcionan las señales tree (Er_Makina) + 18/12/2002 ---------- * Mas comentarizacion siguiendo las normas del ANSI C (Daijo) diff --git a/ediv/bin/ROBOTS.PRG b/ediv/bin/ROBOTS.PRG index 173b7e4..ea7d7cb 100644 --- a/ediv/bin/ROBOTS.PRG +++ b/ediv/bin/ROBOTS.PRG @@ -57,6 +57,7 @@ BEGIN // fade_on(); // prota=protag(rand(0,39)*8,rand(0,24)*8); protag(rand(0,39)*8,rand(0,24)*8); + debug_procesos(); for(i=1;i<=num_robots;i++) loop x=rand(0,39); @@ -189,8 +190,11 @@ BEGIN mueve_robots(); end end + debug_procesos(); signal(prota,s_kill); + debug_procesos(); signal(type robot,s_kill); + debug_procesos(); muertos=0; cogido=0; ya=0; diff --git a/ediv/bin/signal2.prg b/ediv/bin/signal2.prg new file mode 100644 index 0000000..b695339 --- /dev/null +++ b/ediv/bin/signal2.prg @@ -0,0 +1,81 @@ +program prueba_signal2; +global + idbola; + +begin + load_fnt("system.fnt"); + load_fpg("test16.fpg"); + put_screen(0,1); + + write_int(1,0,0,0,&idbola); + + idbola=bola(0); + + loop + frame; + if(key(_f)) + signal(idbola,s_freeze_tree); + while(key(_f)) + frame; + end + signal(idbola,s_wakeup_tree); + end + if(key(_s)) + signal(idbola,s_sleep_tree); + while(key(_s)) + frame; + end + signal(idbola,s_wakeup_tree); + end + if(key(_k)) + signal(idbola,s_kill_tree); + while(key(_k)) + frame; + end + triangulo(7); + idbola=bola(0); + end + if(key(_esc)) + exit("Taluego lucas!!",0); + end + end +end + +process bola(num) +begin + graph=100; + x=160; + y=30+num*20; + + if(num<3) + bola(num+1); + else + triangulo(num+1); + end + + loop + frame; + x+=rand(-5,5); + if(x<30) x=30; end + if(x>290) x=290; end + end +end + +process triangulo(num) +begin + graph=101; + x=160; + y=30+num*20; + + if(num<6) + triangulo(num+1); + end + + loop + frame; + x+=rand(-5,5); + if(x<30) x=30; end + if(x>290) x=290; end + end +end + diff --git a/ediv/src/ediv/compiler.c b/ediv/src/ediv/compiler.c index 8fa7417..9d7cc37 100644 --- a/ediv/src/ediv/compiler.c +++ b/ediv/src/ediv/compiler.c @@ -335,7 +335,7 @@ void compila() #endif if ((f=fopen(outfilename,"ab"))!=NULL) { - fwrite(nombre_program,strlen(nombre_program)+1,1,f); + fwrite(nombre_program,strlen((const char*)nombre_program)+1,1,f); p=(byte*)e_malloc((imem+iloc)*4); m=(imem+iloc)*4+1024; q=(byte*)e_malloc(m); @@ -1065,7 +1065,7 @@ void escribe_lin(FILE* f) b++; progcomp=e_malloc(b*2); l=b*2; - if(compress(progcomp,&l,prog,b)) { + if(compress(progcomp,(unsigned long*)&l,prog,b)) { fclose(linf); fclose(f); errormem(); diff --git a/ediv/src/ediv/config.c b/ediv/src/ediv/config.c index a793e31..88f9799 100644 --- a/ediv/src/ediv/config.c +++ b/ediv/src/ediv/config.c @@ -33,12 +33,12 @@ char* buffer; int linea; char cfg[256]; -void cfg_error(int error) +/*void cfg_error(int error) { printf(translate(41),cfg,linea,translate_cfg_error(error)); printf(translate(42)); exit(1); -} +}*/ void salta_spc() { while(lower[buffer[i]]==0 && iu1.Function = (PDWORD) func; + ptd_out->u1.Function = (unsigned long)(PDWORD) func; ptd_in++; ptd_out++; diff --git a/ediv/src/ediv/ediv.c b/ediv/src/ediv/ediv.c index a1408d0..edcf00e 100644 --- a/ediv/src/ediv/ediv.c +++ b/ediv/src/ediv/ediv.c @@ -242,9 +242,9 @@ int main(int argc, char *argv[]) /* mete el PRG en el buffer prog */ fseek(fp,0,SEEK_END); progsize=ftell(fp); - prog = (char *)e_malloc(progsize+1); + prog = (unsigned char *)e_malloc(progsize+1); fseek(fp,0,SEEK_SET); - p=prog; + p=(char*)prog; do { *p = getc(fp); p++; diff --git a/ediv/src/ediv/lower.c b/ediv/src/ediv/lower.c index 52ef9fa..b4f0cef 100644 --- a/ediv/src/ediv/lower.c +++ b/ediv/src/ediv/lower.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include "main.h" #include "lower.h" diff --git a/ediv/src/shared/shared.h b/ediv/src/shared/shared.h index 1ce56c9..c61fb58 100644 --- a/ediv/src/shared/shared.h +++ b/ediv/src/shared/shared.h @@ -39,4 +39,4 @@ #define long_header 9 /* Longitud de la cabecera al inicio de los programas */ -#endif /* __EDIV_SHARED_H_ \ No newline at end of file +#endif /* __EDIV_SHARED_H_ */ \ No newline at end of file diff --git a/ediv/src/stub/inte.c b/ediv/src/stub/inte.c index 5ca74f6..a5c1d06 100644 --- a/ediv/src/stub/inte.c +++ b/ediv/src/stub/inte.c @@ -123,9 +123,9 @@ int lista_quita( int num ) { int i ; - procs_s[num].tipo=0; + procs_s[proc_orden[num]].tipo=0; - for ( i = procs_s[num].orden+1 ; i < num_proc_orden ; i++ ) + for ( i = num+1 ; i < num_proc_orden ; i++ ) { procs_s[ proc_orden[ i ] ].orden-- ; proc_orden[ i - 1 ] = proc_orden[ i ] ; @@ -155,9 +155,12 @@ int interprete() for ( proceso_actual = 0 ; proceso_actual < num_proc_orden ; proceso_actual++ ) { + //printf("Proceso %d - Estado: %d\n",procs_s[proc_orden[proceso_actual]].id,mem[procs_s[proc_orden[proceso_actual]].id+_status]); if(mem[procs_s[proc_orden[proceso_actual]].id+_status]==1) { - //mem[procs_s[num].id+_status=0; + mem[procs_s[proc_orden[proceso_actual]].id+_status]=0; + //assert(0); lista_quita(proceso_actual); + proceso_actual--; } } diff --git a/ediv/src/visual c/ediv_ws.suo b/ediv/src/visual c/ediv_ws.suo index 2a391a5e432c6a9fdd12fb0c2cc152fb505d1e47456ef4ae409a924f1cbba26a..0dc4029b376632356b40da9d72acc199de14ae8fce6abbad51c27fc22c0d5a58 100644 GIT binary patch delta 1484 zcmaJ>T}+!*7(VCQ_w|pjuu{8qw6K~WOomw*1Qn`nX@SwfItFn|Hlr<6EGum-?Y26X zu{dWoRAbr4LfcXF~{$Owp zyn=}jcmjA5@B;xL2#f$BAPlh67{+mc+{UcVLIUJD7S@bzFAIz;gcpEU0p@v(1>hWT z9=HI!4A8H}Gh-aT8jj^-7=`83)TC!-?)k)0jatLWSSqvN8J$n&GdVUepG?F(W0~9% z=O!$n%u+U!PNehnp~%TIUAt9lzI51lt1#YQs9S5?w~=zODI%?s zMQej6RrKR}(+&^HTaWAd4$;sGVNNM;TCXWl$>GccLhKd4Dc?y8N7t>0U8y_=R{L%_ z#YDY7SPzA|c}F?}8Y{Y*?hJx^F>=IqA|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sEzMX>bkKRg+2VbmrPLH|DT{Q{-2bq)id_8$kS4rujvzsT zY=jOt59aSsTWALbyGeuP{iJewWGi<#qo?vLtSj{WQq${{bJ>p`!86#6Oy>Q9x56fH zZny!LPRLwx2XVpet)P13pAV}~vMIK?lJ%nr@Mh41F^YJ^SqCPvkt=;f=1nOJB%ej?ju<8?l*E=2>GS|_&7F+JZQMIEE+Nnlau3H{2Ck36u zc1Phu-_Joais|a79@Af6efG0_e=qH|WSyDchE||FE6uH>vo;GAwd~7Jfz^d~eN1gt z#o1BRQcS)h14zDqx%Es=5>1PD3T?R!_fuI(u03;`z>% diff --git a/ediv/src/visual c/encrypt/encrypt.vcproj b/ediv/src/visual c/encrypt/encrypt.vcproj index f30d4b4..66ff6b8 100644 --- a/ediv/src/visual c/encrypt/encrypt.vcproj +++ b/ediv/src/visual c/encrypt/encrypt.vcproj @@ -27,7 +27,7 @@ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" MinimalRebuild="TRUE" BasicRuntimeChecks="3" - RuntimeLibrary="5" + RuntimeLibrary="2" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="FALSE"