Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5 from shirosweets/develop
Browse files Browse the repository at this point in the history
Update master
  • Loading branch information
shirosweets authored Jun 15, 2021
2 parents a0ec943 + 397a301 commit 86c742b
Show file tree
Hide file tree
Showing 49 changed files with 7,936 additions and 732 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rec
assets/rename_me

# Ignora
*.txt
assets/owl_md.txt
*.o
app.o
start.o
Expand All @@ -23,15 +23,17 @@ kernel8.img
kernel8.list

# Python
sprite_parser.py


# Examples
assets/algorithms

# Krita
*.kra
*.kra~

# ToDos README
todo_readme.md
tod

# Archivos grandes
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ runQEMU : kernel8.img
qemu-system-aarch64 -s -S -M raspi3 -kernel kernel8.img

runGDB:
gdb-multiarch -ex "set architecture aarch64" -ex "target remote localhost:1234" --ex "dashboard registers -style list 'x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 sp pc cpsr'" \-ex "add-symbol-file app.o 0x00000000000900c8" \-ex "b break" \-ex "continue"
gdb-multiarch -ex "set architecture aarch64" -ex "target remote localhost:1234" --ex "dashboard registers -style list 'x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 sp pc cpsr'" \-ex "add-symbol-file app.o 0x00000000000c6024" \-ex "add-symbol-file draw.o 0x00000000000900c8" \-ex "add-symbol-file animations.o 0x0000000000146398"

#0x00000000000900c8"
#\-ex "b break" \-ex "continue"
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Vc framebuffer
Framebuffer to the graphics device access method of a computer system, in which each pixel on the screen is represented as locations of a specific portion of the random access memory map (main memory system)

# Instalation
# Debian Based Instalation
`sudo apt update`

`sudo apt install gcc-aarch64-linux-gnu`
Expand Down Expand Up @@ -111,22 +111,24 @@ Your browser does not support the video tag.

**[app.s](app.s)** **** "main"

**[baseCore.s](baseCore.s)** **** low level abstractions for framebuffer manipulation

**[draw.s](draw.s)** **** basic lines and figures

**[font.s](font.s)** **** upper case and lower case

**[animations.s](animations.s)** **** delay

**[screen_animations.s](screen_animation.s)** **** screen animations (animations across the screen)
**[aScreenAnimations.s](aScreenAnimation.s)** **** screen animations (animations across the screen)

**[todo.md](todo.md)**

**[owl.s](owl.s)** **** Pixel Art
**[zowl.s](zowl.s)** **** Pixel Art
<p align="center">
<img src="png/owl_100x100.png" width="350" title="doOwl">
</p>

**[raven.s](raven.s)** **** Pixel Art
**[zraven.s](zraven.s)** **** Pixel Art
<p align="center">
<img src="png/raven_100x100.png" width="350" title="doRaven">
</p>
Expand Down
240 changes: 240 additions & 0 deletions aScreenAnimations.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@

.equ SCREEN_WIDTH, 640
.equ SCREEN_HEIGH, 480

.data
WHITE: .word 0xFFFFFF

