Nokia 770 port

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Yurand
Newbie
Posts: 5
Joined: Tue Sep 06, 2005 12:38 pm
Location: Minsk, Belarus
Contact:

Nokia 770 port

#1 Post by Yurand »

I am trying to port renpy to this handhelder http://europe.nokia.com/A4145104

Currently I was able to run Lucys Revenge and renpai 6.0.0 demo games without sound.

I have several questions about renpy.

1) Nokia 770 support max 16 color depth for a display, renpy try to set it to 32 and fails. In Lucys Revenge's renpy I saw some code for supporting 24 color depth, but it was deleted in 6.0.0. Is there any problem I should be aware?

I had to write this patch to deal with the problem:

Code: Select all

diff -ru renpy-6.0.0.old/renpy/display/core.py renpy-6.0.0/renpy/display/core.py
--- renpy-6.0.0.old/renpy/display/core.py	2007-02-04 17:04:48.000000000 +0200
+++ renpy-6.0.0/renpy/display/core.py	2007-02-24 15:28:44.000000000 +0200
@@ -590,19 +590,26 @@
         height = renpy.config.screen_height
         self.screen_xoffset = 0
 
+        depth = 32
         # Try out the widescreen mode.
         if os.environ.get('RENPY_FULLSCREEN_WIDE', False):
             wide_width = max(int(1.6 * height), width)
 
             try:
-                pygame.display.set_mode((wide_width, height), fsflag, 32)
+                d = pygame.display.mode_ok((wide_width, height), fsflag)
+                if d:
+                    depth = d
+                pygame.display.set_mode((wide_width, height), fsflag, depth)
                 self.screen_xoffset = (wide_width - width) // 2 
                 width = wide_width
             except:
                 pass
 
+        d = pygame.display.mode_ok((width, height), fsflag)
+        if d:
+            depth = d
         # The window we display things in.
-        self.window = pygame.display.set_mode((width, height), fsflag, 32)
+        self.window = pygame.display.set_mode((width, height), fsflag, depth)
         
         # Sample surface that all surfaces are created based on.
         sample = pygame.Surface((10, 10))
2) Memory usage.
Nokia 770 have only 64mb on board, so when system is loaded, only about 24mb free user program. I have not looked at code very closely, but does renpy unload any pictures as game progress?

3) Resolution
Nokia 770 support 800x480 resolution so images are cropped and I can't access any menu unless I modify script.rpy:
$ config.screen_width = 640
$ config.screen_width = 480
(This works for Lucys Revenge, but not for 6.0.0)

As a solution to this problem I see evironment variable to set fullscreen resolution. All images and absolute coordinates from scripts.rpy will be scalled from game resolution to screen resolution. This will allow to run game on low resolution display without modification to game itself.

Anyone have better idea?

4) During game start I see this message

Code: Select all

The _renpy module was not found. Please read module/README.txt for
more information.
I looked at that readme file, it contains link to instructions how to compile module. While I have no problem compiling it I wander WHY it needed?
Everything seems to work without it.
"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery

User avatar
EwanG
Miko-Class Veteran
Posts: 711
Joined: Thu Oct 26, 2006 5:37 pm
Location: San Antonio, TX
Contact:

#2 Post by EwanG »

I wish you luck with this project (since I'm not conversant enough with Python to help out).

I have a Nokia N800, so if you get this working, I'd be happy to test it on that platform so you can address that audience as well.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Nokia 770 port

#3 Post by PyTom »

Yurand wrote:I am trying to port renpy to this handhelder http://europe.nokia.com/A4145104
1) Nokia 770 support max 16 color depth for a display, renpy try to set it to 32 and fails. In Lucys Revenge's renpy I saw some code for supporting 24 color depth, but it was deleted in 6.0.0. Is there any problem I should be aware?
For the past few releases, I've set Ren'Py to use 32-bit images internally. Previously, it supported 32 or 24 bit, but that required me to write twice as much code, for little gain. The big problem is that the code in the _renpy module all assumes it's working with 32-bit surfaces, and fails (often catastrophically) if it is not.

This shouldn't be a problem, as according to:

http://www.libsdl.org/cgi/docwiki.cgi/S ... tVideoMode

"Normally, if a video surface of the requested bits-per-pixel (bpp) is not available, SDL will emulate one with a shadow surface."

For some reason, that doesn't seem to be working on S60. That's a bug in SDL/S60, IMO. Not like there's much we can do about it.
2) Memory usage.
Nokia 770 have only 64mb on board, so when system is loaded, only about 24mb free user program. I have not looked at code very closely, but does renpy unload any pictures as game progress?
Yes, we do. The number of pictures we keep in memory at once is controlled by config.image_cache_size. The default value, 8, means we keep 8 screens worths of images in memory at once.
3) Resolution
Nokia 770 support 800x480 resolution so images are cropped and I can't access any menu unless I modify script.rpy:
$ config.screen_width = 640
$ config.screen_width = 480
(This works for Lucys Revenge, but not for 6.0.0)

As a solution to this problem I see evironment variable to set fullscreen resolution. All images and absolute coordinates from scripts.rpy will be scalled from game resolution to screen resolution. This will allow to run game on low resolution display without modification to game itself.
I've been considering this. There are a lot of issues involved... maybe I'll have a go at it. I think it's best accomplished at the pygame level, since that's what abstracts surfaces.
4) During game start I see this message

Code: Select all

The _renpy module was not found. Please read module/README.txt for
more information.
I looked at that readme file, it contains link to instructions how to compile module. While I have no problem compiling it I wander WHY it needed?
Everything seems to work without it.
The _renpy module contains code that performs various special effects. For example, this code is responsible for stuff like recoloring the buttons, zooming images, dissolves (in 6.1), and so on.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Sugar_and_rice, voluorem