duskos

dusk os fork
git clone git://git.alexwennerberg.com/duskos
Log | Files | Refs | README | LICENSE

commit 6bb5c4931f484ec10a2ebfd5111cfe27396f49a8
parent 15990c4ef0be0fe0ff564fd16a59f1ebb4796067
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Sun, 18 Dec 2022 19:01:54 -0500

emul/uxn/screen: pixel perfect!

You can run "f<< tests/manual/uxn/sprite.fs" on PC and see that it renders
exactly like in the official uxn emulator.

Diffstat:
Mfs/emul/uxn/screen.fs | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/fs/emul/uxn/screen.fs b/fs/emul/uxn/screen.fs @@ -88,13 +88,15 @@ create _fgmask FGMASKSZ allot $f over Device dat + c@ >r \ V1=spriteopts $8 over devshort@ >r $a over devshort@ >r \ V2=x V3=y $c over devshort@ uxn_ram + >r ( dev ) \ V4=sprite' - Device dat $6 + c@ ( auto ) - dup 4 rshift ( length ) 1+ >r begin ( auto ) + $6 over Device dat + c@ swap ( auto dev ) + over $1 and if $8 over V2 8 + rot> devshort! then ( auto dev ) + over $2 and if $a over V3 8 + rot> devshort! then ( auto dev ) + drop dup 4 rshift ( length ) 1+ >r begin ( auto ) V2 V3 V4 V1 _blit ( auto ) - dup $1 and if 8 to+ V2 then - dup $2 and if 8 to+ V3 then + dup $1 and if 8 to+ V3 then + dup $2 and if 8 to+ V2 then dup $4 and if 8 to+ V4 V1 $80 and if 8 to+ V4 then then - next drop rfree ; + next ( auto ) drop rfree ; : screendeo ( dev port -- ) 0 to@! rgbchanged if \ we need to fill the screen with the new color