Thanks to dr-carlos's help on displaying Chinese, I spent a week to write this simple txt viewer.
WARNING: The program is in its Alpha development state; Serious bugs may appear and in some extreme situations, it might damage your OS. TO BE SAFE, RUN IT ONLY IN THE EMULATOR.

FEATURES
    Displaying Chinese in 18px / 24px fonts

    Paginating, for up to 8192 pages

    Bookmark feature (8 bookmark for each book and up to 32 books)


WARNING
Because I'm not a good programmer, there are some quite serious flaws on the program, like:
    It might not work well with files in folders

    When there's a 0x00 in the file, it might go into an infinite loop

    Only GB2312 encoding is supported

Please note that trying to display a binary file will cause unexpected behaviours.

NOTES
    Changing the font will clear all the bookmarks currently;

    Pressing MENU while reading will open the software menu, not main menu. This is because I want to give the app some time to close the files.

    The program will generate 3 files listed below:

- prconf.cfg -- Sessions and config
- <filename>.lpd -- pagination result in large fonts
- <filename>.spd -- pagination result in small fonts
All of them are binary files.

You can check its source code at github:
https://github.com/xuhao148/prEader/
(Though its code is really ugly and dirty...)

Used "Text and Number input" routine by Christopher Mitchell / Kerm Martian. Thanks!
Builds are under "Releases" tag of the repository.
Sorry about my poor English!
This is really cool, I'm surprised it only took a week!

I have a few suggestions after some very limited use:
- Exit to the main menu when quitting the reader. I like how the software menu comes up when you use the MENU key, but if you press quit, it should probably go straight to the calculator menu, given that you already pressed MENU once.

- Enable GetkeyToMainFunctionReturn before returning from read_book. A little bug I found was that if read_book returns early, it doesn't run EnableGetKeyToMainFunctionReturn, and you can't leave the addin. Easy fix, just call this before returning early.

I would also note that EnableGetkeyToMainFunctionReturn and DisableGetkeyToMainFunctionReturn are in libfxcg's fxcg/keyboard.h, and ProcessPrintChars is in fxcg/display.h (if you have the latest version), so you no longer need to implement these in assembly Smile

Other than that, I really liked it. Let me know if you have any questions (or make any discoveries!), I'm happy to help.
dr-carlos wrote:
This is really cool, I'm surprised it only took a week!

I have a few suggestions after some very limited use:
- Exit to the main menu when quitting the reader. I like how the software menu comes up when you use the MENU key, but if you press quit, it should probably go straight to the calculator menu, given that you already pressed MENU once.

- Enable GetkeyToMainFunctionReturn before returning from read_book. A little bug I found was that if read_book returns early, it doesn't run EnableGetKeyToMainFunctionReturn, and you can't leave the addin. Easy fix, just call this before returning early.

I would also note that EnableGetkeyToMainFunctionReturn and DisableGetkeyToMainFunctionReturn are in libfxcg's fxcg/keyboard.h, and ProcessPrintChars is in fxcg/display.h (if you have the latest version), so you no longer need to implement these in assembly Smile

Other than that, I really liked it. Let me know if you have any questions (or make any discoveries!), I'm happy to help.

I'm really glad that you liked it! Very Happy
I've updated the source code (of the Chinese version) on github to change what the 'quit' item does by using your code here, and fixed the bug that returning-to-menu flag is not re-enabled. Later I think I will try to internationalize the program by putting some hard-coded string tables into i18n.c and writing some sort of GetString function, so there will be no more separated en versions.
xuhao394 wrote:
dr-carlos wrote:
This is really cool, I'm surprised it only took a week!

I have a few suggestions after some very limited use:
- Exit to the main menu when quitting the reader. I like how the software menu comes up when you use the MENU key, but if you press quit, it should probably go straight to the calculator menu, given that you already pressed MENU once.

- Enable GetkeyToMainFunctionReturn before returning from read_book. A little bug I found was that if read_book returns early, it doesn't run EnableGetKeyToMainFunctionReturn, and you can't leave the addin. Easy fix, just call this before returning early.

I would also note that EnableGetkeyToMainFunctionReturn and DisableGetkeyToMainFunctionReturn are in libfxcg's fxcg/keyboard.h, and ProcessPrintChars is in fxcg/display.h (if you have the latest version), so you no longer need to implement these in assembly Smile

Other than that, I really liked it. Let me know if you have any questions (or make any discoveries!), I'm happy to help.

I'm really glad that you liked it! Very Happy
I've updated the source code (of the Chinese version) on github to change what the 'quit' item does by using your code here, and fixed the bug that returning-to-menu flag is not re-enabled. Later I think I will try to internationalize the program by putting some hard-coded string tables into i18n.c and writing some sort of GetString function, so there will be no more separated en versions.


Sounds great!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement