zet23t / td2play

A followup library for the TinyScreen+
MIT License
16 stars 3 forks source link

TSV recording doesn't work with 8 bit color. #5

Open dulsi opened 6 years ago

dulsi commented 6 years ago

The rawFrameBuffer is all 0 in 8 bit color. I coded up a fix in my fork of your simulator. I don't think you can pull it directly but here is a link:

https://github.com/dulsi/tinyscreensim/commit/0b23c9b66865c2fa7888e94df483fa7105aee903

It wouldn't be hard to copy the code into your codebase if you want.

zet23t commented 6 years ago

Hey wow, someone is using the crappy code I write?! Didn't think this would happen :D - if you have a fix, just send it to me! Edit: looking at the code right now of your fix

zet23t commented 6 years ago

Applied code change: https://github.com/zet23t/td2play/commit/846a9306e28a4cf33689c96d3a63ca442d289253

Just a word of caution: I haven't tested 8bit mode in quite a while; all my projects use 16bit by now, so I suspect lots of broken code like that around all corners (e.g. the texture blitting).

May I ask, why do you use 8bit?

dulsi commented 6 years ago

I was targeting the tinyscreen video game kit not the tinyarcade. I went with 8bit simply to use less space.

I probably should mention two other changes in my version of your simulator.

This draws G and H on the buttons so it is obvious what keys to use (or at least a little more obvious): https://github.com/dulsi/tinyscreensim/commit/087ed24268892b88bde9b51166c5968efd5cb8df

This is a script I use under linux to compile projects with the simulator. It avoids having to create the wrappers like you do although it needs bash and other unix commands to work: https://github.com/dulsi/tinyscreensim/blob/master/tinyscreensim