Shop OBEX P1 Docs P2 Docs Learn Events
Logicon — Parallax Forums

Logicon

Here's a game console based on the @Wuerfel_21 emulators and the P2 SWaP module.

This was my son's idea. He thinks that if it is home made, he will be able to bring it to school.
(But now he's wondering what kind of lawyers we have access too :)
He came up with the name too...

Anyway, was already making this Eval style adapter for these 2.3" display modules when decided we could just squeeze a Stamp module in underneath and make it stand alone.

Appears to be working. Just need to add speakers and some kind of power supply (right now is USB-C powered).

Needs Prop Plug for now to program.

«134

Comments

  • RaymanRayman Posts: 15,591

    Testing with this wireless USB NES controller. Might keep that and find a way to make the controller detachable from the enclosure...

  • @Rayman said:
    Needs Prop Plug for now to program.

    I guess this is where having an SD program loader would come in.

    Also cool things happening on forum right now.

  • TonyB_TonyB_ Posts: 2,219

    @Wuerfel_21 said:
    Also cool things happening on forum right now.

    Spam-tastic!

  • RaymanRayman Posts: 15,591

    @Wuerfel_21 said:

    I guess this is where having an SD program loader would come in.

    Downloaded one from @pik33
    Seems fairly straightforward... Copy binary to PSRAM. Then, copy PSRAM to HUB, stop all other cogs and reboot.

    @RossH Has a version that doesn't need PSRAM. But, this has it, so might as well use it...

  • RaymanRayman Posts: 15,591

    Suppose without lcd could add a second P2 to Eval style P2 board…

    Not thinking that is particularly useful though…

  • RaymanRayman Posts: 15,591

    Suppose should have added HDMI output. Think can do HDMI and LCD6 at same time, right @Wuerfel_21 ?

  • Wuerfel_21Wuerfel_21 Posts: 5,532
    edited 2025-08-11 21:17

    @Rayman said:
    Suppose should have added HDMI output. Think can do HDMI and LCD6 at same time, right @Wuerfel_21 ?

    Not with 1 cog. I think you could detect the HPD signal on the HDMI port and decide the mode on that. But hot-switching would be difficult.

  • RaymanRayman Posts: 15,591

    Ok, thanks. Now wondering if LCD will keep displaying an image if LCD6 input stops. Imagine not, but guess should try...

    Was going to make a unit with HDMI output as a separate project, but now think they can be combined into one.

    Found a little 2 port USB hub that should work nicely for 2 player...

  • @Rayman said:
    Ok, thanks. Now wondering if LCD will keep displaying an image if LCD6 input stops. Imagine not, but guess should try...

    No, it'll go into this weird lock-up state where the image fades to white.

  • RaymanRayman Posts: 15,591

    @Wuerfel_21 Is there a way to control volume in the code?

  • @Rayman said:
    @Wuerfel_21 Is there a way to control volume in the code?

    Yes and no. There's some values in the code that control volume, but they're not really meant to be changed. If you digitally reduce the signal amplitude, you do not lower the DAC noise floor, so it's not really a great idea. If it's about making it louder: There's kind of a problem there, the audio synthesized by sound chips naturally has rather high dynamic range, so it's rather quiet compared to, e.g. playing WAV files of pop music.

  • RaymanRayman Posts: 15,591

    Ok, have to decide between digital and mechanical pot…

    Mechanical might add to retro vibe…

  • mechanical is good in that it will keep state across resets/different apps.

  • RaymanRayman Posts: 15,591

    Might have to work on a menu system sooner than planned...
    Seems the SWaP module can't use uSD when Megayume is flashed.

    For some reason that is not yet understood, have to fire up FSRW first to make FatFS work.
    The flash was previously loaded with this simple code to mount using FSRW and then stop:

    Pub SuperMain()| r, s, bytes
        'Try to mount a few times then give up if not successful
        repeat 10
            waitms(500)
            r:=sd.mount_explicit(MISO, CLK, MOSI, CS)
            if r<0
              ser.dec(r)
              ser.tx(13)
              sd.release() 'see if this helps next attempt
            else
                quit 'escape from repeat loop if mounted
    
      repeat
    

    So, guess options are figure out why FatFS isn't working or to create a bootloader that need to do anyway...

  • RaymanRayman Posts: 15,591

    Case test 1 is now printing...

    584 x 726 - 89K
  • RaymanRayman Posts: 15,591

    @Wuerfel_21 Did you not have uSD issues with your Stamp during testing?

  • No, but I almost never use the flash. For development I always just RAM boot from the PC.

  • Wuerfel_21Wuerfel_21 Posts: 5,532
    edited 2025-08-16 19:50

    Pro tip: You can just steal the MegaYume uppercode (which is a fairly functional file browser) , change the extension it looks for to .BIX and strip out the actual emulation, that would be a super quick and dirty graphical bootloader that works with all display types.

  • RaymanRayman Posts: 15,591

    @Wuerfel_21 But, this SWaP module doesn't work with FatFS unless FSRW is run first...

    I seem to recall a binary of something in the original Stamp thread where you were getting it to work with @knivd
    Have to see if that one has same issue or not...

  • RaymanRayman Posts: 15,591

    Found a quote from @ke4pjw that might be related to my uSD problem:

    I found that I had to send the SD card a CMD0 before rebooting. That places all of the SD card pins to float. I know that some SD cards have caused reboot issues because of this.

    I see FSRW sending out a bunch of zeros, that might be the same as CMD0...

    @Wuerfel_21 is "_mount" in FlexSpin undocumented? Looked around but don't see it...
    Guess the real thing is in VFS code anyway, so maybe doesn't matter...

  • @Rayman said:
    @Wuerfel_21 is "_mount" in FlexSpin undocumented? Looked around but don't see it...
    Guess the real thing is in VFS code anyway, so maybe doesn't matter...

    Yeah IDK where that one comes from, but the actual thing lives in the SDSPI driver, which is @evanh 's baby.

  • RaymanRayman Posts: 15,591

    @Wuerfel_21 That reminds me... Downloaded the latest NeoYume and got it to work (with aforementioned FSRW hack). But, noticed that the 4-bit experimental uSD driver flag was set. Don't know if it really does anything, but commented that out and it worked...

  • @Rayman said:
    @Wuerfel_21 That reminds me... Downloaded the latest NeoYume and got it to work (with aforementioned FSRW hack). But, noticed that the 4-bit experimental uSD driver flag was set. Don't know if it really does anything, but commented that out and it worked...

    Oh, is it on-by-default in the repo????

  • RaymanRayman Posts: 15,591
    edited 2025-08-16 21:43

    Is that what this means?

    ' 4 bit SD mode (experimental)
    #define USE_SD_4BIT
    SD4_DAT0 = 0
    SD4_CMD  = 4
    SD4_CLK  = 5
    SD4_PLED = 6
    SD4_PPWR = 7
    
  • Wuerfel_21Wuerfel_21 Posts: 5,532
    edited 2025-08-16 21:49

    yes! Oh no!

    EDIT: Fixed on github/sourcehut

  • RaymanRayman Posts: 15,591

    @Wuerfel_21 trying to remember… is there a way to launch MegaYume into a particular rom and bypass the menu?

  • Wuerfel_21Wuerfel_21 Posts: 5,532
    edited 2025-08-16 23:13

    @Rayman said:
    @Wuerfel_21 trying to remember… is there a way to launch MegaYume into a particular rom and bypass the menu?

    Yes. if you're using loadp2, you can just add something like -a /sd/foobar/whatever.bin to the end. This also works for MisoYume. For NeoYume you want to have just the game directory name, like -a mslug. In that you can also override the BIOS selection with the second argument, like -a mslug japan.

    To manually implement this, put %"ARGv" at $FC000, then the list of argument strings (zero-terminated). The list ends on an empty string (two consecutive zeroes).

    I.e. it'd look like

    '' Just for illustration, you can't actually put this in the code
    orgh $FC000
    byte "ARGv","/sd/MEGAYUME/SONIC2.BIN",0,0
    

    or

    '' Two arguments (NeoYume BIOS type override)
    orgh $FC000
    byte "ARGv","lastbld2",0,"japan",0,0
    

    Though MegaYume/MisoYume don't actually check if the list is terminated currently.

    Note that it's also possible to use this style of parameter passing with FlexC natively (i.e. getting the argc/argv passed into main).

    One problem with this is that it doesn't work if the debugger has locked high memory.

  • RaymanRayman Posts: 15,591

    Case #1 has some issues, but does look like it can generally work.
    Need to improve holder for this SNES controller. Seems it is thicker in the back than in the front, missed that.

    These square speakers work. They were same price as round ones, so giving them a try.
    Still need to work in volume control though...
    Also need to integrate them into the case

    Added lipo battery power and charging using this thing:
    https://www.sparkfun.com/sparkfun-lipo-charger-plus.html
    Hacked it into the onboard USB-C connector.

    But, seems forgot that USB devices won't work at 4.7 V (or whatever this is).
    Seems controllers need actual 5.0 V to work :(
    So, need to build or buy a boost converter.

    Actually, something like this is what is needed:
    https://www.sparkfun.com/sparkfun-lipo-charger-booster-5v-1a.html

    480 x 640 - 150K
  • If it's a 1:1 SNES clone, the attached OpenSCAD model might be of help. I searched that up for an idea earlier, don't remember where it came frome, hope there's a credit inside the file...

  • evanhevanh Posts: 16,696
    edited 2025-08-18 09:13

    @Wuerfel_21 said:

    @Rayman said:
    @Wuerfel_21 is "_mount" in FlexSpin undocumented? Looked around but don't see it...
    Guess the real thing is in VFS code anyway, so maybe doesn't matter...

    Yeah IDK where that one comes from, but the actual thing lives in the SDSPI driver, which is @evanh 's baby.

    It's a lot easier now to make edits to a driver when using the new mounting API. Megayume is still configured for the old API. Required changes to use new mounting API in megayume_upper.spin2. Two steps ...

    • Add the external sdmm driver object, attached below (needs placed with megayume_upper.spin2), to replace the built-in driver:
    sdmm: "sdmm_bashed.cc"
    c : "libc"
    a : "fsadapter.c"
    
    • Replace the single _mount() line with 5 lines as follows (I've copied this from Neoyume):
    '_mount(@"/sd",c._vfs_open_sdcardx(SDCARD_CLK,SDCARD_SELECT,SDCARD_DI,SDCARD_DO))
    tmp := c._vfs_open_fat_handle(sdmm._sdmm_open(SDCARD_CLK,SDCARD_SELECT,SDCARD_DI,SDCARD_DO))
    if _mount(@"/sd",tmp)
      putstring(@"FS mount error:",2,24,0)
      putstring(c.strerror(errno),3,25,0)
      repeat
    
Sign In or Register to comment.