From c59f57e7af85b5d48540ef4bc8e50520f9d8706f58aab84c25dfa644bc7b7758 Mon Sep 17 00:00:00 2001 From: Gabriel Lorenzo Date: Wed, 30 Oct 2002 20:12:22 +0000 Subject: [PATCH] signal!! :D --- ediv/CHANGE_LOG.txt | 4 ++- ediv/bin/ROBOTS.PRG | 4 +-- ediv/src/dlls/dlls.suo | Bin 23552 -> 23552 bytes ediv/src/dlls/edivstd/edivstd.c | 46 ++++++++++++++++++++++++++++++ ediv/src/dlls/edivstd/main.h | 3 +- ediv/src/dlls/graphics/graphics.h | 4 +-- ediv/src/dlls/graphics/main.c | 38 ++++++++++++++---------- ediv/src/stub/inte.c | 14 +++++++-- ediv/src/stub/stub.c | 5 ++-- ediv/src/visual c/ediv_ws.suo | Bin 18432 -> 18944 bytes 10 files changed, 92 insertions(+), 26 deletions(-) diff --git a/ediv/CHANGE_LOG.txt b/ediv/CHANGE_LOG.txt index 0fabfad..d6b1119 100644 --- a/ediv/CHANGE_LOG.txt +++ b/ediv/CHANGE_LOG.txt @@ -1,8 +1,10 @@ 30/10/2002 ---------- - * Añadido la variable RESOLUTION, que a la hora de compilar el TUTOR2.PRG daba problemas. Ya se puede usar RESOLUTION =) (|RooT|) + * Corregido en la graphics donde ponia "trasparente" por "traNsparente". + (Er_Makina) + * ¡Funciona Signal! =) Solo falta testearlo... (Er_Makina) 29/10/2002 ---------- diff --git a/ediv/bin/ROBOTS.PRG b/ediv/bin/ROBOTS.PRG index 808c398..173b7e4 100644 --- a/ediv/bin/ROBOTS.PRG +++ b/ediv/bin/ROBOTS.PRG @@ -189,8 +189,8 @@ BEGIN mueve_robots(); end end - //signal(prota,s_kill); - //signal(type robot,s_kill); + signal(prota,s_kill); + signal(type robot,s_kill); muertos=0; cogido=0; ya=0; diff --git a/ediv/src/dlls/dlls.suo b/ediv/src/dlls/dlls.suo index 6f56e0dc1abd8130eeaa06bec0dcb4e7f28c80a08c0f5e34a9e81d7c825475c3..05bcb98b33c6769664652842991ac3f70687fea5986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/ediv/src/dlls/edivstd/edivstd.c @@ -161,6 +161,7 @@ int ExportaFuncs(EXPORTAFUNCS_PARAMS) FUNCTION("exit",2,eDIV_Exit); FUNCTION("get_id",1,eDiv_GetId) ; FUNCTION("define_region",5,eDiv_DefineRegion) ; + FUNCTION("signal",2,eDIV_Signal); ENTRYPOINT( first_load ) ; ENTRYPOINT(frame); @@ -242,9 +243,54 @@ int eDiv_DefineRegion(FUNCTION_PARAMS) return 1 ; } +void signal_tree(int proc, int signal, FUNCTION_PARAMS) +{ + int id2; + if(id2=local("son",proc)) { + signal_tree(id2,signal,fp); + reserved("status",proc)=signal; + } + while(local("bigbro",proc)) { + proc=local("bigbro",proc); + reserved("status",proc)=signal; + } + /*while(local("smallbro",proc)) { + proc=local("smallbro",proc); + reserved("status",proc)=signal; + }*/ +} + int eDIV_Signal(FUNCTION_PARAMS) { + int signal=getparm(); + int proc=getparm(); + char tree=FALSE; + 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))) + signal_tree(proc,signal,fp); + } + /* Si se le pasa un type */ + else { + int i,p; + 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))) + signal_tree(fp->procs_s[fp->proc_orden[i]].id,signal,fp); + } + } + } } diff --git a/ediv/src/dlls/edivstd/main.h b/ediv/src/dlls/edivstd/main.h index d62bc98..1125e90 100644 --- a/ediv/src/dlls/edivstd/main.h +++ b/ediv/src/dlls/edivstd/main.h @@ -6,4 +6,5 @@ struct _regions regions[32] ; // Prototipos int eDIV_Exit(FUNCTION_PARAMS); int eDiv_GetId(FUNCTION_PARAMS) ; -int eDiv_DefineRegion(FUNCTION_PARAMS) ; \ No newline at end of file +int eDiv_DefineRegion(FUNCTION_PARAMS) ; +int eDIV_Signal(FUNCTION_PARAMS); diff --git a/ediv/src/dlls/graphics/graphics.h b/ediv/src/dlls/graphics/graphics.h index c8e3780..2ee7bb7 100644 --- a/ediv/src/dlls/graphics/graphics.h +++ b/ediv/src/dlls/graphics/graphics.h @@ -23,8 +23,8 @@ int eDIV_UNLOAD_MAP(FUNCTION_PARAMS); */ int eDIV_LOAD_BMP(FUNCTION_PARAMS); int eDIV_COLLISION(FUNCTION_PARAMS); -int eDIV_SET_TRASPARENT_COLOR(FUNCTION_PARAMS); -int eDIV_GET_TRASPARENT_COLOR(FUNCTION_PARAMS); +int eDIV_SET_TRANSPARENT_COLOR(FUNCTION_PARAMS); +int eDIV_GET_TRANSPARENT_COLOR(FUNCTION_PARAMS); int eDIV_RGB(FUNCTION_PARAMS); int eDIV_ADVANCE(FUNCTION_PARAMS); int eDIV_XADVANCE(FUNCTION_PARAMS) ; diff --git a/ediv/src/dlls/graphics/main.c b/ediv/src/dlls/graphics/main.c index 624ddd8..2fa2747 100644 --- a/ediv/src/dlls/graphics/main.c +++ b/ediv/src/dlls/graphics/main.c @@ -32,7 +32,7 @@ SDL_Surface *Mapa[0xFFF] ; SDL_Surface *fondo ; struct _file file0[0xFFF] ; int last_map[0xFF] ; -int color_trasparente ; +int color_transparente ; int define_region ; typedef struct { @@ -147,8 +147,8 @@ int ExportaFuncs(EXPORTAFUNCS_PARAMS) FUNCTION("load_bmp",1,eDIV_LOAD_BMP) ; FUNCTION("collision",1,eDIV_COLLISION) ; - FUNCTION("set_trasparent_color",1,eDIV_SET_TRASPARENT_COLOR) ; - FUNCTION("get_trasparent_color",0,eDIV_GET_TRASPARENT_COLOR) ; + FUNCTION("set_transparent_color",1,eDIV_SET_TRANSPARENT_COLOR) ; + FUNCTION("get_transparent_color",0,eDIV_GET_TRANSPARENT_COLOR) ; FUNCTION("rgb",3,eDIV_RGB) ; FUNCTION("advance",1,eDIV_ADVANCE) ; FUNCTION("xadvance",2,eDIV_XADVANCE) ; @@ -173,7 +173,7 @@ int ExportaFuncs(EXPORTAFUNCS_PARAMS) FUNCTION("graphic_info",3,eDIV_GRAPHIC_INFO) ; FUNCTION("fade",4,eDIV_FADE) ; FUNCTION("xput",6,eDIV_XPUT); - FUNCTION("setmode",4,eDIV_SETMODE); +// FUNCTION("setmode",4,eDIV_SETMODE); ENTRYPOINT( frame ) ; ENTRYPOINT( first_load ) ; @@ -211,6 +211,7 @@ int eDIV_COLLISION(FUNCTION_PARAMS) int id1, id2 ; int a, i ; SDL_Rect r1 , r2 ; + int _status=reservedptr("status"); a = getparm() ; id1 = fp->procs_s[ fp->proc_orden[ *fp->proceso_actual ] ].id ; @@ -224,7 +225,8 @@ int eDIV_COLLISION(FUNCTION_PARAMS) //if ( a < 4000000 ) if(aimem_max) { - if(a==id1) return 0; + if(a==id1 || (fp->mem[id1+_status]!=2 && fp->mem[id1+_status]!=4)) + return 0; r1.x = local("x",id1) ; r1.y = local("y",id1) ; r1.w = files[f1].mapa[g1].Surface->w ; @@ -259,7 +261,8 @@ int eDIV_COLLISION(FUNCTION_PARAMS) for ( i = *id_scan+1 ; i < *fp->num_procs ; i++ ) { id2 = fp->procs_s[ fp->proc_orden[ i ] ].id; - if(id2==id1) continue; + if(id2==id1 || (fp->mem[id1+_status]!=2 && fp->mem[id1+_status]!=4)) + continue; //Si el proceso se corresponde con el type if ( reserved("process_type",id2) == a ) @@ -317,7 +320,7 @@ int eDIV_LOAD_BMP(FUNCTION_PARAMS) files[0].mapa[i].existe = 1 ; files[0].mapa[i].cpoint[0].x = (int)files[0].mapa[i].Surface->w / 2 ; files[0].mapa[i].cpoint[0].y = (int)files[0].mapa[i].Surface->h / 2 ; - SDL_SetColorKey( files[0].mapa[i].Surface , SDL_SRCCOLORKEY | SDL_RLEACCEL , color_trasparente ) ; + SDL_SetColorKey( files[0].mapa[i].Surface , SDL_SRCCOLORKEY | SDL_RLEACCEL , color_transparente ) ; if ( i > last_map[0] ) last_map[0] = i ; return i ; @@ -336,16 +339,16 @@ int eDIV_LOAD_BMP(FUNCTION_PARAMS) /* */ /*****************************************************************/ -int eDIV_SET_TRASPARENT_COLOR(FUNCTION_PARAMS) +int eDIV_SET_TRANSPARENT_COLOR(FUNCTION_PARAMS) { int b , i; int a = getparm() ; - b = color_trasparente ; - color_trasparente = a ; + b = color_transparente ; + color_transparente = a ; for ( i = 1 ; i <= last_map[0] ; i++ ) { if ( files[0].mapa[i].existe ) - SDL_SetColorKey( files[0].mapa[i].Surface , SDL_SRCCOLORKEY | SDL_RLEACCEL , color_trasparente ) ; + SDL_SetColorKey( files[0].mapa[i].Surface , SDL_SRCCOLORKEY | SDL_RLEACCEL , color_transparente ) ; } return b ; } @@ -358,9 +361,9 @@ int eDIV_SET_TRASPARENT_COLOR(FUNCTION_PARAMS) /* */ /*****************************************************************/ -int eDIV_GET_TRASPARENT_COLOR(FUNCTION_PARAMS) +int eDIV_GET_TRANSPARENT_COLOR(FUNCTION_PARAMS) { - return color_trasparente ; + return color_transparente ; } /*****************************************************************/ @@ -807,7 +810,7 @@ int eDIV_NEW_MAP(FUNCTION_PARAMS) files[0].mapa[i].cpoint[0].x = cx ; files[0].mapa[i].cpoint[0].y = cy ; SDL_FillRect( files[0].mapa[i].Surface , NULL , c ) ; - SDL_SetColorKey( files[0].mapa[i].Surface , SDL_SRCCOLORKEY | SDL_RLEACCEL , color_trasparente ) ; + SDL_SetColorKey( files[0].mapa[i].Surface , SDL_SRCCOLORKEY | SDL_RLEACCEL , color_transparente ) ; if ( i > last_map[0] ) last_map[0] = i ; return i ; @@ -1258,7 +1261,12 @@ void frame(FUNCTION_PARAMS) for ( i = 0 ; i < *fp->num_procs ; i++ ) { + int _status=reservedptr("status"); id = fp->procs_s[ fp->proc_orden[i] ].id ; + + if(fp->mem[id+_status]!=2 && fp->mem[id+_status]!=4) + continue; + f = local("file",id); g = local("graph",id); r = local("region",id); @@ -1378,7 +1386,7 @@ void first_load(FUNCTION_PARAMS2) for ( i = 0 ; i < 0xFF ; i++ ) last_map[i] = 0 ; - color_trasparente = 0 ; + color_transparente = 0 ; if (SDL_Init(SDL_INIT_VIDEO)) ; //k_error(K_ERR_SDL_INIT); diff --git a/ediv/src/stub/inte.c b/ediv/src/stub/inte.c index 0d5c637..d9120cc 100644 --- a/ediv/src/stub/inte.c +++ b/ediv/src/stub/inte.c @@ -141,14 +141,15 @@ int lista_quita( int num ) int interprete() { - int i ; - + int _status=reservedptr("status"); + // PROVISIONAL. Se tendra que cambiar para k soporte frame(int) y prioritys if ( num_proc_orden > 0 ) { for ( proceso_actual = 0 ; proceso_actual < num_proc_orden ; proceso_actual++ ) { - proceso( proc_orden[ proceso_actual ], -1 ) ; + if(procs_s[proc_orden[proceso_actual]].tipo==0 || mem[procs_s[proc_orden[proceso_actual]].id+_status]==2) + proceso( proc_orden[ proceso_actual ], -1 ) ; } Call_Entrypoint(EDIV_frame); @@ -173,6 +174,7 @@ int proceso( int num, int padre ) #ifdef DBG int actual_lin; #endif + int _status=reservedptr("status"); num_proc = num ; imem = procs_s[num_proc].imem ; @@ -353,6 +355,7 @@ int proceso( int num, int padre ) } procs_s[num_proc].tipo = mem[ imem++ ] ; reserved("process_type",procs_s[num_proc].id) = procs_s[num_proc].tipo ; + mem[procs_s[num_proc].id+_status] = 2; inicio_privadas=mem[6]; break ; case lpri://33 POR HACER? @@ -554,6 +557,11 @@ int proceso( int num, int padre ) #endif /* DBG */ } + if(mem[procs_s[num].id+_status]==1) { + //mem[procs_s[num].id+_status=0; + lista_quita(num_proc); + } + if ( devolver > 0 && no_devuelve == 0 ) { //pila[++sp] = 0 ;// AQUI SE DEBERA DEVOLVER EL ID diff --git a/ediv/src/stub/stub.c b/ediv/src/stub/stub.c index 0e41ed8..108f9fb 100644 --- a/ediv/src/stub/stub.c +++ b/ediv/src/stub/stub.c @@ -367,7 +367,8 @@ int main(int argc, char* argv[]) */ // PETA EN AMD???? <-- y esto? a mi no me peta.. (Er_Makina) - tiempo_i ++ ; + // me peta a veces por "division entre cero" +/* tiempo_i ++ ; if ( tiempo_i > 99 ) tiempo_i = 0 ; tiempo[ tiempo_i ] = SDL_GetTicks() ; @@ -376,7 +377,7 @@ int main(int argc, char* argv[]) else if ( tiempo[tiempo_i] - tiempo[tiempo_i+1] != 0 ) global("fps") = 100000 / (tiempo[tiempo_i] - tiempo[tiempo_i+1] ) ; - +*/ //SDL_BlitSurface( imagen1 , NULL , screen , NULL ) ; diff --git a/ediv/src/visual c/ediv_ws.suo b/ediv/src/visual c/ediv_ws.suo index fddc2739d90cf04e8dd963a3a6ba5bf6a8a6b82ce8afb61280a8445d3e6f7afa..4a8e55c474b350a63754af647ae3a8371271f4dc4358ade96223460a0a5f66e0 100644 GIT binary patch delta 596 zcmZWlOGuPa6h7zo|7o7)%=pA`w3!AWK@m5K%s4r&%E+~k$h6YZ8egcWOt=Z$s3*jg z+NO;J>0KHU`2=YpLJ&a;wri0K8LWllce6n7!gudE-*@i0=YEMvPQ2##uM8_dM5jv) zy*zE+VV4w{{`7latYm%S6Q@C{DObbhUACqEE!j1L>ew4;k{_ zmYBOt9eWR*o)rhUHhNA^sUJ}wS4MBgKyy61h#-}%}q7zFIRNhqWX9GW(Rela~GmapbxpuUSNVoDx+p_*_ZfA zs-$KZnx#Hge_$?x71z=XI+BGtk1dujKj$)G>LazduuRBSHb@bB+GKNg0ib3bcJ}*{yf33dzuHF8ITUUV) zpx1w`*dTt^ZJd)tZ*ys68@YZ&uM^BTk@JKeP|sgOo3Ib!+wI7^Wh{DM_NwA?P}Oz; FEoXy6r&$01 delta 525 zcmYjOOGsNm6g~I(9=>Q|H4znrhGMZ51${9fiuR=@(uGop8#jU|sh|4)qbLO2xYXXR zTitXch3agJN^v0+3t5WLjhliCg$8LAlHT!Cyl`jE{hgUJlYCFfHTtq@P-Z(mPw&hQ z%HbzwuwdfH;8rC0jdCF7s73QN**<|;F;1CJRoXHwI#7S}z7xm1bt>&O$>_4xmG6VW z8*W8O9qQp&$ORG5Al@PF<5Xe5(=Mn}96H)5ijwb!H~#^@6_DVN7yRvBk09@Zl1lqe z^NXhQB$dE8hA}HBP{zyEYKq=0QJ4QV;GG<8W#y*u{=}=-#3>diLeRrUx6HVwAc?pc52lFCfOg