gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Ebook for DS ?

#44907 - Spindle - Mon Jun 06, 2005 6:26 pm

Why not creating a homebrew that read ebooks for the ds ?
That would be fun to use the DS as a book so we could use it like an open book, touch screen for the left page and the other for the right page, to turn the pages we just would have to close and open the DS like we would with a real book, or using L and R buttons... I don't have the knowledge to do it but I hope someone will. Anyone of you will ever create it ?

(Sorry for my bad english)

#44909 - Mr Snowflake - Mon Jun 06, 2005 6:30 pm

There are already ebook reader for gba, so you can use them for DS, but I don't think it will take too long for someone to make a ebook ready with nifty ds enhancements :)

#44917 - unrequited - Mon Jun 06, 2005 7:01 pm

My dream would be to see a horizontal dual screen (much like the Brain Excerciser E3 demo) usage and two pages you can read from. Since both screens would be in landscape mode, it'd could make for some easy reading. Couple that in with a vertial (instead of horizontal) subpixel rendering font (won't help get characters per line, but would still help render low resolution text), and this could be a very nice package. It'd be a small wrapper you could combine with a text file and then wifime. Of course, since I have practically 0 programming experience this is my dream for somebody else to hopefully realize.
_________________
-Unrequited

#44921 - Diskun - Mon Jun 06, 2005 8:21 pm

unrequited wrote:
My dream would be to see a horizontal dual screen (much like the Brain Excerciser E3 demo) usage and two pages you can read from. Since both screens would be in landscape mode, it'd could make for some easy reading. Couple that in with a vertial (instead of horizontal) subpixel rendering font (won't help get characters per line, but would still help render low resolution text), and this could be a very nice package. It'd be a small wrapper you could combine with a text file and then wifime. Of course, since I have practically 0 programming experience this is my dream for somebody else to hopefully realize.

Wow! Great Idea! Subpixel font + good programming = The Perfect e-Book Application

Hope someone with the required coding skills reads this ;)

Greets

#44927 - Mr Snowflake - Mon Jun 06, 2005 9:24 pm

I read here that if you turn the ds sideway, you get to see the scanline or something like that.
I think it would be beter to just leave the screens in portrait. I (and I think most poeple) find it easier to read long lines on a short page, than short lines on a long page.

#44931 - zubiac - Mon Jun 06, 2005 9:35 pm

Mr Snowflake wrote:
I read here that if you turn the ds sideway, you get to see the scanline or something like that.
I think it would be beter to just leave the screens in portrait. I (and I think most poeple) find it easier to read long lines on a short page, than short lines on a long page.


mmhh....but usual books are also "short lines on a long page" so I guess it wouldn't matter.

It would be great if it would be an app for "DS WinS".
This OS is getting better and better.A e-book app,media player and some organizer-app(s) and maybe even a webbrowser and it would rock away.
_________________
Abusing Cube and DS with all sorts of homebrew and hacks.

#44941 - Mr Snowflake - Mon Jun 06, 2005 10:04 pm

zubiac wrote:

mmhh....but usual books are also "short lines on a long page" so I guess it wouldn't matter.

True indeed, but on the ds the pages will be smaller (in portrait) or you have to use small fonts, which is a pain if you want to read long txt's. Actually, that's all a madder of opinion. They should make a version where the reader can choose his own format (portrait or landscape) :).

zubiac wrote:
It would be great if it would be an app for "DS WinS".
This OS is getting better and better.A e-book app,media player and some organizer-app(s) and maybe even a webbrowser and it would rock away.

I like nDoS better: it looks better, it is usable and it's more aimed at handhelds, whereas wins is willing to make a portable windows clone, nDoS is kinda aiming for a ds version of Windows mobile.

#44944 - zubiac - Mon Jun 06, 2005 10:10 pm

Mr Snowflake wrote:
I like nDoS better: it looks better, it is usable and it's more aimed at handhelds, whereas wins is willing to make a portable windows clone, nDoS is kinda aiming for a ds version of Windows mobile.


wins DS runs awefuly slow.
what about ndos'es speed?
(Note:I would try it myself but I fried my flashcard 10 min ago...oh well)
_________________
Abusing Cube and DS with all sorts of homebrew and hacks.

#45006 - speedWh0re - Tue Jun 07, 2005 3:27 am

I myself personally use this BookReader program at the moment. It simple, you can add in pictures easily and allows for tagging (ie. chapters, individual books in the one gba rom file, bookmarking multiple positions, etc). I make the font tiny to make it the most readable but then who really uses their GBA/DS further than arms length anyway :P It is small font but hold a bit closer and its perfectly readable I find.

http://www.mqp.com/fun/gb_dnld.htm

Rich

