diff --git a/projects/examples/demos/font.tal b/projects/examples/demos/font.tal index ba9fe6c..0118089 100644 --- a/projects/examples/demos/font.tal +++ b/projects/examples/demos/font.tal @@ -1,4 +1,4 @@ -( font ) +( uxnasm projects/examples/demos/font.tal bin/font.rom && uxnemu bin/font.rom ) %+ { ADD } %- { SUB } %* { MUL } %/ { DIV } %< { LTH } %> { GTH } %= { EQU } %! { NEQ } @@ -8,10 +8,20 @@ %RTN { JMP2r } %TOS { #00 SWP } +%GET-WIDTH { TOS ;font-data ++ LDA } +%GET-GLYPH { TOS #50 SFT2 ;font-data/glyphs ++ } + +%AUTO-NONE { #00 .Screen/auto DEO } +%AUTO-X { #01 .Screen/auto DEO } +%AUTO-Y { #02 .Screen/auto DEO } +%AUTO-ADDR { #04 .Screen/auto DEO } +%AUTO-X-ADDR { #05 .Screen/auto DEO } +%AUTO-Y-ADDR { #06 .Screen/auto DEO } + ( devices ) |00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2 -|20 @Screen &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 +|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 |a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 ( variables ) @@ -76,41 +86,35 @@ RTN STH SWP2 .Screen/y DEO2 - SWP2 DUP2 .Screen/x DEO2 SWP2 - &loop - LDAk - DUP #0a ! ,&no-linebreak JCN - ( move down ) STH OVR2 .Screen/x DEO2 STHr - ( incr y ) .Screen/y DEI2 #0010 ++ .Screen/y DEO2 - POP ,&continue JMP &no-linebreak - STHkr ,&sprite JSR + SWP2 .Screen/x DEO2 + AUTO-Y-ADDR + &while + LDAk #0a ! ,&no-linebreak JCN + ( reset ) #0020 .Screen/x DEO2 + ( down ) .Screen/y DEI2k #0010 ++ ROT DEO2 + ,&continue JMP &no-linebreak + LDAk STHkr ,&sprite JSR &continue - ( incr addr ) INC2 - LDAk ,&loop JCN - POP2 POP2 POPr + INC2 LDAk ,&while JCN + POP2 POPr + AUTO-NONE RTN &sprite ( char color -- ) - STH - ( get addr ) STHk TOS #50 SFT2 ;font-data #0100 ++ ++ .Screen/addr DEO2 - ( get width ) STHkr TOS ;font-data ++ LDA TOS - SWPr - ( left-top ) STHkr .Screen/sprite DEO - .Screen/y DEI2 #0008 ++ .Screen/y DEO2 - .Screen/addr DEI2 #0010 ++ .Screen/addr DEO2 - ( left-bottom ) STHkr .Screen/sprite DEO - .Screen/x DEI2 #0008 ++ .Screen/x DEO2 - .Screen/y DEI2 #0008 -- .Screen/y DEO2 - DUP #0a < ,&thin JCN - .Screen/addr DEI2 #0008 -- .Screen/addr DEO2 - ( right-top ) STHkr .Screen/sprite DEO - .Screen/addr DEI2 #0010 ++ .Screen/addr DEO2 - .Screen/y DEI2 #0008 ++ .Screen/y DEO2 - ( right-bottom ) STHkr .Screen/sprite DEO - .Screen/y DEI2 #0008 -- .Screen/y DEO2 &thin - SWPr - ( use width ) .Screen/x DEI2 ++ #0008 -- .Screen/x DEO2 - POPr POPr + .Screen/x DEI2 STH2 + .Screen/y DEI2 STH2 + ( glyph ) OVR GET-GLYPH .Screen/addr DEO2 + DUP .Screen/sprite DEOk DEO + STH2kr .Screen/y DEO2 + SWP GET-WIDTH + DUP #09 < ,&narrow JCN + .Screen/x DEI2k #0008 ++ ROT DEO2 + OVR .Screen/sprite DEOk DEO + STH2kr .Screen/y DEO2 + &narrow + POP2r + ( width ) TOS STH2r ++ .Screen/x DEO2 + POP RTN RTN @@ -187,4 +191,4 @@ RTN @font-path-small "projects/fonts/atari8.uf1 $1 -@font-data \ No newline at end of file +@font-data $100 &glyphs \ No newline at end of file diff --git a/projects/fonts/chicago12.uf2 b/projects/fonts/chicago12.uf2 index c754d46..631221e 100644 Binary files a/projects/fonts/chicago12.uf2 and b/projects/fonts/chicago12.uf2 differ diff --git a/projects/fonts/courier12.uf2 b/projects/fonts/courier12.uf2 new file mode 100644 index 0000000..c78d270 Binary files /dev/null and b/projects/fonts/courier12.uf2 differ diff --git a/projects/fonts/diamond12.uf2 b/projects/fonts/diamond12.uf2 index e6e7070..bba55a6 100644 Binary files a/projects/fonts/diamond12.uf2 and b/projects/fonts/diamond12.uf2 differ diff --git a/projects/fonts/geneva12.uf2 b/projects/fonts/geneva12.uf2 index 65e0c32..bf9f07c 100644 Binary files a/projects/fonts/geneva12.uf2 and b/projects/fonts/geneva12.uf2 differ diff --git a/projects/fonts/geneva14.uf2 b/projects/fonts/geneva14.uf2 index d06061b..68e95af 100644 Binary files a/projects/fonts/geneva14.uf2 and b/projects/fonts/geneva14.uf2 differ diff --git a/projects/fonts/helvetica12.uf2 b/projects/fonts/helvetica12.uf2 index 81638b0..58db7a5 100644 Binary files a/projects/fonts/helvetica12.uf2 and b/projects/fonts/helvetica12.uf2 differ diff --git a/projects/fonts/helvetica14.uf2 b/projects/fonts/helvetica14.uf2 index a10b999..02039cc 100644 Binary files a/projects/fonts/helvetica14.uf2 and b/projects/fonts/helvetica14.uf2 differ diff --git a/projects/fonts/losangeles12.uf2 b/projects/fonts/losangeles12.uf2 index 5648a20..5d055a3 100644 Binary files a/projects/fonts/losangeles12.uf2 and b/projects/fonts/losangeles12.uf2 differ diff --git a/projects/fonts/monaco12.uf2 b/projects/fonts/monaco12.uf2 new file mode 100644 index 0000000..6488cd3 Binary files /dev/null and b/projects/fonts/monaco12.uf2 differ diff --git a/projects/fonts/msx816.uf2 b/projects/fonts/msx816.uf2 new file mode 100644 index 0000000..6b52329 Binary files /dev/null and b/projects/fonts/msx816.uf2 differ diff --git a/projects/fonts/newyork12.uf2 b/projects/fonts/newyork12.uf2 index c5cae00..407943d 100644 Binary files a/projects/fonts/newyork12.uf2 and b/projects/fonts/newyork12.uf2 differ diff --git a/projects/fonts/newyork14.uf2 b/projects/fonts/newyork14.uf2 index 9eb0f12..8c21ab0 100644 Binary files a/projects/fonts/newyork14.uf2 and b/projects/fonts/newyork14.uf2 differ diff --git a/projects/fonts/palatino12.uf2 b/projects/fonts/palatino12.uf2 index ff4d17e..fc9cf68 100644 Binary files a/projects/fonts/palatino12.uf2 and b/projects/fonts/palatino12.uf2 differ diff --git a/projects/fonts/palatino14.uf2 b/projects/fonts/palatino14.uf2 index 7b8caac..e41cf11 100644 Binary files a/projects/fonts/palatino14.uf2 and b/projects/fonts/palatino14.uf2 differ diff --git a/projects/fonts/sans10-bold.uf2 b/projects/fonts/sans10-bold.uf2 index 8272ef4..444f8da 100644 Binary files a/projects/fonts/sans10-bold.uf2 and b/projects/fonts/sans10-bold.uf2 differ diff --git a/projects/fonts/sans10-regular.uf2 b/projects/fonts/sans10-regular.uf2 index 9cfd638..f733b77 100644 Binary files a/projects/fonts/sans10-regular.uf2 and b/projects/fonts/sans10-regular.uf2 differ diff --git a/projects/fonts/sapphire14.uf2 b/projects/fonts/sapphire14.uf2 index b1d976e..ed61654 100644 Binary files a/projects/fonts/sapphire14.uf2 and b/projects/fonts/sapphire14.uf2 differ diff --git a/projects/fonts/terminal12.uf2 b/projects/fonts/terminal12.uf2 index f4dffc3..e2fdb19 100644 Binary files a/projects/fonts/terminal12.uf2 and b/projects/fonts/terminal12.uf2 differ diff --git a/projects/fonts/times12.uf2 b/projects/fonts/times12.uf2 index 39fd710..7d58768 100644 Binary files a/projects/fonts/times12.uf2 and b/projects/fonts/times12.uf2 differ diff --git a/projects/fonts/times15.uf2 b/projects/fonts/times15.uf2 index 9ff9ddd..8c76579 100644 Binary files a/projects/fonts/times15.uf2 and b/projects/fonts/times15.uf2 differ diff --git a/projects/fonts/venice14.uf2 b/projects/fonts/venice14.uf2 index d79e49a..a686609 100644 Binary files a/projects/fonts/venice14.uf2 and b/projects/fonts/venice14.uf2 differ