Bad Apple

For Scene Demos that display animations, graphics, and music. Also for tech demos of graphics capability of VERA or the audio capabilities of the PSG, FM, or PCM audio channels.
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Bad Apple

Post by desertfish »

Bad Apple in PETSCII format. Animation only.

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

Try It Now!
Attachments
badapple.zip
(1.26 MiB) Downloaded 987 times
User avatar
ahenry3068
Posts: 1135
Joined: Tue Apr 04, 2023 9:57 pm

Re: Bad Apple

Post by ahenry3068 »

I'm impressed. :) .
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

Re: Bad Apple

Post by Cyber »

Yeah. Well known thing turned out pretty good on X16. ^_^
grml
Posts: 60
Joined: Sat Aug 13, 2022 8:31 pm

Re: Bad Apple

Post 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?
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Bad Apple

Post 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 :)
grml
Posts: 60
Joined: Sat Aug 13, 2022 8:31 pm

Re: Bad Apple

Post 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.
kelli217
Posts: 531
Joined: Sun Jul 05, 2020 11:27 pm

Re: Bad Apple

Post 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?
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Bad Apple

Post 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.
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Bad Apple

Post 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
User avatar
ahenry3068
Posts: 1135
Joined: Tue Apr 04, 2023 9:57 pm

Re: Bad Apple

Post by ahenry3068 »

Runs very well on hardware :)
Post Reply