You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All files in this repository are licensed under the following BSD License. See 
10
12
11
13
# Intro
12
14
13
-
The R36S is a very powerful little handheld computer, that comes with the Linux based ArkOS Open Source operating system preinstalled. The system is built with emulation in mind, but as it is a standard Linux based system, it is quite straightforward to write native programs and games for it.
15
+
The R36S is a very powerful little handheld computer, that comes with the Ubuntu Linux based ArkOS Open Source operating system preinstalled. The system is built with emulation in mind, but as it is a standard Linux based system, it is quite straightforward to write native programs and games for it.
16
+
The hardware make up of the R36S is:
17
+
18
+
- Rockchip RK3326 Quad-core ARM Cortex-A35 CPU with GPU
19
+
- One Gigabyte Micron DDR RAM
20
+
- RK817 PMIC with RTC and CODEC
21
+
- TCS7191A Class-D audio power amplifier
22
+
- ME4057 Lithium Ion Battery Linear Charger
23
+
- 3.5-inch LCD panel (640 x 480) is Sitronix ST7703 or Elida KD35T133 or clone of
24
+
- One or two SD Card slots, headphone output, one charging USB-C, one USB-C OTG
25
+
26
+
Here is a photo of the main PCB:
27
+
28
+

14
29
15
30
This repo will explore what is needed to program the system in C. Note that in addition, you can use almost any program that Linux supports and which has SDL bindings. E.g. C++, python, and zig.
16
31
17
32
# Connecting
18
33
19
34
In order to program the R36S you first need to connect to it from your computer by carrying out the folloiwing steps.
20
35
21
-
1. Connect Wifi dongle to the right hand usb port
36
+
1. Connect Wifi dongle to the right hand USB-C port. Not all WiFi dongles work, especially newer ones. Your best bet is Realtek or Ralink, the units that come with an internal WiFi module use a RTL8188.
22
37
2. Navigate through EmulationStation (ES) to Options, and connect to your local Wifi, by choosing your SSID and entering your password.
23
38
3. In the Options menu, choose "Enable remote services". This will only be needed the first time, as we will turn on this permanently. (See note about ssh connections below)
24
39
4. After succesfully connecting, check the IP address you connected to through Options->Network Info
@@ -82,7 +97,7 @@ sudo systemctl enable sshd
82
97
```
83
98
2. Setup C and C++ environment. The arkos system comes with some of the system packages crippled, e.g. they are missing header files needed for C-compilation. The following command rectifies this as well as sets up additional system development packages that we need:
3. We are now ready to compile our first C-program. To do so, first clone this repository by git
@@ -111,15 +126,26 @@ This program writes "Hello world" to the console and quits.
111
126
Our first hello world program was a command line program. But to write games, we want to have graphics. The R36S supports the standard graphics library SDL2. We can test compiling a SDL2 based c-program as follows:
112
127
113
128
```
114
-
cd ~/git/r36-programming/cprog/hello-sdl2
129
+
cd ~/git/r36s-programming/cprog/hello-sdl2
115
130
mkdir build && cd build && cmake -GNinja ..
116
131
ninja
117
132
./hello-sdl2
118
133
```
119
134
120
135
This worked, somehow, but our program "collides" with the use of the screen by ES, because our program and ES are both running at the same time.
121
136
122
-
To fix this we can exit emulator system by Menu→Quit→Quit Emulationstation. This will turn the EmulationStation off, until next time you reboot the R36S.
137
+
To fix this we can exit emulator system by Menu→Quit→Quit Emulationstation. This will turn the EmulationStation off, until next time you reboot the R36S. If you want to permanently disable ES, then do:
138
+
139
+
```
140
+
sudo systemctl disable emulationstation
141
+
```
142
+
143
+
You can always bring it back by doing:
144
+
145
+
```
146
+
sudo systemctl enable emulationstation
147
+
```
148
+
123
149
124
150
If we now rerun ./hello-sdl2, we get only our colorful SDL on the screen:
125
151
@@ -208,7 +234,7 @@ The axes are mapped as follows:
208
234
209
235
To test this on your own, you can run the program `print-joystick`:
210
236
211
-
```sh
237
+
```
212
238
cd cprog/print-joystick
213
239
mkdir build && cd build && cmake -GNinja ..
214
240
ninja
@@ -217,6 +243,42 @@ ninja
217
243
218
244
Press Fn+Start to exit the program.
219
245
246
+
# SDL2 graphics with TTF font's
247
+
248
+
This example is a simple C++ program to put fonts using standard installable fonts on the screen:
Note however that I get a warning about "source-only" when running a python sdl2 program. I'm not sure what this warning means.
278
340
341
+
279
342
# Final thoughts
280
343
281
344
First of all, this repository, and this article is work in progress. I hope to expand it as time allows.
282
345
283
346
However, my intention was not to teach "everything". There are lots of material available on the net about Linux, SDL, git, game programming, and more. My intent was to try to put these into perspective with regards to the R36S.
0 commit comments