Opened 22 years ago

Closed 22 years ago

Last modified 5 years ago

#37 closed defect (fixed)

Unaligned access in saveload.cpp

Reported by: SF/vasyl Owned by: SF/strigeus
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game:

Description

Function saveLoadArrayOf contains four instances of unaligned access (byte pointer "at" is forced to uint16 and uint32 types). Two of these instances can be replaced by READ_LE_UINT16/UINT32. Two others either require more access functions to be added to scummvm.h or just using byte access instead.

This bug was reported to me by Oleg Zakharov.

This is not the same as the other bug reported earlier -- that one referred to unaligned access functions not being implemented in header, now fixed.

Ticket imported from: #480571. Ticket imported from: bugs/37.

Change History (6)

comment:1 by SF/strigeus, 22 years ago

saveLoadArrayOf should only read from data structures that are already aligned properly, so there's no need to change anything there. The source of the problem might have been that some structures were declared in the packed section of scumm.h even though they didn't need to be packed. I will commit the update in a little while.

comment:2 by SF/strigeus, 22 years ago

Owner: set to SF/strigeus

comment:3 by SF/strigeus, 22 years ago

Resolution: fixed
Status: newclosed

comment:4 by SF/strigeus, 22 years ago

It should be fixed now, if not, reopen.

comment:5 by digitall, 5 years ago

Component: Engine: SCUMM

comment:6 by Filippos Karapetis <bluegr@…>, 5 years ago

In 13dbfbd8:

WINTERMUTE: Fix slider bugs in several games

There is a bug introduced in WME Lite.

Testcase:

  1. Download https://github.com/lolbot-iichan/wme_testsuite/tree/master/slider_test/packages
  2. Download https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/wmelite/wmelite_10_win.zip

3a. Run game.exe -> Slider moves with the mouse while it is pressed and
released when mouse is released
3b. Run wmelite.exe -> Slider is never released
3c. Run ScummVM -> Slider is never released

Related bugs:
https://bugs.scummvm.org/ticket/6567
https://bugs.scummvm.org/ticket/9861

Reason: slider is a button object that changes it's X until "LeftRelease" event is revieved and breaks the endless loop.
Sample code: https://github.com/lolbot-iichan/wme_testsuite/blob/master/slider_test/data/interface/system/speechvolume.script
However, WME Lite does not send "LeftRelease" events to any objects, if Game object can handle such event, even is game is frozen and UI is shown.

Original code: https://github.com/lolbot-iichan/Wintermute-Engine/blob/master/src/engine_core/wme_ad/AdGame.cpp#L2218
Changed in WME Lite: https://github.com/lolbot-iichan/wmelite/blob/master/src/AdGame.cpp#L2120

This behaviour was introduced in SVN period of wmelite, I believe it was
made on purpose for handling some iOS scenarios at commit #37 mentioned
on page https://code.google.com/archive/p/wmelite/source/default/commits

My proposal is to mark iOS apps as WME_LITE and fill exact WME_1_X_X/WME_LITE versions for all known
games. WME_1_X_X can be seen by right-clicking on main executable and seems to be non-empty for almost all existing WME games.

Version 0, edited 5 years ago by Filippos Karapetis <bluegr@…> (next)
Note: See TracTickets for help on using tickets.