NeoOne wrote: Thu Sep 25, 2025 8:35 amYes DSP-1 seems to be in a fair number of games. If it only does 3D stuff though, it doesn't seem that useful for most normal 2D games. Probably made sense to take it out in that case.
The DSP-1's functions are:
General:
- 16-bit multiplication
- floating-point inverse
- sin/cos
Vector:
- vector magnitude squared
- vector magnitude compare
- vector magnitude
Coordinate:
- 2D rotation
- 3D rotation
Projection:
- set parameters for screen projection
- calculate Mode 7 matrix elements for a scanline
- calculate object position and size onscreen
- calculate ground coordinates of screen pixel
Attitude Control:
- calculate attitude matrices
- convert from global to object coordinates
- convert from object to global coordinates
- inner product of forward attitude with a vector
New Angle:
- 3D gyration
It almost seems custom-built for Pilotwings specifically, but it would be helpful for any game using Mode 7 perspective, and probably some 2D games, not to mention something like Wolfenstein 3D. It would almost have been like a very primitive GTE or RSP, one generation early...
Thanks for the info! It does seems that Nintendo didn't plan for OAM raster updates! I guess with 128 sprites available though, its not that much of an issue
It's not too bad, considering how much cheaper the SNES was than the Neo Geo, plus the fact that it has robust BG layer functionality.
The guy who made the recent Sonic demo on SNES suggested that the moving stage elements in Marble Zone would be hard to do on SNES due to the limits of the sprite system. Leaving aside the possibility that he was being too pessimistic about using sprites, I figured out that using Mode 2 would probably work fine because you can use HDMA to change the VRAM offset of the column scroll table...
Nice work with the bullets. It seems like you are making some kind of bullet hell game - whichever one it is. Would be interested to know how you do collision checks quickly on the *player bullets* versus enemies. That's the proper CPU intensive one if you have a lot of enemies. I think about this a lot!
Thanks. I've been thinking about that on and off, but I haven't finalized a method. Like I said, I haven't made as much progress as you'd expect, for reasons which will hopefully be out of the way in the near future. You're quite right; in rare circumstances it appears to be possible to have to deal with thousands of unique enemy/bullet combinations.
One fairly obvious approach would be to make sure the player bullets (which
largely move upwards at constant speed) are strictly sorted by Y-coordinate. The simplest thing would then be to do a linear search from the near side, aborting on overshoot. A binary search would probably be a fair bit faster, although you'd have to check in both directions from the first detected hit to catch simultaneous collisions. This should already be a substantial improvement over just trying all of the possible combinations.
Most types of player bullets in this game can be grouped into "flights", which are released at the same time, travel (mostly) upward, and maintain a narrow vertical extent. Checking for collision with whole flights would allow much faster rejection of distant bullets. Sorting the flights and enemies into bins in the Y-axis could make this even quicker.
Some types of bullets travel in a fairly narrow column, the horizontal extent of which can be easily tracked. This could allow substantial numbers of enemies to reject that entire bullet type before even checking for collision with flights.
Homing shots can't really use the "flight" method and they're hard to sort by Y-coordinate, but they might benefit from a full 2D grid method like the one I used to do 128x128 collisions at 60 fps on the SNES CPU:
ROM:
viewtopic.php?p=240647#p240647
Explanation:
viewtopic.php?p=240751#p240751
This type of method should work well with the Y-axis bin sort used for flight collision checks, because the grid assignment can be easily reused as a 1D bin assignment by simply considering a row of cells as a bin, without having to redo anything.
I expect using box-point collision will be optimal. Basically you just have to adjust the hitbox of whatever thing you're checking for collisions to be appropriate for the size of the colliders in the list you're checking it against, which should be much more efficient than loading or calculating a hitbox every time you load a collider from the list.
Did I miss any good ideas?
I'll have to do comprehensive testing to make sure I go with the optimal method. This game does load the Super FX fairly heavily just with the enemy bullet patterns, and in some cases I have to render backdrop elements into the bargain, so I can't afford to be lazy with collisions.