payonel / ocvm

OpenComputer Emulator
41 stars 7 forks source link

Plan9k is unusable due to messed up color palette #20

Open DCNick3 opened 6 years ago

DCNick3 commented 6 years ago

It looks like this in xterm (mintty gives similar results, so looks like this is not related to terminal) image

bauen1 commented 5 years ago

This seems to be caused by the implementation of the cursor (bin/getty.lua unblink and reblink function) in plan9k (but the bug might still be in ocvm). Commenting both functions out gives better (but still broken) results: image please note the 'e' that was typed while the cursor was unblinked (ie. black)

Ocawesome101 commented 3 years ago

this is definitely an ocvm bug, but as far as i can tell only affects plan9k.

Ocawesome101 commented 2 years ago

on looking through source and docs it appears this is due to a subtle behavior bug in OCVM's gpu.setForeground and gpu.setBackground methods: they should return the old foreground/background color, but instead return the new one. interestingly OCEmu and Ocelot do this too - i haven't yet tested in-game, but given that Plan9k works there i'd say it's a safe bet that OC proper does do this correctly.

Ocawesome101 commented 2 years ago

so OCEmu and Ocelot probably were returning the correct values and my tests were just bad. OCVM still was returning incorrect ones though - #51 now fixes that too.

ETA: here's plan9k with the fix (the cursor does blink, i just didn't time the screenshot quite right for it to show :p): Screenshot_20221002_005847