Homebrew IkuReader, an e-book reader

2-bias

Well-Known Member
Member
Joined
Jul 30, 2009
Messages
142
Trophies
0
Location
Germany
XP
95
Country
Gambia, The
whats with the path issue? because i would like to use ikureader also as a moonshell2 inilink file. but i am using it as a dstwo plugin as well, and now i need multiple iku-data folders inside many folders. and i can't use the bookmarks, because they are always inside the folder with the started nds file.
frown.gif


and is there a chance for a version for moonshell2 that loads the selected ebook directly?
 

chintoi

Well-Known Member
OP
Newcomer
Joined
Oct 9, 2008
Messages
51
Trophies
0
Website
Visit site
XP
65
Country
Serbia, Republic of
There is a possibility distorted text problem is going to be solved once and for all. If you got distorted text (known to happen on DSTT) please run this .nds and say if you see any text.
http://code.google.com/p/ikureader/downloa...mp;can=1&q=
Thank you.

Upd. No luck this time.

2-bias I don't get what are you talking about, If you can get bookmarks to work by placing IkuReader in the same folder or whatever then just do it.

gumbyx84 Then that's just your half forgotten hobby, nothing to worry about.
 

2-bias

Well-Known Member
Member
Joined
Jul 30, 2009
Messages
142
Trophies
0
Location
Germany
XP
95
Country
Gambia, The
chintoi said:
2-bias I don't get what are you talking about, If you can get bookmarks to work by placing IkuReader in the same folder or whatever then just do it.

my sd card looks like this (not in details):
CODE_dstwoplug/iku-data/bookmarks
_dstwoplug/iku.nds

moonshl2/extlink/iku-data/bookmarks
moonshl2/extlink/epub.iku.nds

iku-data/fonts

while fonts are used by both iku.nds - bookmarks are saved in the folder that belongs to the started iku.nds.
so i can't read a book with the moonshell iku.nds, save a bookmark and continue later with the dstwoplug iku.nds
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
220
Country
United States
2-bias said:
my sd card looks like this (not in details):
Code:
_dstwoplug/iku-data/bookmarks
_dstwoplug/iku.nds

moonshl2/extlink/iku-data/bookmarks
moonshl2/extlink/epub.iku.nds

iku-data/fonts

while fonts are used by both iku.nds - bookmarks are saved in the folder that belongs to the started iku.nds.
so i can't read a book with the moonshell iku.nds, save a bookmark and continue later with the dstwoplug iku.nds
You shouldn't need the moonshl2/extlink/iku-data folder unless the problem is that iku.nds treats it's folder as the starting point, which should be fixed to "fat(#):/" or something.
 

chintoi

Well-Known Member
OP
Newcomer
Joined
Oct 9, 2008
Messages
51
Trophies
0
Website
Visit site
XP
65
Country
Serbia, Republic of
QUOTE said:
unless the problem is that iku.nds treats it's folder as the starting point
it does
QUOTEwhich should be fixed to "fat(#):/"
And what, limit possible iku-data locations to just the root?

I'm still working on the distorted text problem and, uh, it's hard.
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,484
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,901
Country
United States
chintoi said:
QUOTE said:
which should be fixed to "fat(#):/"
And what, limit possible iku-data locations to just the root?
You could try having it read from an ini file in the same location as the .nds and have the iku-data location a configurable point.
Another option would be to put it the /data/ikureader/ folder so that if need be, people with the know-how have a fair amount of leeway to hex edit and the people that don't at least have it in the data folder (which various other homebrew also use).
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
220
Country
United States
jurassicplayer said:
Another option would be to put it the /data/ikureader/ folder so that if need be, people with the know-how have a fair amount of leeway to hex edit and the people that don't at least have it in the data folder (which various other homebrew also use).I suggested that a few pages back...

QUOTE(chintoi @ Feb 2 2011, 12:28 PM) And what, limit possible iku-data locations to just the root?
I don't really see it as a limitation... more of a compatibility or simplification.
By making the NDS file start at the ROOT of the card (the 'fat:/'), you make it so you ALWAYS look in the same location for the files. This way it should work on EVERY set up no matter where the NDS file is run from.
Currently. if I want to put iku.nds into my Homebrew folder, I would have to move the iku-data folder to the Homebrew folder.
With the change mentioned, I could put iku.nds ANYWHERE on my card and it would always look to fat:/iku-data/

Otherwise people like 2-bias will have to have 2 or 3 iku-data folders on their card, and none of them will match unless you manually copy the files every time something changes (like a setting or a bookmark) or you add a font.
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,484
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,901
Country
United States
twiztidsinz said:
By making the NDS file start at the ROOT of the card (the 'fat:/'), you make it so you ALWAYS look in the same location for the files. This way it should work on EVERY set up no matter where the NDS file is run from.
Currently. if I want to put iku.nds into my Homebrew folder, I would have to move the iku-data folder to the Homebrew folder.
With the change mentioned, I could put iku.nds ANYWHERE on my card and it would always look to fat:/iku-data/
I suppose another idea would be to have it check certain generic places first before making a new iku-data folder like the root, the data folder, and maybe a couple other places.
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
220
Country
United States
jurassicplayer said:
I suppose another idea would be to have it check certain generic places first before making a new iku-data folder like the root, the data folder, and maybe a couple other places.
Eh.. there's no real reason to have it anywhere else.
I suggested a while back to put everything into the Data folder (i.e. Data/Fonts for fonts, Data/Iku for bookmarks and settings), which would be located on the root.
A lot of Homebrew apps already use a Data folder and some use Data/fonts, if Iku reader used the Data folder you wouldn't have to have two copies of fonts in that case.
 

