fixed chicken messages
[snoogans.git] / stubs.S
blobb15052c6afee87b37b1efd54017c855736c712ff
2 #  Copyright (C) 2010 gonzoj
4 #  Please check the CREDITS file for further information.
6 #  This program is free software: you can redistribute it and/or modify
7 #  it under the terms of the GNU General Public License as published by
8 #  the Free Software Foundation, either version 3 of the License, or
9 #  (at your option) any later version.
11 #  This program is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #  GNU General Public License for more details.
16 #  You should have received a copy of the GNU General Public License
17 #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 .section .text
22 # assembly stubs for hooking
24 .globl draw_ingame_STUB
26 .globl draw_automap_STUB
28 .globl draw_message_log_STUB
30 .globl view_inventory_patch_1
31 .globl view_inventory_patch_2
32 .globl view_inventory_patch_3
34 .globl item_name_patch_STUB
36 .type draw_ingame_STUB, @function
37 draw_ingame_STUB:
39         call draw_ingame
40         pop %esi
41         pop %ebx
42         pop %ecx
43         ret $0x4
45 .type draw_automap_STUB, @function
46 draw_automap_STUB:
48         call draw_automap
49         pop %edi
50         pop %esi
51         ret
53 .type draw_message_log_STUB, @function
54 draw_message_log_STUB:
56         # call draw_message_log
57         pop %edi
58         pop %esi
59         pop %ebp
60         add $0x800, %esp
61         ret $0x10
63 .type view_inventory_patch_1, @function
64 view_inventory_patch_1:
66         push %eax
67         call view_inventory_patch
68         mov %eax, %esi
69         pop %eax
70         ret
72 .type view_inventory_patch_2, @function
73 view_inventory_patch_2:
75         push %eax;
76         call get_view_unit
77         mov %eax, %ebx
78         pop %eax
79         ret
81 .type view_inventory_patch_3, @function
82 view_inventory_patch_3:
84         push %eax
85         push %ebx
86         call get_view_unit
87         movl (%edi), %ebx
88         cmp $1, %ebx
89         je old_code
91         mov %eax, %edi
93         old_code:
94         pop %ebx
95         pop %eax
96         test %eax, %eax
97         movl 0x60(%edi), %ecx
99         ret
101 .type item_name_patch_STUB, @function
102 item_name_patch_STUB:
104         mov %ebx, %ecx
105         mov %edi, %edx
106         call item_name_patch
107         mov 0x12a(%ebp), %al
108         ret