LIJI32 / GBVideoPlayer2

A new version of GBVideoPlayer with higher resolution, 3-bit stereo PCM audio and video compression
MIT License
96 stars 15 forks source link

Original Gameboy (DMG) version? #5

Open sttng opened 3 years ago

sttng commented 3 years ago

Would it be possible to create an original Gameboy DMG version ?

LIJI32 commented 3 years ago

It's possible, but very tricky considering the lower clock rate and reduced timer resolution (The DMG can't accurately trigger a timer interrupt every 114 M-cycles)

sttng commented 3 years ago

Yeah I understand this maybe quite a challenge given the color Gameboy has twice the clockspeed of the cpu, double the video ram and tripple the ram. Maybe if you reduce the framerate ?

LIJI32 commented 3 years ago

RAM and VRAM aren't an issue, I hardly use them. Reducing the frame rate won't help either – GBVP plays video in a volatile way – it actively draws an image in real time as the LCD updates the frame.

sttng commented 3 years ago

In that sense the only challenge is the less accurate interrupt trigger on the DMG ? Which means you can't be sure to color the 8 (or 16) pixels correctly in each hblank ?

T0biasCZe commented 3 years ago

@LIJI32 Gameboy has 160x144 screen, which is 20x18 tiles, which is 360tiles total. but gameboy has 256tiles limit. (and it can reuse tiles) If it was only 20x12 tiles (160x96) it would be only 240tiles which would fit. there would be one filler tile for the borders on top and bottom, which would be 241 tiles total. so it would fit all at once into the screen without the mid scan interupt example picture: SonicGBGreem

LIJI32 commented 3 years ago

As mentioned above, VRAM (and tile count) aren't an issue, GBVP (both 1 and 2) don't display data using tiles; GBVP2 only uses 2 different tiles. The issue is not having double speed mode on the original Game Boy – the halved CPU speed means we get half the horizontal resolution (it gets stretch though), as well as lose the ability to compress video. Additionally, we lose required timer precision, making the code more wasteful on CPU time as we need to take care of timing things ourselves. It's probably better to display DMG video in a different technique.

T0biasCZe commented 3 years ago

the halved CPU speed means we get half the horizontal resolution (it gets stretch though)

@LIJI32 well if its stretched back it doesnt matter since it wouldnt be visible on the 2.2" screen

as well as lose the ability to compress video.

The video is only 2bit it will not take a lot of space like the color video so it doesnt need the compression as much

T0biasCZe commented 3 years ago

Well i tried the original version of the GBVideoplayer, and it sort of works on the original gameboy...

sttng commented 2 years ago

You mean the stock released rom for V1 Player or did you modify the source ?

Lucas-mother3 commented 1 year ago

Well, I will revive the thread because of this: https://github.com/Staacks/wifi-game-boy-cartridge/tree/master/gb/stream

It's from the GB Wifi cartridge source code, which is impressive by itself, I don't know much assembly myself, but I think it might be helpful. (This is posted while I ran GBVideoPlayer2 on Termux)

Addendum: Here's also the color version: https://github.com/Staacks/wifi-game-boy-cartridge/tree/master/gb/color-stream

I don't know if these are compatible with most emulators instead of the already limited set of emulators that can run videos encoded on this program.

Addendum 2: Here's the details about how this guy worked on it: https://there.oughta.be/gta5-for-the-game-boy https://youtu.be/pX1opw_gsBs - YouTube video