.globl animationTest
// NOTE Animation Test
animationTest:
sub sp, sp, #8
stur x30, [sp, #0] // Guardamos el return pointer en memoria
mov x18, xzr // Empieza en negro
antestloop:
bl paintScreen // Pinta la pantalla
bl delay
add x18, x18, #1
mov x8, WHITE
cmp x18, x8
b.ne antestloop
ldur x30, [sp, #0] // Guardamos el return pointer en memoria ret
add sp, sp, #8
ret

.globl circleAnimation1
// NOTE circle Animation 1
circleAnimation1:
sub sp, sp, #8
stur x30, [sp, #0] // Guardamos el return pointer en memoria
mov x21, 320
mov x22, 240
mov x23, 10 // x23 = Radio
mov x24, 30 // x24 = Color
// circloop1...

circloop1:
mov x13, x24 // R
mov x14, 10 // G
mov x15, x24 // B
bl setColour // R+G+B = Naranja
bl doCircle
add x23, x23, #1 // r++
bl doCircle
bl delay
add x23, x23, #2 // r++
mov x8, #255
cmp x24, x8
b.eq circlend
add x24, x24, #1 // colour++
b circloop1

circlend:
ldur x30, [sp, #0] // Guardamos el return pointer en memoria ret
add sp, sp, #8
ret

.globl circleAnimation2
// NOTE circle Animation 2
circleAnimation2:
sub sp, sp, #8
stur x30, [sp, #0] // Guardamos el return pointer en memoria
mov x21, 320
mov x22, 240
mov x23, 10 // x23 = Radio
mov x24, 30 // x24 = Color
// circloop2...

circ2loop1:
mov x13, x24 // R
mov x14, 10 // G
mov x15, 10 // B
bl setColour // R+G+B = Naranja
bl doCircle
add x23, x23, #1 // r++
bl doCircle
add x23, x23, #1 // r++
bl doCircle
bl delay
add x23, x23, #1 // r++
mov x8, #255
cmp x24, x8
b.eq circ2lend
add x24, x24, #1 // colour++
b circ2loop1

circ2lend:
ldur x30, [sp, #0] // Guardamos el return pointer en memoria ret
add sp, sp, #8
ret

// BL sobreescribe el registro x30 y RET lee el registro x30 //
// BL (Break and link -> funciones) es para salto incondicional, cambia el program counter y cambia el registro x30 //
// B (Break dentro de funciones) es para saltos condicionales cambia el program counter //

.globl cleanScreen
// NOTE cleanScreen
cleanScreen: // Pinta toda la pantalla de negro
sub sp, sp, #16
stur lr, [sp] // Guardo el link register para no pisarlo
stur x30, [sp, #8] // Guardamos el return pointer en memoria
mov x13, xzr // R
mov x14, xzr // G
mov x15, xzr // B
bl setColour // Negro
bl paintScreen
ldur x30, [sp, #8] // Guardamos el return pointer en memoria ret
ldur lr, [sp] // Devuelvo el link register
add sp, sp, #16
ret

.globl cleanScreenBuffer
// NOTE cleanScreenBuffer
cleanScreenBuffer: // Pinta toda la pantalla de negro
sub sp, sp, #16
stur lr, [sp] // Guardo el link register para no pisarlo
stur x30, [sp, #8] // Guardamos el return pointer en memoria
mov x13, xzr // R
mov x14, xzr // G
mov x15, xzr // B
bl setColour // Negro
bl paintScreenBuffer
ldur x30, [sp, #8] // Guardamos el return pointer en memoria ret
ldur lr, [sp] // Devuelvo el link register
add sp, sp, #16
ret

.globl paintScreenBuffer
// NOTE paintScreenBuffer
paintScreenBuffer: // 320w 240h -> 76800 + 240
// Return -> nada
// Args: x18 Colour
mov x0, x20 // Origen del frameBuffer
mov x8, SCREEN_WIDTH
mov x9, SCREEN_HEIGH
mul x8, x8, x9 // x8 contador de pixeles a pintar
// paintScreenBufferLoop...

paintScreenBufferLoop:
stur w18, [x0] // Set color of pixel N
add x0, x0, 4 // Next pixel
sub x8, x8, 1 // decrement pixel counter
cbnz x8, paintScreenBufferLoop // If not end row jump
ret

.globl paintScreen
// NOTE paintScreen
paintScreen: // 320w 240h -> 76800 + 240
// Return -> nada
// Args: x18 Colour
adr x28, PreFrameBuffer // Origen del frameBuffer
mov x8, SCREEN_WIDTH
mov x9, SCREEN_HEIGH
mul x8, x8, x9 // x8 contador de pixeles a pintar
// paintScreenLoop...

paintScreenLoop:
stur w18, [x28] // Set color of pixel N
add x28, x28, 4 // Next pixel
sub x8, x8, 1 // decrement pixel counter
cbnz x8, paintScreenLoop // If not end row jump
ret

// TODO revisar
/*
drawBorder:
// Args
// x18 colour
sub sp, sp, #8 // Guardo el link register para no sobreescribirlo
stur lr, [sp]
mov x16, 0 // Guardo la posicion en x a la que quiero llegar
mov x12, SCREEN_HEIGH // Guardo la posicion y donde quiero llegar
bl setPixel
ldur x9, [x0]
mov x16, SCREEN_WIDTH
mov x12, SCREEN_HEIGH
bl setPixel
stur x18, [x0]
drawLeft:
bl setPixel
stur x18, [x0]
sub x16, x16, #1
cmp x9, x0
b.eq preDrawUp
b drawLeft
preDrawUp:
mov x9, #0
drawUp:
bl setPixel
stur x18, [x0]
sub x12, x12, #1
cmp x9, x0
b.eq preDrawRight
b drawUp
preDrawRight:
mov x12, #0
mov x16, SCREEN_WIDTH
bl setPixel
ldur x9, [x0]
drawRight:
bl setPixel
stur x18, [x0]
sub x16, x16, #1
cmp x9, x0
b.eq preDrawDown
b drawRight
preDrawDown:
mov x12, SCREEN_HEIGH
mov x16, SCREEN_WIDTH
bl setPixel
ldur x9, [x0]
drawDown:
bl setPixel
stur x18, [x0]
add x12, x12, #1
cmp x9, x0
b.eq endBorder
b drawDown
endBorder:
ldur lr, [sp]
add sp, sp, #8
ret
*/
/*
endDraw:
// TODO
borderLoop:
// TODO Hacer
b borderLoop
borderEnd:
// TODO
*/
Loading

0 comments on commit 86c742b

Please sign in to comment.