87 lines
2.0 KiB
Markdown
87 lines
2.0 KiB
Markdown
# R36 Ultra Framebuffer Demo - ARM64 Build
|
|
|
|
## ✅ Successfully Compiled for ARM64!
|
|
|
|
The program has been cross-compiled for ARM64 (aarch64) architecture.
|
|
|
|
## Files
|
|
|
|
- **`framebuffer_simple.c`** - Pure C implementation (no dependencies)
|
|
- **`framebuffer_demo.vala`** - Vala implementation (requires GLib)
|
|
- **`framebuffer_demo`** - ARM64 binary (statically linked, ready to run)
|
|
- **`compile_simple.sh`** - Compilation script for C version
|
|
|
|
## Binary Information
|
|
|
|
```
|
|
framebuffer_demo: ELF 64-bit LSB executable, ARM aarch64, statically linked
|
|
```
|
|
|
|
This binary is:
|
|
- ✅ Compiled for ARM64 (R36 Ultra architecture)
|
|
- ✅ Statically linked (no dependencies needed)
|
|
- ✅ Ready to transfer and run on R36 Ultra
|
|
|
|
## Transfer to R36 Ultra
|
|
|
|
### Option 1: SCP (Network Transfer)
|
|
```bash
|
|
scp framebuffer_demo user@r36ultra-ip:/home/user/
|
|
```
|
|
|
|
### Option 2: USB/SD Card
|
|
1. Copy `framebuffer_demo` to USB drive or SD card
|
|
2. Insert into R36 Ultra
|
|
3. Copy to device
|
|
|
|
## Running on R36 Ultra
|
|
|
|
```bash
|
|
chmod +x framebuffer_demo
|
|
sudo ./framebuffer_demo
|
|
```
|
|
|
|
## What It Does
|
|
|
|
The program:
|
|
1. Opens `/dev/fb0` framebuffer (720x720, BGRA format)
|
|
2. Draws colorful shapes:
|
|
- Red rectangle
|
|
- Green circle
|
|
- Blue rectangle
|
|
- Yellow circle
|
|
3. Waits for Enter key
|
|
4. Clears screen and exits
|
|
|
|
## Recompiling
|
|
|
|
### For ARM64 (cross-compile):
|
|
```bash
|
|
./compile_simple.sh arm64
|
|
```
|
|
|
|
### For native (x86_64):
|
|
```bash
|
|
./compile_simple.sh
|
|
```
|
|
|
|
## Customization
|
|
|
|
Edit `framebuffer_simple.c` and use these functions:
|
|
|
|
- `fill_screen(fb, b, g, r, a)` - Fill screen with color
|
|
- `set_pixel(fb, x, y, b, g, r, a)` - Set individual pixel
|
|
- `draw_rectangle(fb, x, y, w, h, b, g, r, a)` - Draw rectangle
|
|
- `draw_circle(fb, cx, cy, radius, b, g, r, a)` - Draw circle
|
|
- `fb_update(fb)` - Write to framebuffer
|
|
|
|
**Note**: Colors are in BGRA format (Blue, Green, Red, Alpha)
|
|
|
|
## Advantages of C Version
|
|
|
|
- ✅ No dependencies (pure C, statically linked)
|
|
- ✅ Easy cross-compilation
|
|
- ✅ Small binary size
|
|
- ✅ Fast execution
|
|
- ✅ Works on any ARM64 Linux system
|