GrimSqueaker / remc2

Recode Binary code of game Magic Carpet2 to C/C++ language(remake MC2 for any platform)
6 stars 0 forks source link

Sprites not rendered correctly when tilting screen #45

Closed GrimSqueaker closed 3 years ago

GrimSqueaker commented 3 years ago

When tilting the screen sprites disappear. See the screenshot in which villagers should be visible in the front and not just the background.

Screenshot from 2021-02-13 23-25-17

Git bisect helped to find that it was introduced in the following range of commits:

$ git bisect log
git bisect start
# bad: [ebd44563c28f212939f4adc05b14fe1e784b0048] fix: CMake for new config.ini, graphics, and music locations
git bisect bad ebd44563c28f212939f4adc05b14fe1e784b0048
# good: [97eedfe478f23db8f77fd2ac9e6fe9fe39d2967d] Merge pull request #21 from thobbsinteractive/re-definitions
git bisect good 97eedfe478f23db8f77fd2ac9e6fe9fe39d2967d
# bad: [51159e06357a009fc38c783e300f46b32da2b518] begin of rewriting str_E37A0_sound_buffer2
git bisect bad 51159e06357a009fc38c783e300f46b32da2b518
# skip: [3bcd152bc521407fbbbed197a2307a78b62399ae] 210209-02
git bisect skip 3bcd152bc521407fbbbed197a2307a78b62399ae
# skip: [ea3136b7f0a4ab45010fdd55495252143f5ce953] 210209
git bisect skip ea3136b7f0a4ab45010fdd55495252143f5ce953
# good: [e7f362f04ea375124ad5bf798ccda89aaa729528] Merge: turican0/development
git bisect good e7f362f04ea375124ad5bf798ccda89aaa729528
# bad: [c3a76285720363b791b5f4b90981718af6536f56] Feature: Prepare CMake for 64 bit compilation
git bisect bad c3a76285720363b791b5f4b90981718af6536f56
# skip: [1a1da24cc3ce332bd4d6ee40bae5545b3460bd0f] 210208-02
git bisect skip 1a1da24cc3ce332bd4d6ee40bae5545b3460bd0f
# skip: [6d851f61a34caa1b1cc2e39da0ed1e190b1d9688] Sound and Animation separated
git bisect skip 6d851f61a34caa1b1cc2e39da0ed1e190b1d9688
# good: [c33456f68449715043dbb350c7aacf5c2ae8588b] next void fixes
git bisect good c33456f68449715043dbb350c7aacf5c2ae8588b
# skip: [e580349bc03a02063b593b8f66de9bd2bacb2880] 210208
git bisect skip e580349bc03a02063b593b8f66de9bd2bacb2880
# skip: [ddcd1e79e37fa7234453ac2b5762e2bb109d7dca] added stub of editor
git bisect skip ddcd1e79e37fa7234453ac2b5762e2bb109d7dca
# skip: [3a62ddbd35fc7a9837cc55a8f6ddf75d8b5ddbcb] 210207-2
git bisect skip 3a62ddbd35fc7a9837cc55a8f6ddf75d8b5ddbcb
# bad: [5fb70fe06a666e0ca32bd86218c2231decfafefc] Fix: Fix CMake after splitting files
git bisect bad 5fb70fe06a666e0ca32bd86218c2231decfafefc
# only skipped commits left to test
# possible first bad commit: [5fb70fe06a666e0ca32bd86218c2231decfafefc] Fix: Fix CMake after splitting files
# possible first bad commit: [3bcd152bc521407fbbbed197a2307a78b62399ae] 210209-02
# possible first bad commit: [ddcd1e79e37fa7234453ac2b5762e2bb109d7dca] added stub of editor
# possible first bad commit: [ea3136b7f0a4ab45010fdd55495252143f5ce953] 210209
# possible first bad commit: [1a1da24cc3ce332bd4d6ee40bae5545b3460bd0f] 210208-02
# possible first bad commit: [6d851f61a34caa1b1cc2e39da0ed1e190b1d9688] Sound and Animation separated
# possible first bad commit: [e580349bc03a02063b593b8f66de9bd2bacb2880] 210208
# possible first bad commit: [3a62ddbd35fc7a9837cc55a8f6ddf75d8b5ddbcb] 210207-2

I cannot narrow it down further, because the intermediate commits do not compile successfully on Linux.

turican0 commented 3 years ago

There will probably be a problem with the signed / unsigned int. I'll look into it, Tom.

turican0 commented 3 years ago

&x_DWORD_E9C38_smalltit[45920] or (&x_DWORD_E9C38_smalltit + 59360) array is different with original - bad initialization in sub_56A30_init_game_level->sub_43830_generate_level_map->sub_44E40 x_DWORD_E9C38_smalltit + 59360 mixed with x_BYTE_13B4E0_angle

fixed! bug is in another part of code - in sub_41BD3_subDrawSprite is bad adress (&x_DWORD_E9C38_smalltit + 59360) changed to (x_DWORD_E9C38_smalltit + 59360) Tom.