00cc9309cb
de6e324bdseparate emu thread10d3daf86Roms List improvements95d202f37Let's make the rom list process on a separate thread so the emulator doesnt take ages to load.fc306967fWow the ROM Header was just completely busted. Game list view works nowbad1691eefuck this shit2b59e5f46game list in progressd26417b83remappable inputs in progressac4af8106inpute72abc240update readme430139dc9Qt6 frontend3080d4d45Fix this small bug too08cd13b85Cop0 unused functions do not actually pose a threat (as per manual). They don't do anything, so shall we.61bb4fb44make idle loop detection a little more specific with where the load goesb037de4c3SAZDFsdff12e81e73eneed to figure out why n64-systemtest loops indefinitely at some address that appears to be valid (i think it's me not invalidating the cache properly)204f0e13bidle skipping seems to work!cb8bb634asdkfjlasdf58e5c89c1Fix compilation issue on my machine (no idea)24fb2898eattempting more serious idle skipping214719577Place rsp.Step inside cached interpreter. Gains about 3 more fpsbb97dcc23mmmmm920b77d38wjkhasdfjhkasdf430ccdab4it's a start...4f42a673aCached interpreter plays Mario 64. Start looking into RSP as wellc9a030787idle skipping works!5fbda03cenew idea366637abaIdle skipping... maybe?609fa2fb0Cache instructions implemented but broken lmao. Commented out for nowe140a6d12- Stop using inheritance for CPU, instead use composition. - Introduce KAIZEN_JIT_ENABLED optional define instead of relying on __aarch64__ and the like. - More cache work68e613057prep cache impl811b4d809fix clang formatfda755f7didkd5024ebbfsmall MI refactor in preparation of (eventually) implementing the RDRAM interface properly694b45341Merge commit '206dcdedf195fb320913584180edb12c7731e396' as 'external/SDL'206dcdedfSquashed 'external/SDL/' content from commit 4d17b99d0a4d16e1cb4need to update sdl848b19920Fix compilation errordb61b5299Merge commit 'e94a94559f28e49678fbcf72199a5258137b0fe9' as 'external/imgui'e94a94559Squashed 'external/imgui/' content from commit 02e9b8cac52edb3757need to update imguic1a705e86Emulate weird JALR behaviour4b4c32f4bFix exception for "unusable COP1" in 4 instructions i missed accidentally (again)df5828142Bug putting 0s in the log everywheref8b580048Make isviewer a sink to file8241e9735Fix exception for "unusable COP1" in 4 instructions i missed accidentallyb29715f20small changesd9a620bc1make use of my new small utility library0d1aa938eAdd 'external/ircolib/' from commit 'ce3cd726c8df8388d554abf8bb55d55020eb4450'e64eb40b3Fuck git git-subtree-dir: external/ircolib git-subtree-split:de6e324bde
89 lines
3.1 KiB
C
89 lines
3.1 KiB
C
/* Copyright 2015 the unarr project authors (see AUTHORS file).
|
|
License: LGPLv3 */
|
|
|
|
/* adapted from https://code.google.com/p/theunarchiver/source/browse/XADMaster/LZSS.h */
|
|
|
|
#ifndef rar_lzss_h
|
|
#define rar_lzss_h
|
|
|
|
#include <stdlib.h>
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <string.h>
|
|
|
|
#if defined(_MSC_VER) && !defined(inline)
|
|
#define inline __inline
|
|
#endif
|
|
|
|
typedef struct {
|
|
uint8_t *window;
|
|
int mask;
|
|
int64_t position;
|
|
} LZSS;
|
|
|
|
static inline int64_t lzss_position(LZSS *self) { return self->position; }
|
|
|
|
static inline int lzss_mask(LZSS *self) { return self->mask; }
|
|
|
|
static inline int lzss_size(LZSS *self) { return self->mask + 1; }
|
|
|
|
static inline uint8_t *lzss_window_pointer(LZSS *self) { return self->window; }
|
|
|
|
static inline int lzss_offset_for_position(LZSS *self, int64_t pos) { return (int)(pos & self->mask); }
|
|
|
|
static inline uint8_t *lzss_window_pointer_for_position(LZSS *self, int64_t pos) { return &self->window[lzss_offset_for_position(self, pos)]; }
|
|
|
|
static inline int lzss_current_window_offset(LZSS *self) { return lzss_offset_for_position(self, self->position); }
|
|
|
|
static inline uint8_t *lzss_current_window_pointer(LZSS *self) { return lzss_window_pointer_for_position(self, self->position); }
|
|
|
|
static inline int64_t lzss_next_window_edge_after_position(LZSS *self, int64_t pos) { return (pos + lzss_size(self)) & ~(int64_t)lzss_mask(self); }
|
|
|
|
static inline int64_t lzss_next_window_edge(LZSS *self) { return lzss_next_window_edge_after_position(self, self->position); }
|
|
|
|
static inline uint8_t lzss_get_byte_from_window(LZSS *self, int64_t pos) { return *lzss_window_pointer_for_position(self, pos); }
|
|
|
|
static inline void lzss_emit_literal(LZSS *self, uint8_t literal) {
|
|
/* self->window[(self->position & self->mask)] = literal; */
|
|
*lzss_current_window_pointer(self) = literal;
|
|
self->position++;
|
|
}
|
|
|
|
static inline void lzss_emit_match(LZSS *self, int offset, int length) {
|
|
int windowoffs = lzss_current_window_offset(self);
|
|
int i;
|
|
for (i = 0; i < length; i++) {
|
|
self->window[(windowoffs + i) & lzss_mask(self)] = self->window[(windowoffs + i - offset) & lzss_mask(self)];
|
|
}
|
|
self->position += length;
|
|
}
|
|
|
|
static inline void lzss_copy_bytes_from_window(LZSS *self, uint8_t *buffer, int64_t startpos, int length) {
|
|
int windowoffs = lzss_offset_for_position(self, startpos);
|
|
int firstpart = lzss_size(self) - windowoffs;
|
|
if (length <= firstpart) {
|
|
/* Request fits inside window */
|
|
memcpy(buffer, &self->window[windowoffs], length);
|
|
}
|
|
else {
|
|
/* Request wraps around window */
|
|
memcpy(buffer, &self->window[windowoffs], firstpart);
|
|
memcpy(buffer + firstpart, &self->window[0], length - firstpart);
|
|
}
|
|
}
|
|
|
|
static inline bool lzss_initialize(LZSS *self, int windowsize) {
|
|
self->window = malloc(windowsize);
|
|
if (!self->window)
|
|
return false;
|
|
|
|
self->mask = windowsize - 1; /* Assume windows are power-of-two sized! */
|
|
memset(self->window, 0, lzss_size(self));
|
|
self->position = 0;
|
|
return true;
|
|
}
|
|
|
|
static inline void lzss_cleanup(LZSS *self) { free(self->window); }
|
|
|
|
#endif
|