Opened 22 years ago

Closed 22 years ago

Last modified 5 years ago

#18 closed defect (fixed)

Crash on LE CPUs with alignement issues

Reported by: SF/bbrox Owned by:
Priority: normal Component: Port: WinCE
Version: Keywords:
Cc: Game:


On the iPAQ (Little-endian based with ARM CPU), memory accesses NEED to be aligned.

By doing some hacks (ie checking on all READ_LE_UINT16 and READ_LE_UINT32 inline functions if the pointer is correctly aligned), I changed a LOT of these function calls to the (newly created) READ_LE_UINT16_UNALIGNED and READ_LE_UINT32_UNALIGNED.

Now, I wonder if by default, on platform like the ARM, the default should not be 'unaligned'...

Or is there really some places where we are sure to be aligned ?

Ticket imported from: #478437. Ticket imported from: bugs/18.

Change History (8)

comment:1 by SF/bbrox, 22 years ago

Just to add that I now changed ALL the READ_LE_UINTxx functions to the UNALIGNED version (by some #define magic in scummsys.h).

Now, Day of the Tentacle almost starts on the iPAQ (yoohoo), but I get this :

Error: Gdi::drawBitmap, strip drawn to 256 below window bottom 200!

Time to go back to some GDBing to search for further alignement problems :-)

Anyway, thanks for the cool project, I was dreaming of doing the same thing on my own but never even knew how to start !

comment:2 by SF/strigeus, 22 years ago

Status: newpending

comment:3 by SF/strigeus, 22 years ago

Have you located the source of the bug, and can this bug report be closed?

comment:4 by SF/bbrox, 22 years ago

This is closed since the CVS commit that added the SCUMM_NEED_ALIGNMENT define in scummsys.h .

comment:5 by SF/bbrox, 22 years ago

Resolution: fixed
Status: pendingnew

comment:6 by SF/bbrox, 22 years ago

Status: newclosed

comment:7 by digitall, 5 years ago

Component: Ports

comment:8 by digitall, 5 years ago

Component: PortsPort: WinCE
Note: See TracTickets for help on using tickets.