Skip to content

Commit

Permalink
Merge branch 'mafemergency:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
FluffyGhoster authored Sep 24, 2024
2 parents c19a8f5 + 9d1fc8f commit c7e8a6b
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 4 deletions.
72 changes: 69 additions & 3 deletions prof.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,8 @@ long long unix_timestamp(void) {
#define UTRACY_PROTOCOL_0_8_2 (57)
#define UTRACY_PROTOCOL_0_9_0 (63)
#define UTRACY_PROTOCOL_0_10_0 (64)
#define UTRACY_PROTOCOL_0_11_0 (66)
#define UTRACY_PROTOCOL_0_11_1 (69)

#define UTRACY_EVT_ZONEBEGIN (15)
#define UTRACY_EVT_ZONEEND (17)
Expand Down Expand Up @@ -1903,6 +1905,56 @@ int utracy_protocol_init(int unsigned version) {
utracy.protocol.query_data_transfer_part = 15;
break;

case UTRACY_PROTOCOL_0_11_0:
utracy.protocol.zone_begin = 15;
utracy.protocol.zone_end = 17;
utracy.protocol.zone_color = 65;
utracy.protocol.thread_context = 59;
utracy.protocol.framemark = 67;

utracy.protocol.response_source_location = 71;
utracy.protocol.response_server_query_noop = 92;
utracy.protocol.response_source_code_unavail = 93;
utracy.protocol.response_symbol_code_unavail = 94;
utracy.protocol.response_string_data = 99;
utracy.protocol.response_thread_name = 100;

utracy.protocol.query_terminate = 0;
utracy.protocol.query_string = 1;
utracy.protocol.query_thread_string = 2;
utracy.protocol.query_source_location = 3;
utracy.protocol.query_disconnect = 9;
utracy.protocol.query_symbol_code = 12;
utracy.protocol.query_source_code = 13;
utracy.protocol.query_data_transfer = 14;
utracy.protocol.query_data_transfer_part = 15;
break;

case UTRACY_PROTOCOL_0_11_1:
utracy.protocol.zone_begin = 15;
utracy.protocol.zone_end = 17;
utracy.protocol.zone_color = 65;
utracy.protocol.thread_context = 59;
utracy.protocol.framemark = 67;

utracy.protocol.response_source_location = 71;
utracy.protocol.response_server_query_noop = 92;
utracy.protocol.response_source_code_unavail = 93;
utracy.protocol.response_symbol_code_unavail = 94;
utracy.protocol.response_string_data = 100;
utracy.protocol.response_thread_name = 101;

utracy.protocol.query_terminate = 0;
utracy.protocol.query_string = 1;
utracy.protocol.query_thread_string = 2;
utracy.protocol.query_source_location = 3;
utracy.protocol.query_disconnect = 9;
utracy.protocol.query_symbol_code = 12;
utracy.protocol.query_source_code = 13;
utracy.protocol.query_data_transfer = 14;
utracy.protocol.query_data_transfer_part = 15;
break;

default:
return -1;
}
Expand Down Expand Up @@ -2284,7 +2336,9 @@ int utracy_write_source_code(int unsigned id) {
break;

case UTRACY_PROTOCOL_0_9_0:
case UTRACY_PROTOCOL_0_10_0:;
case UTRACY_PROTOCOL_0_10_0:
case UTRACY_PROTOCOL_0_11_0:
case UTRACY_PROTOCOL_0_11_1:;
struct network_response_source_code msg = {
.type = utracy.protocol.response_source_code_unavail,
.id = id
Expand Down Expand Up @@ -2822,7 +2876,7 @@ void *hook(char *const restrict dst, char *const restrict src, char unsigned siz
}

#if defined(UTRACY_WINDOWS)
# define BYOND_MAX_BUILD 1637
# define BYOND_MAX_BUILD 1643
# define BYOND_MIN_BUILD 1543
# define BYOND_VERSION_ADJUSTED(a) ((a) - BYOND_MIN_BUILD)

Expand Down Expand Up @@ -2921,10 +2975,16 @@ static int unsigned const byond_offsets[][9] = {
[BYOND_VERSION_ADJUSTED(1635)] = {0x00408574, 0x00408578, 0x00408584, 0x00408594, 0x001C002C, 0x0012FE00, 0x0020AAD0, 0x001C2BD0, 0x00050606},
[BYOND_VERSION_ADJUSTED(1636)] = {0x0040860C, 0x00408610, 0x0040861C, 0x0040862C, 0x001C002C, 0x0012FFE0, 0x0020AEE0, 0x001C2F60, 0x00050606},
[BYOND_VERSION_ADJUSTED(1637)] = {0x0040860C, 0x00408610, 0x0040861C, 0x0040862C, 0x001C002C, 0x00130290, 0x0020B290, 0x001C3270, 0x00050606},
[BYOND_VERSION_ADJUSTED(1638)] = {0x0040960C, 0x00409610, 0x0040961C, 0x0040962C, 0x001C002C, 0x00130AE0, 0x0020BB10, 0x001C3AE0, 0x00050606},
[BYOND_VERSION_ADJUSTED(1639)] = {0x0040960C, 0x00409610, 0x0040961C, 0x0040962C, 0x001C002C, 0x00130AE0, 0x0020BB10, 0x001C3AE0, 0x00050606},
[BYOND_VERSION_ADJUSTED(1640)] = {0x0040960C, 0x00409610, 0x0040961C, 0x0040962C, 0x001C002C, 0x00130AA0, 0x0020BB40, 0x001C3AE0, 0x00050606},
[BYOND_VERSION_ADJUSTED(1641)] = {0x00409614, 0x00409618, 0x00409624, 0x00409634, 0x001C002C, 0x00130B20, 0x0020BA10, 0x001C3890, 0x00050606},
[BYOND_VERSION_ADJUSTED(1642)] = {0x00409614, 0x00409618, 0x00409624, 0x00409634, 0x001C002C, 0x00130B20, 0x0020BAE0, 0x001C3940, 0x00050606},
[BYOND_VERSION_ADJUSTED(1643)] = {0x0040961C, 0x00409620, 0x0040962C, 0x0040963C, 0x001C002C, 0x00130B20, 0x0020BAD0, 0x001C38E0, 0x00050606},
};

#elif defined(UTRACY_LINUX)
# define BYOND_MAX_BUILD 1637
# define BYOND_MAX_BUILD 1643
# define BYOND_MIN_BUILD 1543
# define BYOND_VERSION_ADJUSTED(a) ((a) - BYOND_MIN_BUILD)

Expand Down Expand Up @@ -3021,6 +3081,12 @@ static int unsigned const byond_offsets[][9] = {
[BYOND_VERSION_ADJUSTED(1635)] = {0x006D8798, 0x006D879C, 0x006D87B0, 0x006D87EC, 0x001C002C, 0x003220E0, 0x0030EF40, 0x00306B80, 0x00050505},
[BYOND_VERSION_ADJUSTED(1636)] = {0x006D9198, 0x006D919C, 0x006D91B0, 0x006D91EC, 0x001C002C, 0x00322D40, 0x0030FBA0, 0x003065A0, 0x00050505},
[BYOND_VERSION_ADJUSTED(1637)] = {0x006DA338, 0x006DA33C, 0x006DA350, 0x006DA38C, 0x001C002C, 0x003228B0, 0x0030FEF0, 0x003068F0, 0x00050505},
[BYOND_VERSION_ADJUSTED(1638)] = {0x006DAC58, 0x006DAC5C, 0x006DAC70, 0x006DACAC, 0x001C002C, 0x00322E00, 0x00310440, 0x00306E40, 0x00050505},
[BYOND_VERSION_ADJUSTED(1639)] = {0x006DA198, 0x006DA19C, 0x006DA1B0, 0x006DA1EC, 0x001C002C, 0x00322F10, 0x00310550, 0x00306F50, 0x00050505},
[BYOND_VERSION_ADJUSTED(1640)] = {0x006DB498, 0x006DB49C, 0x006DB4B0, 0x006DB4EC, 0x001C002C, 0x00323160, 0x003107B0, 0x003071B0, 0x00050505},
[BYOND_VERSION_ADJUSTED(1641)] = {0x006DB678, 0x006DB67C, 0x006DB690, 0x006DB6CC, 0x001C002C, 0x00322FD0, 0x00310590, 0x00306F90, 0x00050505},
[BYOND_VERSION_ADJUSTED(1642)] = {0x006DB818, 0x006DB81C, 0x006DB830, 0x006DB86C, 0x001C002C, 0x00323000, 0x003105C0, 0x00306FC0, 0x00050505},
[BYOND_VERSION_ADJUSTED(1643)] = {0x006DB618, 0x006DB61C, 0x006DB630, 0x006DB66C, 0x001C002C, 0x00322E10, 0x00310430, 0x00306E30, 0x00050505},
};

#endif
Expand Down
8 changes: 7 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ byond-tracy glues together a byond server with the tracy profiler allowing you t
## supported byond versions
| windows | linux |
| -------- | -------- |
| 515.1643 | 515.1643 |
| 515.1642 | 515.1642 |
| 515.1641 | 515.1641 |
| 515.1640 | 515.1640 |
| 515.1639 | 515.1639 |
| 515.1638 | 515.1638 |
| 515.1637 | 515.1637 |
| 515.1636 | 515.1636 |
| 515.1635 | 515.1635 |
Expand Down Expand Up @@ -53,7 +59,7 @@ byond-tracy glues together a byond server with the tracy profiler allowing you t
| 514.* | 514.* |

## supported tracy versions
`0.8.1` `0.8.2` `0.9.0` `0.9.1` `0.10.0`
`0.8.1` `0.8.2` `0.9.0` `0.9.1` `0.10.0` `0.11.0` `0.11.1`

## usage
simply call `init` from `prof.dll` to begin collecting profile data and connect using [tracy-server](https://github.com/wolfpld/tracy/releases) `Tracy.exe`
Expand Down

0 comments on commit c7e8a6b

Please sign in to comment.