chintoi

Well-Known Member
OP
Newcomer
Joined
Oct 9, 2008
Messages
51
Trophies
0
Website
Visit site
XP
65
Country
Serbia, Republic of
Mkay, I'll change current_folder/iku-data to root/data/iku in the next release. I hope this will not confuse anybody. Oh yeah, an error message in case it's not there will settle it. However I don't believe it's an IkuReader issue since a copy of executable is not a link like moonshell creator must be thinking.

Meanwhile distorted text problem really-really seems to be fixed now, but this requires testing. Please report if you had this problem and if it is fixed in this version and what is your card.
Confirmed to be fixed with M3 Real and moonshell.
Confirmed to be fixed with DSTT.
http://code.google.com/p/ikureader/downloa...mp;can=1&q=
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
220
Country
United States
chintoi said:
However I don't believe it's an IkuReader issue since a copy of executable is not a link like moonshell creator must be thinking.Moonshell2 has a feature called ExtLink (Extension Link). Homebrew authors can make their apps compatible with ExtLink which will allow files to be loaded directly.
For example, normally when you want to run a NES game through NesDS you would have to:
1). Browse to the Emulator
2). Select the emulator to run it
3). Browse for the NES file
4). Select the NES file to run it

With the ExtLink version of NesDS in the Moonshl2\ExtLink folder (called nes.NesDS.nds, the "nes" prefix represents the file extension to associate the file with. It only works for 3 char extensions or less so "epub.iku.nds" wouldn't work.), you can run the .NES file directly through Moonshell2 and it will load the Emulator which automatically starts the game.


You can still use the ExtLink feature of Moonshell2 even if the app doesn't support it.
For example if I rename iku.nds to fb2.iku.nds and put it into the Moonshl2\ExtLink folder, I can select a fb2 file and it will automatically load iku reader. But because iku reader doesn't support ExtLink, it just runs the app normally.
If it did support ExtLink, the fb2 file would be automatically opened.



I'm not sure how to include it, but this is the file that comes with Moonshell2 for developers to use to make their apps ExtLink-able.
CODE#ifndef extlink_filestruct_h
#define extlink_filestruct_h

// extlink.dat structure

typedef u16 UnicodeChar;

#define ExtLinkBody_MaxLength (256)

#define ExtLinkBody_ID (0x30545845) // EXT0

typedef struct {
ÂÂu32 ID,dummy1,dummy2,dummy3; // dummy is ZERO.
ÂÂchar DataFullPathFilenameAlias[ExtLinkBody_MaxLength];
ÂÂchar DataPathAlias[ExtLinkBody_MaxLength];
ÂÂchar DataFilenameAlias[ExtLinkBody_MaxLength];
ÂÂchar NDSFullPathFilenameAlias[ExtLinkBody_MaxLength];
ÂÂchar NDSPathAlias[ExtLinkBody_MaxLength];
ÂÂchar NDSFilenameAlias[ExtLinkBody_MaxLength];
ÂÂUnicodeChar DataFullPathFilenameUnicode[ExtLinkBody_MaxLength];
ÂÂUnicodeChar DataPathUnicode[ExtLinkBody_MaxLength];
ÂÂUnicodeChar DataFilenameUnicode[ExtLinkBody_MaxLength];
ÂÂUnicodeChar NDSFullPathFilenameUnicode[ExtLinkBody_MaxLength];
ÂÂUnicodeChar NDSPathUnicode[ExtLinkBody_MaxLength];
ÂÂUnicodeChar NDSFilenameUnicode[ExtLinkBody_MaxLength];
} TExtLinkBody;


static bool GetFileBody_From_MoonShell2_ExtLink(const char **res_pFullPathFilenameAlias,void **res_pfilebuf,u32 *res_filesize)
{
ÂÂ*res_pFullPathFilenameAlias=NULL;
ÂÂ*res_pfilebuf=NULL;
ÂÂ*res_filesize=0;
ÂÂ
/*
ÂÂconsolePrintf("Start disk driver.\n");
ÂÂif(FAT_InitFiles()==false){
ÂÂÂÂconsolePrintf("DLDI init error.\n");
ÂÂÂÂreturn(false);
ÂÂ}
*/
ÂÂ
ÂÂstatic char FullAlias[ExtLinkBody_MaxLength];
ÂÂ
ÂÂ{
ÂÂÂÂconst char *pfn="/moonshl2/extlink.dat"; // This full path file name is fixation. It is never moved.
ÂÂÂÂ
ÂÂÂÂFILE *pf=FAT_fopen(pfn,"r");
ÂÂÂÂif(pf==NULL){
ÂÂÂÂÂÂconsolePrintf("Extend link data file not found. [%s]\n",pfn);
ÂÂÂÂÂÂreturn(false);
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂu32 ID,IDSize;
ÂÂÂÂIDSize=FAT_fread(&ID,1,4,pf);
ÂÂÂÂ
ÂÂÂÂif((IDSize==0)||(ID==0)){
ÂÂÂÂÂÂconsolePrintf("Please call this application from MoonShell2 by way of the extend link. [%s]\n",pfn);
ÂÂÂÂÂÂFAT_fclose(pf); pf=NULL;
ÂÂÂÂÂÂreturn(false);
ÂÂÂÂ}
ÂÂÂÂif(ExtLinkBody_ID!=ID){
ÂÂÂÂÂÂconsolePrintf("Extend link ID error. (0x%08x!=0x%08x)\n",ExtLinkBody_ID,ID);
ÂÂÂÂÂÂFAT_fclose(pf); pf=NULL;
ÂÂÂÂÂÂreturn(false);
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂu32 Dummy[3];
ÂÂÂÂFAT_fread(Dummy,1,4*3,pf);
ÂÂÂÂ
ÂÂÂÂFAT_fread(FullAlias,1,ExtLinkBody_MaxLength,pf);
ÂÂÂÂ
ÂÂÂÂFAT_fclose(pf); pf=NULL;
ÂÂ}
ÂÂ
ÂÂu8 *pfilebuf=NULL;
ÂÂu32 filesize=0;
ÂÂ
ÂÂ{
ÂÂÂÂconst char *pfn=FullAlias;
ÂÂÂÂ
ÂÂÂÂFILE *pf=FAT_fopen(pfn,"r");
ÂÂÂÂif(pf==NULL){
ÂÂÂÂÂÂconsolePrintf("File not found. [%s]\n",pfn);
ÂÂÂÂÂÂreturn(false);
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂFAT_fseek(pf,0,SEEK_END);
ÂÂÂÂfilesize=FAT_ftell(pf);
ÂÂÂÂFAT_fseek(pf,0,SEEK_SET);
ÂÂÂÂ
ÂÂÂÂpfilebuf=malloc(filesize);
ÂÂÂÂif(pfilebuf==NULL){
ÂÂÂÂÂÂconsolePrintf("Memory overflow. [%s] %dbyte.\n",pfn,filesize);
ÂÂÂÂÂÂFAT_fclose(pf); pf=NULL;
ÂÂÂÂÂÂreturn(false);
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂif(FAT_fread(pfilebuf,1,filesize,pf)!=filesize){
ÂÂÂÂÂÂconsolePrintf("File read error. [%s] %dbyte.\n",pfn,filesize);
ÂÂÂÂÂÂFAT_fclose(pf); pf=NULL;
ÂÂÂÂÂÂreturn(false);
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂFAT_fclose(pf); pf=NULL;
ÂÂ}
ÂÂ
ÂÂ*res_pFullPathFilenameAlias=FullAlias;
ÂÂ*res_pfilebuf=pfilebuf;
ÂÂ*res_filesize=filesize;
ÂÂ
ÂÂreturn(true);
}

#endif
 

chintoi

Well-Known Member
OP
Newcomer
Joined
Oct 9, 2008
Messages
51
Trophies
0
Website
Visit site
XP
65
Country
Serbia, Republic of
What a monstrosity...
Let's try to take a closer look. It says:
"/moonshl2/extlink.dat"; // This full path file name is fixation. It is never moved.
Oops, it lied. The only version of moonshell I could run on my M3 Real doesn't have /moonshl2/ folder.

This means I can't even test it. In addition moonshell can't be run with an emulator, am I right? Is it so hard to to use built-in browser to open a book anyway?
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
220
Country
United States

chintoi

Well-Known Member
OP
Newcomer
Joined
Oct 9, 2008
Messages
51
Trophies
0
Website
Visit site
XP
65
Country
Serbia, Republic of
twiztidsinz Indeed, thank you.

Update
major card/loader compatibility issue solved: no more distorted text
changed folder structure upon multiple requests
moonshell's extlink enabled (there are issues with this which I am not going to solve for various reasons)
Download
 

twiztidsinz

Taiju Yamada Fan
Member
Joined
Dec 23, 2008
Messages
4,979
Trophies
0
Website
Visit site
XP
220
Country
United States
Moonshell integration works perfectly on my ebooks.
But the bottom screen text has gotten blurry on my DS Phat. Not sure if this is related to your fixes or not.
 

chintoi

Well-Known Member
OP
Newcomer
Joined
Oct 9, 2008
Messages
51
Trophies
0
Website
Visit site
XP
65
Country
Serbia, Republic of
No, it's not perfect. It doesn't support non-Latin filenames and stores separate bookmarks for each book depending on how it was opened and it has a limitation to path length of 255 bytes. If first two are solvable, the last one is not. I have supplied one file browser and I am not going to maintain another one.
QUOTE said:
But the bottom screen text has gotten blurry on my DS Phat.
Does pressing BGR button change it?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/WOppJ92RgGU?si=KE79L6A_3jESsGQM