New P1 game: Spin Hexagon
Wuerfel_21
Posts: 5,105
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
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.
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...
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.
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:
(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.
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.
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.
Also, could the powers that be please split the offtopic into it's own thread?
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
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).
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.
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).
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.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