Das dores contemporâneas

Há quem esteja muito aborrecido com a chegada de Passos Coelho e de Portas ao governo e as medidas ultra-liberais associadas. Mas há coisas bem piores. Olhem lá a dor profunda, fria e irritante que dá uma picada de peixe-aranha, ou mesmo as sempre dolorosas cólicas que a insuportável prisão de ventre pode oferecer, já para não falar de uma perna partida.

4 thoughts on “Das dores contemporâneas

  1. Código do clássico “Sid Spanners” !!! Agora podemos fazer alterações, e até, com UDP sockets, criar um multiplayer online !!! eheheheh
    //Sid Spanners (v1.0)
    //
    //Digital Prawn, 26th December 2010
    //
    //Public Domain
    //
    //Data structures
    //All sprites 16×16 Pixels
    //All levels consist 32×16 tiles
    //All tiles are “character code” based 8×8 cells
    //Sprite engine set to only manage uppermost 32×16 character area of the screen
    //
    // Memory map
    //
    // 23755 ZX BASIC loader
    // 24576 3K Heap (in contended RAM)
    // 27648 Start of compiled object code
    // 52480 ($CD00) 257-byte ISR table
    // 52942 ($CECE) Three-byte jump instruction to ISR
    // 52945 Lowest possible area used by stack (allocated size=311 bytes)
    // 53246 Highest word on the stack
    // 53248 Sprite library rotation tables/scratch area
    //Must compile with -zorg=27648
    //Compiling this game
    //Within the below comment is the Makefile that was used to build the game
    //Either copy and paste this into a file called “Makefile” and build with “make”
    //Or just compile with zcc directly using all options shown below
    //zcc v2.57 was originally used to build the game
    /*
    sidspan.tap: sidspan.c
    zcc +zx -osidspan.bin -lndos -lmalloc -lim2 -lsp1 sidspan.c -zorg=27648 -create-app
    */
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    #include
    //Pre-processor directives, definitions and macros
    #define SGN(x) ((x)px=(se->s->cols->hrot&7);
    se->py=(se->s->rows->vrot&7);
    //collision detection
    //for each enemy sprite – detect if the player
    //sprite has been touched
    if(i)
    {
    //need (int) casts to produce signed result
    cx=(byte)ABS((int)(se->px)-(int)(sprtbl[0].px));
    cy=(byte)ABS((int)(se->py)-(int)(sprtbl[0].py));
    //These values dictate the sensitivity of the collision detection
    if((cxs->row+2)pys->col+i]>’a’)
    {
    touchloc=j+se->s->col+i;
    touched=current_map[touchloc];
    }
    }
    //deal with touched nut (enough of that – ed)
    if(touched==’b’)
    {
    current_map[touchloc]=’ ‘;
    ty=touchloc>>5;
    tx=touchloc&31;
    sp1_PrintAt(ty,tx,PAPER_BLACK|INK_YELLOW|BRIGHT,’ ‘);
    onecr.row=ty;
    onecr.col=tx;
    sp1_Invalidate(&onecr);
    sp1_UpdateNow();
    nuts–;
    draw_nuts();
    my_bit_fx(1,2);
    //activate door if no nuts remaining
    if(!nuts)
    {
    my_bit_fx(2,4);
    sp1_PrintAt(doorrow,doorcol,6|BRIGHT|FLASH,’c’);
    sp1_PrintAt(doorrow,doorcol+1,6|BRIGHT|FLASH,’d’);
    sp1_PrintAt(doorrow+1,doorcol,6|BRIGHT|FLASH,’e’);
    sp1_PrintAt(doorrow+1,doorcol+1,6|BRIGHT|FLASH,’f’);
    twocr.row=doorrow;
    twocr.col=doorcol;
    sp1_Invalidate(&twocr);
    sp1_UpdateNow();
    }
    }
    //deal with player entering open door
    if((!nuts)&&(touched>=’c’)&&(toucheddx=0;
    se->dy=0;
    airborne=0;
    sp1_MoveSprAbs(se->s, &cr, start_frame[0],se->startrow , se->startcol, 0, 0);
    draw_lives();
    //deal with player dead
    if(!lives)
    {
    //set level_over to 1 when player dies
    level_over=1;
    }
    }
    //decrement timer
    if(time_ticks++>50)
    {
    time_ticks=0;
    time–;
    if(time==255)
    level_over=3; //out of time
    else
    draw_time();
    }
    //solid_ground=((current_map[((se->s->row+2)s->col]==’a’)||
    // (current_map[((se->s->row+2)s->col+1]==’a’)||
    // ((current_map[((se->s->row+2)s->col+2]==’a’))
    //detect a solid surface under player
    //only check the last tile if the horizontal rotation is non-zero
    solid_ground=((current_map[maprowfeet+se->s->col]==’a’)||
    (current_map[maprowfeet+se->s->col+1]==’a’)||
    ((current_map[maprowfeet+se->s->col+2]==’a’))&&se->s->hrot);
    //check for walking off the end of a platform
    if((!solid_ground)&&(!airborne))
    {
    se->dy=1;
    airborne=1;
    }
    //read keyboard
    input = (getjoy)(&keys);
    //player walking on a platform
    if(!airborne)
    {
    if((input & in_LEFT)&&(se->px>8))
    {
    facing_left=1;
    se->dx=-1;
    //if somehow got stuck inside a platform, then
    //move back onto the top of it
    if(se->s->vrot&7)
    {
    se->dy=-(se->s->vrot&7);
    }
    //animate sprite
    if(frame_tick++>1)
    {
    se->frame++;
    if(se->frame>5) se->frame=0;
    frame_tick=0;
    }
    }
    if((input & in_RIGHT)&&(se->pxdx=1;
    //if somehow got stuck inside a platform, then
    //move back onto the top of it
    if(se->s->vrot&7)
    {
    se->dy=-(se->s->vrot&7);
    }
    //animate sprite
    if(frame_tick++>1)
    {
    se->frame++;
    if(se->frame>5) se->frame=0;
    frame_tick=0;
    }
    }
    if(input & (in_FIRE|in_UP|in_DOWN))
    {
    airborne=1;
    se->dx=(input & in_RIGHT?1:0)-(input & in_LEFT?1:0);
    se->dy=-2;
    }
    }
    if(airborne)
    {
    //adjust speed every few ticks
    //The higher this value, the higher sid can jump
    if(jump_tick++>8)
    {
    if(se->dydy++;
    jump_tick=0;
    //if speed changed to +2 on an odd line, then adjust to +1
    //for one more iteration, to keep the vertical position an
    //even number and avoid landing inside a platform
    if((se->dy==2)&&(se->s->vrot&1))
    {
    se->dy=1;
    //force increment to speed of two on following interation
    jump_tick=9;
    }
    }
    //landed – check for sold ground, moving downwards and player not off the top of the screen
    //also check for vrot values of 0,1,2 preventing player getting stuck inside platform
    //near the top of the jump
    i=se->s->vrot&7;
    if(solid_ground&&(se->dy>=0)&&(se->pydy=0;
    jump_tick=0;
    }
    //prevent jumping beyond the sides of the play area
    if((se->pxdx==-1)) se->dx=0;
    if((se->px>231)&&(se->dx==1)) se->dx=0;
    //Check for player falling through hole in “The Black Hole” level
    if(se->py>191&&se->pys->row=0;
    }
    //move player sprite
    if(facing_left)
    sp1_MoveSprRel(se->s, &cr, anim_sid_left[se->frame], 0, 0, se->dy, se->dx); //Move sprite
    else
    sp1_MoveSprRel(se->s, &cr, anim_sid_right[se->frame], 0, 0, se->dy, se->dx);
    if(!airborne)
    {
    //stop moving if not airborne
    se->dx=0;
    se->dy=0;
    }
    //move guardian sprites
    for(i=1;istartrow==se->endrow)
    {
    //horizontal guardian
    if(se->direction==1)
    {
    //going from start to end
    //cast operands to signed values
    se->dx=SGN((char)se->endcol-(char)se->startcol);
    //check for end reached
    if((se->s->col==se->endcol)&&(se->s->hrot==0))
    {
    se->direction=-1; //reverse direction
    se->dx=0; //stop moving
    }
    }
    else
    {
    //going from end to start
    //cast operands to signed values
    se->dx=SGN((char)se->startcol-(char)se->endcol);
    //check for start reached
    if((se->s->col==se->startcol)&&(se->s->hrot==0))
    {
    se->direction=1; //forward direction
    se->dx=0; //stop moving
    }
    }
    }
    else
    {
    //vertical guardian
    if(se->direction==1)
    {
    //going from start to end
    //cast operands to signed values
    se->dy=SGN((char)se->endrow-(char)se->startrow);
    //check for end reached
    if((se->s->row==se->endrow)&&((se->s->vrot&7)==0))
    {
    se->direction=-1; //reverse direction
    se->dy=0; //stop moving
    }
    }
    else
    {
    //going from end to start
    //cast operands to signed values
    se->dy=SGN((char)se->startrow-(char)se->endrow);
    //check for start reached
    if((se->s->row==se->startrow)&&((se->s->vrot&7)==0))
    {
    se->direction=1; //forward direction
    se->dy=0; //stop moving
    }
    }
    }
    //move the sprite
    sp1_MoveSprRel(se->s, &cr, (guardian_flip?start_frame[i]+96:start_frame[i]), 0, 0, se->dy, se->dx);
    } //end for()
    //alternate between two animated frames
    if(guardian_tick++>15)
    {
    guardian_flip^=1;
    guardian_tick=0;
    }
    } //end while(!level_over)
    //end of level conditions
    //level_over==1 Player has ran out of lives (game over)
    //level_over==2 Player has successfully complteted the level (go to next level or win the game)
    //level_over==3 Player has ran out of time (game over)
    if(level_over==1)
    {
    //game over
    for(i=0;i=’a’)
    {
    switch(c)
    {
    //brick
    case ‘a’: sp1_PrintAt(y,x,2|BRIGHT,’a’);
    break;
    //nut
    case ‘b’: sp1_PrintAt(y,x,7|BRIGHT,’b’);
    nuts++;
    break;
    //door
    case ‘c’: doorrow=y;
    doorcol=x;
    sp1_PrintAt(y,x,6|BRIGHT,’c’);
    sp1_PrintAt(y,x+1,6|BRIGHT,’d’);
    sp1_PrintAt(y+1,x,6|BRIGHT,’e’);
    sp1_PrintAt(y+1,x+1,6|BRIGHT,’f’);
    break;
    //ignore any undefined characters in map data
    default:
    break;
    }
    }
    }
    sp1_Invalidate(&cr); //Invalidate the area defined by the clipping rectangle
    sp1_UpdateNow(); //Update (redraw) the area
    }
    void printchrat64(byte x, byte y, char c)
    {
    putchar(22);putchar(32+y);putchar(32+x);putchar(c);
    }
    void printstrat64(byte x, byte y, char *s)
    {
    putchar(22);putchar(32+y);putchar(32+x);
    printf(“%s”,s);
    }
    void define_tileset(byte level)
    {
    //Brick
    sp1_TileEntry(‘a’, tile_brick);
    //Nut
    sp1_TileEntry(‘b’,tile_nut);
    //Door
    sp1_TileEntry(‘c’,tile_door01);
    sp1_TileEntry(‘d’,tile_door02);
    sp1_TileEntry(‘e’,tile_door03);
    sp1_TileEntry(‘f’,tile_door04);
    }
    void init_sprites(char *map)
    {
    struct sp1_ss *s;
    byte row,col,sn;
    word i;
    char c;
    init_anim_lists();
    //reset sprite parameters
    for(i=0;i>5;
    col=i&31;
    if((c>=’0′)&&(c>1;
    //if even then it’s a start position, else an end position
    if((c-‘0’)&1)
    {
    //odd
    sprtbl[sn].endcol=col;
    sprtbl[sn].endrow=row;
    }
    else
    {
    //even
    sprtbl[sn].startcol=col;
    sprtbl[sn].startrow=row;
    }
    }
    }
    //Colour all sprites, and place them on the screen
    for(i=0;iattr=sprite_colour[global_n];
    cs->attr_mask=0;
    }
    }
    void my_bit_fx(byte n, byte m)
    {
    switch(n)
    {
    case 1: bit_fx(m); break;
    case 2: bit_fx2(m); break;
    case 3: bit_fx3(m); break;
    case 4: bit_fx4(m); break;
    default: break;
    }
    }
    void draw_status_area(void)
    {
    setcolmode(32);
    setcolattr(7,0,0,1);
    draw_level_name();
    draw_lives();
    draw_nuts();
    draw_time();
    }
    void draw_level_name(void)
    {
    sprintf(tempstr,”LEVEL %01d: %s”,level,level_name[level-1]);
    printstrat32(0,17,tempstr);
    }
    void draw_lives(void)
    {
    sprintf(tempstr,”LIVES: %03d “,lives);
    printstrat32(0,20,tempstr);
    }
    void draw_nuts(void)
    {
    sprintf(tempstr,”NUTS : %03d “,nuts);
    printstrat32(0,19,tempstr);
    }
    void draw_time(void)
    {
    sprintf(tempstr,”TIME : %03d “,time);
    printstrat32(0,21,tempstr);
    }
    void game_over(void)
    {
    byte i;
    //set border
    zx_border2(0);
    //clear and initialise low res screen
    cclg(0);
    print_huge_string(0,16,2,”GAME”);
    print_huge_string(0,24,2,”OVER”);
    //Play short noise
    for(i=0;iattr=sprite_colour[global_n];
    cs->attr_mask=0;
    }
    }
    void my_bit_fx(byte n, byte m)
    {
    switch(n)
    {
    case 1: bit_fx(m); break;
    case 2: bit_fx2(m); break;
    case 3: bit_fx3(m); break;
    case 4: bit_fx4(m); break;
    default: break;
    }
    }
    void draw_status_area(void)
    {
    setcolmode(32);
    setcolattr(7,0,0,1);
    draw_level_name();
    draw_lives();
    draw_nuts();
    draw_time();
    }
    void draw_level_name(void)
    {
    sprintf(tempstr,”LEVEL %01d: %s”,level,level_name[level-1]);
    printstrat32(0,17,tempstr);
    }
    void draw_lives(void)
    {
    sprintf(tempstr,”LIVES: %03d “,lives);
    printstrat32(0,20,tempstr);
    }
    void draw_nuts(void)
    {
    sprintf(tempstr,”NUTS : %03d “,nuts);
    printstrat32(0,19,tempstr);
    }
    void draw_time(void)
    {
    sprintf(tempstr,”TIME : %03d “,time);
    printstrat32(0,21,tempstr);
    }
    void game_over(void)
    {
    byte i;
    //set border
    zx_border2(0);
    //clear and initialise low res screen
    cclg(0);
    print_huge_string(0,16,2,”GAME”);
    print_huge_string(0,24,2,”OVER”);
    //Play short noise
    for(i=0;i<12;i++)
    my_bit_fx(4,2);
    WAIT_KEY;
    }
    void out_of_time(void)
    {
    byte i;
    //set border
    zx_border2(0);
    //clear and initialise low res screen
    cclg(0);
    print_huge_string(4,12,2,"OUT");
    print_huge_string(8,20,2,"OF");
    print_huge_string(0,28,2,"TIME");
    //Play short noise
    for(i=0;i<12;i++)
    my_bit_fx(4,2);
    WAIT_KEY;
    }
    void won_game(void)
    {
    byte i;
    //set border
    zx_border2(0);
    //clear and initialise low res screen
    cclg(0);
    print_huge_string(0,8,6,"CONG");
    print_huge_string(0,16,6,"RATS");
    print_huge_string(0,24,4,"GAME");
    print_huge_string(0,32,4,"WON!");
    //Play short noise
    for(i=0;i<3;i++)
    my_bit_fx(4,1);
    WAIT_KEY;
    }
    void print_huge_char(byte x, byte y, byte i, char c)
    {
    word k;
    //get base address of character from ROM
    k=0x3d00+((c-32)<<3);
    //copy character from ROM to "monochrome sprite" array
    memcpy(&mono_sprite0[2],(byte *)k,8);
    cputsprite(i,x,y,mono_sprite0);
    }
    void print_huge_string(byte x, byte y, byte i, char *s)
    {
    char c;
    while(c=*s++)
    {
    print_huge_char(x,y,i,c);
    x+=8;
    }
    }

  2. RICK DANGEROUS !!!!! Lindo !!!!! Podemos hackar o codigo, e meter-lhe uns collans !!! Lançavamos uma nova versão !!
    SOURCE CODE (Rick Character):
    /*
    * xrick/src/e_rick.c
    *
    * Copyright (C) 1998-2002 BigOrno (bigorno@bigorno.net). All rights reserved.
    *
    * The use and distribution terms for this software are contained in the file
    * named README, which can be found in the root of this distribution. By
    * using this software in any fashion, you are agreeing to be bound by the
    * terms of this license.
    *
    * You must not remove this notice, or any other, from this software.
    */
    #include “system.h”
    #include “config.h”
    #include “game.h”
    #include “ents.h”
    #include “e_rick.h”
    #include “e_bullet.h”
    #include “e_bomb.h”
    #include “control.h”
    #include “maps.h”
    #include “util.h”
    /*
    * public vars
    */
    S16 e_rick_stop_x = 0;
    S16 e_rick_stop_y = 0;
    U8 e_rick_state = 0;
    /*
    * local vars
    */
    static U8 scrawl;
    static U8 trigger = FALSE;
    static S8 offsx;
    static U8 ylow;
    static S16 offsy;
    static U8 seq;
    static U8 save_crawl;
    static U16 save_x, save_y;
    /*
    * Box test
    *
    * ASM 113E (based on)
    *
    * e: entity to test against (corresponds to SI in asm code — here DI
    * is assumed to point to rick).
    * ret: TRUE/intersect, FALSE/not.
    */
    U8
    e_rick_boxtest(U8 e)
    {
    /*
    * rick: x+0x05 to x+0x11, y+[0x08 if rick’s crawling] to y+0x14
    * entity: x to x+w, y to y+h
    */
    if (E_RICK_ENT.x + 0x11 ent_ents[e].x + ent_ents[e].w ||
    E_RICK_ENT.y + 0x14 ent_ents[e].y + ent_ents[e].h – 1)
    return FALSE;
    else
    return TRUE;
    }
    /*
    * Go zombie
    *
    * ASM 1851
    */
    void
    e_rick_gozombie(void)
    {
    #ifdef ENABLE_CHEATS
    if (game_cheat2) return;
    #endif
    /* already zombie? */
    if E_RICK_STTST(E_RICK_STZOMBIE) return;
    #ifdef ENABLE_SOUND
    syssnd_play(WAV_DIE, 1);
    #endif
    E_RICK_STSET(E_RICK_STZOMBIE);
    offsy = -0x0400;
    offsx = (E_RICK_ENT.x > 0x80 ? -3 : +3);
    ylow = 0;
    E_RICK_ENT.front = TRUE;
    }
    /*
    * Action sub-function for e_rick when zombie
    *
    * ASM 17DC
    */
    static void
    e_rick_z_action(void)
    {
    U32 i;
    /* sprite */
    E_RICK_ENT.sprite = (E_RICK_ENT.x & 0x04) ? 0x1A : 0x19;
    /* x */
    E_RICK_ENT.x += offsx;
    /* y */
    i = (E_RICK_ENT.y > 8;
    offsy += 0x80;
    ylow = i;
    /* dead when out of screen */
    if (E_RICK_ENT.y 0x0140)
    E_RICK_STSET(E_RICK_STDEAD);
    }
    /*
    * Action sub-function for e_rick.
    *
    * ASM 13BE
    */
    void
    e_rick_action2(void)
    {
    U8 env0, env1;
    S16 x, y;
    U32 i;
    E_RICK_STRST(E_RICK_STSTOP|E_RICK_STSHOOT);
    /* if zombie, run dedicated function and return */
    if E_RICK_STTST(E_RICK_STZOMBIE) {
    e_rick_z_action();
    return;
    }
    /* climbing? */
    if E_RICK_STTST(E_RICK_STCLIMB)
    goto climbing;
    /*
    * NOT CLIMBING
    */
    E_RICK_STRST(E_RICK_STJUMP);
    /* calc y */
    i = (E_RICK_ENT.y > 8;
    /* test environment */
    u_envtest(E_RICK_ENT.x, y, E_RICK_STTST(E_RICK_STCRAWL), &env0, &env1);
    /* stand up, if possible */
    if (E_RICK_STTST(E_RICK_STCRAWL) && !env0)
    E_RICK_STRST(E_RICK_STCRAWL);
    /* can move vertically? */
    if (env1 & (offsy 0x0800) {
    offsy = 0x0800;
    ylow = 0;
    }
    /*
    * HORIZONTAL MOVE
    */
    horiz:
    /* should move? */
    if (!(control_status & (CONTROL_LEFT|CONTROL_RIGHT))) {
    seq = 2; /* no: reset seq and return */
    return;
    }
    if (control_status & CONTROL_LEFT) { /* move left */
    x = E_RICK_ENT.x – 2;
    game_dir = LEFT;
    if (x = 0xe8) { /* next submap */
    game_chsm = TRUE;
    E_RICK_ENT.x = 0x04;
    return;
    }
    }
    /* still within this map: test environment */
    u_envtest(x, E_RICK_ENT.y, E_RICK_STTST(E_RICK_STCRAWL), &env0, &env1);
    /* save x-position if it is possible to move */
    if (!(env1 & (MAP_EFLG_SOLID|MAP_EFLG_SPAD|MAP_EFLG_WAYUP))) {
    E_RICK_ENT.x = x;
    if (env1 & MAP_EFLG_LETHAL) e_rick_gozombie();
    }
    /* end */
    return;
    /*
    * NO VERTICAL MOVE
    */
    vert_not:
    if (offsy hit the roof */
    E_RICK_STSET(E_RICK_STJUMP); /* fall back to the ground */
    E_RICK_ENT.y &= 0xF8;
    offsy = 0;
    ylow = 0;
    goto horiz;
    }
    /* else: not climbing + trying to go _down_ not possible -> standing */
    /* align to ground */
    E_RICK_ENT.y &= 0xF8;
    E_RICK_ENT.y |= 0x03;
    ylow = 0;
    /* standing on a super pad? */
    if ((env1 & MAP_EFLG_SPAD) && offsy >= 0X0200) {
    offsy = (control_status & CONTROL_UP) ? 0xf800 : 0x00fe – offsy;
    #ifdef ENABLE_SOUND
    syssnd_play(WAV_PAD, 1);
    #endif
    goto horiz;
    }
    offsy = 0x0100; /* reset*/
    /* standing. firing ? */
    if (scrawl || !(control_status & CONTROL_FIRE))
    goto firing_not;
    /*
    * FIRING
    */
    if (control_status & (CONTROL_LEFT|CONTROL_RIGHT)) { /* stop */
    if (control_status & CONTROL_RIGHT)
    {
    game_dir = RIGHT;
    e_rick_stop_x = E_RICK_ENT.x + 0x17;
    } else {
    game_dir = LEFT;
    e_rick_stop_x = E_RICK_ENT.x;
    }
    e_rick_stop_y = E_RICK_ENT.y + 0x000E;
    E_RICK_STSET(E_RICK_STSTOP);
    return;
    }
    if (control_status == (CONTROL_FIRE|CONTROL_UP)) { /* bullet */
    E_RICK_STSET(E_RICK_STSHOOT);
    /* not an automatic gun: shoot once only */
    if (trigger)
    return;
    else
    trigger = TRUE;
    /* already a bullet in the air … that’s enough */
    if (E_BULLET_ENT.n)
    return;
    /* else use a bullet, if any available */
    if (!game_bullets)
    return;
    #ifdef ENABLE_CHEATS
    if (!game_cheat1)
    game_bullets–;
    #endif
    /* initialize bullet */
    e_bullet_init(E_RICK_ENT.x, E_RICK_ENT.y);
    return;
    }
    trigger = FALSE; /* not shooting means trigger is released */
    seq = 0; /* reset */
    if (control_status == (CONTROL_FIRE|CONTROL_DOWN)) { /* bomb */
    /* already a bomb ticking … that’s enough */
    if (E_BOMB_ENT.n)
    return;
    /* else use a bomb, if any available */
    if (!game_bombs)
    return;
    #ifdef ENABLE_CHEATS
    if (!game_cheat1)
    game_bombs–;
    #endif
    /* initialize bomb */
    e_bomb_init(E_RICK_ENT.x, E_RICK_ENT.y);
    return;
    }
    return;
    /*
    * NOT FIRING
    */
    firing_not:
    if (control_status & CONTROL_UP) { /* jump or climb */
    if (env1 & MAP_EFLG_CLIMB) { /* climb */
    E_RICK_STSET(E_RICK_STCLIMB);
    return;
    }
    offsy = -0x0580; /* jump */
    ylow = 0;
    #ifdef ENABLE_SOUND
    syssnd_play(WAV_JUMP, 1);
    #endif
    goto horiz;
    }
    if (control_status & CONTROL_DOWN) { /* crawl or climb */
    if ((env1 & MAP_EFLG_VERT) && /* can go down */
    !(control_status & (CONTROL_LEFT|CONTROL_RIGHT)) && /* + not moving horizontaly */
    (E_RICK_ENT.x & 0x1f) climb */
    E_RICK_ENT.x &= 0xf0;
    E_RICK_ENT.x |= 0x04;
    E_RICK_STSET(E_RICK_STCLIMB);
    }
    else { /* crawl */
    E_RICK_STSET(E_RICK_STCRAWL);
    goto horiz;
    }
    }
    goto horiz;
    /*
    * CLIMBING
    */
    climbing:
    /* should move? */
    if (!(control_status & (CONTROL_UP|CONTROL_DOWN|CONTROL_LEFT|CONTROL_RIGHT))) {
    seq = 0; /* no: reset seq and return */
    return;
    }
    if (control_status & (CONTROL_UP|CONTROL_DOWN)) {
    /* up-down: calc new y and test environment */
    y = E_RICK_ENT.y + ((control_status & CONTROL_UP) ? -0x02 : 0x02);
    u_envtest(E_RICK_ENT.x, y, E_RICK_STTST(E_RICK_STCRAWL), &env0, &env1);
    if (env1 & (MAP_EFLG_SOLID|MAP_EFLG_SPAD|MAP_EFLG_WAYUP) &&
    !(control_status & CONTROL_UP)) {
    /* FIXME what? */
    E_RICK_STRST(E_RICK_STCLIMB);
    return;
    }
    if (!(env1 & (MAP_EFLG_SOLID|MAP_EFLG_SPAD|MAP_EFLG_WAYUP)) ||
    (env1 & MAP_EFLG_WAYUP)) {
    /* ok to move, save */
    E_RICK_ENT.y = y;
    if (env1 & MAP_EFLG_LETHAL) {
    e_rick_gozombie();
    return;
    }
    if (!(env1 & (MAP_EFLG_VERT|MAP_EFLG_CLIMB))) {
    /* reached end of climb zone */
    offsy = (control_status & CONTROL_UP) ? -0x0300 : 0x0100;
    #ifdef ENABLE_SOUND
    if (control_status & CONTROL_UP)
    syssnd_play(WAV_JUMP, 1);
    #endif
    E_RICK_STRST(E_RICK_STCLIMB);
    return;
    }
    }
    }
    if (control_status & (CONTROL_LEFT|CONTROL_RIGHT)) {
    /* left-right: calc new x and test environment */
    if (control_status & CONTROL_LEFT) {
    x = E_RICK_ENT.x – 0x02;
    if (x = 0xe8) { /* next submap */
    game_chsm = TRUE;
    /*6dbd = 0x01;*/
    E_RICK_ENT.x = 0x04;
    return;
    }
    }
    u_envtest(x, E_RICK_ENT.y, E_RICK_STTST(E_RICK_STCRAWL), &env0, &env1);
    if (env1 & (MAP_EFLG_SOLID|MAP_EFLG_SPAD)) return;
    E_RICK_ENT.x = x;
    if (env1 & MAP_EFLG_LETHAL) {
    e_rick_gozombie();
    return;
    }
    if (env1 & (MAP_EFLG_VERT|MAP_EFLG_CLIMB)) return;
    E_RICK_STRST(E_RICK_STCLIMB);
    if (control_status & CONTROL_UP)
    offsy = -0x0300;
    }
    }
    /*
    * Action function for e_rick
    *
    * ASM 12CA
    */
    void e_rick_action(UNUSED(U8 e))
    {
    static U8 stopped = FALSE; /* is this the most elegant way? */
    e_rick_action2();
    scrawl = E_RICK_STTST(E_RICK_STCRAWL);
    if E_RICK_STTST(E_RICK_STZOMBIE)
    return;
    /*
    * set sprite
    */
    if E_RICK_STTST(E_RICK_STSTOP) {
    E_RICK_ENT.sprite = (game_dir ? 0x17 : 0x0B);
    #ifdef ENABLE_SOUND
    if (!stopped)
    {
    syssnd_play(WAV_STICK, 1);
    stopped = TRUE;
    }
    #endif
    return;
    }
    stopped = FALSE;
    if E_RICK_STTST(E_RICK_STSHOOT) {
    E_RICK_ENT.sprite = (game_dir ? 0x16 : 0x0A);
    return;
    }
    if E_RICK_STTST(E_RICK_STCLIMB) {
    E_RICK_ENT.sprite = (((E_RICK_ENT.x ^ E_RICK_ENT.y) & 0x04) ? 0x18 : 0x0c);
    #ifdef ENABLE_SOUND
    seq = (seq + 1) & 0x03;
    if (seq == 0) syssnd_play(WAV_WALK, 1);
    #endif
    return;
    }
    if E_RICK_STTST(E_RICK_STCRAWL)
    {
    E_RICK_ENT.sprite = (game_dir ? 0x13 : 0x07);
    if (E_RICK_ENT.x & 0x04) E_RICK_ENT.sprite++;
    #ifdef ENABLE_SOUND
    seq = (seq + 1) & 0x03;
    if (seq == 0) syssnd_play(WAV_CRAWL, 1);
    #endif
    return;
    }
    if E_RICK_STTST(E_RICK_STJUMP)
    {
    E_RICK_ENT.sprite = (game_dir ? 0x15 : 0x06);
    return;
    }
    seq++;
    if (seq >= 0x14)
    {
    #ifdef ENABLE_SOUND
    syssnd_play(WAV_WALK, 1);
    #endif
    seq = 0x04;
    }
    #ifdef ENABLE_SOUND
    else
    if (seq == 0x0C)
    syssnd_play(WAV_WALK, 1);
    #endif
    E_RICK_ENT.sprite = (seq >> 2) + 1 + (game_dir ? 0x0c : 0x00);
    }
    /*
    * Save status
    *
    * ASM part of 0x0BBB
    */
    void e_rick_save(void)
    {
    save_x = E_RICK_ENT.x;
    save_y = E_RICK_ENT.y;
    save_crawl = E_RICK_STTST(E_RICK_STCRAWL);
    /* FIXME
    * save_C0 = E_RICK_ENT.b0C;
    * plus some 6DBC stuff?
    */
    }
    /*
    * Restore status
    *
    * ASM part of 0x0BDC
    */
    void e_rick_restore(void)
    {
    E_RICK_ENT.x = save_x;
    E_RICK_ENT.y = save_y;
    E_RICK_ENT.front = FALSE;
    if (save_crawl)
    E_RICK_STSET(E_RICK_STCRAWL);
    else
    E_RICK_STRST(E_RICK_STCRAWL);
    /* FIXME
    * E_RICK_ENT.b0C = save_C0;
    * plus some 6DBC stuff?
    */
    }
    /* eof */

  3. Paradise: Não podia concordar mais
    Spectrum coder: Li tudo o que dissestes com atenção e acho que és um parvalhão. Não concordo nada!

Comentar

Preencha os seus detalhes abaixo ou clique num ícone para iniciar sessão:

Logótipo da WordPress.com

Está a comentar usando a sua conta WordPress.com Terminar Sessão /  Alterar )

Google photo

Está a comentar usando a sua conta Google Terminar Sessão /  Alterar )

Imagem do Twitter

Está a comentar usando a sua conta Twitter Terminar Sessão /  Alterar )

Facebook photo

Está a comentar usando a sua conta Facebook Terminar Sessão /  Alterar )

Connecting to %s