-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is just a bit of fun, so Not really planning to merge. Note the unicorn version (without rewriting all the drawing completely) adds quite a bit of code, so this only builds with Clang to build with Clang, you need >1.5.0/develop of pico-sdk (and pico_extras). -DPICO_COMPILER=pico_arm_clang, and PICO_TOOLCHAIN_PATH pointing at ARM embedded LLVM 14.0.0 You must also specify -DPICO_BOARD=pimoroni_cosmic_unicorn Note also the unicorn uses 16K of RAM for the frame buffer, and so that is new RAM we didn't have space for, so i have decreased the size of the columns area. You may experience OOM on some levels, or visual distortion Sleep: Enter / Fire (keyboard L-CTRL & Return) Vol+: UP/Forward (keyboard Up) Vol-: Down/Backward (keyboard Down) Brightness+: Back one menu (keyboard Backspace) Brightness-: Toggle menu (keyboard Escape) A: Right (keyboard Right) B: Left (keyboard Left) C: Door open (keyboard Space) D: Strafe (keyboard Alt) You can start a game with Enter/Enter/Enter
- Loading branch information
1 parent
baf678b
commit 6d1deb1
Showing
12 changed files
with
933 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
.program cosmic_unicorn | ||
.side_set 1 opt | ||
|
||
; out pins: | ||
; | ||
; - 3: row select bit 0 | ||
; - 4: row select bit 1 | ||
; - 5: row select bit 2 | ||
; - 6: row select bit 3 | ||
|
||
; set pins: | ||
; | ||
; - 0: column data (base) | ||
; - 1: column latch | ||
; - 2: column blank | ||
|
||
; sideset pin: | ||
; | ||
; - 0: column clock | ||
|
||
; for each row: | ||
; for each bcd frame: | ||
; 0: 00111111 // row pixel count (minus one) | ||
; 1 - 64: xxxxxbgr, xxxxxbgr, xxxxxbgr, ... // pixel data | ||
; 65 - 67: xxxxxxxx, xxxxxxxx, xxxxxxxx // dummy bytes to dword align | ||
; 68: xxxxrrrr // row select bits | ||
; 69 - 71: tttttttt, tttttttt, tttttttt // bcd tick count (0-65536) | ||
; | ||
; .. and back to the start | ||
|
||
|
||
.wrap_target | ||
|
||
; loop over row pixels | ||
out y, 8 ; get row pixel count (minus 1 because test is pre decrement) | ||
pixels: | ||
|
||
; red bit | ||
out x, 1 side 0 [1] ; pull in blue bit from OSR into register x, clear clock | ||
set pins, 0b100 ; clear data bit, blank high | ||
jmp !x endb ; if bit was zero jump | ||
set pins, 0b101 ; set data bit, blank high | ||
endb: | ||
nop side 1 [2] ; clock in bit | ||
|
||
; green bit | ||
out x, 1 side 0 [1] ; pull in green bit from OSR into register X, clear clock | ||
set pins, 0b100 ; clear data bit, blank high | ||
jmp !x endg ; if bit was zero jump | ||
set pins, 0b101 ; set data bit, blank high | ||
endg: | ||
nop side 1 [2] ; clock in bit | ||
|
||
; blue bit | ||
out x, 1 side 0 [1] ; pull in red bit from OSR into register X, clear clock | ||
set pins, 0b100 ; clear data bit, blank high | ||
jmp !x endr ; if bit was zero jump | ||
set pins, 0b101 ; set data bit, blank high | ||
endr: | ||
out null, 5 side 1 [2] ; clock in bit | ||
|
||
;out null, 5 side 0 ; discard the five dummy bits for this pixel | ||
|
||
jmp y-- pixels | ||
|
||
out null, 24 ; discard dummy bytes | ||
|
||
out pins, 8 ; output row select | ||
|
||
set pins, 0b110 [5] ; latch high, blank high | ||
set pins, 0b000 ; blank low (enable output) | ||
|
||
; loop over bcd delay period | ||
out y, 24 ; get bcd delay counter value | ||
bcd_delay: | ||
jmp y-- bcd_delay | ||
|
||
set pins 0b100 ; blank high (disable output) | ||
|
||
.wrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.