#45043 - unrequited - Tue Jun 07, 2005 8:28 am

Diskun wrote:
unrequited wrote:
My dream would be to see a horizontal dual screen (much like the Brain Excerciser E3 demo) usage and two pages you can read from. Since both screens would be in landscape mode, it'd could make for some easy reading. Couple that in with a vertial (instead of horizontal) subpixel rendering font (won't help get characters per line, but would still help render low resolution text), and this could be a very nice package. It'd be a small wrapper you could combine with a text file and then wifime. Of course, since I have practically 0 programming experience this is my dream for somebody else to hopefully realize.

Wow! Great Idea! Subpixel font + good programming = The Perfect e-Book Application

Hope someone with the required coding skills reads this ;)

Greets

GREAT mockup and exactly what I was envisioning.
_________________
-Unrequited

#45048 - cory1492 - Tue Jun 07, 2005 9:21 am

ever see this "ebook advanced"?
http://members.optushome.com.au/dancotter/ebook.htm
uses scaling and such to allow you to choose which direction the text sits in and resize it, unfortunately the author lost his code in an HDD crash and never restarted.. it would be nice to see similar functionality on a bookreader for DS, as well as save support/multibook support...

my thoughts: use the touchscreen for navi/menus and reg. screen for ebook, and be able to switch off to "book mode" so the nds is like a book as the above pics suggested.... and if possible timeout the touchscreen light when in single screen book mode to conserve power, if it is at all possible to kill one screens light at a time without going into gba mode...

#45053 - josath - Tue Jun 07, 2005 10:53 am

i threw this hack together real quick, based off of Sylfurd's subpixel text rendering example:

http://ds.rorexrobots.com/ebook

still only does one screen. up & down on dpad scroll, L & R do a page at a time.

try reading it and see if you think the font is too small. I think a little bigger font would be nicer myself

#45057 - cory1492 - Tue Jun 07, 2005 12:15 pm

josath wrote:
i threw this hack together real quick, based off of Sylfurd's subpixel text rendering example:

http://ds.rorexrobots.com/ebook

still only does one screen. up & down on dpad scroll, L & R do a page at a time.

try reading it and see if you think the font is too small. I think a little bigger font would be nicer myself


For a 'quick hack' I like it, dont much care for that font though, very non white on my DS which makes it tough to read, wouldnt want to go much smaller than crowe ebook reader's small font though... not sure whats going on when I press the B/A buttons, kinda funky stuff if ya ask me. (laughs) I went crosseyed counting the pixels between scanlines, the crowe capital W is 10 pixels high by 9 wide....

#45059 - josath - Tue Jun 07, 2005 12:34 pm

the subpixel font i used is 8 pixels high by 3 pixels wide....so yeah it's pretty small

#45081 - Pacifist - Tue Jun 07, 2005 3:45 pm

I find it fairly hard to read.

Are the odd blue and red overtones intentional?

#45084 - strager - Tue Jun 07, 2005 4:07 pm

If everyone would use my algorithm, we wouldn't have any problems reading it, would we? :-)

Note: Mine may not go that fast, because it has to do a divide by three three times every pixel. So that's 256 * 192 * 3 = 147456 divide by threes... Maybe I could rewrite it?

#45123 - tepples - Tue Jun 07, 2005 7:58 pm

"Divide by three" is the same as a multiply by 0x55555555 and taking only the upper 32 bits. Use the 'umull' or 'smull' instruction of ARM mode to do this.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#45125 - strager - Tue Jun 07, 2005 8:22 pm

Yes, but it is still slow. 147456 umull's isn't too pretty, either.

#45126 - ScottLininger - Tue Jun 07, 2005 8:33 pm

Diskun wrote:
Wow! Great Idea! Subpixel font + good programming = The Perfect e-Book Application


Subpixel rendering wouldn't be quite as useful in landscape mode, since most characters are taller than they are wide, and the BGR subpixels stack side by side when viewing the LCD in "normal" orientation.

Don't know if that made much sense. :P

Point being that portrait mode viewing would take better advantage of your subpixels. Though with a wider-character font like Japanese or the like, it probably would be about the same either way.

-Scott

#45189 - cory1492 - Wed Jun 08, 2005 12:27 pm

josath, if you found a way to make the font white I think it could be quite readable even at that tiny size, although I could see some crosseyed ebook readers coming of such a small font :D

#45211 - Mollusk - Wed Jun 08, 2005 5:35 pm

Josath, did you see my PM ?

I currently use a white/black fonts, works great...

I didn't get the division thing though ! From what I tested, in tiles mode, I was able to refresh the whole screen instantly, so why would it be so slow ? I have no divisions to do...

