Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int position;
- void randomise_pipe_0(void)
- {
- position = rand() & 0x03;
- switch(position)
- {
- case 0x00:
- PIPE_0_0.tile = PIPE_SECTION;
- PIPE_0_1.tile = PIPE_SECTION;
- PIPE_0_2.tile = PIPE_SECTION;
- PIPE_0_3.tile = PIPE_END;
- PIPE_0_4.tile = PIPE_SECTION;
- PIPE_0_5.tile = PIPE_END;
- PIPE_0_0.ctrl = OAM_ENABLE;
- PIPE_0_1.ctrl = OAM_ENABLE;
- PIPE_0_2.ctrl = OAM_ENABLE;
- PIPE_0_3.ctrl = OAM_ENABLE|OAM_FLIPH;
- PIPE_0_4.ctrl = 0x00;
- PIPE_0_5.ctrl = OAM_ENABLE;
- break;
- case 0x01:
- PIPE_0_0.tile = PIPE_SECTION;
- PIPE_0_1.tile = PIPE_SECTION;
- PIPE_0_2.tile = PIPE_END;
- PIPE_0_3.tile = PIPE_SECTION;
- PIPE_0_4.tile = PIPE_END;
- PIPE_0_5.tile = PIPE_SECTION;
- PIPE_0_0.ctrl = OAM_ENABLE;
- PIPE_0_1.ctrl = OAM_ENABLE;
- PIPE_0_2.ctrl = OAM_ENABLE|OAM_FLIPH;
- PIPE_0_3.ctrl = 0x00;
- PIPE_0_4.ctrl = OAM_ENABLE;
- PIPE_0_5.ctrl = OAM_ENABLE;
- break;
- case 0x02:
- PIPE_0_0.tile = PIPE_SECTION;
- PIPE_0_1.tile = PIPE_END;
- PIPE_0_2.tile = PIPE_SECTION;
- PIPE_0_3.tile = PIPE_END;
- PIPE_0_4.tile = PIPE_SECTION;
- PIPE_0_5.tile = PIPE_SECTION;
- PIPE_0_0.ctrl = OAM_ENABLE;
- PIPE_0_1.ctrl = OAM_ENABLE|OAM_FLIPH;
- PIPE_0_2.ctrl = 0x00;
- PIPE_0_3.ctrl = OAM_ENABLE;
- PIPE_0_4.ctrl = OAM_ENABLE;
- PIPE_0_5.ctrl = OAM_ENABLE;
- break;
- case 0x03:
- PIPE_0_0.tile = PIPE_END;
- PIPE_0_1.tile = PIPE_SECTION;
- PIPE_0_2.tile = PIPE_END;
- PIPE_0_3.tile = PIPE_SECTION;
- PIPE_0_4.tile = PIPE_SECTION;
- PIPE_0_5.tile = PIPE_SECTION;
- PIPE_0_0.ctrl = OAM_ENABLE|OAM_FLIPH;
- PIPE_0_1.ctrl = 0x00;
- PIPE_0_2.ctrl = OAM_ENABLE;
- PIPE_0_3.ctrl = OAM_ENABLE;
- PIPE_0_4.ctrl = OAM_ENABLE;
- PIPE_0_5.ctrl = OAM_ENABLE;
- break;
- }
- }
- void randomise_pipe_1(void)
- {
- position = rand() & 0x03;
- switch(position)
- {
- case 0x00:
- PIPE_1_0.tile = BIRD_TILE_0;
- PIPE_1_1.tile = PIPE_SECTION;
- PIPE_1_2.tile = PIPE_SECTION;
- PIPE_1_3.tile = PIPE_END;
- PIPE_1_4.tile = PIPE_SECTION;
- PIPE_1_5.tile = PIPE_END;
- PIPE_1_0.ctrl = OAM_ENABLE;
- PIPE_1_1.ctrl = OAM_ENABLE;
- PIPE_1_2.ctrl = OAM_ENABLE;
- PIPE_1_3.ctrl = OAM_ENABLE|OAM_FLIPH;
- PIPE_1_4.ctrl = 0x00;
- PIPE_1_5.ctrl = OAM_ENABLE;
- break;
- case 0x01:
- PIPE_1_0.tile = BIRD_TILE_0;
- PIPE_1_1.tile = PIPE_SECTION;
- PIPE_1_2.tile = PIPE_END;
- PIPE_1_3.tile = PIPE_SECTION;
- PIPE_1_4.tile = PIPE_END;
- PIPE_1_5.tile = PIPE_SECTION;
- PIPE_1_0.ctrl = OAM_ENABLE;
- PIPE_1_1.ctrl = OAM_ENABLE;
- PIPE_1_2.ctrl = OAM_ENABLE|OAM_FLIPH;
- PIPE_1_3.ctrl = 0x00;
- PIPE_1_4.ctrl = OAM_ENABLE;
- PIPE_1_5.ctrl = OAM_ENABLE;
- break;
- case 0x02:
- PIPE_1_0.tile = BIRD_TILE_0;
- PIPE_1_1.tile = PIPE_END;
- PIPE_1_2.tile = PIPE_SECTION;
- PIPE_1_3.tile = PIPE_END;
- PIPE_1_4.tile = PIPE_SECTION;
- PIPE_1_5.tile = PIPE_SECTION;
- PIPE_1_0.ctrl = OAM_ENABLE;
- PIPE_1_1.ctrl = OAM_ENABLE|OAM_FLIPH;
- PIPE_1_2.ctrl = 0x00;
- PIPE_1_3.ctrl = OAM_ENABLE;
- PIPE_1_4.ctrl = OAM_ENABLE;
- PIPE_1_5.ctrl = OAM_ENABLE;
- break;
- case 0x03:
- PIPE_1_0.tile = PIPE_END;
- PIPE_1_1.tile = BIRD_TILE_0;
- PIPE_1_2.tile = PIPE_END;
- PIPE_1_3.tile = PIPE_SECTION;
- PIPE_1_4.tile = PIPE_SECTION;
- PIPE_1_5.tile = PIPE_SECTION;
- PIPE_1_0.ctrl = OAM_ENABLE|OAM_FLIPH;
- PIPE_1_1.ctrl = 0x00;
- PIPE_1_2.ctrl = OAM_ENABLE;
- PIPE_1_3.ctrl = OAM_ENABLE;
- PIPE_1_4.ctrl = OAM_ENABLE;
- PIPE_1_5.ctrl = OAM_ENABLE;
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement