Fortran on the Panic Playdate

I recently wrote a “Fortran Playdate Development” blog post on getting Fortran code to compile and run on the Panic Playdate (simulator and hardware). The post specifically covers calling Fortran from C in the context of the Playdate.

My question is, is there any existing Fortran code that could be used as the basis of a video game or toy simulation? The Playdate has a 168 MHz Cortex M7 CPU, 16 MB RAM, and a limited stack. It is definitely not a modern supercomputer. =) I am specifically interested in N-body simulations.


Welcome to the Fortran-lang Discourse. The Playdate looks neat. Thanks for sharing that.

I think there was mention of some Fortran games in a thread or two here. I don’t remember exactly which ones (This one maybe Anecdotal Fortran... :-)).

As for N-body simulations, I’m sure there are lots here with experience implementing them in Fortran.

One of the first computer-based games I played was Dungeon, in the 1970s. It was written in fortran, with maybe a little assembler to read keystrokes and such. It was a command line game, not a video game.

I am a space studies major. I wrote my final paper on making “space simulations” (video games) more realistic. First, I covered what a model is. Then I reviewed four space simulations (two single-user, two multiuser) marketed for the general public in the context of being models of space exploration. After that, I gave recommendations.

Some of the research was on N-body simulations. The main book I used for N-body simulations, Gravitational N-Body Simulations: Tools and Algorithms by Sverre Aarseth, wrote about code written in Fortran, so that is why I am here. The code was written for GRAPE hardware though.

My understanding is that Fortran is used for number crunching and physical science calculations. My goal in using Fortran is not to write games in Fortran. Rather, it is to leverage existing Fortran code to make games and simulations that are more accurate and less likely to miseducate the general public.

As models, the titles I reviewed were fit for their intended purpose of making money in a commercial context. As models of space exploration, important details were hand waved to the extent they were garbage in, garbage out. The single-user simulations did not capture interpersonal dynamics at all, and the multiuser simulations had terrible models of the physical system. None of the existing models can be used as meaningful predictive simulations of near term space exploration, although some meaningful conclusions can be drawn. (As research goes, I could conduct a more thorough investigation and write a book on the topic…)