Edit : just checked the ebook reader, the 3x8 font is really hard to read :( I guess it may not be the best solution... Having a choice between 2-3 fonts could be better

#45214 - josath - Wed Jun 08, 2005 6:15 pm

added the source code to my ebook test thingie:
http://ds.rorexrobots.com/ebook/

it's really rough, don't blame me if something explodes :P

#45215 - Mollusk - Wed Jun 08, 2005 6:19 pm

Thanks, I'll check that out right away

#45216 - Mollusk - Wed Jun 08, 2005 6:24 pm

I just looked, you use the original version of the text output, while I made a sort of tile-based one... I believe it is really faster (for one letter, it just has 8 times tilepointer = fontpart)...

How did you convert the ebook to .txt format ? And how do you include the .txt ?

#45219 - josath - Wed Jun 08, 2005 7:11 pm

the ebook was originally html, when i got it from irc://undernet/#bookz , i used a tool called html2text to convert it to .txt.

look at buildROM.sh to see how to include it. basically, I add the ebook to the arm9.bin, with the bytes "BOOKTEXT" at the beginning and end of the ebook so i can find them again later. then i make a .nds from the arm9 bin using ndstool. (i don't have any special arm7 code).
then i add ndsmall.bin + the .nds to make a .nds.gba file.

For tile based, wouldn't the font need to be 8x8, or some multiple of that, as tiles are 8x8?

The text drawing is quite fast already, I wait 10 frames between updating the screen, otherwise it would be too fast. But that's all i'm doing, drawing text. If you are doing more than that, it may be too slow.

#45221 - Mollusk - Wed Jun 08, 2005 7:19 pm

FOr the tile version, actually it was 32*24 different tiles... so it's just like writing on the sceen in framebuffer with a palette... I'll do the same thing in bg BMP 8bit mode... With a palette, it alows you to write 3 or 4 pixels at a time, and you don't have to check which color it is... You don't need to have 8 x8, you can write 2 characters per tile...

Thanks for the info on including the text files :)

#45222 - Diskun - Wed Jun 08, 2005 7:29 pm

josath wrote:
the ebook was originally html, when i got it from irc://undernet/#bookz , i used a tool called html2text to convert it to .txt.

look at buildROM.sh to see how to include it. basically, I add the ebook to the arm9.bin, with the bytes "BOOKTEXT" at the beginning and end of the ebook so i can find them again later. then i make a .nds from the arm9 bin using ndstool. (i don't have any special arm7 code).
then i add ndsmall.bin + the .nds to make a .nds.gba file.

Could you make a wrapper, in ".bat" form or so?
I would, it's really easy but I'm busy with exams now :P

#45226 - josath - Wed Jun 08, 2005 8:41 pm

if you have sh or bash installed, just run "sh buildROM.sh" from the command line, or "bash buildROM.sh".
If you have "cat" installed (comes with cygwin or msys maybe), just rename the .sh to .bat and run it. ndstool & cat need to be in your path.

otherwise,

cat a b c > d

converts to

copy /b a+b+c d

#46396 - cory1492 - Fri Jun 24, 2005 4:15 am

Thanks to Josath for the origional code (and sylfurd for the subpixel stuff), doublec's tutorials, and GPFerrors thread on timers I was able to add some new ideas in, adding the Pause() timer routine and fixing up the button presses with polling (disabled B button as its now taken care automatically when you switch text screens/modes).

Planning to add in sram position saving next, trying to work out how to change the font and bg color along with the text color inversion while in the frame buffer mode (no luck so far on figuring out these framebuffer mode changes I'd like to do though, any direction on it would be appreciated).

Considering moving on to sprites for more advanced ability to rotate/scale etc, but I will need to learn about sprites and 2d first (long road that way with little info on DS sprites that makes sense to a console.h type programmer like me, who knows though, maybe doublec has a tutorial on the way and will show me its simpler than I thought)

Currently the scroll up/down is too fast, so I had to implement some pauses (which really slows it down on the emulators) to delay key repeats and such, but on hardware it is working as I intended.

Check out my changes so far here (in nds and nds.gba formats with the book included in the source):
ebook2.rar

expect more to follow (as long as Josath doesnt mind me taking up this project as my own, source will be open of course) after I implement some more improvements (as I learn), I will be cleaning up the source and removing some unneeded things that are currently commented (in mine anyway) as well as removing the onscreen debug info and preparing a simpler method of creating the rom (.bat I expect).

comments/suggestions/some info I need to learn? very welcome indeed - requests uhmm, not just yet, please.

#46398 - josath - Fri Jun 24, 2005 4:32 am

sounds good, i'll take a look at it when i get a chance. don't worry about me, it was just something i threw together real quick before, to show its possible.

#46399 - cory1492 - Fri Jun 24, 2005 5:27 am

Thanks Josath, I really like having a direction to go in, and what you "tossed" together seems to work really well from what I'd like it to do, even if its not "tidy".

I'm also working on an cmdline exe that will take a txt file as input and just make the ebook in nds and nds.gba formats... just not tonite.

#101806 - dracflamloc - Fri Sep 08, 2006 4:31 am

Any progress on this? I think it'd be great

#101828 - bjoerngiesler - Fri Sep 08, 2006 8:03 am

dracflamloc wrote:
Any progress on this? I think it'd be great


Just to chip in -- I've been working on an e-book reader. It doesn't use subpixel fonts, but it uses anti-aliased variable-width selectable fonts. It's also in portrait format, i.e. you hold the DS on end.

Expect a preprint edition sometime next week.
_________________
DSFTP homepage

#101835 - spinal_cord - Fri Sep 08, 2006 9:10 am

An on-end ebook reader would be much better in my opinion. preferably with some sore of support for images, grayscale gifs or something.as for sup-pixel fonts, why bother? You can never be certain of the pixels on an lcd screen, so you would have to account for both RGB and BGR screens. besides if you make the font too small people wont be able to read it.
A variable width font would also be best, and it can be done with tiled mode, making rendering nice and fast (using 4 layers and font character widths as multiples of 2)
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#101837 - bjoerngiesler - Fri Sep 08, 2006 9:31 am

spinal_cord wrote:
as for sup-pixel fonts, why bother? You can never be certain of the pixels on an lcd screen, so you would have to account for both RGB and BGR screens. besides if you make the font too small people wont be able to read it.


Exactly. The subpixel font rendering I've seen so far on the DS is great for when you need lots of text at the expense of readability. But it's not what I'd want in an ebook, where readability is priority number one.

Subpixel antialiasing is another matter; that can really improve font rendering, but it also costs a lot of time (or memory). Regular grayscale-based antialiasing is almost as good and much faster, because fonts can be pre-rendered.

Quote:
A variable width font would also be best, and it can be done with tiled mode, making rendering nice and fast (using 4 layers and font character widths as multiples of 2)


My current solution uses pre-rendered AA fonts (5-15KB per font) and draws to frame buffer / background bitmaps. It takes about 0.3s for two pages of text. Faster isn't necessary, IMHO, unless you're reading at the rate of 6 pages per second or the book is a flipbook. :-)
_________________
DSFTP homepage

#101902 - spinal_cord - Fri Sep 08, 2006 7:53 pm

Can I suggest for turning pages that a stylus swipe right to left to go forwards and left to right for backwards. with some sort of page-turning animation, a very simple one to make changing the page more noticable.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#101907 - HyperHacker - Fri Sep 08, 2006 8:41 pm

I'd try to just keep it simple. Left and right on the D-pad go through pages, maybe up and down go back/forward one line or through bookmarks or chapters. A, B, X, Y, R, Start and Select are left for whatever purpose you want, eg changing font sizes, setting/clearing bookmarks, closing the file and choosing another, etc. (L would probably be hit fairly often by accident so best leave it unused.) This assumes you're holding it such that the top screen is on the left.
_________________
I'm a PSP hacker now, but I still <3 DS.

#104306 - spinal_cord - Wed Sep 27, 2006 10:49 pm

is this going anywhere?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#104313 - bjoerngiesler - Wed Sep 27, 2006 11:28 pm

spinal_cord wrote:
is this going anywhere?


Yes. Be patient. :-)
_________________
DSFTP homepage

#104389 - telamon - Thu Sep 28, 2006 4:34 pm

Hi guys, I'm currently working on an eBook solution to.
Feel free to try out this WIP demo. It uses kevinc's dstype lib to render TT fonts, so please buy him a beer!

http://www.warpaint.se/dump/uReader.zip

It's currently just a quick "throwtogheter", I haven't yet implented power management, screen brightness control nor bookmarks.
And I have a wierd bug which skips some chars between the first and the second page in the book. The other pages seem to be just fine tough.
_________________
http://manifested.ath.cx

#104392 - kevinc - Thu Sep 28, 2006 5:20 pm

telamon wrote:
It uses kevinc's dstype lib to render TT fonts, so please buy him a beer!


Somebody uses code I wrote?!?

Wow. Now I can die in peace...


/if you need support send me a PM :]
//slashies!
_________________
http://akzeac.blogspot.com

#104501 - ooheadsoo - Fri Sep 29, 2006 9:04 pm

May I suggest being able to change to background color to black with white text? Great for reducing the strain on the eyes, especially when reading for longer periods.

#115435 - ooheadsoo - Tue Jan 16, 2007 2:03 am

Did anything ever come of this idea?