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
182 lines
4.0 KiB
C
182 lines
4.0 KiB
C
/* Ppmd8.h -- Ppmd8 (PPMdI) compression codec
|
|
2021-04-13 : Igor Pavlov : Public domain
|
|
This code is based on:
|
|
PPMd var.I (2002): Dmitry Shkarin : Public domain
|
|
Carryless rangecoder (1999): Dmitry Subbotin : Public domain */
|
|
|
|
#ifndef __PPMD8_H
|
|
#define __PPMD8_H
|
|
|
|
#include "Ppmd.h"
|
|
|
|
EXTERN_C_BEGIN
|
|
|
|
#define PPMD8_MIN_ORDER 2
|
|
#define PPMD8_MAX_ORDER 16
|
|
|
|
|
|
|
|
|
|
struct CPpmd8_Context_;
|
|
|
|
typedef Ppmd_Ref_Type(struct CPpmd8_Context_) CPpmd8_Context_Ref;
|
|
|
|
// MY_CPU_pragma_pack_push_1
|
|
|
|
typedef struct CPpmd8_Context_
|
|
{
|
|
Byte NumStats;
|
|
Byte Flags;
|
|
|
|
union
|
|
{
|
|
UInt16 SummFreq;
|
|
CPpmd_State2 State2;
|
|
} Union2;
|
|
|
|
union
|
|
{
|
|
CPpmd_State_Ref Stats;
|
|
CPpmd_State4 State4;
|
|
} Union4;
|
|
|
|
CPpmd8_Context_Ref Suffix;
|
|
} CPpmd8_Context;
|
|
|
|
// MY_CPU_pragma_pop
|
|
|
|
#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->Union2)
|
|
|
|
/* PPMdI code rev.2 contains the fix over PPMdI code rev.1.
|
|
But the code PPMdI.2 is not compatible with PPMdI.1 for some files compressed
|
|
in FREEZE mode. So we disable FREEZE mode support. */
|
|
|
|
// #define PPMD8_FREEZE_SUPPORT
|
|
|
|
enum
|
|
{
|
|
PPMD8_RESTORE_METHOD_RESTART,
|
|
PPMD8_RESTORE_METHOD_CUT_OFF
|
|
#ifdef PPMD8_FREEZE_SUPPORT
|
|
, PPMD8_RESTORE_METHOD_FREEZE
|
|
#endif
|
|
, PPMD8_RESTORE_METHOD_UNSUPPPORTED
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
{
|
|
CPpmd8_Context *MinContext, *MaxContext;
|
|
CPpmd_State *FoundState;
|
|
unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder, RestoreMethod;
|
|
Int32 RunLength, InitRL; /* must be 32-bit at least */
|
|
|
|
UInt32 Size;
|
|
UInt32 GlueCount;
|
|
UInt32 AlignOffset;
|
|
Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;
|
|
|
|
UInt32 Range;
|
|
UInt32 Code;
|
|
UInt32 Low;
|
|
union
|
|
{
|
|
IByteIn *In;
|
|
IByteOut *Out;
|
|
} Stream;
|
|
|
|
Byte Indx2Units[PPMD_NUM_INDEXES + 2]; // +2 for alignment
|
|
Byte Units2Indx[128];
|
|
CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES];
|
|
UInt32 Stamps[PPMD_NUM_INDEXES];
|
|
Byte NS2BSIndx[256], NS2Indx[260];
|
|
Byte ExpEscape[16];
|
|
CPpmd_See DummySee, See[24][32];
|
|
UInt16 BinSumm[25][64];
|
|
|
|
} CPpmd8;
|
|
|
|
|
|
void Ppmd8_Construct(CPpmd8 *p);
|
|
BoolInt Ppmd8_Alloc(CPpmd8 *p, UInt32 size, ISzAllocPtr alloc);
|
|
void Ppmd8_Free(CPpmd8 *p, ISzAllocPtr alloc);
|
|
void Ppmd8_Init(CPpmd8 *p, unsigned maxOrder, unsigned restoreMethod);
|
|
#define Ppmd8_WasAllocated(p) ((p)->Base != NULL)
|
|
|
|
|
|
/* ---------- Internal Functions ---------- */
|
|
|
|
#define Ppmd8_GetPtr(p, ptr) Ppmd_GetPtr(p, ptr)
|
|
#define Ppmd8_GetContext(p, ptr) Ppmd_GetPtr_Type(p, ptr, CPpmd8_Context)
|
|
#define Ppmd8_GetStats(p, ctx) Ppmd_GetPtr_Type(p, (ctx)->Union4.Stats, CPpmd_State)
|
|
|
|
void Ppmd8_Update1(CPpmd8 *p);
|
|
void Ppmd8_Update1_0(CPpmd8 *p);
|
|
void Ppmd8_Update2(CPpmd8 *p);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define Ppmd8_GetBinSumm(p) \
|
|
&p->BinSumm[p->NS2Indx[(size_t)Ppmd8Context_OneState(p->MinContext)->Freq - 1]] \
|
|
[ p->PrevSuccess + ((p->RunLength >> 26) & 0x20) \
|
|
+ p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
|
|
+ p->MinContext->Flags ]
|
|
|
|
|
|
CPpmd_See *Ppmd8_MakeEscFreq(CPpmd8 *p, unsigned numMasked, UInt32 *scale);
|
|
|
|
|
|
/* 20.01: the original PPMdI encoder and decoder probably could work incorrectly in some rare cases,
|
|
where the original PPMdI code can give "Divide by Zero" operation.
|
|
We use the following fix to allow correct working of encoder and decoder in any cases.
|
|
We correct (Escape_Freq) and (_sum_), if (_sum_) is larger than p->Range) */
|
|
#define PPMD8_CORRECT_SUM_RANGE(p, _sum_) if (_sum_ > p->Range /* /1 */) _sum_ = p->Range;
|
|
|
|
|
|
/* ---------- Decode ---------- */
|
|
|
|
#define PPMD8_SYM_END (-1)
|
|
#define PPMD8_SYM_ERROR (-2)
|
|
|
|
/*
|
|
You must set (CPpmd8::Stream.In) before Ppmd8_RangeDec_Init()
|
|
|
|
Ppmd8_DecodeSymbol()
|
|
out:
|
|
>= 0 : decoded byte
|
|
-1 : PPMD8_SYM_END : End of payload marker
|
|
-2 : PPMD8_SYM_ERROR : Data error
|
|
*/
|
|
|
|
|
|
BoolInt Ppmd8_Init_RangeDec(CPpmd8 *p);
|
|
#define Ppmd8_RangeDec_IsFinishedOK(p) ((p)->Code == 0)
|
|
int Ppmd8_DecodeSymbol(CPpmd8 *p);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ---------- Encode ---------- */
|
|
|
|
#define Ppmd8_Init_RangeEnc(p) { (p)->Low = 0; (p)->Range = 0xFFFFFFFF; }
|
|
void Ppmd8_Flush_RangeEnc(CPpmd8 *p);
|
|
void Ppmd8_EncodeSymbol(CPpmd8 *p, int symbol);
|
|
|
|
|
|
EXTERN_C_END
|
|
|
|
#endif
|