-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathlogos.c
115 lines (85 loc) · 2.18 KB
/
logos.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#include <gb/gb.h>
#include "defines.h"
#include "gamestate.h"
#include "logos.h"
#include "fade.h"
#include "sound.h"
#include "mmlgb/driver/music.h"
#include "data/bg/tangram.h"
#include "data/bg/potato.h"
#include "data/sprite/shine.h"
extern UBYTE tangram_shine_song_data;
extern UBYTE tangram_vox_song_data;
extern UBYTE potato_jingle_song_data;
void initLogos() {
disable_interrupts();
DISPLAY_OFF;
OBP0_REG = 0xD0U; // 11010000
BGP_REG = 0xE4U; // 11100100
HIDE_WIN;
SHOW_SPRITES;
SHOW_BKG;
SPRITES_8x16;
set_bkg_data_rle(0U, tangram_data_length, tangram_data);
set_bkg_tiles_rle(0U, 0U, tangram_tiles_width, tangram_tiles_height, tangram_tiles);
set_sprite_data(0U, shine_data_length, shine_data);
DISPLAY_ON;
enable_interrupts();
}
void enterLogos() {
UBYTE i;
initLogos();
fadeFromWhite(8U);
for(i = 0U; i != 8U; ++i) wait_vbl_done();
setMusicBank(9U);
disable_interrupts();
playMusic(&tangram_vox_song_data);
enable_interrupts();
for(i = 0U; i != 60U; ++i) wait_vbl_done();
stopMusic();
disable_interrupts();
playMusic(&tangram_shine_song_data);
enable_interrupts();
for(i = 10U; i != 142U; i += 6U) {
if(i < 64U) {
setSprite(i+8U, 80U, 0U, OBJ_PAL0);
setSprite(i+16U, 80U, 2U, OBJ_PAL0);
setSprite(i+24U, 80U, 4U, OBJ_PAL0);
} else {
setSprite(i+4U, 88U, 0U, OBJ_PAL0);
setSprite(i+12U, 88U, 2U, OBJ_PAL0);
setSprite(i+20U, 88U, 4U, OBJ_PAL0);
}
setSprite(i, 96U, 0U, OBJ_PAL0);
setSprite(i+8U, 96U, 2U, OBJ_PAL0);
setSprite(i+16U, 96U, 4U, OBJ_PAL0);
clearRemainingSprites();
snd_update();
wait_vbl_done();
}
clearRemainingSprites();
while(!mus_is_done()) {
wait_vbl_done();
}
stopMusic();
fadeToWhite(8U);
disable_interrupts();
DISPLAY_OFF;
set_bkg_data_rle(0U, potato_data_length, potato_data);
set_bkg_tiles_rle(0U, 0U, potato_tiles_width, potato_tiles_height, potato_tiles);
DISPLAY_ON;
enable_interrupts();
fadeFromWhite(8U);
disable_interrupts();
for(i = 0U; i != 10U; ++i) wait_vbl_done();
disable_interrupts();
setMusicBank(9U);
playMusic(&potato_jingle_song_data);
enable_interrupts();
while(!mus_is_done()) {
wait_vbl_done();
}
stopMusic();
fadeToWhite(8U);
gamestate = GAMESTATE_INTRO;
}