Page 1 of 3

Bad Apple

Posted: Sun May 21, 2023 8:11 pm
by desertfish
Bad Apple in PETSCII format. Animation only.

160x120 resolution (using petscii block characters), 30 fps.

Try It Now!

Re: Bad Apple

Posted: Sun May 21, 2023 10:23 pm
by ahenry3068
I'm impressed. :) .

Re: Bad Apple

Posted: Wed May 24, 2023 6:55 pm
by Cyber
Yeah. Well known thing turned out pretty good on X16. ^_^

Re: Bad Apple

Posted: Wed May 24, 2023 9:18 pm
by grml
I appreciate your work, keep it up bro! prog8 is really good, too!

Anything interesting you wanna share about how you did this?

Re: Bad Apple

Posted: Wed May 24, 2023 10:33 pm
by desertfish
sure thing

- used ffmpeg to rescale and convert the badapple.mp4 video into individual black and white .PNG frames of the target resolution
- used a python script to match each 2x2 pixel block (basically 4 bits = number of 0 to 15) of every frame to one of the 16 possible PETSCII block characters, corresponding to that small pixel pattern
- every byte written sequentially to the big data file contains 2 characters (lo and hi nibble).
- the player program more or less just reads the bytes from the data file as fast as it can, uses a lookup table to get the correct petscii character for the nibbles, and writes those to the vera's tile buffer. After reading enough bytes to fill 1 scrreen it starts over at the top left, until no more bytes remain in the file.

using the default 80x60 text mode this yields 160x120 "pixels".

I didn't spend much effort to get the playback frame rate correct. It may depend on the emulator and computer speed. I have no idea how this runs on real hardware :)

Re: Bad Apple

Posted: Wed May 24, 2023 10:35 pm
by grml
desertfish wrote: Wed May 24, 2023 10:33 pm I have no idea how this runs on real hardware :)
It*s a shame you're not first in line to receive a dev board.

Re: Bad Apple

Posted: Thu May 25, 2023 1:18 am
by kelli217
desertfish wrote: Wed May 24, 2023 10:33 pm - the player program more or less just reads the bytes from the data file as fast as it can, uses a lookup table to get the correct petscii character for the nibbles, and writes those to the vera's tile buffer. After reading enough bytes to fill 1 scrreen it starts over at the top left, until no more bytes remain in the file.
Do you wait for VSYNC at all, in order to prevent tearing, or do you just keep dumping text into VRAM without concern for such things?

Re: Bad Apple

Posted: Fri May 26, 2023 11:18 am
by desertfish
I put one wait for vsync in just before the next frame gets drawn into vram.
But that was to not let it play too fast in the web emulator. It seems to be too much for x16emu when reading from sdcard.

Re: Bad Apple

Posted: Fri May 26, 2023 11:21 am
by desertfish
grml wrote: Wed May 24, 2023 10:35 pm It*s a shame you're not first in line to receive a dev board.
I would have appreciated that obviously, but we can't have it all

Re: Bad Apple

Posted: Tue Jul 04, 2023 6:12 am
by ahenry3068
Runs very well on hardware :)