Advertisement
Guest User

Untitled

a guest
May 30th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.28 KB | None | 0 0
  1. //dec10,2014 connor oliver
  2. #include <genesis.h>
  3. #include "music.h"
  4. #include "gfx.h"
  5.  
  6. int startMnu = 0;
  7.  
  8. void joyEvent(u16 joy, u16 changed, u16 state)
  9. {
  10.     //Check is start button has been pressed
  11.     if (state & BUTTON_START)
  12.     {
  13.         startMnu = 1;
  14.     }
  15. }
  16.  
  17. int main(){
  18.        
  19.     u16 palette[64];
  20.     u16 ind;
  21.    
  22.     //disable interrupt while accessing VDP
  23.     SYS_disableInts();
  24.     //init
  25.     VDP_setScreenWidth320();
  26.  
  27.     //start sprites engine
  28.     SPR_init(256);
  29.  
  30.     //load up bg
  31.     ind = TILE_USERINDEX;
  32.     VDP_drawImageEx(APLAN, &bg_img, TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE, ind), 0, 0, FALSE, TRUE);
  33.     ind += bg_img.tileset->numTile;
  34.    
  35.     //start music
  36.     SND_startPlay_VGM(christmas_music);
  37.     //Was going play some PCM audio, decided against it.
  38.     //SND_startPlay_PCM(DeckTheHalls, sizeof(DeckTheHalls), SOUND_RATE_8000, SOUND_PAN_CENTER, 0);
  39.  
  40.     //VDP done, renable interrupts
  41.     SYS_enableInts();
  42.  
  43.     //prepare palettes
  44.     memcpy(&palette[16], bg_img.palette->data, 16 * 2);
  45.    
  46.    
  47.     //fade in, doesn't seem to want to fade in right atm, should fix.
  48.     SYS_disableInts();
  49.     VDP_fadeIn(0, (3 * 16) - 1, palette, 20, FALSE);
  50.     SYS_enableInts();
  51.  
  52.     while(1){
  53.         //main game code if there was any
  54.     }
  55.     return 0;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement