git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 5194a41d9997a1f21d2a8d99b6a2cb98d64c3434
parent 7efd26c548f3ce1f1969a53c7ce5b1ed96a42f7b
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Sun, 28 Aug 2022 16:48:20 +0300

Slight improvements to symbol hash performance

Diffstat:
MCore/symbol_hash.c8++++----
MCore/symbol_hash.h2+-
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Core/symbol_hash.c b/Core/symbol_hash.c @@ -77,13 +77,13 @@ static unsigned hash_name(const char *name) unsigned r = 0; while (*name) { r <<= 1; - if (r & 0x400) { - r ^= 0x401; + if (r & 0x2000) { + r ^= 0x2001; } - r += (unsigned char)*(name++); + r ^= (unsigned char)*(name++); } - return r & 0x3FF; + return r; } void GB_reversed_map_add_symbol(GB_reversed_symbol_map_t *map, uint16_t bank, GB_bank_symbol_t *bank_symbol) diff --git a/Core/symbol_hash.h b/Core/symbol_hash.h @@ -23,7 +23,7 @@ typedef struct { } GB_symbol_map_t; typedef struct { - GB_symbol_t *buckets[0x400]; + GB_symbol_t *buckets[0x2000]; } GB_reversed_symbol_map_t; #ifdef GB_INTERNAL

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.