Bad Apple UDG

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
nollkolltroll
Posts: 268
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Bad Apple UDG

Post by nollkolltroll » Sun Mar 18, 2018 9:41 am

Bad Apple ZX81 v1.1

Intro
The famous Bad Apple video is played full screen at 15, 25 or 30fps.

Requirements
This player requires a ZX81 with UDG4ZXpand and a ZXpand+ or ZXpand.

Usage real HW
For the classic ZXpand: use zxp25.p to play the video in 50Hz PAL mode, giving 25fps. TV standard jumper is ignored.
For the classic ZXpand: use zxp15.p to play the video in 60Hz NTSC mode, giving 15fps. TV standard jumper is ignored.
For the ZXpand+: use zxpp2530 to play the video, which auto-adjusts to the ZX81 tv-standard, giving either 25fps or 30fps.

Usage EightyOne emulator v1.8 or later
Use zxpp2530.p to play the video. Both zxp15.p and zxp25.p plays too slow.
Use correct settings:
- RAM pack = 32k
- chr$ generator = CHR$16
- high resolution = none
- ZXpand = yes

Background
It all started when I got the UDG-board and began wondering how I could use it to play video. I thought it would be a quick and simple hack to create an encoder, but I soon realized that I actually had to learn some new tricks and spend quite some time. Not really cozy-coding, but very rewarding :)

Technical
The encoder takes a 256x192 video and groups every 4 frames. Each group is analyzed to get all 8x8 patterns used, and reduce that to a maximum of 128 UDG characters.
The video stream has 768 bytes of frame data and 256 bytes of character set data per frame, so 4 frames gives a new UDG character set.
1kB data per frame is only 1/6th of the original video bandwidth, (just) possible to stream from the ZXpand.

The player for ZXpand+ looks at the PAL/NTSC jumper setting at startup and changes some values regarding the picture generation, and chooses one of the two video files to play. PAL playback at 25fps and NTSC playback at 30fps, just the way we like it.

The players for the classic ZXpand ignores the PAL/NTSC jumper setting and just plays at the programmed framerate. NTSC had to be lowered to 15fps because the overhead of reading from the classic ZXpand is so much greater than on the ZXpand+.

It would be possible to add audio, but this was an exercise in video encoding for me. I've already done a different video/audio version of Bad Apple for the ZX81.

Video
For those wanting to see the show without getting out real hardware, you can watch on YouTube at: https://youtu.be/iMzVWNWk4E0

Demo appreciation
There is an entry for this on Pouet, a site devoted to demos: http://www.pouet.net/prod.php?which=75655
EDIT:
- updated to reflect v1.1 of this player
- added link to YouTube
- added link to pouet
Attachments
BadApple_ZX81_v1.1.zip
(4.02 MiB) Downloaded 176 times
Last edited by nollkolltroll on Fri Mar 23, 2018 11:04 am, edited 4 times in total.
/Adam

User avatar
zx81jens
Posts: 190
Joined: Sat May 10, 2008 8:26 am
Location: a Basement in Nienburg / Germany

Re: Bad Apple UDG

Post by zx81jens » Sun Mar 18, 2018 10:06 am

Wow, this is great stuff!!!!!!!!!!!!!
eyerything will be okay in the end.
if it´s not okay, it´s not the end.

and: uıɐbɐ ʎɐqǝ uo pɹɐoqʎǝʞ ɐ ʎnq ɹǝʌǝ ɹǝʌǝu ןןıʍ ı

User avatar
Andy Rea
Posts: 1530
Joined: Fri May 09, 2008 2:48 pm
Location: notts UK

Re: Bad Apple UDG

Post by Andy Rea » Sun Mar 18, 2018 10:37 am

wow.... just freaking wow.... its not often in the world of ZX81 that i'm totally taken aback by what can be achieved.

Give your self a huge pat on the back, have a beer or 2 and play that trumpet loudly so that everyone know what a wizard you are.

fabulous work indeed... now i have to ask.... have you tried it with other video streams ?

regards Andy
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

nollkolltroll
Posts: 268
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: Bad Apple UDG

Post by nollkolltroll » Sun Mar 18, 2018 11:29 am

Yes, Big Buck Bunny is coming up. Error diffusion video does not look good, bayer dither looks very good.

Feels nice to surprise you Andy :)
/Adam

nollkolltroll
Posts: 268
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: Bad Apple UDG

Post by nollkolltroll » Sun Mar 18, 2018 12:11 pm

And for those without the proper HW, it is possible to run this in EightyOne v1.8 or later with the appropriate settings.
/Adam

McKlaud
Posts: 240
Joined: Tue Dec 19, 2017 10:02 pm
Location: St Albans, UK

Re: Bad Apple UDG

Post by McKlaud » Sun Mar 18, 2018 12:43 pm

:shock: :shock: :shock:

My jaws dropped to the floor and can't lift them up.
Claudius
----------

User avatar
Andy Rea
Posts: 1530
Joined: Fri May 09, 2008 2:48 pm
Location: notts UK

Re: Bad Apple UDG

Post by Andy Rea » Sun Mar 18, 2018 9:06 pm

Blimey looks even better on real hardware and a good old CRT screen complete with Persistence of vision motion blur :D

and a heads up for anyone trying to get it to run on real harware,

original zxpand firmware 2.62 "troll" ROM 6.6, no dice, crashes after filling screen with "udg player"

zxpand+ firmware 1.08, ROM 7.0 , no dice also crashed...

ZXpand+ firmware 1.12 ( latest as far as i can tell ) ROM 7.0 Yes we have some action....

HTH anybody else trying to get it to work.

@sirmorris / nollkolltroll any idea why it doesn't work ( for me anyway ) on an original Zxpand

Regards andy
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

nollkolltroll
Posts: 268
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: Bad Apple UDG

Post by nollkolltroll » Sun Mar 18, 2018 9:30 pm

The original zxpand does not support 512-byte requests/transfers, only 256-byte is ok. The new mode has less overhead, which is why I started coding for the zxpand+.
I made a quick test this afternoon, and managed to get a version working on the original zxpand. So far only tested in 25fps mode. Will get back to you on this subject.
The documentation claims requirements to be zxpand+, but I forgot to mention a later version fw, sorry. Been inside the code and working environment too long...
/Adam

User avatar
Andy Rea
Posts: 1530
Joined: Fri May 09, 2008 2:48 pm
Location: notts UK

Re: Bad Apple UDG

Post by Andy Rea » Sun Mar 18, 2018 9:36 pm

nollkolltroll wrote:
Sun Mar 18, 2018 9:30 pm

The documentation claims requirements to be zxpand+
Documentation ??? is that like a manual... pffpfff fpff nobody reads those :lol: :lol: :lol:
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

nollkolltroll
Posts: 268
Joined: Sat Sep 27, 2014 8:02 pm
Location: Stockholm, Sweden

Re: Bad Apple UDG

Post by nollkolltroll » Sun Mar 18, 2018 9:43 pm

Well, the top post has the same text as the docs...
No worries, I think it IS interesting to know the differences between zxpand and zxpand+ regardless.
Hope to have some time to test 30fps mode on the zxpand tomorrow.
/Adam

Post Reply