I've added it to the CusPop TODO list:robert wrote:Great info! It should be added to cuspop
viewtopic.php?p=13133#p13133
I've added it to the CusPop TODO list:robert wrote:Great info! It should be added to cuspop
To show "LEVEL 13" and "LEVEL 14"robert wrote:3) What if I want the rescue level (or prince level 14) to still have time running? Because some mods have the vizier in level 14... (and to see the text "LEVEL 14" below?)
Code: Select all
seg008:25B4 or ax, ax ; level 0 doesn't show its number
seg008:25B6 jz loc_C218
seg008:25B8 cmp ax, 0Eh ; level 14 and above doesn't show its number
seg008:25BB jge loc_C218
seg008:25BD cmp word_20566, 0
seg008:25C2 jnz loc_C218
seg008:25C4 cmp ax, 0Dh ; level 13 shows level 12
seg008:25C7 jnz loc_C1EE
seg008:25C9 mov word ptr [bp+disp_level], 0Ch
Code: Select all
0000C3D4:i0BC0 or ax,ax
0000C3D6:i7440 je file:0000C418
0000C3D8:i3D0E00 cmp ax,000E
0000C3DB:i7D3B jnl file:0000C418 ; <- change to nop
0000C3DD:i833E865800 cmp (w) [+5886],+00
0000C3E2:i7534 jne file:0000C418
0000C3E4:i3D0D00 cmp ax,000D
0000C3E7:i7505 jne file:0000C3EE ; <- change to jmp
0000C3E9:iC746FE0C00 mov [bp-02],000C
Code: Select all
seg008:24BC cmp current_level, 0Dh ; level 13
seg008:24C1 jg loc_C142
seg008:24C3 jnz loc_C0EC
seg008:24C5 cmp leveldoor_open?, 0 ; Jaffar died?
seg008:24CA jnz loc_C142
Code: Select all
0000C2DC:i833E9E0F0D cmp (w) [+0F9E],+0D
0000C2E1:i7F5F jg file:0000C342
0000C2E3:i7507 jne file:0000C2EC
0000C2E5:i833E9C4000 cmp (w) [+409C],+00
0000C2EA:i7556 jne file:0000C342
Amazing info! Many thanks DavidDavid wrote:To show "LEVEL 13" and "LEVEL 14"robert wrote:3) What if I want the rescue level (or prince level 14) to still have time running? Because some mods have the vizier in level 14... (and to see the text "LEVEL 14" below?)
Code: Select all
seg008:25B4 or ax, ax ; level 0 doesn't show its number seg008:25B6 jz loc_C218 seg008:25B8 cmp ax, 0Eh ; level 14 and above doesn't show its number seg008:25BB jge loc_C218 seg008:25BD cmp word_20566, 0 seg008:25C2 jnz loc_C218 seg008:25C4 cmp ax, 0Dh ; level 13 shows level 12 seg008:25C7 jnz loc_C1EE seg008:25C9 mov word ptr [bp+disp_level], 0Ch
search 3D 0E 00 7D 3B , change 7D 3B to 90 90 -or- 0E to 0F (first level that doesn't show its number)Code: Select all
0000C3D4:i0BC0 or ax,ax 0000C3D6:i7440 je file:0000C418 0000C3D8:i3D0E00 cmp ax,000E 0000C3DB:i7D3B jnl file:0000C418 ; <- change to nop 0000C3DD:i833E865800 cmp (w) [+5886],+00 0000C3E2:i7534 jne file:0000C418 0000C3E4:i3D0D00 cmp ax,000D 0000C3E7:i7505 jne file:0000C3EE ; <- change to jmp 0000C3E9:iC746FE0C00 mov [bp-02],000C
search 3D 0D 00 75 05 , change 75 to EB (show level 13 (and not level 12) on level 13)
To have level 14 the time running, and make Jaffar's death there stop the time:
Code: Select all
seg008:24BC cmp current_level, 0Dh ; level 13 seg008:24C1 jg loc_C142 seg008:24C3 jnz loc_C0EC seg008:24C5 cmp leveldoor_open?, 0 ; Jaffar died? seg008:24CA jnz loc_C142
search 83 3E 9E 0F 0D 7F 5F , change 0D to 0ECode: Select all
0000C2DC:i833E9E0F0D cmp (w) [+0F9E],+0D 0000C2E1:i7F5F jg file:0000C342 0000C2E3:i7507 jne file:0000C2EC 0000C2E5:i833E9C4000 cmp (w) [+409C],+00 0000C2EA:i7556 jne file:0000C342
Note: You also need to change the level in the "Customize Jaffar/guard death: blinking and event trigger" category in CusPoP.
I looked into this. It seems that the problem is caused by that the room is linked to itself on the left side.Norbert wrote:Something I ran into while working on Prince of Wateria that I cannot yet explain: in level 2, the two gates in room 10 do not make a sound when slowly going down.
In the original game, when I put gates at these two locations, they do make the normal sound when slowly going down. Strange...
Code: Select all
seg007:1669 ; int __stdcall far play_door_sound_if_visible(int sound_id)
seg007:1669 play_door_sound_if_visible proc far ; CODE XREF: animate_door+83p
seg007:1669 ; gate_reached_top+Ap
seg007:1669
seg007:1669 gate_room = word ptr -6
seg007:1669 tile_pos = word ptr -4
seg007:1669 has_sound = word ptr -2
seg007:1669 sound_id = word ptr 6
seg007:1669
seg007:1669 push bp
seg007:166A mov bp, sp
seg007:166C sub sp, 6
seg007:166F mov al, trob_tile
seg007:1672 sub ah, ah
seg007:1674 mov [bp+tile_pos], ax
seg007:1677 mov al, trob_room
seg007:167A mov [bp+gate_room], ax
seg007:167D mov [bp+has_sound], 0
seg007:1682 cmp current_level, 3 ; Special event: sound of closing gates
seg007:1687 jnz loc_9BDE
seg007:1689 cmp ax, 2 ; room 2
seg007:168C jz sound_yes
seg007:168E
seg007:168E loc_9BDE: ; CODE XREF: play_door_sound_if_visible+1Ej
seg007:168E mov ax, room_L
seg007:1691 cmp [bp+gate_room], ax
seg007:1694 jnz loc_9BF6
seg007:1696 mov ax, [bp+tile_pos]
seg007:1699 cwd
seg007:169A mov cx, 0Ah
seg007:169D idiv cx
seg007:169F cmp dx, 9 ; right edge of the room to the left: play sound
seg007:16A2 jnz sound_no ; elsewhere in the room to the left: no sound
seg007:16A4 jmp short sound_yes
seg007:16A6 ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
seg007:16A6
seg007:16A6 loc_9BF6: ; CODE XREF: play_door_sound_if_visible+2Bj
seg007:16A6 mov ax, drawn_room
seg007:16A9 cmp [bp+gate_room], ax
seg007:16AC jnz sound_no
seg007:16AE mov ax, [bp+tile_pos]
seg007:16B1 cwd
seg007:16B2 mov cx, 0Ah
seg007:16B5 idiv cx
seg007:16B7 cmp dx, 9 ; right edge of this room: no sound
seg007:16BA jz sound_no ; elsewhere in this room: play sound
seg007:16BC
seg007:16BC sound_yes: ; CODE XREF: play_door_sound_if_visible+23j
seg007:16BC ; play_door_sound_if_visible+3Bj
seg007:16BC mov [bp+has_sound], 1
seg007:16C1
seg007:16C1 sound_no: ; CODE XREF: play_door_sound_if_visible+39j
seg007:16C1 ; play_door_sound_if_visible+43j ...
seg007:16C1 cmp [bp+has_sound], 0
seg007:16C5 jz loc_9C1F
seg007:16C7 push [bp+sound_id] ; resource
seg007:16CA call play_sound
seg007:16CF
seg007:16CF loc_9C1F: ; CODE XREF: play_door_sound_if_visible+5Cj
seg007:16CF mov sp, bp
seg007:16D1 pop bp
seg007:16D2 retf 2
seg007:16D2 play_door_sound_if_visible endp
Code: Select all
0000B469:i55 push bp
0000B46A:i8BEC mov bp,sp
0000B46C:i83EC06 sub (w) sp,+06
0000B46F:iA0BC4C mov al,[+4CBC]
0000B472:i2AE4 sub ah,ah
0000B474:i8946FC mov [bp-04],ax
0000B477:iA0BD4C mov al,[+4CBD]
0000B47A:i8946FA mov [bp-06],ax
0000B47D:iC746FE0000 mov [bp-02],0000
0000B482:i833E9E0F03 cmp (w) [+0F9E],+03
0000B487:i7505 jne file:0000B48E
0000B489:i3D0200 cmp ax,0002
0000B48C:i742E je file:0000B4BC
0000B48E:iA1C04C mov ax,[+4CC0]
0000B491:i3946FA cmp [bp-06],ax
0000B494:i7510 jne file:0000B4A6
0000B496:i8B46FC mov ax,[bp-04]
0000B499:i99 cwd
0000B49A:iB90A00 mov cx,000A
0000B49D:iF7F9 idiv (w) cx
0000B49F:i83FA09 cmp (w) dx,+09
0000B4A2:i751D jne file:0000B4C1 ; <- this has to be changed
0000B4A4:iEB16 jmps file:0000B4BC
0000B4A6:iA19E40 mov ax,[+409E]
0000B4A9:i3946FA cmp [bp-06],ax
0000B4AC:i7513 jne file:0000B4C1
0000B4AE:i8B46FC mov ax,[bp-04]
0000B4B1:i99 cwd
0000B4B2:iB90A00 mov cx,000A
0000B4B5:iF7F9 idiv (w) cx
0000B4B7:i83FA09 cmp (w) dx,+09
0000B4BA:i7405 je file:0000B4C1
0000B4BC:iC746FE0100 mov [bp-02],0001
0000B4C1:i837EFE00 cmp (w) [bp-02],+00
0000B4C5:i7408 je file:0000B4CF
0000B4C7:iFF7606 push (w) [bp+06]
0000B4CA:i9AC5120000 callf file:000012C5
0000B4CF:i8BE5 mov sp,bp
0000B4D1:i5D pop bp
0000B4D2:iCA0200 retf 0002
Code: Select all
seg007:0999 ; int __stdcall far trigger_1(int button_type,int tile,int room,int target_type)
seg007:0999 trigger_1 proc far ; CODE XREF: do_trigger_list+3A↓p
seg007:0999
seg007:0999 result = word ptr -2
seg007:0999 button_type = word ptr 6
seg007:0999 tile = word ptr 8
seg007:0999 room = word ptr 0Ah
seg007:0999 target_type = word ptr 0Ch
seg007:0999
seg007:0999 push bp
seg007:099A mov bp, sp
seg007:099C sub sp, 2
seg007:099F push si
seg007:09A0 mov [bp+result], 0FFFFh
seg007:09A5 cmp [bp+target_type], tiles_4_gate ; gate
seg007:09A9 jnz loc_8F0D
seg007:09AB push [bp+room] ; room
seg007:09AE push [bp+tile] ; tile
seg007:09B1 push [bp+button_type] ; button_type
seg007:09B4 push cs
seg007:09B5 call near ptr trigger_gate
seg007:09B8 mov [bp+result], ax
seg007:09BB jmp short loc_8F2B
seg007:09BD ; ───────────────────────────────────────────────────────────────────────────
seg007:09BD
seg007:09BD loc_8F0D: ; CODE XREF: trigger_1+10↑j
seg007:09BD cmp [bp+target_type], tiles_16_level_door_left ; level door
seg007:09C1 jnz loc_8F2B
seg007:09C3 mov bx, [bp+tile]
seg007:09C6 mov si, addr_modif
seg007:09CA cmp byte ptr [bx+si], 0
seg007:09CD jz loc_8F26
seg007:09CF mov [bp+result], 0FFFFh
seg007:09D4 jmp short loc_8F2B
seg007:09D6 ; ───────────────────────────────────────────────────────────────────────────
seg007:09D6
seg007:09D6 loc_8F26: ; CODE XREF: trigger_1+34↑j
seg007:09D6 mov [bp+result], 1
seg007:09DB
seg007:09DB loc_8F2B: ; CODE XREF: trigger_1+22↑j
seg007:09DB ; trigger_1+28↑j ...
seg007:09DB mov ax, [bp+result]
seg007:09DE pop si
seg007:09DF mov sp, bp
seg007:09E1 pop bp
seg007:09E2 retf 8
seg007:09E2 trigger_1 endp
Code: Select all
000090E9:i55 push bp
000090EA:i8BEC mov bp,sp
000090EC:i83EC02 sub (w) sp,+02
000090EF:i56 push si
000090F0:iC746FEFFFF mov [bp-02],FFFF
000090F5:i837E0C04 cmp (w) [bp+0C],+04
000090F9:i7512 jne file:0000910D
000090FB:iFF760A push (w) [bp+0A]
000090FE:iFF7608 push (w) [bp+08]
00009101:iFF7606 push (w) [bp+06]
00009104:i0E push cs
00009105:iE874FF calln file:0000907C
00009108:i8946FE mov [bp-02],ax
0000910B:iEB1E jmps file:0000912B
0000910D:i837E0C10 cmp (w) [bp+0C],+10
00009111:i7518 jne file:0000912B ; <-- here
00009113:i8B5E08 mov bx,[bp+08]
00009116:i8B36885F mov si,[+5F88]
0000911A:i803800 cmp [bx+si],00
0000911D:i7407 je file:00009126
0000911F:iC746FEFFFF mov [bp-02],FFFF
00009124:iEB05 jmps file:0000912B
00009126:iC746FE0100 mov [bp-02],0001
0000912B:i8B46FE mov ax,[bp-02]
0000912E:i5E pop si
0000912F:i8BE5 mov sp,bp
00009131:i5D pop bp
00009132:iCA0800 retf 0008
This is great.David wrote:In addition to gates and level doors, you will be able to trigger spikes, chompers and loose floors (but not buttons).
Certain combinations of buttons have some effect though.David wrote:In addition to gates and level doors, you will be able to trigger spikes, chompers and loose floors (but not buttons).
Ah, now I know what happens: the triggered tile must have modifier=0. (That is event 1 in Apoplexy.)Norbert wrote:Or simply create a raise button with event 2 (a) and point it to a drop button with event 1 (b), then stand on a.
I'm running into a problem with this, because certain events in a chain of events aren't being fired.David wrote:Allow triggering of any tile
[...]
search: 83 7E 0C 10 75 18, change 75 18 to 90 90
Thanks, I'll make sure to fix that.David wrote:The real solution would be to change that byte (the last room of the level) to 24. In Apoplexy it is sUnknownI[0].
I no longer have the file, and I just tried to reproduce the problem but now I no longer run into it.David wrote:I couldn't reproduce the bug. [...] Maybe you could send me the level?