From eaace7d9c1def6ce66ecf602176b26669e14f9a1 Mon Sep 17 00:00:00 2001 From: koniifer Date: Sat, 26 Oct 2024 09:23:28 +0100 Subject: [PATCH] unoptimised text load & render --- sysdata/consolefonts/tamsyn/10x20b.psf | Bin 0 -> 10823 bytes sysdata/consolefonts/tamsyn/10x20r.psf | Bin 0 -> 10823 bytes sysdata/consolefonts/tamsyn/5x9b.psf | Bin 0 -> 2887 bytes sysdata/consolefonts/tamsyn/5x9r.psf | Bin 0 -> 2887 bytes sysdata/consolefonts/tamsyn/6x12b.psf | Bin 0 -> 3655 bytes sysdata/consolefonts/tamsyn/6x12r.psf | Bin 0 -> 3655 bytes sysdata/consolefonts/tamsyn/7x13b.psf | Bin 0 -> 3911 bytes sysdata/consolefonts/tamsyn/7x13r.psf | Bin 0 -> 3911 bytes sysdata/consolefonts/tamsyn/7x14b.psf | Bin 0 -> 4167 bytes sysdata/consolefonts/tamsyn/7x14r.psf | Bin 0 -> 4165 bytes sysdata/consolefonts/tamsyn/8x15b.psf | Bin 0 -> 4423 bytes sysdata/consolefonts/tamsyn/8x15r.psf | Bin 0 -> 4421 bytes sysdata/consolefonts/tamsyn/8x16b.psf | Bin 0 -> 4679 bytes sysdata/consolefonts/tamsyn/8x16r.psf | Bin 0 -> 4677 bytes sysdata/consolefonts/tamsyn/LICENSE | 10 +++ sysdata/libraries/render/TODO.md | 5 +- sysdata/libraries/render/src/image.hb | 4 +- sysdata/libraries/render/src/lib.hb | 2 + sysdata/libraries/render/src/software.hb | 63 ++++++++++++++- sysdata/libraries/render/src/text.hb | 75 ++++++++++++++++++ sysdata/libraries/stn/src/assets/sin_table | Bin 0 -> 728 bytes .../stn/src/assets/this-is-temporary | 0 sysdata/libraries/stn/src/math.hb | 28 ++++--- .../render_example/src/examples/text.hb | 23 ++++++ sysdata/programs/render_example/src/main.hb | 2 +- sysdata/system_config.toml | 12 +-- 26 files changed, 198 insertions(+), 26 deletions(-) create mode 100644 sysdata/consolefonts/tamsyn/10x20b.psf create mode 100644 sysdata/consolefonts/tamsyn/10x20r.psf create mode 100644 sysdata/consolefonts/tamsyn/5x9b.psf create mode 100644 sysdata/consolefonts/tamsyn/5x9r.psf create mode 100644 sysdata/consolefonts/tamsyn/6x12b.psf create mode 100644 sysdata/consolefonts/tamsyn/6x12r.psf create mode 100644 sysdata/consolefonts/tamsyn/7x13b.psf create mode 100644 sysdata/consolefonts/tamsyn/7x13r.psf create mode 100644 sysdata/consolefonts/tamsyn/7x14b.psf create mode 100644 sysdata/consolefonts/tamsyn/7x14r.psf create mode 100644 sysdata/consolefonts/tamsyn/8x15b.psf create mode 100644 sysdata/consolefonts/tamsyn/8x15r.psf create mode 100644 sysdata/consolefonts/tamsyn/8x16b.psf create mode 100644 sysdata/consolefonts/tamsyn/8x16r.psf create mode 100644 sysdata/consolefonts/tamsyn/LICENSE create mode 100644 sysdata/libraries/render/src/text.hb create mode 100644 sysdata/libraries/stn/src/assets/sin_table create mode 100644 sysdata/libraries/stn/src/assets/this-is-temporary create mode 100644 sysdata/programs/render_example/src/examples/text.hb diff --git a/sysdata/consolefonts/tamsyn/10x20b.psf b/sysdata/consolefonts/tamsyn/10x20b.psf new file mode 100644 index 0000000000000000000000000000000000000000..4a582d9edd10dd598469dd6bb3ffb479fadb5145 GIT binary patch literal 10823 zcmeHN+ml>H8Sm6qC6=|tzVNUqQVCIRqQb_N5MkK~ihu~=uBd=Bj&1~US%^Yn;!Xn! z%0;<^n{p>0_lt&$f-sq{%BN6yg~}T*`~keC>c{t;Z@%e1=k&~(G8^DwyQ@$4>HhWC z{ayMy-92;N>*w6!I2_4okreoG9A}4f`m(%7q2-!UY(*`@7oYc+t{o-~Px13bPPv&Z zPJO=9D2+bqit#`Rldd>W>M4}UVXR#oA^kqqF86hbF_5H}>N~%6NX~D5$4K!zto+jY zD9d_SKGJe7(@WRPw_FYtz2$DwO>o?iJty3$ZquO}Dxy2?rm{Hh#=Etl6kzHxWC>U*`!w{a7J9|7$S?AuE#X$VR0-8tkHs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RN;g#(U=7NTG?AxRd}cm3?6WrEi(?mPE8`3 z_qWr*xFDCoxWMmVT(G|)PP|h7>!oXP6aQ1d>}3mkIIRsl>&~h8o0Q&n8a?2n`|p8- z&a3kLXy=2R?&5R@r=6VM$!dM}e3;*NaoWx4MNT(K7j&Kij>JlQ1z*KcI2y;`SR9A1 z;dp!<-@rF<0#3vPR^eNi#J6!0R^w!>!FO;9PQ?^X!!&AGi_`I4d=F>f`#2M4;cWZ> z=irAp7w2Ie&c_9~5EtQMT!KsSBm5Yb;V1Yheum3&1+K);QAY#6Koh^juP}r4_%*J= z)wl*5uo0WE8MC++*I^5OgWuwM+<>jvhTma3cHsAz%eWZ$=sb?j6X-lCymoe>^E5io zFyqgn^BiX{aC%7uk%_RgTS#@@lE>Rw@jZ|S-3Yn~bTjA=pg)3c0o@Av6X?&N+d#L2 z?f~5h`U~ihd_S={T=i$=n>GPpvORugPs6A33>{& z3-mPT8PGpK&w`!!3G4Z-U+e{TuWj(A%JQ MK>r233wjTq0xbmld;kCd literal 0 HcmV?d00001 diff --git a/sysdata/consolefonts/tamsyn/10x20r.psf b/sysdata/consolefonts/tamsyn/10x20r.psf new file mode 100644 index 0000000000000000000000000000000000000000..e9222b77d336baf4eeeedde32764cf5352cc7b62 GIT binary patch literal 10823 zcmeHM>2nlC6z>GeS}n^Y$_L9r*es}k3h_q8WH$sz6pyHQ;sJQzeVeG59q$Vj5fSf$ z!vnlgQBkPv|AfDSZ$IDb-k0v_>D^h2Q1~I;HPhFxU%#u5>3Q_mOJ7zLiuAN`hF)_h znMThsT=v44>i6Q9*V20S+hj$#m8W%zM;19@H?d>H=u*{0@K6ILrh#_MUR6g zKEu*jrFzt0GNjH{Q>py~H9Hwdri2hG6UxLM$_=R{wCXQW3zHBi(uVcfa=RI?P`3r! zrPJ^?Rkf$UTsxIwyBE34J;P8S&gQA<^bApZ<6yb0n(><9(iBcqCz>8T>FV)Pbv)Nv zhUtZYEya>r39WXDv=f&phJo$7n5;0QhSe&{v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mW5$TYUx^9`p$U(Zuk`jDXi}R7JJ=c@r66 z|JpUsHmvlye`+0j!M>V(ihZwV2mZN%<7xI;_8sgiH3Y-WK!SsD2oA+zI2=ddNF0Tu zaSV>daX20);6$W22`A$eoQl(MI?liZ&csD9j?a>xDhwuX54~XaT{*O9k>&B;ci&mgL`ow?#Bao5D(#DJc38@ z7#_zHcoI(`$J1DjXYeeZ!}E9nEAS#-!pnFCui`boi+_9!OAI$+xJmaqoW^hqhFiJu z84S1awVi#Z3gIOj&T6XRZhh?Wa35p- zW+2-j-$J%Sc0hJQzJq)ZsUSZ|rkUt>%@E7HW B)?5Gp literal 0 HcmV?d00001 diff --git a/sysdata/consolefonts/tamsyn/5x9r.psf b/sysdata/consolefonts/tamsyn/5x9r.psf new file mode 100644 index 0000000000000000000000000000000000000000..185806c5575d067809dc630076f27bc65c75dde7 GIT binary patch literal 2887 zcmeHI*_IVG6fGZo@U1=}&a+z*IDpHPc0s7Kzm`y^G>Ecz}UeD-uFwX;uhlI$esF5R(Yc|tQRhbUlm7(ZGL)%GIG z=GwnSo{5C>ZX&-x8d}{oYi(&`N`cyxwiN8sN*jx9-(pG`9niRSAn*TJ`VHpg}6{|Jvg4ho0(>W7Mhx1ic6uJ)Q8}Io|YR^9fc@aHi zd}O$uA}*Dnh-A<0^t)7S0_b2WG&?Wa98} zOgdM8)flCl-8-i)5>1RueF9jKaY5>8cxny5xt^r8d6E{AXIHyPN5GZ4g4JfASivu$`ZL7xDO8Pe72Lq{uJQZ;e$ zLHZDfyKw>N>_H)&G)>7>!>AZ{W*Y6IvkyXN-|CZav}>6r^hrqgzE8M86i8hIDq#%A z>vCv(7gWpIA${YD)&KUN6ySr?OJVY|%nc*-$x3f(I166Ym`POipnN}3)+4^y_9paH zGVP}q8Ug7+PP8^_O!T#6Y7XYz-)G$Ztp)6-{X%0h;s$Mz^L-7n@L-K?fh}7wu1s`g zNy`kfmf<^V%5W7!jxvrHKc=R%1MC@@OtYvyd~4d&ly-oxom9@>1pS6rnbg@htHVXt z+{7GVc{(b1YFc1R=1OJw7$WfcZ4ZS@)D5SBDL9;-IJ^ZM9+~h}mo=QxK z0n6X0Ztt}ZIVuR`I8zXaV6i?)5J>wl{pBn)704C3L56Wkm{=`u`JUe7;OX$4#yEV5=Y@^9D`$V z9FE5cI1wk|WSoLiF~Dg!9cSQ7oQ1P-4yJG}&cpe*02ksSTnvj#a49as<+uV@;wntz zYAnGuxE9ypdfb2vH{vGTj9YLkZo}=k19##s+>Lv1FYd$raCiU@;vqbYNAM^f!{c}Y zPvR*&jc4#Io6m_d1%zXcI=8 zx$!xSw(zr+WxEOyBpl6asL@WXb_KWxQb68;EQ7oYc@OeFWI5ym$O_1ZkdGiALsmjQ zfqV-24B{c5Lsmh)fXqO?gsg^q1z7|68uATfEo2?!TgZ2i?;#~*J!Au9BV-n`39=dT z17r@e1@a?gD`XpFJLD(G&yWi83*=YGZ;*M&4#@A2KOj3He?tC(?1Jou{0;dBvIqYH D?YdE9 literal 0 HcmV?d00001 diff --git a/sysdata/consolefonts/tamsyn/6x12b.psf b/sysdata/consolefonts/tamsyn/6x12b.psf new file mode 100644 index 0000000000000000000000000000000000000000..4ae9d6a4480198d161fc665bc51ba903c5675c51 GIT binary patch literal 3655 zcmeHJOSBzB6m1jBz#zjOWN;D0zx^MA_!GZ}ApY%t@lfJ-5mp585Ihla5#;Yi5*`vl zLVDdZxx+i`;aeGH*ux&YwYGguRrkFSFDpX>=iRE_b^7!^r%s)!dW&~1SRPRtY)2?y zcQhZ`j?{4!Eg7RM@wo0g3kQF-^00yH_1s|_M~O-?WM7yjG0i-Wt)J&@3{MZ)41Ib4 zoIYT5(7hcv?$UviujA7JkRxEGFpy~mTVj( zNh?c}*zBToZKvN@)S0W%r2T$6o#(cWsj>u#lZ3-GN#ZEV^r_=aUp7itHWW~jgmd)J zdgqeV4-X93In&0*nq@k0y?lSK^!mgVKOlgO?_wr(@ z$i0oZ3Y_D4S$4+91JC}Fq=p$L#pgkTXZ{OTv{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|GU_TP`6RYJo{DZe z@c3MDH;pS)==umXTbVnH19d>C9gsjPV9k8BlDX^kt!d0y103D39@6^zWjs2yk^4IC zYq?KxKdhvy)VPW9H1`?qd%3R`7xcFQ5l+S_I2BEthSPBdVw{Pya5k3V9Gr{u(8Bq+ z02g8i7vW-Df&`c1GF*-}uE3SJ3MsC}HMkZTuEX`X0Xc5Oa@>RtZpJOR6Q!?!|o=!Topu4`LJ#;bA<2F+7UL@Hn2plXwbGV;s-mSv-dcJdYK40W0w$ zUc$@h;T61!*HGehyrHrwP+6vkRng(qL?ErlT+6meP+6~$R+6&qT`X2NH mXg}yj&`+SBK{KEOpkF}0f)0Xy1N{y<1Ud}*1N0~82>t@jmacgK literal 0 HcmV?d00001 diff --git a/sysdata/consolefonts/tamsyn/7x14b.psf b/sysdata/consolefonts/tamsyn/7x14b.psf new file mode 100644 index 0000000000000000000000000000000000000000..a473750d7816a1fbf8dd3b58a859e506d5aa2b63 GIT binary patch literal 4167 zcmeHJOOzZ_7%nRob*y`lMKIp4LeLly?-B2J5ELSUMvI`(av~yL!HB^i$YTrvy z(R}GVQnBYPo^Qrtiz?5R14ETxg>blkn`zoSTp2I0quVFgwTo_TrsJ`%nReB!?eF94 zQ*r>v+P>2-;>1lgho+nsRco(BM6jNUplyGSsL~I^+v%R1X)#< z>&<4t>KzzPvuOl<-{=eD*uW_1bS5X0$N(>BcGVvz8YO-$2xEsbzgGACoU>M+Gn&yg zE0@J_ucXz(xR)e3C*@33mNVjdNz=bAzh*sC_sQh^ERc&xT?uNw)#7P%Wq>g$bkxwI z733^x(~0AjAqIpQZCWk8B;haVSv1I$#Bn%iQ8y(eNxK$ld?Y%H4#kBWIU7!n zf7O7q!1`43>FX%+Lgf<^G-I`>Z4PH4$+C);WHRfNIvIivS1}U+1+A8xX7gldg@sle zH*3D{qII4zQ#!25T&G1*g{JQ0oKc`z%uzy^HzE5$+tCQY8#nb44O zEv>j&&+ErDYYc-qO;zT3vGvUB=Xrbf?9H;tg3}b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uh!s1hTpa+tv%2ae$e{h=k{PAtkGed#^ySq`A zeSKc}JgIiZQ{IfjW;2ZKp5#N41$@zJUbXM^?lTMSC%>r7Vs+-CB}*2~thzj<`Sh?I zPA{#LfI0Z3wF!Y7X1PEn(Tdk{62ex*_ZxP4&M!wBmVW!3le3c1XjH+f$&PM0H>q=2Y)`3b^;at|CvMW(II5s#KsuD{?=Cu|lS+lyz%?9xJk&ye>K+&vmF6%&c z(q&dLr;*6$Hl-G>Xth>{(EwvMq!sI(#v!;+gfv!$ShGvj%$k=Yv( zlk?!Rv;$R01y$1FP}!^lt6^AmpfWZ(eeBBAjJy2h?np(T4-Y>hA@l~ync+??!(Q2fi2mef&AV{g5O=rLccQRP~R^ za9mAKg4TlG0<8nR4SEOkE@(aIJ<$804?rJ+J_2n3eGK{p^eJc~=rhnJ(C46W&=;W1 zpf5pNKwp8r27LqC3i=lG9q4<|Hqds^4$w}}F3@h!9?%b-pg%#!K_@_ef&K=a#D781OWyzh literal 0 HcmV?d00001 diff --git a/sysdata/consolefonts/tamsyn/8x15r.psf b/sysdata/consolefonts/tamsyn/8x15r.psf new file mode 100644 index 0000000000000000000000000000000000000000..0054a2b4f3ed691ef2bcd72e08ad90c94e0ecdb5 GIT binary patch literal 4421 zcmeHJ>2nlC6d$&>sG%waBbBn&s#MslD+Ui-5FzNe%#O>t8xtX5yblBqyb%wA#syLF zLPbPGMdg-LQ9)5qs`mXS{1trr`CcEhJ;7L1KJ$|9nP0#Ab#K2}d#Zo4$CT$WNnUuG z#t#|3V5VlQsHu@V4$6g7^w0CJoYk1DWlQyXX-=b7Td1KntlxRg`o8kz`&n7b2Z72q2=W4%in(U4 z?VFh!cxaZHb2+wQS1vlAxtw8Tm8*O{iqt|F*ZP;Oj6=iqbG_oYY+x8?vVM@a)|y$L z6HJ7&9i7E$GpizIg=Q3uI^0}78s*=LwcN~T&xz$Ybhz?f&SY(no(eaK*+QG3#1!aC zDRUg34Uw_1SU@`pV}5V%U{|5CWN2vlV3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u z1E)4`glf&hYCN@R3;PE4_3WG2Pw3gzdfZC9i~R`uLH0FD1kIg5h;|e(8AV)!YcT~= zF%8$@dfb2;F&#Id12ZraH)9rV!EDSyC+6Z-+=dcvM;UjZf-Xe36II-WZp=dsb@bqF z%ttTo!2&Eq9~NOT?nOWD!~Ix-2k;;s!cshpNAM_?;V}$gIUdIocoI+HX*`2x@f@DV z3wRMPVGu841zy3ccnz;(C5EsHZ{SS~<1I9F6z3e8+tA#O<_;BWa~GPs(cHtp_oBIv zj|1$7R3dZ=m7?Y`H5}KkCn2jL??Bc--i5pec^|SC@&V*S$VZTMkdGnjA)i1#g?t9t z0QnrU5%L9O6XZ+CX2@5NEs(Dv-$1^FY=wLW`5y8EWE*5VWCvs?WEW&NWDn#=$X>`k y$bQHH$U(><$WM@;A%`KqKz@b%1~~#b3i%!K2jm#!Psm@8= surface.width { + cursor.x = pos.x + cursor.y += font.height + font.line_gap + } + if cursor.y + font.height > surface.height break + + dest := @inline(indexptr, surface, cursor.x, cursor.y) + src := glyph_data + rows_remaining := font.height + + loop if rows_remaining == 0 break else { + byte := *glyph_data + pixel_dest := dest + mask := @as(u8, 0x80) + bits_remaining := font.width + + loop if bits_remaining == 0 break else { + if (byte & mask) != 0 { + *pixel_dest = color + } + pixel_dest += 1 + mask >>= 1 + if mask == 0 { + glyph_data += 1 + byte = *glyph_data + mask = 0x80 + } + bits_remaining -= 1 + } + + glyph_data += 1 + dest += surface.width + rows_remaining -= 1 + } + + cursor.x += font.width + font.char_gap + current_char += 1 + } + return } \ No newline at end of file diff --git a/sysdata/libraries/render/src/text.hb b/sysdata/libraries/render/src/text.hb new file mode 100644 index 00000000..46896106 --- /dev/null +++ b/sysdata/libraries/render/src/text.hb @@ -0,0 +1,75 @@ +.{log} := @use("../../stn/src/lib.hb") + +PSF1Header := packed struct { + magic: u16, + font_mode: u8, + character_size: u8, +} + +PSF2Header := packed struct { + magic: u32, + version: u32, + header_size: u32, + flags: u32, + num_glyph: u32, + bytes_per_glyph: u32, + height: u32, + width: u32, +} + +Font := struct { + data: ^u8, + width: uint, + height: uint, + num_glyphs: uint, + bytes_per_glyph: uint, + has_unicode_table: bool, + line_gap: uint, + char_gap: uint, +} + +font_from_psf1 := fn(psf: ^u8): Font { + header := @as(^PSF1Header, @bitcast(psf)) + if header.magic != 0x436 { + log.error("failed to load psf font: not a psf1 font, idiot\0") + return idk + } + + psf += @sizeof(PSF1Header) + + return .( + psf, + 8, + @intcast(header.character_size), + 256, + @intcast(header.character_size), + false, + 0, + 0, + ) +} + +font_from_psf2 := fn(psf: ^u8): Font { + header := @as(^PSF2Header, @bitcast(psf)) + if header.magic != 0x864AB572 { + log.error("failed to load psf font: not a psf2 font, idiot\0") + return idk + } + + psf += header.header_size + + return .( + psf, + @intcast(header.width), + @intcast(header.height), + @intcast(header.num_glyph), + @intcast(header.bytes_per_glyph), + (header.flags & 1) != 0, + 0, + 0, + ) +} + +get_glyph := fn(font: Font, index: uint): ^u8 { + return font.data + index * font.bytes_per_glyph +} \ No newline at end of file diff --git a/sysdata/libraries/stn/src/assets/sin_table b/sysdata/libraries/stn/src/assets/sin_table new file mode 100644 index 0000000000000000000000000000000000000000..0d1c9d8b1737b6f0e24ea094333419297756bd95 GIT binary patch literal 728 zcmXZUJxc;m7(ijO4>L{8vNBCg%b+ocen8M)DA1|Jp`oFmKw6v{S{hthirQ@`h^R>l zY-tLjIS7KF7HPEMoVz^tyzk`(0-Tms`?y4cc&D{~IyHc8-5I2_L)g*15S<^!XWb3^ zegq$NJ3=R;c&pV>x~CU0dM%D0+DOoaF?`UCB>k&L<8*EUuXQ~|ziDlf?rLL-j!t7! zGimx=KS6wPHKhzh^l$h7_ vO1ru`&wgKT^he7J>??Y#_xh>vGVfM&QxCMMEq&5={n9@TF7jVkW17%^E6g+* literal 0 HcmV?d00001 diff --git a/sysdata/libraries/stn/src/assets/this-is-temporary b/sysdata/libraries/stn/src/assets/this-is-temporary new file mode 100644 index 00000000..e69de29b diff --git a/sysdata/libraries/stn/src/math.hb b/sysdata/libraries/stn/src/math.hb index 563e9c3d..91089194 100644 --- a/sysdata/libraries/stn/src/math.hb +++ b/sysdata/libraries/stn/src/math.hb @@ -30,26 +30,30 @@ Vec2 := fn($Expr: type): type { return struct {x: Expr, y: Expr} } -SIN_TABLE := [int].(0, 174, 348, 523, 697, 871, 1045, 1218, 1391, 1564, 1736, 1908, 2079, 2249, 2419, 2588, 2756, 2923, 3090, 3255, 3420, 3583, 3746, 3907, 4067, 4226, 4384, 4540, 4695, 4848, 5000, 5150, 5299, 5446, 5591, 5735, 5877, 6018, 6156, 6293, 6427, 6560, 6691, 6819, 6946, 7071, 7193, 7313, 7431, 7547, 7660, 7771, 7880, 7986, 8090, 8191, 8290, 8386, 8480, 8571, 8660, 8746, 8829, 8910, 8987, 9063, 9135, 9205, 9271, 9335, 9396, 9455, 9510, 9563, 9612, 9659, 9702, 9743, 9781, 9816, 9848, 9877, 9902, 9925, 9945, 9961, 9975, 9986, 9993, 9998, 10000) +SIN_TABLE := @as([int; 91], @bitcast(@embed("./assets/sin_table"))) -sin_i := fn(theta_deg: int, amplitude: int): int { - theta := theta_deg % 360 +sin := fn(theta: int, amplitude: uint): int { if theta < 0 { - theta += 360 + theta += (-theta / 360 + 1) * 360 + } else if theta >= 360 { + theta -= theta / 360 * 360 } quadrant := theta / 90 - theta = theta % 90 + index := theta % 90 - sign := 1 - ((quadrant & 2) >> 1) * 2 - complement := quadrant & 1 + if @as(u8, @intcast(quadrant)) == @as(u8, 1) { + index = 90 - index + } - index := theta * (1 - complement) + (90 - theta) * complement - sin_value := SIN_TABLE[index] * sign + value := SIN_TABLE[@bitcast(index)] + if quadrant >= 2 { + value = -value + } - return (sin_value * amplitude + 5000) / 10000 + return (value * @bitcast(amplitude) + 5000) / 10000 } -cos_i := fn(theta_deg: int, amplitude: int): int { - return @inline(sin_i, theta_deg + 90, amplitude) +cos := fn(theta: int, amplitude: uint): int { + return @inline(sin, theta + 90, amplitude) } \ No newline at end of file diff --git a/sysdata/programs/render_example/src/examples/text.hb b/sysdata/programs/render_example/src/examples/text.hb new file mode 100644 index 00000000..98789d64 --- /dev/null +++ b/sysdata/programs/render_example/src/examples/text.hb @@ -0,0 +1,23 @@ +.{Vec2, sin, cos} := @use("../../../../libraries/stn/src/lib.hb").math +render := @use("../../../../libraries/render/src/lib.hb") + +/* expected result: + words */ + +psf := @embed("../../../../consolefonts/tamsyn/10x20r.psf") + +example := fn(): void { + screen := render.init(true) + font := render.text.font_from_psf2(@bitcast(&psf)) + t := 0 + str := "Hello, World! +This is a test +of multiline rendering\0" + loop { + render.clear(screen, render.black) + render.put_text(screen, font, .(t, t % screen.height), render.red, str) + render.sync(screen) + t += 1 + } + return +} \ No newline at end of file diff --git a/sysdata/programs/render_example/src/main.hb b/sysdata/programs/render_example/src/main.hb index 289d8128..3edd356e 100644 --- a/sysdata/programs/render_example/src/main.hb +++ b/sysdata/programs/render_example/src/main.hb @@ -1,3 +1,3 @@ -.{example} := @use("./examples/surface.hb") +.{example} := @use("./examples/text.hb") main := example \ No newline at end of file diff --git a/sysdata/system_config.toml b/sysdata/system_config.toml index a97af89b..f5562824 100644 --- a/sysdata/system_config.toml +++ b/sysdata/system_config.toml @@ -28,8 +28,8 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.diskio_driver] # path = "boot:///diskio_driver.hbf" -# [boot.limine.ableos.modules.render_example] -# path = "boot:///render_example.hbf" +[boot.limine.ableos.modules.render_example] +path = "boot:///render_example.hbf" # [boot.limine.ableos.modules.serial_driver] # path = "boot:///serial_driver.hbf" @@ -37,11 +37,11 @@ resolution = "1024x768x24" # [boot.limine.ableos.modules.serial_driver_test] # path = "boot:///serial_driver_test.hbf" -[boot.limine.ableos.modules.horizon] -path = "boot:///horizon.hbf" +# [boot.limine.ableos.modules.horizon] +# path = "boot:///horizon.hbf" -[boot.limine.ableos.modules.horizon_testing_program] -path = "boot:///horizon_testing_program.hbf" +# [boot.limine.ableos.modules.horizon_testing_program] +# path = "boot:///horizon_testing_program.hbf" # [boot.limine.ableos.modules.dt_buffer_test] # path = "boot:///dt_buffer_test.hbf"