Matthew Duggan
4500cc8451
ULTIMA8: Fix int16 casts in 32 bit usecode operands
...
These opcodes are all unused in Ultima8, so this bug probably only affects
Crusader games.
2021-05-23 16:23:17 +09:00
Matthew Duggan
c74ae95508
ULTIMA8: Avoid confman call on every animation
2021-05-23 16:23:17 +09:00
Matthew Duggan
b9ddaf64f2
ULTIMA8: Remove some dead code
...
Code that has been #if 0 for a long time, and some default setting for Crusader
which is not used.
2021-05-23 16:23:17 +09:00
Matthew Duggan
95670203d9
ULTIMA8: Avoid OOB access in Crusader weapon shape list
...
Updated list for No Regret, and check value which gets loaded from data file.
Identified by Coverity.
2021-05-19 17:18:21 +09:00
Matthew Duggan
bc4e1eeefb
ULTIMA8: Scan more pixel offsets in Crusader
...
The list before had some omissions so the avatar would still fall a bit. This
should remove the last places we see pausing while walking around on elevated
platforms etc.
2021-05-19 17:18:20 +09:00
Matthew Duggan
345537c519
ULTIMA8: Improve test for Crusader slide movements
...
The previous code made it possible to accidentally jump through thin objects
like laser barriers because it was not testing that the avatar could get to the
start point of the adjusted move. Added a sweep test to ensure the start point
is also valid.
2021-05-16 22:19:45 +09:00
Matthew Duggan
c40477ef67
ULTIMA8: Don't pause crusader turn while firing
2021-05-16 22:19:45 +09:00
Matthew Duggan
3e0c3089e9
ULTIMA8: Remove outdated FIXME and TODO comments
2021-05-16 20:36:58 +09:00
Matthew Duggan
ccc91e43ca
ULTIMA8: Fix a TODO in Crusader attack, add another one for Regret
2021-05-16 20:36:57 +09:00
Matthew Duggan
d5a5b5c5ed
ULTIMA8: Add comments
2021-05-16 20:36:57 +09:00
Matthew Duggan
8d3e556e97
ULTIMA8: Clean up a Crusader TODO.
2021-05-16 20:36:57 +09:00
Matthew Duggan
0ee35a1e1f
ULTIMA8: Get Crusader default HP from data table
2021-05-16 18:21:38 +09:00
Matthew Duggan
46982981f5
ULTIMA8: Update Crusader random weapon table for No Regret
2021-05-16 18:21:38 +09:00
Matthew Duggan
f5d4a91576
ULTIMA8: Use bool type for two firetype flags
2021-05-16 18:21:38 +09:00
Matthew Duggan
07dee61a72
ULTIMA8: Add No Remorse data to FireTypeTable
2021-05-16 18:21:38 +09:00
Matthew Duggan
07d7e335d7
ULTIMA8: Add repeating firing in Crusader
2021-05-16 18:21:38 +09:00
Matthew Duggan
dce361bf3b
ULTIMA8: Turn Crusader immediately while moving
...
Crusader games allow the avatar to turn once immediately while walking/running.
2021-05-16 18:21:38 +09:00
Matthew Duggan
f3eb0a978e
ULTMA8: JANITORIAL: Remove incorrect commented-out code
2021-05-16 18:21:38 +09:00
Matthew Duggan
15b265abdc
ULTIMA8: Use readSByte to eliminate casts
2021-05-16 18:21:38 +09:00
D G Turner
82b1f3603a
ULTIMA8: Fix GCC Shadowing Warning
2021-05-15 20:17:38 +01:00
Matthew Duggan
4384d75d8c
ULTIMA8: Usecode push-byte-indirect should sign-extend
...
Opcode 0x3E pushes a byte on to the stack as a 16-bit value. Previously we
assumed it should be treated as an unsigned value, but the code for conveyors
in Crusader clearly treats it as a signed value - they move at +3 or -3 per
tick. Confirmed in the disasm that both U8 and Cru use CBW to sign-extend
value in AL, so this may fix some things in U8 too.
2021-05-15 22:13:59 +09:00
Matthew Duggan
9d34f7b680
ULTIMA8: Crusader rolls should end kneeling
...
Even when they started standing. Match the original behavior.
2021-05-15 17:17:39 +09:00
Matthew Duggan
6d71176b8f
ULTIMA8: Improve debug message in ActorAnimProcess
2021-05-15 17:06:36 +09:00
Matthew Duggan
21ac02ab46
ULTIMA8: Remove Crusader elevator hack and fix it properly
...
Crusader globs sometimes contain items with an odd z value - eg, stripey floors
or elevators. This is not done in U8 and probably a hack to make the paint
order right in the original, but our scan function was only checking +/-4 and
+/-8 pixels so the avatar would jump 4 pixels up then fall, which was nasty.
Add odd-pixel checks as well when doing a scan in Crusader, and clean up the
old hack. Also tidied up the scan function to make it more understandable.
2021-05-15 17:06:30 +09:00
Matthew Duggan
f70cb80c30
ULTIMA8: Don't 'land' dead actors in Crusader
2021-05-15 17:06:04 +09:00
Matthew Duggan
4c4b8a6cf5
ULTIMA8: Remove a bit of dead code
2021-05-15 17:06:04 +09:00
Matthew Duggan
edf0797728
ULTIMA8: Wire up more intrinsics for No Regret
2021-05-15 17:06:04 +09:00
Matthew Duggan
f7e07c0eb0
ULTIMA8: Fix uninitialized members identified by Coverity
2021-05-10 14:54:16 +09:00
Matthew Duggan
ebbfb88174
ULTIMA8: Fix array size, thanks Coverity.
2021-05-10 14:51:37 +09:00
Matthew Duggan
b73d04844e
ULTIMA8: Avoid small leak on invalid data
2021-05-10 14:51:05 +09:00
Matthew Duggan
f456e268ec
ULTIMA8: Avoid potential null reference
2021-05-10 14:50:36 +09:00
Matthew Duggan
927e7ca3b0
ULTIMA8: Add comments about some Remorse intrinsics
2021-05-10 11:47:51 +09:00
Matthew Duggan
4cb6c0a087
ULTIMA8: Add a TODO for No Regret
2021-05-10 11:47:51 +09:00
Matthew Duggan
3febff9639
ULTIMA8: Fix off-by-one glob egg calculation for Crusader
...
This caused elevator doors to not close properly as the poles either side were
off by 1 pixel and blocked the creation of the door objects.
2021-05-09 17:41:31 +09:00
Matthew Duggan
47d8b281c7
ULTIMA8: Only move Crusader camera if position is valid.
...
This avoids strange results if you try to move the camera while the avatar has
temporarily been moved to 0,0,0.
2021-05-09 17:41:05 +09:00
Matthew Duggan
cf7ae46475
ULTIMA8: Adjust Crusader step tests to match original
2021-05-09 13:09:08 +09:00
Matthew Duggan
6f5538ab4d
ULTIMA8: Fix actor anim speed in Crusader
2021-05-09 12:04:25 +09:00
Matthew Duggan
26f936510f
ULTIMA8: Implement "cruStasis", stops some key events
...
The main bugs that this fixes are when using a remote camera:
* Z should not recenter camera on avatar
* Escape should close remote viewing, not open menu
2021-05-09 09:08:31 +09:00
Matthew Duggan
bda1466e0a
ULTIMA8: Fix Crusader items reappearing after exploding
2021-05-09 08:17:01 +09:00
Matthew Duggan
137fa8ea29
ULTIMA8: Implement 'grab' operation for Crusader games
...
Since it only works on loose items and not for searching boxes etc, it's
actually not so useful, but implemented for completeness.
2021-05-09 07:48:26 +09:00
Matthew Duggan
cf085788c2
ULTIMA8: Add Crusader key for using energy cube
...
Had to reassign the "paint editor items" debug key because it was using 'e',
which we need.
2021-05-09 07:31:43 +09:00
Matthew Duggan
d83ccb7e9b
ULTIMA8: Default to no mouse cursor in Crusader
2021-05-09 07:31:43 +09:00
Matthew Duggan
f5c4374888
ULTIMA8: Refactor so all Crusader movies get subtitles
...
Previously there was a bit of duplication, and Weasel and the intro movies
didn't get subtitles. Cleaned up the code a bit and now all are treated
consistently.
2021-05-09 07:31:43 +09:00
Matthew Duggan
531ed6865b
ULTIMA8: Add comment about iteration order
...
This function looks tempting to "optimize", by changing the order, so add a
warning for new adventurers.
2021-05-09 07:31:43 +09:00
Matthew Duggan
6f483eb53b
ULTIMA8: Don't reset FIRSTSTEP on non-step animations
...
Confirmed in both U8 and Crusader, single steps should alternate left foot /
right foot, even when there is a stand animation in-between.
2021-05-07 18:52:16 +09:00
Matthew Duggan
7338e7ab02
ULTIMA8: Fix animations used for Crusader combat rolls
2021-05-07 18:52:11 +09:00
Matthew Duggan
dc8a9487ec
ULTIMA8: Return area search items in same order as original
...
For most situations this should make no difference, but Crusader: No Remorse
has some behavior where it relies on the items being returned in x/y scan
order, not y/x.
Particularly, in Mission 2 there is a camera which searches for an event
trigger with qlo == 5. There are 2 triggers on the map with that qlo, but the
code previously returned them in the wrong order so the correct event would not
be triggered and the game could not be continued.
This may have previously caused other subtle bugs too.
2021-05-07 12:41:51 +09:00
Matthew Duggan
a00ec35068
ULTIMA8: Fix Crusader detpac usage.
2021-05-07 10:56:37 +09:00
Matthew Duggan
014ad8f23a
ULTIMA8: Avoid possible assertion on avatar death
2021-05-07 10:56:37 +09:00
Matthew Duggan
764f310f8a
ULTIMA8: Crusader camera centre button improvement
...
The "centre on avatar" button should use the centre of the avatar, not his
feet.
2021-05-07 10:56:37 +09:00