Ticket #9265: bugfix.txt

File bugfix.txt, 3.4 KB (added by SF/obcd, 10 years ago)

The above text...

Line 
11. Problem description:
2
3Some Humogonous scumm games don't show the ingame cursor on the wii port of scummvm.
4This happens with the stable 1.2.0 build and also with the svn builds.
5
62. Cause of problem:
7
8The Wii port has the separate cursor palette enabled.
9The _cursorPalette is used as a buffer.
10When the system switches to the _texMouse.palette (setCursorPalette) and the _cursorPaletteDisabled == true,
11than the _texMouse.palette is copied to the _cursorPalette.
12The disableCursorPalette function copies the _cursorPalette back to to the _texMouse.palette when the cursor
13palette is disabled.
14
15I did some loggings of the functions and there appearance during the startup of a humogonous game:
16
17=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2010.11.26 10:28:09 =~=~=~=~=~=~=~=~=~=~=~=
18startup as 'scummvm_stripped.dol'
19chdir to default
20initSize 320*200*8 (000 -> 000 match: 1)
21window caption: ScummVM 1.3.0svn (Nov 26 2010 10:26:51)
22switching to palette based cursor
23setCursorPalette with _cusorPaletteDisabled = TRUE
24disabling cursor palette
25User picked target 'PuttTime-nl-1' (gameid 'putttime')...
26 Looking for a plugin supporting this gameid... SCUMM Engine [all games]
27 Starting 'Putt-Putt Travels Through Time'
28disabling cursor palette
29window caption: Putt-Putt Travels Through Time (Dutch)
30switchVideoMode 0
31initSize 640*480*8 (000 -> 000 match: 1)
32enabling cursor palette
33setCursorPalette with _cusorPaletteDisabled = FALSE
34disabling cursor palette
35Set palette
36disabling cursor palette
37Set palette
38Set palette
39disabling cursor palette
40Set palette
41Set palette
42disabling cursor palette
43Set palette
44Set palette
45Set palette
46Set palette
47Set palette
48Set palette
49Set palette
50Set palette
51Set palette
52Set palette
53disabling cursor palette
54disabling cursor palette
55...
56
57
58As you can see, the cursor palette is enabled before the actual colors are set with the setCursorPalette.
59Due to that issue, the _cursorPalette isn't updated in the SetCursorPalette function.
60
613. My solution:
62
63The _cursorPalette is suposed to have the same entries as the normal in game palette.(In a different format)
64So, I changed the SetPalette function a little:
65
66
67
68osystem_gfx.cpp:
69
70
71void OSystem_Wii::setPalette(const byte *colors, uint start, uint num) {
72#ifdef USE_RGB_COLOR
73 assert(_pfGame.bytesPerPixel == 1);
74#endif
75
76 const byte *s = colors;
77 u16 *d = _texGame.palette;
78
79 for (uint i = 0; i < num; ++i) {
80 d[start + i] = Graphics::RGBToColor<Graphics::ColorMasks<565> >(s[0], s[1], s[2]);
81 s += 4;
82 }
83
84 gfx_tex_flush_palette(&_texGame);
85
86 // Obcd
87 /* this background cursor palette should always be equal to the game screen palette */
88 s = colors;
89 d = _cursorPalette;
90 for (uint i = 0; i < num; ++i) {
91 d[start + i] = Graphics::ARGBToColor<Graphics::ColorMasks<3444> >(0xff, s[0], s[1], s[2]);
92 s += 4;
93 }
94 if (_cursorPaletteDisabled) //There should be a direct reflection to the current showed cursor
95 {
96 assert(_texMouse.palette);
97 u16*f = _cursorPalette;
98 d = _texMouse.palette;
99 memcpy(d + start, f + start, num * 2);
100 _cursorPaletteDirty = true;
101 }
102/*
103
104 if (_cursorPaletteDisabled) {
105 assert(_texMouse.palette);
106
107 s = colors;
108 d = _texMouse.palette;
109
110 for (uint i = 0; i < num; ++i) {
111 d[start + i] = Graphics::ARGBToColor<Graphics::ColorMasks<3444> >(0xff, s[0], s[1], s[2]);
112 s += 4;
113 }
114
115 _cursorPaletteDirty = true;
116 }
117*/
118}
119
120It seemed like the most logical place to do things....
121
122regards.