Changelog:
Changed loadstate_slot function to keep only 5 latest backups when saving curring state before loading.
Once more than 5 exist, oldest one will be overwritten.
Fixed bug when writing index, set default max to 200
Added configuration option to define number of max number of backups.Windows only at the moment.
Added check that index file was actually openned for writing.If not, skip creating backup part of loading.
check gameCode==#### for homebrew
fix support link in help menu
update make_scmrev.h.js for modern times by searching for 64bit git on 32bit msbuild/devenv
bump version to 0.9.14 for future interim builds.
Cocoa Port: Update version number to support version bump from commit 60714f6.
GFX3D: The position test and the vector test are now performed usingfixed-point instead of floating-point.
GFX3D: GEM_TransformVertex() now uses the SIMD-optimized generic matrix functions instead of using its own scalar-only version.
– This change results in a small, yet measurable, performance improvement.
– Note that this change has the side-effect of enabling saturation logic for the following functions: MatrixMultVec3x3(), MatrixTranslate(), MatrixScale(). This is a change in their behavior, since these functions did not perform saturation logic before. This will need additional testing.
JIT (ARM): Make the code a little more portable, and also silence a couple compiler warnings.
GFX3D: The box test now partially works in fixed-point.- Specifically, the vertex calculations are performed using fixed-point. However, clipping still occurs using floating-point.
Fixed GBA SRAMPath in posix CLI
Merge pull request #537 from colton5007/patch-1Fixed GBA SRAMPath in posix CLI
Cocoa Port: When dealing with file paths, replace instances of [NSString cStringUsingEncoding:NSUTF8StringEncoding] with [NSString fileSystemRepresentation] and [NSFileManager stringWithFileSystemRepresentation:].
– This commit doesn’t actually do anything, but it is the “proper” way for Apple OSes to deal with file paths that interact with lower-level C file functions.
Fix Linux CLI keyboard input bug due to mismatched types
CLI: Re-work KEYDOWN handling to allow both shift keys as control inputsRight Shift is the default for Select key.
attempt to fix some problems caused by users running desmume out of directories with non-english characters (could manifest as “could not get read/write access to the battery save file”)
sampcnt/sampinc as .32fxp, add catmull-spline interpolation
fix PSG square waveWas reading the wrong part of GBATek
attempt to fix for macos
fix broken adpcm
Split 64bit counters into 2x32bitThis appears to generate slightly saner code
tighter bounds on interpolation accuracy
fix overflow problemsCatmull-Rom can give outputs greater than 16bit, so we must use 15bit precision. Also, ensure to use floor() to force a round-down regardless of host rounding behaviour.
Merge pull request #546 from Aikku93/spu-enhanced-interpolationEnhanced interpolation, and fixed-point sample positions
Merge pull request #532 from Aikku93/patch-3Check gameCode==#### for homebrew
Fix compiling on GCC for AArch64. Fixes #548.
Remove AltiVec compiling for ppcle and ppc64le architectures, since our AltiVec code only works on big-endian systems anyways. Fixes #550.
libretro-common: Compiling tune-up for ARM architectures.- Fixes a mismatched register warning in arm_enable_runfast_mode() when compiling for AArch64.
– Fix compiling check_arm_cpu_feature() on non-ARM architectures by being super explicit and pedantic about checking for __ARM_ARCH; none of this compiler-assumes-a-macro-equals-zero-if-undefined stuff.
Fix yet another compiling issue on GCC for AArch64. Fixes #556.
Preemptively fix a compiling issue for AltiVec systems when using GCCwithout running keyword-and-predefine mode.
gtk3/gtk2: fix mismatched types for keyboard config temp storagefallout from c68cc14, closes #558
Fix use of internal storage of temporary bufferThe entry index gets converted to a (temporary) string, from which a
pointer to internal data is taken and only consumed outside the loop,
where parent variable no longer exists.
Fix #563: mismatched buffer sizes for memcpy
Merge pull request #564 from janisozaur/fix-use-of-internal-bufferFix use of internal storage of temporary buffer
Merge pull request #566 from janisozaur/patch-1Fix #563: mismatched buffer sizes for memcpy
posix: properly fix size mismatch of keyboard/joystick_cfg arraysfixes #563
unlike #566, this also fixes the gtk2 frontend automatically.
CI: add build job for linux/GTK2
CI: also upload linux cli/gtk2 build artifact
Remove self-reference in variable declaration
Merge pull request #569 from janisozaur/patch-3Remove self-reference in variable declaration
FIFO.cpp: Code cleanup; remove AltiVec-specific code from display FIFO, as it is no longer needed.
– The new code works by pre-swapping big-endian words on disp_fifo.buf write, rather than swapping the big-endian words during disp_fifo.buf read.
– There is a behavior change here. Before, 8-bit and 16-bit writes to disp_fifo.buf would increment disp_fifo.tail. Now, 8-bit and 16-bit writes only increment disp_fifo.tail when the most significant bit within the FIFO value’s 32-bit boundary is written to.
– Behavior is unchanged when doing 32-bit writes. In practice, the rare games that use display FIFO have only ever done 32-bit writes, so this scenario is well tested.
make hud editor actually save position (fixes #572)
Update default joystick cofiguration size in line with #567
Merge pull request #575 from janisozaur/update-default-joystick-sizeUpdate default joystick cofiguration size in line with #567
Merge pull request #523 from Keppl/backup_saves_max_patchLimit maximum number of backups files for load state backup
saves.cpp: Fix compiling issue for all non-Windows platforms. (Regression from commit 3a6c8cf.)
Cocoa Port: Fix HUD rendering on the OpenGL blitter for GPUs that don’t support shaders.
Fix division edge cases and prevent crash
Merge pull request #602 from KellanClark/masterFix division edge cases and prevent crash
winport – fix issues with save/load state to japanese filename (fixes #615)
crude hack to fix problem where loadstate could crash if the GPU hasn’t ever booted up. see TODO TODO TODO TODO in gfx3d.cpp — somebody needs to revise the tables so they arent memory mapped but so that they work rather like shininess tables. if they aren’t truly latched when the gpu is flushed, then put them in a table anyway and simply reference the live values instead of the latched ones. How to keep from accidentally referencing the latched ones? perhaps the 3d state could be divided into a latched part and an unlatched part via base classes. Could also be done by embedding a “latched” and “unlatched” struct in the gpu but that would involve touching every line of code that used something from it.
Add support for page-aligned variables/arrays.- Better account for UltraSPARC’s unique memory page size.
– malloc_alignedCacheLine() no longer returns 16-byte aligned memory if the architecture is neither 32-bit or 64-bit. Now, the function only returns 64-byte alignment for 64-bit architectures OR 32-byte alignment for 32-bit architectures.
Colorspace Handler: FragmentColor may now be accessed through a 4-element array, in which elements 0-1-2-3 represent color components R-G-B-A, respectively.
Add mac address setting
Merge pull request #627 from RainingChain/fwSettingsMacAddressAdd mac address setting
GFX3D: Render states and geometry lists are now copied/swapped more consistently on flush. (Related to commit 8438a5a.)
– Viewports are now processed on VIEWPORT register write instead of being processed at render time.
– CLEAR_DEPTH, CLRIMAGE_OFFSET, EDGE_COLOR, FOG_TABLE, and TOON_TABLE register writes are now handled more consistently.
– The fogDensityTable check for force-drawing clear images in gfx3d_VBlankEndSignal() has been removed. Changes done in commit 8438a5a will always causes this check to fail, and this commit will always cause this check to fail. Therefore, this check is now obsolete.
– Change a bunch of GFX3D-related structs from C++ style constructed structs into C-style POD structs.
SoftRasterizer: Fix compiling issue for non-SSE2 systems. (Regressionfrom commit 5426509.)
Fix a few compiler warningswarning: use of bitwise ‘&’ with boolean operands [-Wbitwise-instead-of-logical]
Reported by clang 15.
Merge pull request #628 from radioactiveman/masterFix a few compiler warnings
Save States: Oops! Fix a bug where 3D vertices were getting double-loaded, causing save state file reads to desync. Fixes #629. (Regression from commit 5426509.)
– Problems only occurred when LOADING a save state. However, SAVING a save state on commit 5426509 should be okay, so such save states should not be broken.
GFX3D: Encapsulate some data into the GFX3D struct, and also do someminor code cleanup.
GFX3D: The POLY and VERT structs have been converted to POD-style structs for better data consistency.
Cocoa Port: Fix some random compiling issues.
GFX3D: Various minor tweaks and optimizations, plus code cleanup.- Most importantly, refactor the GFX3D_Clipper::ClipPoly() method into the standalone GFX3D_GenerateClippedPoly() function, which drops all class member dependencies and is much more straightforward to use.
– Remove the GFX3D_Clipper class. It has been slowly gutted over the years, but the loss of the ClipPoly() method makes the class obsolete, putting the final nail in its coffin.
– Using the new GFX3D_GenerateClippedPoly() function, gfx3d_PerformClipping() operates on the unsorted clipped polygon list directly. This means that the polygon clipping step requires one less buffer copy.
– Clipped polygons no longer retain direct pointers to POLY structs, instead using their index member to reference a POLY struct at a POLY array location. All 3D renderers have been updated to reflect this change.
– Rename a bunch of variables that reference POLY, CPoly, and VERT structs to clearly differentiate them between raw NDS data and our own internally processed data.
– Fix a potential bug in GFX3D_GenerateRenderLists() where sorting clipped polygons would reorder their polygon indices without reordering their other data members along with the indices, causing the data members to desync. OpenGL rendering was immune to this bug, but SoftRasterizer might have possibly seen it. In any case, this fix is the correct behavior.
GFX3D: Clipping functions now take VERT parameters as non-nullable references instead of as nullable pointers where appropriate.
– GFX3D_ClipPoint() (formerly named clipPoint()) now writes directly to the target VERT rather than copying a return value back to the target.
fix: strchr check
Merge pull request #632 from hjung4/fix/strchr-oob-checkFix out-of-bounds index access
GFX3D: Remove POLY struct members that don’t need to be swapped. Thisresults in less buffer copying for all POLY lists.
– Also remove Viewer3D_State.indexList. This member is obsolete since Viewer3D_State.gList.clippedPolyList is generated in the same order described by indexList.
– Encapsulate and rename some more lists to make their intended purpose more descriptive.
GFX3D: Do some major code cleanup.- Rename a bunch of variables to better reflect their intended usage.
– Add new data types for organizing 3D vectors and coordinates.
– C functions that are called in response to 3D commands now follow the exact same pattern: “static void gfx3d_glFuncName(const u32 param)”
– Be super explicit about the usage of numeric data types and their typecasts to improve their code visibility.
– Remove implementation-specific ambiguity of right bit-shifting signed numerics (Logical-Shift-Right vs Arithmetic-Shift-Right) in the following functions: gfx3d_glLightDirection_cache(), gfx3d_glNormal(), gfx3d_glTexCoord(), gfx3d_glVertex16b(), gfx3d_glVertex10b(), gfx3d_glVertex3_cord(), gfx3d_glVertex_rel(), gfx3d_glVecTest().
Oops! Forgot a file. (Related to commit a67e040.)
GFX3D: The Box Test is now performed with integer operations insteadof with floating point.
– The integer-based Box Test should be just as good as the old float-based one, as tested by “American Girl: Julie Finds a Way”. Of course, there are still bugs compared to a hardware NDS, but we haven’t transitioned to rendering with integer-based vertices yet to make a meaningful test possible.
fixed: EMUFILE_FILE eof() on textmode failed on windows (caused .dctfiles from mac systems freeze process while loading)
Cocoa Port: In the OpenGL blitter, prevent FBO-related GL calls if FBOs are not available.
– Also silence some compiler warnings.
GFX3D: Begin encapsulating stuff into the new NDSGeometryEngine() class.- Also do some minor misc. code cleanup.
GFX3D: Continue encapsulating stuff into the new NDSGeometryEngine class, mostly focusing on matrix-related things.
– There are two significant behavior changes in this commit that will require further testing.
– Behavior change: Before, MTX_LOAD_4x4 and MTX_LOAD_4x3 commands would update the individual values in the current matrix for each command. Now, these commands will batch the values into a temporary matrix until the temp matrix is complete, and then copy the temp matrix into the current matrix. This now matches the batching behavior that the other matrix commands already do.
– Behavior change: Before, there was a single shared temporary multiplication matrix used to batch the values of incoming MTX_MULT_4x4, MTX_MULT_4x3, and MTX_MULT_3x3 commands, theoretically allowing these commands to be used interchangeably and overwrite values from previous commands until the last command made a completed multiplier matrix. Now, there are 3 separate temporary multiplier matrices, one for each of the MTX_MULT_* commands, which means that each command type must now complete its own multiplier matrix before it can perform a matrix multiply.
GFX3D: Clean up some lighting-related code.
GFX3D: Finish refactoring geometry engine related stuff into the newNDSGeometryEngine class.
– Also, the vector test has been changed so that the result vector accounts for the 4 sign bits and proper sign expansion on overflow.
GFX3D: Attempt to fix an MSVC compiling issue. (Related to commit 5d6e866.)
GFX3D: Reorder members of the GeometryEngineLegacySave struct to better reflect the actual order of data in the existing save state format.
– Also rename some matrix-related members for better clarity.
GFX3D: The shininess table is no longer a part of SWAP_BUFFERS.- Since the shininess table is only ever used for vertex generation, it makes no sense for the table to included for the rasterization step. The shininess table has been moved to the NDSGeometryEngine class, which is a class dedicated to just vertex and polygon generation. This reorganization seems more sensible.
GFX3D: Fix longstanding potential overflows related to polygon listsby reducing POLYLIST_SIZE from 20000 to 16383.
– Historically (ever since commit b1e4934 and commit d5bb6fd), VERTLIST_SIZE (based on POLYLIST_SIZE) could reference an index over 66535, but POLY.vertIndexes has always been an unsigned 16-bit value with a max value of 66535, making for a potential overflow. In practice, an overflow has never happened in the past 15 years because a hardware NDS has a limit of 6144 polygons (or 24576 vertices), and that even a VERTLIST_SIZE of 80000 is way more than plenty to accommodate that. Rather than increasing POLY.vertIndexes to 32-bit, it makes more sense to reduce POLYLIST_SIZE to 16383 to keep VERTLIST_SIZE below 66536. Even with this change, POLYLIST_SIZE and VERTLIST_SIZE should be more than plenty in practice.
– Also, now that we’re performing polygon clipping for all client 3D renderers (ever since commit e06d11f), we’re finally accounting for the fact that the clipped polygon list size is larger than POLYLIST_SIZE. Client 3D renderers have been updated to now reflect this change and avoid theoretical overflow issues that have never actually happened in practice.
GFX3D: Move some last bits of static data floating around in gfx3d.cpp into the GFX3D struct, and then make the instantiation of the struct itself static.
OpenGL Renderer: Silence compiler warnings.
OpenGL Renderer: Fix bug where the Depth L-Equal Polygon Facing option would fail to become enabled when running OpenGL 3.2 or later. (Regression from commit ab38d17. Note that this bug does affect the 0.9.13 release build.)
GFX3D: Vertex post-processing has been moved from the 3D renderers toGFX3D.
– Specifically, viewport transformation, face calculation, and face culling are now handled in GFX3D, and are now standard behaviors for all 3D renderers. This reorganization makes more sense since the 3D renderers are primarily responsible for rasterization and framebuffer post-processing, rather than for processing geometry.
– As a positive side-effect, the OpenGL renderer gains a small performance improvement as well as better accuracy in face culling.
GFX3D: Polygon clipping, viewport transformation, perspective correction, and face calculations are now done in fixed-point instead of floating point.
GFX3D: Y-sorting and writing out vertices to a save state are now handled using fixed-point instead of floating-point, where appropriate.
OpenGL Renderer: Use the fixed-point vertex list data instead of thefloating-point based one, alongside other tune-ups.
– To determine polygon facing, use GFX3D’s CPoly.isPolyBackFacing instead of using GLSL’s gl_FrontFacing. This eases OpenGL version requirements and improves older GPU compatibility a little.
– Also fix a bug where GPUs that support FBOs, but not shaders, were unable to read out their framebuffers properly.
GFX3D: Remove the mistaken addition of color clamping when convertingfixed-point vertex colors into floating-point. Fixes the proper coloring of Princess Peach in the opening sequence of Super Mario 64 DS. (Regression from commit 7751b59.)
Cocoa Port: Silence some compiler warnings.
Core: Move low-level vector, vertex coordinate, and color data type declarations into types.h so that they can be used universally. Also update the data type names to be more descriptive and have better consistency.
– Add SIMD-float32 data types, and also add macros to track SIMD data-type availability.
– Also fix some bugs where 3D would fail to render on big-endian systems. (Regression from commit a67e040.)
Silence some compiler warnings.
CI: limit autoconf build to 8 processeshopefully will prevent the OOM killer from kicking in.
GFX3D: Fix clear color on big-endian systems. (Regression from commit 97848fc.)
GFX3D / SoftRasterizer: Small refactor to use some of the new data types introduced in commit cda8cb5.
– Also make SoftRasterizer’s framebuffer out-of-bounds width check more robust.
GFX3D: Clean up the big-endian compatibility code.
SoftRasterizer: Do some minor refactoring and code cleanup, and alsoprepare SoftRasterizer to accept fixed-point vertex data.
Remove superfluous x/y/z names from Vector2s16, Vector2s32, Vector2s64, and Vector2f32 union data types, since it is extremely unlikely that these extra names will ever be used. Just use names “x” and “y”, which are the most likely to be used for these kinds of 2-element vectors.
SoftRasterizer: Read in vertex data data as fixed-point instead of asfloating-point.
GFX3D: Obsolete and remove the VERT struct, since OpenGL, and SoftRasterizer are now both receiving their vertex data in fixed-point.
– Also remove the unused NDSVertexf struct. There shall be only one representation of the NDS vertex data, and that shall be the fixed-point values of NDSVertex.
fix spurious RRX variant selection in several disassembly macros (fixes#652 maybe)
fix alignment of tempMultiplyMatrix and currentMatrix[4] in GeometryEngineLegacySave. Fixes #657. It would be better to fix this perhaps by making NDSMatrix a type that has the alignas(16) put on it while inheriting from std::array
Atualizações:
Alterei a função loadstate_slot para manter apenas os 5 backups mais recentes ao salvar o estado atual antes de carregar.
Quando mais de 5 existirem, o mais antigo será sobrescrito.
Corrigido bug ao escrever o índice, definindo o máximo padrão para 200.
Adicionada uma opção de configuração para definir o número máximo de backups. Apenas para Windows no momento.
Adicionada verificação se o arquivo de índice foi realmente aberto para escrita. Se não, pula a criação do backup durante o carregamento.
Verificação do código do jogo == #### para homebrew.
Corrigido link de suporte no menu de ajuda.
Atualizado make_scmrev.h.js para os tempos modernos, buscando por git 64bit em msbuild/devenv de 32bit.
Aumentada versão para 0.9.14 para futuras compilações intermediárias.
Cocoa Port: Atualizado número da versão para suportar incremento de versão do commit 60714f6.
GFX3D: O teste de posição e o teste de vetor agora são feitos usando ponto fixo em vez de ponto flutuante.
GFX3D: GEM_TransformVertex() agora usa as funções de matriz genéricas otimizadas por SIMD em vez de usar sua própria versão apenas escalar.
Essa mudança resulta em uma pequena, mas mensurável, melhoria no desempenho.
Nota: Essa mudança tem o efeito colateral de habilitar a lógica de saturação para as seguintes funções: MatrixMultVec3x3(), MatrixTranslate(), MatrixScale(). Isso altera o comportamento dessas funções, pois elas não realizavam lógica de saturação antes. Isso precisará de testes adicionais.
JIT (ARM): Tornar o código um pouco mais portátil e também silenciar alguns avisos do compilador.
GFX3D: O teste de caixa agora funciona parcialmente em ponto fixo. Especificamente, os cálculos de vértices são feitos usando ponto fixo. No entanto, o corte ainda ocorre com ponto flutuante.
Corrigido GBA SRAMPath no CLI posix.
Merge do pull request #537 de colton5007/patch-1 – Corrigido GBA SRAMPath no CLI posix.
Cocoa Port: Ao lidar com caminhos de arquivos, substitua as instâncias de [NSString cStringUsingEncoding:NSUTF8StringEncoding] por [NSString fileSystemRepresentation] e [NSFileManager stringWithFileSystemRepresentation:].
Este commit não faz nada de fato, mas é a forma “adequada” para os sistemas da Apple lidarem com caminhos de arquivos que interagem com funções C de nível inferior.
Corrigido bug de entrada do teclado no CLI do Linux devido a tipos incompatíveis.
CLI: Re-trabalhada a manipulação de KEYDOWN para permitir que ambas as teclas shift sejam usadas como entradas de controle. O Shift direito é o padrão para a tecla de Selecionar.
Tentativa de corrigir alguns problemas causados por usuários rodando o desmume a partir de diretórios com caracteres não ingleses (podendo se manifestar como “não foi possível obter acesso de leitura/gravação ao arquivo de backup”).
sampcnt/sampinc como .32fxp, adicionado interpolação Catmull-spline.
Corrigido onda quadrada PSG – Estava lendo a parte errada do GBATek.
Tentativa de correção para macOS.
Corrigido ADPCM quebrado.
Separado contadores de 64 bits em 2×32 bits – Isso parece gerar um código um pouco mais organizado.
Limitação de precisão em interpolação mais rigorosa.
Corrigido problemas de overflow – A interpolação Catmull-Rom pode gerar saídas maiores que 16 bits, então devemos usar precisão de 15 bits. Também, garantido o uso de floor() para forçar o arredondamento para baixo, independentemente do comportamento de arredondamento do host.
Merge do pull request #546 de Aikku93/spu-enhanced-interpolation – Interpolação aprimorada e posições de amostras em ponto fixo.
Merge do pull request #532 de Aikku93/patch-3 – Verificação do código do jogo == #### para homebrew.
Corrigido compilação no GCC para AArch64. Corrige #548.
Removido compilação AltiVec para as arquiteturas ppcle e ppc64le, pois nosso código AltiVec funciona apenas em sistemas big-endian. Corrige #550.
libretro-common: Ajuste na compilação para arquiteturas ARM.
Corrige um aviso de registrador incompatível em arm_enable_runfast_mode() ao compilar para AArch64.
Corrige verificação de compilação em check_arm_cpu_feature() para arquiteturas não-ARM sendo super explícito e meticuloso ao verificar __ARM_ARCH; nada de “o compilador assume que uma macro é zero se não definida”.
Corrigido mais um problema de compilação no GCC para AArch64. Corrige #556.
Corrigido um problema de compilação para sistemas AltiVec ao usar GCC sem o modo de palavras-chave e pré-definições.
gtk3/gtk2: Corrigido tipos incompatíveis para o armazenamento temporário da configuração do teclado – resultado do commit c68cc14, fecha #558.
Corrigido uso de armazenamento interno do buffer temporário – O índice da entrada é convertido para uma string (temporária), de onde um ponteiro para dados internos é obtido e consumido fora do loop, onde a variável pai já não existe.
Corrigido #563: tamanhos de buffers incompatíveis para memcpy.
Merge do pull request #564 de janisozaur/fix-use-of-internal-buffer – Corrigido uso de armazenamento interno do buffer temporário.
Merge do pull request #566 de janisozaur/patch-1 – Corrigido #563: tamanhos de buffers incompatíveis para memcpy.
Posix: Corrigido incompatibilidade de tamanho nos arrays keyboard/joystick_cfg, corrige #563.
Comentários