Views: 6,929,068 | Homepage | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search | 04-26-24 01:42 PM |
Guest: |
Main - Posts by Arisotura |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 121/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
So I used libui and botched it to fit my needs...
Functions that return strings As they are, they allocate the string on heap and return a pointer. You get to do cool one-liners, but you need to remember to free the string, and it's not so efficient. Should change those to use stack-allocated string buffers where possible. uiArea handler (why does this use a handler struct instead of hooking individual event handlers?) The handler struct must remain accessible to libui throughout the uiArea's lifetime. Allocating it on stack can be a bad idea, esp. for secondary windows. (solutions: copy the struct to an internal buffer, for example in the uiArea struct. or use individual handlers.) Sizing Under GTK, it is impossible to resize a window smaller than its original size. List of changes that were made to adapt it for melonDS. (and tags showing where it's finished for now) * [Win/GTK] file dialogs: added filter support, added extra parameter for setting starting dir (not supported yet) * [Win/GTK] uiArea: added small API for creating and drawing bitmaps * [Win/GTK] uiArea: botched keyboard input. only getting raw scancodes * [GTK] uiWindow/GTK: fix window sizing to take the menubar into account. kind of a hack tho. * [Win/GTK] uiWindow: add handlers for getting/losing focus and file dragdrop (limited to one file) * [Win/GTK] uiControl: add uiControlSetFocus() * [GTK] uiArea/GTK: make uiAreaQueueRedrawAll() thread-safe * [Win] uiButton: cache ideal size * wip TODO optimize uiBox sizing under Windows. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 122/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
I can change your name there so you have the same one everywhere, but please decide on a name and don't change constantly. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 123/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 124/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
As the IRC network that hosted our IRC channel is unmaintained and crumbling, we are moving the channel to a network that is in a better state.
irc.badnik.net / irc.rustedlogic.net #melonds Thank you. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 125/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
melonDS 0.5 is out!
This release finally brings a UI that doesn't suck. Oh and antialiasing. There hasn't been a lot of changes due to real life issues (and being oh so efficient with UI coding). The full changelog is below. • new UI, more stable, less windows all over the place • wxWidgets ditched, lost some weight • 2D: allow reading BLDALPHA • GPU: fix potential issues with VCount write • implement 8bit accesses to some registers • 2D: mosaic (not quite right for rotscaled sprites) • 3D: fix culling • allow 128KB firmwares from DSi/3DS • 3D: more accurate fog • 3D: more accurate polygon edges (but not perfect) • 3D: antialiasing • 3D: misc optimizations pile of copypasta How to use melonDS requires BIOS/firmware dumps from a DS. You can dump them with the following dumper. The files must be placed in the same directory as the melonDS executable, as follows: * bios7.bin -- ARM7 BIOS, 16KB * bios9.bin -- ARM9 BIOS, 4KB * firmware.bin -- firmware, 128KB, 256KB or 512KB Note: the DS-mode firmware in the 3DS isn't bootable. It only contains the bare minimum required to run DS games. Be sure to enable direct game boot when using a firmware dump from a 3DS. Settings Emulation: settings related to emulation. For now it lets you enable direct game boot (directly runs the game instead of going through the firmware) and the threaded 3D renderer. There's also a wifi-related setting (which only ended up there because I'm lazy and I need to redo the UI). You should try toggling it if you have trouble getting multiplayer working. Input: allows you to configure keyboard and joystick input. You can change a mapping by clicking the corresponding entry, then pressing a keyboard key or joystick button. For now, joystick input uses the first joystick available if multiple joysticks are plugged. If your game fails to save Check the size of the savefile. melonDS can, in some circumstances, misdetect the save memory type. Save memory type detection is done only when no existing savefile is present. If you provide an existing savefile with the correct size, melonDS will use the correct save memory type and saving should work properly. Downloads * Windows 64-bit * Linux 64-bit If you feel generous melonDS Patreon Have fun! ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 126/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Accuracy isn't something you can measure as a general number. For example, melonDS may have the most accurate 3D renderer, but its timings are still pretty gross (and DeSmuME can be better in that regard). ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 127/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Posted by andlabs mh, good point. Posted by andlabs mh, I see. Posted by andlabs actually, that issue was due to me using gtk_widget_set_size_request(), that sets a minimum size. (see below) Posted by andlabs It works well under Windows and GTK, not sure about Mac. Windows remembers the last visited directory. GTK doesn't. I didn't end up coding support for it because I wasn't sure how to approach it. Apparently under Windows trying to force the starting directory is deprecated. Posted by andlabs I'd have to know more about this, but the name uiTable implies that it wouldn't really fit melonDS's goals. Posted by andlabs Nah, I meant that libui comes with a whole system for detecting 'good' keys and modifiers and all that. Which is nice if you want to implement text entry I guess. In the case of melonDS, I only need to know when a given key is pressed, and to tell that key apart from other keys, regardless of what it is. (think Left Ctrl vs Right Ctrl) Posted by andlabs The issue under GTK is that the menubar is part of the client area, which is inconsistent with Windows. The original hack was calling gtk_widget_set_size_request() on the window's childHolderWidget. While it sized the client area properly, it also set that as a minimum size. The final hack kicks in after the window is shown: the final menubar height is retrieved and the window height is adjusted accordingly. Posted by andlabs Under Windows, I need to explicitly give focus to my uiArea or it won't receive key events until it's clicked. I need to do so when creating the window, and when it gets focus (is brought to foreground) after having lost it. So I added event hooks to detect that. uiControlSetFocus() gives keyboard focus to a particular control. Posted by andlabs It is called in a g_idle_add() callback if the calling thread isn't the GUI thread. In melonDS, the emulator loop runs in a separate thread, and that thread needs a way to signal the UI to refresh itself. With GTK, doing it directly caused random freezes. Posted by andlabs Will look into it. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 128/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
I realized after releasing it that I forgot to add the FPS counter back.
Will be fixed for 0.6. I want to work on wifi, or fancy addon devices. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 129/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Local wifi already works but it can use improvement. Online isn't done yet.
Sound is also a todo. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 130/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Comes with game "Pokémon Typing Adventure" or whatever the name is.
I'll post reverse-engineering notes in this thread. Init Game sends the following data via the aux SPI bus: FF 01 00 00 04 01 03 0C 00 It doesn't read the response. A test on the cart returned all zeros. There has to be something else the game is expecting but not getting. The cart sends an IRQ (IREQ_MC) when receiving data over SPI. Regular carts don't do that (and respond all FF instead of 00 when sent the command above). The IRQ is sent after the first SPI command byte is sent. No idea if there are specific values that don't trigger the IRQ, or if it has a "write zero to get to the backup memory" thing like other Pokémon carts (attempt at sending a RDID command read zeros). Emulating it doesn't do shit, though. Also: IREQ_MC triggers on both CPUs, regardless of EXMEMCNT. In the case of Pokémon, though, it's only enabled on the ARM9. Cart ID The cart returns an ID of 0x80007FC2. Bit 31 there causes the BIOS to load the secure area differently: for each block, the command is repeated 9 times, first time with a zero length, next 8 times with 0x200. It's not too clear how this should work, and melonDS doesn't emulate it, so such an ID causes firmware boot to fail (secure area is loaded wrong, which doesn't bode well). ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 131/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
I got a report that it fails to load a ROM if the path contains special characters, so check for that. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 132/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 133/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Function at 0x0206DEC4 refers to the following strings:
Sending to unknown dest Send - buffer linked Similar strings are found, for example, here: https://android.googlesource.com/platform/external/libnfc-nci/+/jb-mr1-dev/halimpl/bcm2079x/gki/common/gki_buffer.c#681 So I guess our cart is using a Broadcom Bluetooth controller, and they've been using one of those open-source drivers. Interesting. https://github.com/mozilla-b2g/platform_external_bluetooth_bluedroid/blob/master/stack/btu/btu_task.c Driver sitting between the game and the hardware seems to be a stripped-down version of this. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 134/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 135/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Triggering another IRQ after the first SPI command is finished causes the game to send another SPI command.
(and things go wrong, because the command starts with a 02 and melonDS mistakes it for a regular savemem command. I need to rework that code) I need to acquire a cart slot, so I can hook the cart to a raspi and test it. Issue with testing on the DS is that, I guess, when swapping carts, the new cart doesn't get a reset signal. May not be a big deal for regular savemem, but this cart embeds what seems to be a Broadcom controller that can do several things. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 136/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
The one that comes with the DS browser.
First 16MB of the GBA ROM address range are all FF, except: 080000B2: 00 00 00 24 24 24 (signature?) 080000BF: 7F 0801FFFF: 7F 08240000: 32bit register; bit0: 1=enable RAM, 0=disable; other bits are always zero; initial value is 00000001 The register is the only thing that can be written to. The 8MB at 0x09000000 are the RAM. Initially garbage-filled. When disabled, reads FF, but contents are retained (atleast for a certain time). 0x09800000 and up are open-bus. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 137/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 138/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 139/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
0.4 had a secret feature where pressing TAB toggled the framerate limiter.
I could readd it, but it'd be best with a proper hotkey system. ____________________ Kuribo64 |
Arisotura |
| ||
Big fire melon magical melon girl Level: 56 Posts: 140/889 EXP: 1348049 Next: 50127 Since: 03-28-17 From: France Last post: 22 hours ago Last view: 1 hour ago |
MP retry mechanism
after each round: (after ack is sent) txheader[2] is updated, bits are cleared when the corresponding client responded fine if the packet needs to be resent, the clients that responded fine aren't polled again (client mask in the frame body isn't updated on the host side tho, but clients do receive the new mask) seems the frame body client mask is copied to txheader[2] at the beginning, regardless of what the initial value is SEQNO is incremented normally for retries, as if they were separate transmits ____________________ Kuribo64 |
Main - Posts by Arisotura |
Page rendered in 0.095 seconds. (2048KB of memory used) MySQL - queries: 22, rows: 109/109, time: 0.013 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |