Bad Apple in PETSCII format. Animation only.
160x120 resolution (using petscii block characters), 30 fps.
Try It Now!
Bad Apple
- desertfish
- Posts: 1096
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
Bad Apple
- Attachments
-
- badapple.zip
- (1.26 MiB) Downloaded 991 times
Re: Bad Apple
Yeah. Well known thing turned out pretty good on X16. ^_^
Re: Bad Apple
I appreciate your work, keep it up bro! prog8 is really good, too!
Anything interesting you wanna share about how you did this?
Anything interesting you wanna share about how you did this?
- desertfish
- Posts: 1096
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
Re: Bad Apple
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
- 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
It*s a shame you're not first in line to receive a dev board.
Re: Bad Apple
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?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.
- desertfish
- Posts: 1096
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
Re: Bad Apple
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.
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.
- desertfish
- Posts: 1096
- Joined: Tue Aug 25, 2020 8:27 pm
- Location: Netherlands
- ahenry3068
- Posts: 1136
- Joined: Tue Apr 04, 2023 9:57 pm
Re: Bad Apple
Runs very well on hardware