blargSnes -- SNES emulator for the 3DS (WIP)

Discussion in '3DS - Homebrew Development and Emulators' started by StapleButter, Aug 10, 2014.

Thread Status:
Not open for further replies.
  1. StapleButter
    OP

    StapleButter 'New Member' registered since 2009. Fuck yea.

    Member
    776
    1,485
    Dec 5, 2009
    France
    A little progress report of the last days: banging my head against an obscure crash bug. Debugging those with no debugging facilities and a retail console that just freezes when crashing, is real fun.

    The cause of it may still be present in the code so I need to patch more places against that.


    Other than that, I got sprites somewhat working. Except they don't flip and are all 16x16. I'll do the rest tomorrow.
     
    filfat, Margen67, shamzie and 3 others like this.
  2. sgtkwol

    sgtkwol GBAtemp Regular

    Member
    222
    69
    Oct 29, 2008
    United States
    Sprites, in 3D? That would be a great use of 3DS hardware, once this is in a more stable form. Bottom screen for configuring the oddly configured sprite layers.
     
    Margen67 likes this.
  3. ferret7463

    ferret7463 GBAtemp Advanced Fan

    Member
    597
    96
    Sep 21, 2010
    United States
    That is what being the first to try something new means. You doing great and don't stress over it.
     
  4. Normmatt

    Normmatt Former AKAIO Programmer

    Member
    2,145
    549
    Dec 14, 2004
    New Zealand

    Wait 3dmoo and citra can't run your emu?
     
  5. Apache Thunder

    Apache Thunder I have cameras in your head!

    Member
    4,160
    4,155
    Oct 7, 2007
    United States
    Levelland, Texas
    I would assume that pixels hidden behind a different layer like a sprite or player character are actually being rendered anyway. Why would the SNES waste CPU cycles removing/adding back background layers? layers on top always have priority, so for example the player character which likely has it's own layer or is on some kind of sprite layer would be the layer that refreshes while layers below them are loaded with all pixals being rendered and it only calculates where the top layer data is. It's automatically obscured by the end result, but in memory, I'm sure the obscured pixels are actually still there. ;)
     
  6. StapleButter
    OP

    StapleButter 'New Member' registered since 2009. Fuck yea.

    Member
    776
    1,485
    Dec 5, 2009
    France
    Normmatt unless they emulate a SD card, I don't think so.
     
  7. Normmatt

    Normmatt Former AKAIO Programmer

    Member
    2,145
    549
    Dec 14, 2004
    New Zealand

    3dmoo emulates sdmc :P
     
    mercluke likes this.
  8. Kane49

    Kane49 GBAtemp Fan

    Member
    450
    232
    Nov 4, 2013
    Gambia, The
    And even if it didn't, preloading the rom image into memory should be a minor tradeoff for debug facilities
     
    RubenCantuVota likes this.
  9. StapleButter
    OP

    StapleButter 'New Member' registered since 2009. Fuck yea.

    Member
    776
    1,485
    Dec 5, 2009
    France
    SignZ and the_randomizer like this.
  10. dubbz82

    dubbz82 GBAtemp Advanced Maniac

    Member
    1,524
    829
    Feb 2, 2014
    United States
    Very cool...great work. Glad to see 3ds homebrew is starting to kinda take off.
     
  11. planetarian

    planetarian GBAtemp Regular

    Member
    135
    147
    Aug 5, 2014
    United States
    Sorry, my wording was a bit off. What I'm concerned about is not whether lower-layer objects get rendered, but something a bit different.

    For example... this isn't SNES, but illustrates the problem well (and I'm most familiar with it on a technical level): If I recall correctly, Sonic games use two sets of tiles for for levels: one for the actual tile artwork, and a matching set that contains metadata like solidity, surface angles, and more importantly, foreground/background mask. That latter bit determins which pixels in the art tileset are drawn on the foreground layer, and which are drawn on the background layer, so they don't need to draw separate foreground and background tiles.

    This means that in cases similar to this (obviously sonic isn't on SNES but the same principles may apply to some games), behind pixels marked as 'foreground', there's literally nothing to render (except sprite data, anyway). The result is that if you make it 3D without doing some sort of additional work, you may end up seeing some of the 'empty' background behind the foreground. Just an example.
     
  12. loco365

    loco365 GBAtemp Guru

    Member
    5,458
    2,679
    Sep 1, 2010
    Actually, looking at this, would it be possible to have a second version of this emulator as a .dat that has a rom preinjected (Sorta like that GB emulator)? Or would that area of the console not have enough permissions to properly work?
     
  13. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,235
    9,622
    Sep 23, 2013
    from my understanding the .dat homebrew is only run on the arm9 core, and .3ds is running on arm11
     
  14. st4rk

    st4rk nah

    Member
    545
    672
    Feb 11, 2014
    Brazil
    No, have a way to run with ARM11, my Chip8 work in ARM11 .dat
     
  15. gamesquest1

    gamesquest1 Nabnut

    Member
    GBAtemp Patron
    gamesquest1 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    14,235
    9,622
    Sep 23, 2013
    ahhh okies, i seem to remember seeing stuff about that, but correct me if im wrong but there is some technical reasons why .dat homebrew didn't really take off, im not a dev so im not clued up on the specifics, but basically from reading up a while back the .dat homebrew is running on bare bones whilst .3ds has access to 3ds services or something along those lines :lol:
     
  16. st4rk

    st4rk nah

    Member
    545
    672
    Feb 11, 2014
    Brazil
    Exact, with .dat you can't use some services from ARM11, then it is a big problem..

    Sorry Off-topic.
     
  17. spinal_cord

    spinal_cord Knows his stuff

    Member
    3,040
    610
    Jul 21, 2007
    somewhere

    From the little I remember from older SNES emulators, each layer is rendered fully and displayed in a specific order depending on the game. There may or may not have been many games with tiles within a background having different priorities to sprites, I know some games did, which is evident on some incomplete emulators. I would think simply rendering each layer at a different offset for the 'other' eye should would quite well, maybe even have a .ini file or something per game with offset settings that the user can adjust. There's a youtube video out there somewhere that shows some SNES emulation rendered in 3D so the theory is perfectly sound. But I think it would be best to get the emu fully working first before adding 3D into the mix.
     
  18. planetarian

    planetarian GBAtemp Regular

    Member
    135
    147
    Aug 5, 2014
    United States
    Right, we know all that already. The issue is when you encounter games that actually don't have anything in the art tiles for what's behind foreground tile art. Let me use an illustration to demonstrate:

    On the left, a typical game which has art for background and foreground, and simply draws one to foreground and the other to background.

    On the right, a game such as those in the Sonic series where a single art tile is used, and a mask determines which pixels get sent to foreground layer and which get sent to background.

    Top row: actual tile data.
    Middle row: what gets drawn to the foreground and background layers)
    Bottom row: example 3D result, simulated by offsetting the background 4px right and 2px up.

    [​IMG]

    Make sense?

    Obviously, it'd be best to wait until the emulator is fully functional until we start prodding the dev to implement 3D to begin with. It's still fun to discuss though =)
     
    Margen67 likes this.
  19. andremario81

    andremario81 GBAtemp Regular

    Member
    174
    10
    Jun 4, 2014
    United States
    Chicago, Illinois
    How do you get blargsnes to run? I'm lost
     
  20. spinal_cord

    spinal_cord Knows his stuff

    Member
    3,040
    610
    Jul 21, 2007
    somewhere
    Sure, your explanation makes sense, but I really don't think any SNES games did that. Load up an snes emulator that allows removing layers (usually with num keys 1-5) I don't remember ever sing a game where the back/foreground is masked out in any way. Usually the whole layer is drawn, quite often if there was more than one background layer used, it was for parallaxling so would scrol at different speeds anyway.
     
Loading...
Thread Status:
Not open for further replies.