aboutsummaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAgeFilesLines
* core: detect Switch 2 programs in NSP containers (#349)cira010019 hours1-3/+22
| | | Read the selected program metadata before kernel initialization so NSP launches receive the Switch 2 memory layout and clock. This fixes Mario Kart World 1.8.0 crashing during startup while its loose 1.0 dump already boots.
* Merge pull request #155 from Djihads80/neo.ai/vibration-fixJonas23 hours2-6/+26
|\ | | | | Diagnoses to fix vibration support
| * Vibration support for ns2 gamesnéo Luigi24 hours2-36/+25
| | | | | | | | | | | | | | | | | | This branch supports vibration by achieving proper rumble reading from games and uses regular eglantine/eden logic from ns1 to send them over. Tested on windows 10 on Mario Kart World Assisted-by: Claude Opus 5.5 (code cleanup)
| * Merge remote-tracking branch 'origin/nx2' into neo.ai/vibration-fixnéo Luigi25 hours77-449/+6098
| |\ | | | | | | | | | | | | | | | | | | | | | Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # src/core/hle/service/hid/hid_server.cpp # src/core/hle/service/hid/hid_server.h
| * | Vibration fix for ns2 games | Assisted by claude (code)néo Luigi3 days2-5/+36
| | |
* | | network: close each bsd fd once and drop unwanted or malformed room packetscirakg24 hours6-27/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two threads closing the same fd both copied the descriptor and both called Close(), so a host socket could be closed twice, and the second closesocket could hit an unrelated socket that had reused the host fd. CloseImpl now frees the slot under file_descriptors_mutex first and only that thread closes the socket; the other gets EBADF. OnProxyPacketReceived decompressed every room packet when any fd had a socket, including native sockets and proxy sockets on other ports. Sockets now report through AcceptsProxyPacket whether they want a packet, and only those are collected, so an unwanted packet is not decompressed. DecompressDataZSTD passed the frame's declared size straight to the vector constructor, so a malformed or unsized frame from a room member threw on the room thread. The new TryDecompressDataZSTD rejects invalid, unsized and oversized frames, and bsd drops such packets with a warning. DecompressDataZSTD now returns an empty vector for them instead of throwing. Assisted-by: Claude Opus 5.5 (investigation and implementation)
* | | Merge upstream Djihads80/Eglantine nx2 into ldn/room-handshakecirakg25 hours2-10/+102
|\ \ \
| * | | nup_writer: keep the dump's own layout for non-exefs/romfs entriesa55uka25 hours1-2/+5
| | | |
| * | | nx2: video decoder: keep post-stream release fences pendingJavier25 hours1-2/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bananza's movie player acquires one decoded frame every time a released output image's fence completes, and aborts (2111-3604) when the ring is empty. Completing those fences at once after the end of a stream (the Mario Kart World workaround) made it acquire from an empty ring the moment its cutscene movies ended. Released images now keep their normal pending fence after the end of a stream. Stop (207) and Finalize (115) complete every fence handed out so far, so a client that waits on its returned images after a movie is still released when it stops the decoder. EDEN_NX2_VDEC_EOS_RELEASE_NOW=1 restores the old immediate completion; EDEN_NX2_VDEC_TRACE=1 logs every decoder call. Tested on Bananza: the post-breakout cutscene movie ends and gameplay continues (mining tunnel). Mario Kart World not retested. Assisted-by: Claude (Anthropic) for investigation and code. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 0f8eaa54be5bff351de7c9a80cc06a4b3453bc76) (cherry picked from commit 8ed051843a33a5dec086d1ec6985798c8b336a6a)
| * | | nx2: vdecsvc refreshes the GPU copy of each decoded frame (Yoshi demo)rdenno25 hours1-0/+4
| | | | | | | | | | | | | | | | | | | | Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 144b193c841a4b291e5eca065c94cbe82136a4b1)
| * | | nx2: vdecsvc picks H.264 when the configure carries no codec name and the ↵rdenno25 hours1-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | stream is H.264 (Yoshi demo) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| * | | service: nx2:vdecsvc: handle end-of-stream without abortingYuri Olive25 hours1-3/+24
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Complete pending fences immediately on release once the stream ends and no frames remain to be processed, preventing infinite waits in movie teardown. - Stop re-arming m_ready->room when an end-of-stream packet arrives or the final frame is output, avoiding spurious wakeups and subsequent empty queue queries. - Reset m_stream_ended when new input is submitted or on Flush/Stop. Fixes an abort (2111-3604 / 0x1c286f) in Donkey Kong Bananza during the tutorial transition scene when the video decoder stream ends. Assisted-by: Gemini (vdecsvc end-of-stream fence completion and timer de-arming) (cherry picked from commit b180df1ed77568da7c3e78dd97c0c46d84e54494)
* | | network: keep fcntl modes across MSG_DONTWAIT and decompress room packets oncecirakg25 hours4-53/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A receive with MSG_DONTWAIT restored the blocking mode from the descriptor copy taken before the call. When fcntl(SETFL, O_NONBLOCK) ran during the receive, the fd kept reporting O_NONBLOCK while its socket blocked again. Receives now switch the mode only for MSG_DONTWAIT and read the current flags under file_descriptors_mutex at both ends, and SETFL changes the mode and the stored flags in the same critical section. OnProxyPacketReceived decompressed each room packet once per matching socket while holding file_descriptors_mutex, so every bsd call waited for it. It now copies the distinct sockets under the lock, decompresses once without it and delivers the result. Also reject fd == MAX_FD in IsFileDescriptorValid and PollImpl, which read past the table, and guard the ProxySocket blocking and receive timeout setters with packets_mutex, matching their reader. Assisted-by: Claude Opus 5.5 (investigation and implementation)
* | | network: keep bsd sockets alive across concurrent close and fix room gapscirakg25 hours3-135/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bsd runs on three host threads, but its calls kept a raw reference into the shared descriptor table while they used a socket. A close() on another thread could then destroy the socket mid-call. Waking a blocked room recv() on close made this happen every time. Every call now works on a copy of the descriptor taken under the table lock, poll() keeps its sockets alive while it waits, and close() resets the slot only if it still holds the same socket. accept() picked a free fd before blocking and only locked the write, so another thread could publish a socket in the same slot. It now picks and writes the fd in one critical section after Accept() returns. dup() now re-checks the source fd under the lock. A duplicated fd shares its socket, so the room packet loop queued each packet once per fd. Deliver it once per socket. NIFM: when the selected host adapter is missing, the room still works and IsNetworkAvailable reports it, but GetCurrentNetworkProfile returned an empty profile. Report a wired room profile in that case, and put the room address on the first adapter in EnumerateNetworkInterfaces. Assisted-by: Claude Opus 5.5 (investigation and implementation)
* | | Merge upstream Djihads80/Eglantine nx2 into ldn/room-handshakecirakg25 hours1-0/+5
|\| |
| * | Merge pull request #235 from CloudP4bbs/pr/asid-guardJonas25 hours1-0/+5
| |\ \ | | | | | | | | core: do not index registered_processes with an unregistered ASID
| | * | core: do not index registered_processes with an unregistered ASIDPaulo Rossatto2 days1-0/+5
| | | |
* | | | network: use the socket type for room stream reads and wake all readerscirakg25 hours2-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | socket(AF_INET, SOCK_STREAM, 0) leaves the protocol unspecified, so the TCP checks in ProxySocket::Recv and ReceivePacket missed such sockets. recv() then waited for the timeout and returned EAGAIN instead of end of stream, and partial reads dropped the rest of the packet. Keep the socket type and use it for these checks. The protocol stays as it is, because it is sent to other room members. A MSG_PEEK reader leaves the packet queued, so notify every waiter when a packet arrives instead of only one. Assisted-by: Claude Opus 5.5 (investigation and implementation)
* | | | network: fix room socket races and share the room network checkcirakg26 hours7-56/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bsd:s, bsd:u and bsd:a share one file descriptor table, but each service bound its own proxy packet callback, so every room packet was queued three times on each socket. Bind the callback once. The room thread walked the descriptor table without a lock while bsd created and closed sockets, so it could reach a destroyed or not yet created socket. Guard the table with a mutex, and publish a socket only after it is created and initialized. Check airplane mode before an fd is taken, so a refused socket no longer leaks its slot. ProxySocket now initializes protocol, decompresses packets outside the packet lock without copying the compressed data first, and keeps a read offset for partial TCP reads instead of erasing from the front. Add Network::GetRoomIPv4Address(), set only in the Joined and Moderator states. NIFM uses it for network availability and for every reported address, including EnumerateNetworkInterfaces and GetCurrentIpAddress, so no call reports the room address while another rejects the network. Assisted-by: Claude Opus 5.5 (investigation and implementation)
* | | | Merge branch 'nx2' into ldn/room-handshakecirakg26 hours11-77/+352
|\| | |
| * | | Merge pull request #334 from snowstormxd/codex/upstream-mkw-testJonas26 hours5-10/+56
| |\ \ \ | | | | | | | | | | MKW performance improvements
| | * | | kernel: keep migrating fiber TLS lookups outside link-time optimizationsnowstormxd28 hours1-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The game aborted during early thread synchronization with cross-module kernel TLS lookups. Compiling the kernel TLS implementation without LTO restores successful game startup while the other targets retain their build options. Assisted by Codex.
| | * | | nx2: rearm clean read areas when the GPU writes them againsnowstormxd28 hours1-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Port the coherency changes from alarok/Eglantine 77fc365f2 without its diagnostic framework or shutdown changes. Only GPU-dirty CPU reads become permanently preflushable, clean areas can be trapped on the next write, non-core readers avoid indexing core arrays, and collected CPU writes precede readback. Assisted-by: Codex (source review, selective integration and verification) (cherry picked from commit b64e211957180aa218ec6d9a3bcb020332279c3f)
| | * | | loader: find mixed-case loose RomFS directories consistentlysnowstormxd29 hours1-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux missed base version metadata for Base/RomFS while Windows included it. Use a case-insensitive fallback for the loose directory and check the version and resulting archive checksum. Assisted by Codex.
| | * | | kernel: define thread-local state out of line for LTOsnowstormxd29 hours1-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Give the implementation-local TLS object one definition so ThinLTO retains its dynamic initializer. The state and its lifetime are unchanged. Assisted by Codex.
| | * | | core: skip empty bitmap ranges during cache and scheduler traversalsnowstormxd30 hours1-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adapted bitmap scans from sylvieistaken/selevet-eglantine performance build 4. Keep the wide-priority fallback and fix the first live slot after empty bitmap words. Include randomized lifecycle and ordering checks. Assisted by Codex.
| * | | | nx2: map GPU memory before later command lists are readSssnowyyy29 hours1-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 837133792d queues the GMMU maps on the GPU thread (GPU::RunInOrder) so the service thread never waits for the texture cache. With the GPU split (Low GPU accuracy) the GPU thread defers queued functions to its back, but its front reads the command lists: it read the lists submitted after a map through GPU addresses that weren't mapped yet. Pokopia stopped after its first frame. Add GPU::MapInOrder for the GMMU maps and the sparse tile remaps. It runs in order like RunInOrder, and with the split it runs on the front after draining the back, before the front reads further command lists. The service thread still never takes the texture cache lock, and the back is idle while the map changes the caches. Unmaps and the other queued work still run on the back. Assisted-by: Claude Opus 5.5 (bisect, fix, testing and commit message)
| * | | | video_core: don't execute command lists copied before their channel waitedSssnowyyy29 hours1-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cce6d44af2 executes each command list entry from a copy of its words taken at submit. Games submit command lists before writing them: the lists wait behind a semaphore acquire, and the game writes their commands just before it releases the acquire (Mario Kart World after present). The copies of those lists were stale. Pokopia stopped after its first frame on macOS: its GPU never reached the fence the game spun on (EDEN_NX2_PB_SNAPSHOT=0 made it run again). Count each channel's suspensions on an acquire and the resumes after them, and record the count with each copy. A list copied while its channel was suspended, or whose channel suspended since, reads guest memory instead. Lists submitted and run without a wait in between keep the copy. EDEN_NX2_PB_SNAPSHOT=0 still disables it altogether. Assisted-by: Claude Sonnet 5.5 (first version); Claude Opus 5.5 (bisect, suspension count, testing and commit message)
| * | | | nx2: don't stall presents on a current-frame wait the GPU can't finishSssnowyyy29 hours1-22/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 0f14696044 made PresentClientBuffer also wait for the current frame's fence whenever the previous frame's wasn't reached. Mario Kart World's GPU waits on semaphores its CPU releases only after the present returns, so in that state the current fence can't be reached until the present returns, and each such present stalled up to the 4 s deadline. Wait for the current frame by default, but give up after a few ms once a GPU channel was seen suspended on a semaphore acquire and wait for the previous frame instead. EDEN_NX2_FRAMES_AHEAD=1 always waits for the previous frame (with 0f14696044's current-frame wait when the GPU is behind), =0 always for the current one. The scheduler gains a lock-free flag so the present thread can see suspended channels. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
| * | | | nx2: make the 216 sparse request range checks overflow-safeSssnowyyy29 hours2-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4d6a13e3d9 and 3d6156434a added bounds checks to the nx2:gpu 216 sparse map path, but the region checks still compute gpu_address + size, which wraps for a guest-controlled size. 3d6156434a only guards size == 0 and the memory offset on the map path, so an unmap (memory handle 0) with a huge size matches a region through the wrapped sum and reaches Nx2SparseTile, whose own check wraps the same way, and then smmu.Unmap(device, size) with a giant page count. Reject a request whose end wraps the address space before it is used, for map and unmap alike, with a warning like the existing unknown-memory check. Also compare by subtraction in the region lookups here and in Nx2SparseTile and Nx2BackSparse, so none of them depends on the sum. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
| * | | | file_sys: reject NUP tables with wrapping bounds or cyclic directoriesSssnowyyy29 hours2-15/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 31b901b93b checked the TOC with unchecked arithmetic on counts and offsets read from the file. The record-table size (u64 count times record size) and u32 first_child + child_count can wrap, so the bounds checks pass and later reads go out of bounds; the same holds for the TOC range, name ranges, file extents and the meta range. A directory that lists its own ancestor as a child also made BuildDirTree recurse until the stack overflowed. Bound the counts by the TOC size before multiplying, compare ranges by subtraction, and widen the child range to u64. Walk the directory graph once after parsing with an explicit stack and reject cycles and nesting deeper than 128, so BuildDirTree can no longer recurse without bound. The file is rejected with ErrorNUPBadFormat. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
| * | | | file_sys: decompress large NUP zstd members onceSssnowyyy29 hours3-21/+153
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 31b901b93b only cached a zstd member while it fit the 512 MiB cache. Anything larger was never cached, so every Read() allocated the full uncompressed size and decompressed the whole extent again, which makes a multi-GB RomFS read in small chunks unusably slow. Members between 256 and 512 MiB evicted each other on alternate reads, and Insert copied the vector so memory briefly doubled. Two threads decompressing the same member also left a duplicate LRU entry and a wrong byte count. The writer emits one zstd frame per member, so there are no frame boundaries to seek by. Members larger than half the cache are now streamed once into a temporary file under the cache directory and read from there, using bounded memory. The file is removed when the container is released. Smaller members stay in the LRU, which now moves the vector in and ignores a duplicate insert. Assisted-by: Claude Sonnet 5.5 (implementation and commit message)
* | | | network: fix room host LAN Play and room socket review issuescirakg26 hours2-38/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The room host and room moderators are in the Moderator state, not Joined, so the airplane mode override for joined rooms did not apply to them and LAN Play still returned them to the menu. Accept both states. Share the room address override between the NIFM profile and IP config calls so they cannot drift apart. recv() on a room TCP socket now waited for the receive timeout, because Recv goes through RecvFrom. Room TCP sockets have no peer, so keep the previous immediate end-of-stream result when nothing is queued. Close() now drops queued packets and wakes a blocked recv, which then fails with EBADF. The socket state that the room thread reads when it queues a packet is now guarded by the packet mutex. Assisted-by: Claude Opus 5.5 (investigation and implementation)
* | | | nifm: treat a joined room as the LAN for local network gamescirakg27 hours1-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LAN Play through public lobby rooms failed in two ways. With airplane mode on (the default), IRequest::GetResult rejected the game's network request. Mario Kart World then opened the net-connect applet and returned to the main menu instead of the LAN browser. A joined room is the emulated network: its sockets only reach room members. Count it as an available network for GetResult and IsAnyInternetRequestAccepted. With airplane mode off, players could open the browser but never saw each other. Room fake IPs are spread over 192.168.0.0/16, and some room servers give members different /24s. NIFM reported the host adapter's /24 mask with the fake IP, so the games treated each other as off-subnet. Report 255.255.0.0 in a room instead. Assisted-by: Claude Opus 5.5 (investigation and implementation)
* | | | network: fix ProxySocket receive edge casescirakg27 hours2-51/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Routing recv() through RecvFrom made several old RecvFrom problems reachable from the normal read path: - A partial TCP read kept zero bytes in front of the unread data. - A blocking read busy-waited with yield() and reported ETIMEDOUT. - MSG_PEEK hit the flags == 0 assert. - A UDP datagram larger than the buffer was dropped with EMSGSIZE. Wait on a condition variable signalled when a packet arrives, and report an expired wait as EAGAIN like an SO_RCVTIMEO timeout. Keep the existing 5s cap for sockets without a receive timeout. Allow MSG_PEEK. Truncate oversized datagrams as BSD recv() does, and keep the unread tail of a TCP packet for the next read. Assisted-by: Claude Opus 5.5 (investigation and implementation)
* | | | network: deliver room datagrams through ProxySocket::Recvcirakg27 hours1-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When connected to an emulator room every guest socket is a ProxySocket. Its Recv was a stub that always returned zero bytes, so games that read UDP replies with recv() never received them. Mario Kart World LAN Play reads its discovery replies this way, so guests never saw the host's room in the LAN browser. Delegate Recv to RecvFrom without an address, so queued room packets, non-blocking, timeout, peek and truncation behaviour match recvfrom(). Assisted-by: Claude Opus 5.5 (investigation and implementation)
* | | | Merge branch 'nx2' into ldn/room-handshakecirakg27 hours3-20/+143
|\| | |
| * | | loader: read the display version from GameDataList.Product.NNN tookraibse33 hours1-17/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Donkey Kong Bananza names its resource size table without a version, so no version was found for a loose dump. Its GameData/GameDataList.Product .320.* files carry it (3.2.0), so read them as well and use the newest tag from either source. Assisted-by: Claude Sonnet 5.5 (wrote the GameDataList version lookup and its test)
| * | | file_sys: let the NUP packer override and probe the name, icon and versionkraibse33 hours2-3/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PackOptions::metadata overrides the title name, icon and display version found in the dump. A version override is written to the base and to the newest update, since the NUP loader reads the version from the newest update first. ProbeMetadata reads what a dump would be packed with, the version coming from the newest update that reports one, else the base. Assisted-by: Claude Sonnet 5.5 (wrote the metadata overrides, ProbeMetadata and their test)
* | | | ldn: wait for the host's reply when joining a networkcirakg33 hours2-15/+78
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Connect slept for a second while holding packet_mutex, so the host's SyncNetwork reply could not be handled until Connect had already returned success in StationOpened. Players could see each other's group and enter it, but never actually met. Wait on a condition variable instead, accept the reply only from the selected host and session, and fail after five seconds. Check packet sizes and senders, stop duplicate joins from taking another station, and seed session IDs so separate networks don't share one. The SDL frontend never called Network::Init, so its multiplayer option could not join a room. Initialize and shut down networking around the core. Assisted-by: Sol (implementation) Assisted-by: Claude Opus 5.5 (code review)
* | | refactor: remove redundant EnsureRomFS call in ↵kraibse34 hours1-2/+0
| | | | | | | | | | | | AppLoader_DeconstructedRomDirectory
* | | Merge remote-tracking branch 'origin/nx2' into codex/upstream-loading-hotkeyskraibse34 hours73-426/+5152
|\ \ \
| * \ \ Merge nx2 into nx2-experimentalkraibse35 hours14-63/+1953
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved by area: - audio feature_support.h: nx2's native revision handling. - fiber.cpp: ours, which also drops the unused rewind stack. - host_memory.cpp: ours granule bitmap and HintCold, plus nx2's fallocate hole punching per whole dirty granule on Linux. - texture_cache.h: nx2's old-age eviction pass, then our Collect(). - kepler_compute.cpp: shared upscale slots, then Fortune's Weave's, then the Kirby Air Riders scan. - nx2_gsv.h: ours, plus nx2's GetBufferMaxResolution and graphics device ids (1-based). - nvhost_ctrl_gpu.cpp: engine support flag bits 40-44. - lower_to_maxwell.h: ours as the base, with nx2's seven lowering commits applied one at a time. Second texture descriptor buffers are read bindless in TEX, TLD.SCR (level zero) and SUST; FSEL keeps its operand modifiers; TXD takes any channel mask. lower_to_maxwell.h lowers 837 Fortune's Weave and 1183 Mario Kart World shader dumps with the same rejects as nx2 and ours (12 and 0). Assisted-by: Claude Sonnet 5.5 (conflict analysis and drafting)
| | * | | file_sys: add a deterministic NUP packer, Convert to NUP in Qt and eden-cli ↵Jonas41 hours5-1/+1530
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --pack-nup (#271) * file_sys: add a NUP packer for loose dumps Packs a loose dump (exefs/romfs, base/, updates/<version>/ and dlc/<titleid>/<n>/) into a NUP v1 container with the aligned record layout. Every package is kept, files are deduplicated by SHA-256 and compressed with zstd unless that does not shrink them, and files over 256 MiB are stored raw. Output is byte-identical on every platform: compression is single-threaded with every frame parameter set explicitly, and zstd is always bundled so all builds use the same version. A low-storage mode deletes each source file once its extent is synced and journaled, and an interrupted run resumes from the journal. Assisted-by: Claude Opus 5.5 (wrote the packer, its EdenPack-free dump detection, the aligned record layout and the deterministic zstd setup; ran the Raiders and Donkey Kong Bananza packs and boot checks) * tests: cover the NUP packer Round-trips a dump through NupContainer, checks standalone updates, a bare exefs/romfs dump, low-storage resume and overwrite rejection, and pins the hash of a packed dump so changes to the output are deliberate. Assisted-by: Claude Opus 5.5 (wrote the tests, including the pinned output hash) * qt: add Convert to NUP to the game list Shown for loose dumps. Asks for confirmation with the estimated space, offers low-storage mode, runs in the background with progress and cancel, and resumes an interrupted low-storage conversion. Assisted-by: Claude Opus 5.5 (wrote the Convert to NUP action and its progress and resume handling) * cli: add --pack-nup <dump> [out.nup] Assisted-by: Claude Opus 5.5 (wrote the --pack-nup option)
| | * | | Merge pull request #270 from Duck912/fe-rendernowhere0246 hours9-33/+456
| | |\ \ \ | | | | | | | | | | | | Fe render
| | | * | | am: decode the native swkbd config for library version 0x160012Duck91246 hours2-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fire Emblem: Fortune's Weave opens the keyboard with library version 0x160012 and a 0x530-byte config. Read with the Switch 1 layout, the byte taken as use_utf8 belonged to initial_string_offset, so the name entry returned UTF-16 and the game kept only its first letter. The text prefix of the common part keeps its layout; the flags, lengths, string offsets and dictionary fields move (checked against the game's nn::swkbd::keyboardConfig2kbdConfig). Version 0x140010 is unchanged. Assisted-by: Claude Opus 5.5 (debugging, implementation and drafting) Signed-off-by: Duck912 <350528965+Duck912@users.noreply.github.com>
| | | * | | nx2:vi2: report the display's maximum buffer resolutionDuck91246 hours1-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Command 106 was auto-stubbed, and Fire Emblem: Fortune's Weave treats its empty reply as mode 0 and picks its 720p tier (rendering at 360p). Report mode 4 (1440p) docked and 2 (1080p, the screen) handheld; the game then renders at 720p and 540p and upscales to those. EDEN_VI2_MAX_RESOLUTION_MODE overrides the mode. Assisted-by: Claude Opus 5.5 (debugging, implementation and drafting) Signed-off-by: Duck912 <350528965+Duck912@users.noreply.github.com>
| | | * | | nx2:vi2: sleep in the guest kernel while pacing presentsDuck91246 hours1-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vi2 session is served by AM's thread on guest core 3, so the host sleep in PaceToVblank held that core for most of every frame. Game threads scheduled there only ran between presents: Fire Emblem: Fortune's Weave's loader got one RomFS read per frame (33 ms apart instead of about 4 ms), which doubled its load times. Assisted-by: Claude Opus 5.5 (debugging, implementation and drafting) Signed-off-by: Duck912 <350528965+Duck912@users.noreply.github.com>
| | | * | | nx2:gsv: map decoder images the client reads on the GPUDuck9122 days1-5/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fire Emblem: Fortune's Weave's movie player queries (428) and maps (426) each decoder output image, then blits it (RGBA, format 0xd5, block-linear with 16-GOB blocks) into a texture of its own. The pool memory is process memory (114) that no GPU mapping covered, so the blit read zeros and the movies were black. For decoder images, 426 now maps the image at its own address for the GPU unless a mapping already covers it, and replies with the address, the last byte's address and the image descriptor as our Eden tree does. 427 drops the mapping after the last unmap, as do 430 and 112. Images the client reads on the GPU are written as block-linear RGBA, and the GPU caches are invalidated after each frame. NV12 images and images read with 961 keep the pitch-linear layout. Assisted-by: Claude Opus 5.5 (debugging, implementation and drafting) Signed-off-by: duck912 <350528965+Duck912@users.noreply.github.com>
| | | * | | nx2:vi2: pace presents by their swap intervalDuck9122 days1-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Present word 12 holds (swap interval << 16) | refresh rate. Presents were always held to the next 60 Hz vblank, so Fire Emblem: Fortune's Weave, which sends 0x2003c (interval 2) after its boot logos, ran at 60 fps and double speed instead of 30. Pace each present by its interval and rate (interval clamped to 1-4, rate 60 if outside 30-240 Hz) and log when the word changes. EDEN_NX2_SWAP_INTERVAL=<n> forces the interval. Assisted-by: Claude Opus 5.5 (debugging, implementation and drafting) Signed-off-by: duck912 <350528965+Duck912@users.noreply.github.com>