Starting hex editor in usm

This commit is contained in:
neauoire 2021-02-28 20:52:41 -08:00
parent ff3d5e340e
commit 77a00f7a7e
5 changed files with 48 additions and 1039 deletions

View File

@ -20,5 +20,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr
# cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator
# run
./bin/assembler examples/gui.hover.usm bin/boot.rom
./bin/assembler examples/dev.mouse.usm bin/boot.rom
./bin/emulator bin/boot.rom

45
examples/app.hex.usm Normal file
View File

@ -0,0 +1,45 @@
( app/hex )
&Sprite { pad 8 x 2 y 2 addr 2 color 1 }
;color 1 ;addr 2 ;i 1
|0100 @RESET
@loop
#00 ~i #0018 MUL2 #0008 ADD2 #0040 #01 ,font #00 ~i ADD2 ,draw-byte JSR
( incr ) ~i #01 ADD =i
,loop ~i #08 LTH JMP? POP2
BRK
|0200 @FRAME BRK
@draw-byte ( x y color addr )
( load ) =addr =color =dev/sprite.y =dev/sprite.x
,font #00 ~addr LDR #f0 AND #04 ROR #08 MUL ADD2 =dev/sprite.addr #01 =dev/sprite.color
~dev/sprite.x #0008 ADD2 =dev/sprite.x
,font #00 ~addr LDR #0f AND #08 MUL ADD2 =dev/sprite.addr #01 =dev/sprite.color
RTS
@font ( 0-F )
[
7c82 8282 8282 7c00 3010 1010 1010 1000
7c82 027c 8080 fe00 7c82 027c 0282 7c00
4282 82fe 0202 0200 fc82 807c 0282 7c00
7c82 80fc 8282 7c00 7c82 021e 0202 0200
7c82 827c 8282 7c00 7c82 827e 0202 0400
7c82 027e 8282 7e00 fc82 82fc 8282 fc00
7c82 8080 8082 7c00 fc82 8282 8282 fc00
7c82 80f0 8082 7c00 7c82 80f0 8080 8000
]
|d000 @ERROR BRK
|FF20 ;dev/sprite Sprite
|FFF0 .RESET .FRAME .ERROR ( vectors )
|FFF8 [ 13fd 1ef3 1bf2 ] ( palette )

View File

@ -26,4 +26,4 @@ RTS
|FF00 ;dev/console Console
|FFF0 .RESET .FRAME .ERROR ( vectors )
|FFF8 [ f3f0 f30b f30a ] ( palette )
|FFF8 [ 13fd 1ef3 1bf2 ] ( palette )

File diff suppressed because it is too large Load Diff

2
uxn.c
View File

@ -108,7 +108,7 @@ Uint8 opr[][2] = {
/* 16-bit */
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {2,2}, {4,0}, /* TODO */
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {0,0}, /* TODO */
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {1,0}, {0,1}, {0,0}, /* TODO */
{0,0}, {0,0}, {0,0}, {0,0}, {0,0}, {2,0}, {0,2}, {0,0}, /* TODO */
{4,2}, {4,2}, {4,2}, {4,2}, {4,2}, {4,2}, {4,2}, {4,2}
};