|
@@ -0,0 +1,74 @@
|
|
1
|
+#include <scene_intro/blackboard.h>
|
|
2
|
+#include <pokeagb/pokeagb.h>
|
|
3
|
+#include <scene.h>
|
|
4
|
+
|
|
5
|
+#define BLACKBOARD_TEXT_SPEED 1
|
|
6
|
+
|
|
7
|
+extern pchar *blackboard_text[];
|
|
8
|
+
|
|
9
|
+const struct TextboxTemplate blackboard_box[] = {
|
|
10
|
+ {.bg_id = 0, .x = 4, .y = 7, .width = 6, .height = 3, .pal_id = 15, .charbase = 1},
|
|
11
|
+};
|
|
12
|
+
|
|
13
|
+const u16 blackboard_text_pal[] =
|
|
14
|
+ {rgb5(255, 255, 255), rgb5(255, 255, 255), rgb5(255, 255, 255), rgb5(255, 255, 255),
|
|
15
|
+ rgb5(255, 255, 255), rgb5(255, 255, 255), rgb5(255, 255, 255), rgb5(255, 255, 255),
|
|
16
|
+ rgb5(255, 255, 255), rgb5(255, 255, 255), rgb5(255, 255, 255), rgb5(255, 255, 255),
|
|
17
|
+ rgb5(255, 255, 255), rgb5(255, 255, 255), rgb5(255, 255, 255), rgb5(255, 255, 255)};
|
|
18
|
+
|
|
19
|
+void blackboard_vblank(void) {
|
|
20
|
+ gpu_sprites_upload();
|
|
21
|
+ copy_queue_process();
|
|
22
|
+ gpu_pal_upload();
|
|
23
|
+}
|
|
24
|
+
|
|
25
|
+void blackboard_loop(u8 id) {
|
|
26
|
+ switch(tasks[id].priv[0]){
|
|
27
|
+ case 0:
|
|
28
|
+ bgid_send_tilemap(2);
|
|
29
|
+ rboxid_clear_pixels(0, 0);
|
|
30
|
+ palette_bg_faded_fill_black();
|
|
31
|
+ tasks[id].priv[0]++;
|
|
32
|
+ break;
|
|
33
|
+ case 1:
|
|
34
|
+ gpu_sync_bg_show(0);
|
|
35
|
+ gpu_sync_bg_hide(1);
|
|
36
|
+ gpu_sync_bg_hide(3);
|
|
37
|
+
|
|
38
|
+ gpu_sync_bg_show(2);
|
|
39
|
+ fade_screen(0xFFFFFFFF, 1, 16, 0, 0x0000);
|
|
40
|
+ tasks[id].priv[0]++;
|
|
41
|
+ break;
|
|
42
|
+ case 2:
|
|
43
|
+ if (!pal_fade_control.active)
|
|
44
|
+ tasks[id].priv[0]++;
|
|
45
|
+ break;
|
|
46
|
+ break;
|
|
47
|
+ case 3:
|
|
48
|
+ rboxid_print(0, 1, 0, 0, &scene_default_text_color, BLACKBOARD_TEXT_SPEED,
|
|
49
|
+ blackboard_text[0]);
|
|
50
|
+ tasks[id].priv[0]++;
|
|
51
|
+ break;
|
|
52
|
+ default:
|
|
53
|
+ break;
|
|
54
|
+ }
|
|
55
|
+}
|
|
56
|
+
|
|
57
|
+void blackboard_load_gfx(void){
|
|
58
|
+ rbox_init_from_templates(&blackboard_box[0]);
|
|
59
|
+ lz77UnCompVram(blackboardTiles, (void *)0x0600C000);
|
|
60
|
+ LZ77UnCompWram(blackboardMap, bgid_get_tilemap(2));
|
|
61
|
+ gpu_pal_apply_compressed(blackboardPal, 0, 32);
|
|
62
|
+ gpu_pal_apply(blackboard_text_pal, 15 * 16, 32);
|
|
63
|
+ bgid_mark_for_sync(0);
|
|
64
|
+}
|
|
65
|
+
|
|
66
|
+void blackboard_start(void) {
|
|
67
|
+ scene_vram_init(blackboard_vblank, &scene_default_config[0]);
|
|
68
|
+ bgid_set_tilemap(0, malloc(0x800));
|
|
69
|
+ bgid_set_tilemap(2, malloc(0x800));
|
|
70
|
+ blackboard_load_gfx();
|
|
71
|
+ u8 tid = task_add(blackboard_loop, 0);
|
|
72
|
+ tasks[tid].priv[0] = 0;
|
|
73
|
+ set_callback2(scene_default_cb_handler);
|
|
74
|
+}
|