PBDoom is a port of the Doom (1993) videogame for PocketBook eInk devices. Downloads are on the official website of PBDoom.
PBDoom is based on
Sam Lantinga’s SDL Doom. SDL drawing functions were replaced with PocketBook SDK’s
inkview
library functions. SDL sound functions were completely removed
from the code for now (not many PocketBooks have speakers
nowadays, headphones usually can be connected however).
The development of PBDoom started in March of 2022. The first public release was published in January of 2023.
Source code is available on GitHub.
Why?
This project serves several purposes:
- Produce an example of an action game on an eInk reader device
- One more custom application for PocketBook
-
Gather experience of using the
inkview
library
Porting Doom was not a big project. SDL Doom runs on Linux and
(some) PocketBooks run Linux. Reworking the main graphics output
function to use
inkview
’s
FillArea
(fill a rectangle with a color) function instead of writing
pixel data to an SDL surface is easy.
However, due to some limitations of the eInk technology (low refresh rate, lack of color on some devices) some additional work needs to be done on the video output part. In this project we explore what needs to be done and what is possible.
Also this project has introduced me to CMake.
Can PocketBook run Doom?
Yes it can but this is not big news. The developers working on PocketBook released a video of Doom running on a PocketBook 360 Plus back in 2011.
This version was produced “during a lunch break” (original message, archived message) and was (to my knowledge) never released to the public.
So, PBDoom can finally close the gap and serve as a publicly available Doom for PocketBook, (some people) needed so much.
Image dithering: optimization for eInk
As noted before, eInk displays have low refresh rate. This requires some workarounds for a comfortable playing experience.
Some eInk displays have multiple update modes. In some modes the update time depends on the required changes to the displayed image. For example, replacing a full-white region with a full-black region can be faster than working with shades of grey.
Using this quality, we can increase the game refresh rate while sacrificing some of the image quality.
The official
inkview
documentation suggests dithering the image doen to only two
color levels for quick updates (page 12):
Call [
DitherArea
] withlevels=2
andmethod=DITHER_THRESHOLD
to have image that can be quickly updated e.g. for menus, lists and selections.
Formatting by me.
The
inkview
library provides several functions to dither screen output
(DitherArea
and others).
We also can manipulate the colors to change brightness, contrast and do gamma correction to fine tune the output, before dithering.
Post changelog
-
28 February 2023 — add the missing word never to
specify that the port by PocketBook was
never released. Also cite
inkview
documentation for dithering tips.