Shop OBEX P1 Docs P2 Docs Learn Events
New P1 game: Spin Hexagon — Parallax Forums

New P1 game: Spin Hexagon

Wuerfel_21Wuerfel_21 Posts: 5,049
edited 2021-01-05 02:20 in Customer Projects
logo.gif

Here's a new game for the P1: A port of Super Hexagon, written in Spin!
To facilitate better formatting, the wall of text is being hosted externally. Click here to read the README

Click here to download the latest version

I've attached a git build of fastspin, which you'll need to compile Spin Hexagon until fastspin version 4.3.0 is released... - just put it in the Spin Hexagon project directory...

Comments

  • Oh yeah, and I gotta ping @"JT Cook", for it has come to the point that I actually released a finished game: Sadly no SD card support for C3 yet, but it kinda works without and shouldn't be difficult to hack in proper C3 support.
  • mparkmpark Posts: 1,305
    Going by the video, this looks and sounds amazing! Another Wuerfel_21 triumph! And good on you for getting Terry Cavanagh's permission.
  • Mad skills, @Wuerfel_21!!! Wow!
  • Wuerfel_21Wuerfel_21 Posts: 5,049
    edited 2020-08-12 05:22
    It seems that GitHub has an inexplicable 1GB bandwidth cap on LFS objects. Like, what the actual Smile? Anyways, in the case that runs out, you can still clone from this mirror repo on GitLab, which doesn't seem to have an absurdly low bandwidth cap.

    I've also changed the link in the top post to an external MEGA download(now a release download, which is inexplicably unlimited) and disabled inclusion of LFS objects into ZIP downloads to conserve bandwidth... What utter nonsense, lol.

    OTOH now I know someone is actually donwloading the game enough to cause this issue, so that's nice.
  • Great job.
  • Wuerfel_21Wuerfel_21 Posts: 5,049
    edited 2020-08-13 12:05
    mpark wrote: »
    Going by the video, this looks and sounds amazing! Another Wuerfel_21 triumph! And good on you for getting Terry Cavanagh's permission.
    JRoark wrote: »
    Mad skills, @Wuerfel_21!!! Wow!
    Great job.

    Thanks for all the nice words.



    I've migrated the repository away from LFS, which should fix the downloading issues. You might have some problems if you've already cloned the repository, since I had to rewrite history...
  • cgraceycgracey Posts: 14,151
    That's pretty cool!
  • Here's some random photos of Spin Hexagon running on my mini TV in PAL60 mode.
    IDK, but I think it looks really cool on it. (Ignore the terrible geometry - I think it needs new capacitors.)
    The lack of latency is pretty unreal (unlike my main TV, this one doesn't have any fancy framebuffer stuff, just direct signal to the electron guns) - it feels like the game responds before I press the buttons.


    S7300795.JPG
    S7300793.JPG
    3072 x 2304 - 3M
    3072 x 2304 - 3M
  • Cool!

    Yes, old school is fast. I have turned several gamers on to the CRT and have been putting old skills to use finding them, tuning them up and getting them into the hands of people who will use them.

    Depending on our sets and our implementation, we should be able to bring that to the new school displays too.

    Your game on P2, HDMI, set with game mode on, should deliver.

    Good times ahead, IMHO.

    Anyway, nice work. I gotta set up and play this. CRT on a game like that is the only way to play.

    If you are CRT craving, score a PVM before too long. Most display anything PAL, NTSC, 50, 60, etc ..

  • potatohead wrote: »
    Cool!

    Yes, old school is fast. I have turned several gamers on to the CRT and have been putting old skills to use finding them, tuning them up and getting them into the hands of people who will use them.

    Depending on our sets and our implementation, we should be able to bring that to the new school displays too.

    Your game on P2, HDMI, set with game mode on, should deliver.

    Good times ahead, IMHO.

    Anyway, nice work. I gotta set up and play this. CRT on a game like that is the only way to play.

    If you are CRT craving, score a PVM before too long. Most display anything PAL, NTSC, 50, 60, etc ..

    Yeah, I've been kinda wanting a PVM - my only NTSC and/or S-Video capable TV is the really large one with the aforementioned 100Hz framebuffer funkiness (although that is still nicer than most flastscreens, IMO), so I'd want one just for that (but I hear some PVMs have trouble with PAL60, oddly enough). But the online prices too inflated for me and I don't really know where I'd find one locally.

    Relatedly, playing games at 120 or 160Hz on a PC CRT monitor is pretty slick. Sadly, all my PC monitors need fixing - one can't hold HV stable (it kinda sawtooths - bad isolation creating a spark gap?) and one has what appears to be a bad solder joint in the H linearity circuit.

    The problem with the LCDs (and to a degree the 100Hz framebuffer CRT TVs) isn't just delay though - for one, there's the temporal blur caused by the pixel being illuminated all the time and slowly updating to the next value, as opposed to the high-intensity photon bursts from a CRT screen. It works better with the way our eyes work. I think there are some OLED screens that can multiplex their pixels to similiar effect. Then there's the fixed pixels. If the content doesn't match the display, it needs to be scaled. Interpolation scaling looks terrible, as does nearest neighbor sampling on non-integer ratios. And even that just isn't as nice as native resolution content. Here's a photograph of a the aforementioned big TV vs nearest neighbor sampling: realityvseditor.JPG

    (Well, if the scaling ratio is big enough you can put some nice subpixel or CRT filters. And in theory an HDR screen could make them not be too dark.) (Spin Hexagon in particular is, text aside, entirely vector graphics that a P2 could surely push at 1080p, so it's fine, but my other game I'm working on and it's VGA mode... LCD monitors do. not. like. 256x480 input - if I finagle the clock/phase just right, I can at least get the pixels vaguely uniform). Then there's the utterly craptastic analog frontends most new TVs have - most don't support lowres progressive modes properly and utterly butcher composite video.

    So yeah, big agree, nothing better than tube for retro computer graphics.
    6144 x 2560 - 6M
  • If you can score and old plasma display, it is the other glowing phosphors in glass display you can get.

    When one hits timing and native resolution, it is good times. High impact like a CRT, just be careful about burn in.

    I got my PVM for a song. Just set a few searches and or keep an eye out locally. They pop up.

    Mine is amazing, except for the lowly Apple 2! Just a bit too much old school for a PVM.

  • The pictures you linked are dramatic.

    In your VGA, maybe clock it at 512x480 and double up on the pixel clock?

  • Wuerfel_21Wuerfel_21 Posts: 5,049
    edited 2020-09-26 19:26
    potatohead wrote: »
    The pictures you linked are dramatic.

    In your VGA, maybe clock it at 512x480 and double up on the pixel clock?

    That wouldn't really make a difference, would it? That'd just be the same signal. Ideally, I'd make the pixel clock closer to normal VGA, but the video generator clock for VGA mode has to be 80MHz, as otherwise the timing won't work out (there's already 4 different loops for the 4 different sub-long scrolling positions that have the RDLONG in different places relative to WAITVID). Ahh, it's fine enough. The VGA graphics suck, anyways.

    Pictured, a character from the game(tm), in P1 NTSC palette vs 64 color RGB. Maybe a little biased since I draw in NTSC palette first and then convert to VGA.
    NTSCvRGB64.png

    Also, could the powers that be please split the offtopic into it's own thread?
    384 x 256 - 4K
  • potatohead wrote: »
    Mine is amazing, except for the lowly Apple 2! Just a bit too much old school for a PVM.
    Perfect for Spin Hexagon then :) I actually use the vertical chroma blur present on most TVs to get 32 hues instead of 16. Makes the hue shifting a good bit less steppy. But the capture device really doesn't like it and does those weird vertical bars.
  • potatoheadpotatohead Posts: 10,261
    edited 2020-09-26 20:07
    PAL Artifacting! You may be the only one who has done it on a P1. Cool beans.

    Mine will display pretty much anything, except an Apple 2, pixel perfect. And it does that one great, but with extra pixels. Really odd. I need to hook up a P1 and play a little





  • Wuerfel_21 wrote: »
    Oh yeah, and I gotta ping @"JT Cook", for it has come to the point that I actually released a finished game: Sadly no SD card support for C3 yet, but it kinda works without and shouldn't be difficult to hack in proper C3 support.

    My Propeller stuff is packed away, but I am curious to check it out if I can carve out some time. Watching the video, the music really makes it and pulls it all together.

    As far as displays go, good luck finding a PVM. I was fortunate enough to snag two for free a few years ago, however I was able to do so because I knew people who had broadcasting equipment they were unloading so lucked out. However finding a standard CRT display shouldn't be too hard (however they are getting harder to come by), that is what I would try to cast my net to find. When I did all my Propeller stuff I would have a TV right by my computer so I could see how things look and tweak as needed (at least for NTSC stuff).
  • Wuerfel_21 wrote: »
    JT Cook wrote: »
    And of course for the big game that I haven't decided on a tile for yet, I mostly test on the PC version, which also catches a lot more runtime mistakes than the native P1 version (such as reading nonexistant SD ROM pages, writing to hub locations that shouldn't be written by user code, etc). My high-level emulator is seemingly perfect now, I can't remember the last time I had a bug on real HW that I couldn't reproduce on the PC.

    I am curious about your emulator, tell me more about it?
  • It's a thing I made to get that game running on PCs (or anything else with enough resources - I really wann port it for hacked Wiis...) without having to write huge swaths of code twice or accurately emulating a whole P1.

    It has to be said that that game already runs on top of VM of sorts on P1 itself - it abstracts away a lot of non-portable details, including
    - initializing the system (starting gfx/video/sound/input cogs, filesystem wrangling, certain user preferences)
    - how to get gamepad input
    - how to access external ROM/RAM memory (usually backed by an SD card)
    - code exec from external ROM
    - how to do anything sound-related
    - some other gunk (memory copies, multiply/divide, wait for VSYNC, ...)

    Conversely, the user code is not allowed to access any I/O (including CNT) and some memory regions that are needed by the VM (VM LMM code, XMM code cache, graphics driver scratch space, audio data, etc.).

    Aside from VGA/NTSC palette difference, the actual XMM blob is portable between different boards, only the loader/VM needs to be ported...

    The emulator is just an extension of that concept - I wrote C++ equivalents of the gfx/sound cogs and kernal calls and then modified my custom assembler to emit some C++ for every assembly instruction and plop those all into one big function. Link that all together with some glue/init code and voila, PC version!
    As long as the code doesn't invoke illegal or undefined behavior (as an example, trying to read an actual instruction from memory as data is undefined - this allows saving some RAM) it will run exactly the same as the P1 original, except at almost native speed. Well, there's some differences. A big one being that the graphics and audio will only get updated on a wait-for-VSYNC call. So the user code always needs to do that to keep the emulator from freezing. Any race conditions with the graphics code that occur on P1 are also not visible.

    (The VM could (will?) of course also be implemented for P2 - the C++ version won't do tho)

    I hope I did a good job explaining it, but I fear I didn't.

    Anyways, yeah, it's not something that you can just plop any ol' code in and it'll run it, if that's what you hoped for.
  • I've updated Spin Hexagon to work with the new FlexSpin 5.0.0, if you so desire. Compiling with 5.0.0 instead of 4.3.0 doesn't really have any benefit, but you now can.
  • Wuerfel_21Wuerfel_21 Posts: 5,049
    edited 2021-02-24 02:56

    Spin Hexagon for P2 exists now.
    I'm running it at 1024x768 here, but it should probably work at 1920x1080

    However, I can't release it until someone makes a keyboard driver that works under flexspin and an FSRW that works, full stop. I don't think I myself have the mental energy to deal with either of those. If you want to test it as-is right here and now (am particularily interested if you have a 1080p monitor or an HDMI/DVI monitor available), shoot a PM, I can hook you up.

  • Looks pretty cool, Wuerfel.

    I wasn't aware that the keyboard object had stopped working with flexspin. Older versions certainly did, and I've attached one that does work for me.

  • And here's an fsrw that works for me (at least enough to get a directory listing from the card -- I haven't tried all the Ymodem features). It's basically the code forum user @cheezus posted for the P2. I suspect it's flexspin only, since it's pretty old (may pre-date Chip's interpreter).

  • Wuerfel_21Wuerfel_21 Posts: 5,049
    edited 2021-02-24 15:20

    @ersmith said:
    And here's an fsrw that works for me (at least enough to get a directory listing from the card -- I haven't tried all the Ymodem features). It's basically the code forum user @cheezus posted for the P2. I suspect it's flexspin only, since it's pretty old (may pre-date Chip's interpreter).

    The problem I got is that creating the save file (just a simple popen(string("HEXAGON.SAV"),"w")) erases the entire directory. I'll diff it with what I have RN and see what I get.

    @ersmith said:
    Looks pretty cool, Wuerfel.

    I wasn't aware that the keyboard object had stopped working with flexspin. Older versions certainly did, and I've attached one that does work for me.

    I think @garryj said it may be a problem with the PS/2 adapter specifically? (i.e. it'd work with a normal Keyboard. Will have to try that.).

  • @Wuerfel_21 said:

    I think @garryj said it may be a problem with the PS/2 adapter specifically? (i.e. it'd work with a normal Keyboard. Will have to try that.).

    I can't say definitively that it's the PS/2 adapter, although it is a bit of a hybrid. But it's looking more like the keyboard never working may be a very subtle flexspin issue. With a flexspin binary, the USB analyzer shows keyboard data being read, but it never bubbles up to the top object. The PNut binary works as expected. This suggests that maybe some data addressing may be going awry.

    @Wuerfel_21, could you post the MiniKbmObjDemo.spin2, 1CogKbM.spin2 and 1CogKbm_rja3b.spin2 object code that you've been working with? I'd like to make sure we're looking at the same sources.

  • These should be the ones. As I said, I tried a normal keyboard (well, I DVORAK'd it for fun at some point, but that is irrelevant) and it didn't work correctly under flexspin, either.

    My PS/2 adapter actually seems to work fine in an actual application (needs the Re-plug in MiniKbmObjDemo for some reason), provided that the AUX USB PWR socket is connected.

    (Also, note that I can't compile Spin Hexagon P2 on PropTool for testing, it has grown into a weird mash of Spin1-but-with-Spin2-features,Spin2 and C. At least I got rid of the two-stage loader from the P1 version, haha.)

  • I've posted the P2 version in its own thread now, please comment on the P2 version specifically in that one: https://forums.parallax.com/discussion/173007/spin-hexagon-for-p2/p1

Sign In or Register to comment.