-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathunused_slides
228 lines (170 loc) · 3.23 KB
/
unused_slides
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
=
-title: Development overview (txt)
-setcolour,1,FFF:
-rect,5,4,10,2:
-txt,6,5:C source
-pause:
-rect,24,4,10,2:
-txt,25,5:resource
-pause:
-tarrow,10,6,d,3:
-txt,12,7:cross compile
-pause:
-rect,5,9,10,2:
-txt,6,10:obj files
-pause:
-tarrow,29,6,d,5:
-txt,30,7: compile
-pause:
-rect,20,11,18,2:
-txt,21,12:compiled resource
-pause:
-tarrow,20,12,l,10:
-pause:
-rect,20,14,14,2:
-txt,21,15:SGDK library
-tarrow,20,15,l,10:
-tarrow,10,11,d,8:
-txt,12,17:link and other SGDK things
-rect,5,19,10,2:
-txt,6,20:rom.bin
-pause:
-txt,10,22:executable on Meaga Drive
=
-title:Resource declaration
-pz:
-txt,2,5:In resource.res:
IMAGE rk "img/rubykaigi.png" NONE ALL
=
-title:Resource usage
-txt,2,5:In C:
VDP_drawImageEx(
BG_A, rk,
TILE_ATTR_FULL(
PAL3, FALSE, FALSE, FALSE,
TILE_USERINDEX + 1
),
6, 6, FALSE, TRUE
);
=
-title:Resource usage
-txt,2,5:In C:
static void c_draw_img(
mrb_vm *vm, mrb_value *v, int argc
) {
uint8_t x = mrbc_integer(v[1]);
uint8_t y = mrbc_integer(v[2]);
VDP_drawImage( ...
}
=
-title:Make method callable from mruby
-txt,2,5:In C:
mrb_class *cls =
mrbc_define_class(
vm, "MegaMrbc", mrbc_class_object
);
mrbc_define_method(
vm, cls, "draw_image", c_draw_img
);
=
-title:Calling from ruby
-txt,2,5:In Ruby:
MegaMrbc.draw_image
=
-title:Main loop (simplified)
-txt,3,3:
def main_loop
running = true
cmd = :fwd
while running do
if cmd == :fwd
page = next_page(@index)
MegaMrbc.klog(
"next_page: #{page}"
)
end
MegaMrbc.wait_vblank
cmd = MegaMrbc.wait_cmd
end
end
=
-title:What is mruby?
-txt,3,5:` Another implementation of Ruby
` For embedded environments
` Integrates well with C
(or other langs)
` Great for calling Ruby from C
` No require, no eval, no gem
` mrbgem to add features
(at compile time)
=
-title:What is mruby/c?
-pz:
-txt,3,5:A project that makes a compact VM
from
Shimane IT Open-Innovation Center
and
Kyushu Institute of Technology
` Small, less memory over speed
` Limited class libraries
` Better concurrency support
` no mrbgem
=
-title:Resource decleration
-txt,1,5:In resource.res:
IMAGE rca "img/RubyConfAu.png" NONE ALL
This makes 'rca' available in memory
via ROM
=
-title:Resource usage
-txt,2,5:In C:
VDP_drawImageEx(
BG_A, rca,
TILE_ATTR_FULL(
PAL3, FALSE, FALSE, FALSE,
TILE_USERINDEX + 1
),
12, 3, FALSE, TRUE
);
=
-title: Load and start Ruby code
-txt,2,2:
void mrubyc(const uint8_t *mrbbuf)
{
mrbc_init_global();
mrbc_init_class();
mrbc_vm *vm = mrbc_vm_open(NULL);
if(vm == 0) {
return;
}
if(mrbc_load_mrb(vm, mrbbuf) != 0){
return;
}
mrbc_vm_begin(vm);
make_class(vm);
mrbc_vm_run(vm);
mrbc_vm_end(vm);
mrbc_vm_close(vm);
}
=
-title: Slide example
-txt,1,5: =
-title: Amazing Page Title
-txt,2,5: Here's some text content
=
-title: Slide example
-txt,1,5: = <- new page
-title: Amazing Page Title <- title
-txt,2,5: Here's some text content
=
-title: Amazing Page Title
-txt,2,5: Here's some text content
=
-bgcol,000:
-title:What is Mega Drive?
-txt,5,5:` Sega Mega Drive aka Genesis
` Released in 1988
` Motorola 68000 at 7.6MHz
` "16-BIT"
` 64KB main RAM + 64KB VRAM
` Over 30M units sold worldwide