seriously? this is awesome!!!! I remember my 386 PC that had serious trouble with keeping that game run smoothly :-D I ordered this board today and seems I made the right decision!
You can easily upgrade the RAM to 32MB harvesting the ics from old 256MB sodimm modules. Cheap as $3 on eBay and you get 8 chips. Or find any RAM module that has k4s561632 chips. Original 8MB RAM have 12 bit row address and 8 bit column address The 32MB RAM have 13bit row and 9 bit column. After replacing the ic, A12 is not connected in the PCB, so you need to solder a wire from sdram pin 36 to stm32 PG2 (pin87) and modify the FMC (flexible memory controller) settings to add a row and column address . Or you can solder A12 to gnd, then add only a column address in the settings, that way it'll use 16MB which is still better than 8 ;)
I got the STM32F7 Discovery recently. Comes with a mini SD card slot. It's twice a powerful as the above so it could potentially run late 90s-early 00s level games ported natively.
+Sharif Sourour Doom is unusual in having the source code available. John Carmack released it deliberately. The same is true for Quake, but not many other games. For most games, probably an emulator would be best. You can get ARM boards with wickedly fast CPUs, well up to the standard to emulate a fairly fast (by back-then standards) Pentium PC.
@floppes How do you play it with the touch screen? Is there a way to add external buttons perhaps? The finger is in the way of the tiny screen! Other that that awesome job!!! Amazing!
+Thanos 6DOF motion sim electronics Every side of the display corresponds to a direction to move. You can use a small pen if your finger is in the way. I have added an analog joystick to my base board which makes playing really smooth. In the project shown here I removed my base board and external hardware so everyone with a OTG cable can try it.
+floppes Yes, playing with joystick would be much better, can you send me the modified code for it? I couldn't figure out where to do the change for external buttons or joystick in the existing code. My email is Tronickod@yahoo.com Thanks, Thanos
I can not compile. It gives an error message: "src\chocdoom\i_videohr.c:19:17: fatal error: SDL.h: No such file or directory" Indeed, the file "i_videohr.s" contains including #include "SDL.h", but the "SDL.h" nowhere present.
I've read the code it is a custom and embbeded LDC and DMA2D routines. that very interesting tough. why not use CubeMX for more portability ? Anyway there is à lot to learn from that project. thank to share.
Hi, I already did that; I ported floppes's code to hal libs, also got heretic game running on stm32f7. th-cam.com/video/zn9-NjbVlNc/w-d-xo.html Source code: github.com/Julioyevenes/doom_f7 Regards.
i know it's an old video and everything, but i wonder how hard it would be to somehow turn the source code into an Arduino sketch, so you can just directly upload it to any STM32 Board. then there could also be more support for extra hardware like PS/2 Mouse/Keyboard instead of touch, and using different Displays like a cheap 128x160 TFT LCD.
I don't know of any official Arduino with an STM32 microcontroller, but you could use an STM Nucleo board with a high power MCU with LCD interface, if you prefer the Arduino IDE. The advantage of the STM32F429IDISCOVERY board is the 8 MB RAM and an MCU with LCD interface for fast screen drawing. Oh and extra hardware like mouse and keyboard can be added to STM32F429IDISCOVERY. There are plenty of free GPIOs ;)
@@floppes1337 yea i meant Arduino IDE compatible STM32 boards like the Nucleo. not any offical boards from Arduino. are the 8MB RAM nessesary or really just used as a fast Frame buffer of sorts? the Nucleo board i got is the H743ZI2, with a very powerful M7-Cortex @ 480MHz. it should be more than enough to run DOOM, but now i'm worried about the SPI controlled LCD being a massive bottleneck. also is using USB nesseary? shouldn't it be possible to use an SD Card instead? as it only needs an SPI Interface
Maybe there's places you could tinker to reduce RAM usage? Also the touch screen makes it a bit impractical. Not that it's massively practical anyway. But the board, if it's the one I'm thinking of, has gyroscopes, you could use those as a tilt input. Better would be to plug in a joypad, SNES is a good choice, simple serial protocol. Or even a keyboard. I was thinking, ways you could put it in a case to make it more playable. But then I realised Nintendo already make a solution for that, and even things like the Gamepark would do it. Still, cool demo!
+greenaum The gyroscope won't be a better input as it only recognizes movements, not spatial alignments. An accelerometer would be better. I wanted to keep this project as hardware-independent as possible. You only need the board, a USB stick and a USB-OTG cable. Personally, I added this joystick: www.sparkfun.com/products/9032 Makes it very easy to move around :)
Don't gyroscopes and accelerometers actually do what you said, but the other way round? IE accelerometers can only measure relative movement, gyroscopes measure absolute position? I suppose ultimately it's just a fun project, and pretty cool, so I shouldn't get too carried away. I've loved Doom since I first played it, way back when.
+greenaum If you have a 3-axis accelerometer unit and it is kept still or moving at constant speed, you can measure the direction of the gravitational force and thus get an absolute angle. But as soon as you apply (translatory) force to the accelerometers you will get a sum of gravity and external force vectors. That's why IMU's use a combination of both acc and gyros.
Machin396 That's right, the full version (doom.wad) needs more than the 8 MB RAM available on the discovery board. That's why only the shareware version (doom1.wad) containing the first episode will run.
+floppes The PC version only needed 4MB for Doom 1, and 8MB for Doom 2. Bit of a shame. Perhaps some virtual memory? Would be quite a lot of tinkering, but if Doom keeps it's map and graphics data in a particular area of RAM (depends on whether it uses virtual memory, though if it does, adding paging in isn't hard), might be possible. Actually Doom only loaded the levels in one at a time from disk anyway. So why's it so greedy for RAM? Is it to do with ARM code being less dense? Maybe someone could re-write the engine, although that's no easy task even with source available. It's a shame. Is the 8MB on the board on-chip, or on the actual PCB? Do they make versions with more RAM? Even the Gameboy Advance had Doom and Doom 2, and that had something like 384KB RAM, the rest being cart ROM. The ROM image for Doom is 8MB. And it's ARM, of course. Maybe that'd be some help.
+greenaum The code is executed from ROM, no need to load the binary into RAM. The (double) screen buffer is stored in RAM, which takes 300 K. The Doom engine itself needs another few hundred K. But when Doom is starting, it loads all lumps into RAM and with doom.wad this exceeds the remaining 7892 K. You are right, virtual memory would solve the problem. You are invited to add it ;) The external 8 MB RAM is an external chip on the PCB. There are no other variants of the board available.
Okay, maybe I'll let you do the virtual memory in your own time! Seems odd though, because between levels Doom puts up a loading screen. I suppose most of the resources like texture and sound are needed for all maps. Could one, perhaps, look into what's loaded and where, and control it more tightly? Doom I worked on a 4MB PC. Just. You had to use a bit of Memmaker, squeeze things tight as you could, but it worked.
Michael Banville Thanks :) It's 30-35 fps, but that's enough to look smooth. You may use the code anyway you want, but check the licenses in the source file headers in /lib
+Michael Banville It actually probably uses less CPU power to render Doom live than it would to play back a recording. Plus of course, the graphics are perfectly crisp, no compression artefacts.
+Tunahan HAN If you are new to STM32 I suggest you start with a smaller project ;) On the Github project you will find a link to the compiler I used. If you have any of the ST discovery boards, you can use ST-Link utility to flash the firmware.
+floppes I did LED and LCD project, which project do you suggest for learning STM and very thanks to answer. :) Note: I have experience about PIC and Arduino.
The sources and binaries are finally online at GitHub: github.com/floppes/stm32doom It took a while because I wanted to make sure I comply to all the licenses for the libraries I used.
Hi, I ported your code to hal libs, added hub and sound capabilities, also got heretic game running on stm32f7. th-cam.com/video/zn9-NjbVlNc/w-d-xo.html Source code: github.com/Julioyevenes/doom_f7 Regards.
seriously? this is awesome!!!!
I remember my 386 PC that had serious trouble with keeping that game run smoothly :-D
I ordered this board today and seems I made the right decision!
See! If you had done that back in the -80 you would have had no problems!
absolutely beatifuly and awasome job
Wow
You can easily upgrade the RAM to 32MB harvesting the ics from old 256MB sodimm modules.
Cheap as $3 on eBay and you get 8 chips.
Or find any RAM module that has k4s561632 chips.
Original 8MB RAM have 12 bit row address and 8 bit column address
The 32MB RAM have 13bit row and 9 bit column.
After replacing the ic, A12 is not connected in the PCB, so you need to solder a wire from sdram pin 36 to stm32 PG2 (pin87) and modify the FMC (flexible memory controller) settings to add a row and column address .
Or you can solder A12 to gnd, then add only a column address in the settings, that way it'll use 16MB which is still better than 8 ;)
Excellent!
I ran your code on the same board. Now I try to make custom board with ILI9341
Hey floppes, thanks for the source code. I just got an STM32F439I-EVAL and will try to make a port starting tomorrow.
+lassehoei It works!
+lassehoei Show us! ;)
This makes me hate electron apps even more
Hahahahaha... I really hate Electron and all those stuff!!
I got the STM32F7 Discovery recently. Comes with a mini SD card slot. It's twice a powerful as the above so it could potentially run late 90s-early 00s level games ported natively.
+Sharif Sourour Doom is unusual in having the source code available. John Carmack released it deliberately. The same is true for Quake, but not many other games. For most games, probably an emulator would be best. You can get ARM boards with wickedly fast CPUs, well up to the standard to emulate a fairly fast (by back-then standards) Pentium PC.
I just tested it, works a charm! :D
Now I just have to port it to a vape pen
me: what's the wifi password
friend: it's on the back of the router
the back of the router: _this electronic's name_
Thanks, your source code works fine!
Noooo you stole me the idea!! :) Great Job!!
Simone Caporale I had this planned when I bought my stm32f429 too...
Well, you still can do it
@floppes How do you play it with the touch screen? Is there a way to add external buttons perhaps? The finger is in the way of the tiny screen! Other that that awesome job!!! Amazing!
+Thanos 6DOF motion sim electronics Every side of the display corresponds to a direction to move. You can use a small pen if your finger is in the way. I have added an analog joystick to my base board which makes playing really smooth. In the project shown here I removed my base board and external hardware so everyone with a OTG cable can try it.
+floppes Yes, playing with joystick would be much better, can you send me the modified code for it? I couldn't figure out where to do the change for external buttons or joystick in the existing code. My email is Tronickod@yahoo.com Thanks, Thanos
+Thanos 6DOF motion sim electronics Check I_GetEvent() in src/chocdoom/i_video.c. That's where user input is evaluated.
I can not compile.
It gives an error message:
"src\chocdoom\i_videohr.c:19:17: fatal error: SDL.h: No such file or directory"
Indeed, the file "i_videohr.s" contains including #include "SDL.h", but the "SDL.h" nowhere present.
Сергей Александрович You don't need i_videohr.c. Check the Makefile, it is not used there. Just delete the file.
good~ yeah~
Can you make more video for tutorial?
cool
Hello ! nice work it runs smothly ! On which GUI framework did you port it ? emwin ?
bizulk I didn't use any framework, it's bare metal with the ST peripheral libraries.
I've read the code it is a custom and embbeded LDC and DMA2D routines. that very interesting tough. why not use CubeMX for more portability ? Anyway there is à lot to learn from that project. thank to share.
The ST peripheral libraries are superseeded by StmCube, it would be good to port to their new framework. I hope I can do it some day.
Hi, I already did that; I ported floppes's code to hal libs, also got heretic game running on stm32f7.
th-cam.com/video/zn9-NjbVlNc/w-d-xo.html
Source code: github.com/Julioyevenes/doom_f7
Regards.
Я один слышу звук выстрела дробовика?
i know it's an old video and everything, but i wonder how hard it would be to somehow turn the source code into an Arduino sketch, so you can just directly upload it to any STM32 Board.
then there could also be more support for extra hardware like PS/2 Mouse/Keyboard instead of touch, and using different Displays like a cheap 128x160 TFT LCD.
I don't know of any official Arduino with an STM32 microcontroller, but you could use an STM Nucleo board with a high power MCU with LCD interface, if you prefer the Arduino IDE. The advantage of the STM32F429IDISCOVERY board is the 8 MB RAM and an MCU with LCD interface for fast screen drawing.
Oh and extra hardware like mouse and keyboard can be added to STM32F429IDISCOVERY. There are plenty of free GPIOs ;)
@@floppes1337 yea i meant Arduino IDE compatible STM32 boards like the Nucleo. not any offical boards from Arduino.
are the 8MB RAM nessesary or really just used as a fast Frame buffer of sorts?
the Nucleo board i got is the H743ZI2, with a very powerful M7-Cortex @ 480MHz. it should be more than enough to run DOOM, but now i'm worried about the SPI controlled LCD being a massive bottleneck.
also is using USB nesseary? shouldn't it be possible to use an SD Card instead? as it only needs an SPI Interface
Someone take it to the limit and play Doom 3 on it! :D
Is the STM32 runnning an OS?
If not, how is the game being emulated?
There's no OS running, it's bare metal. It's not emulated, the original source code is pure C and I just compiled it with ARM GCC.
Maybe there's places you could tinker to reduce RAM usage?
Also the touch screen makes it a bit impractical. Not that it's massively practical anyway. But the board, if it's the one I'm thinking of, has gyroscopes, you could use those as a tilt input. Better would be to plug in a joypad, SNES is a good choice, simple serial protocol. Or even a keyboard.
I was thinking, ways you could put it in a case to make it more playable. But then I realised Nintendo already make a solution for that, and even things like the Gamepark would do it. Still, cool demo!
+greenaum The gyroscope won't be a better input as it only recognizes movements, not spatial alignments. An accelerometer would be better.
I wanted to keep this project as hardware-independent as possible. You only need the board, a USB stick and a USB-OTG cable.
Personally, I added this joystick: www.sparkfun.com/products/9032 Makes it very easy to move around :)
Don't gyroscopes and accelerometers actually do what you said, but the other way round? IE accelerometers can only measure relative movement, gyroscopes measure absolute position?
I suppose ultimately it's just a fun project, and pretty cool, so I shouldn't get too carried away. I've loved Doom since I first played it, way back when.
+greenaum If you have a 3-axis accelerometer unit and it is kept still or moving at constant speed, you can measure the direction of the gravitational force and thus get an absolute angle. But as soon as you apply (translatory) force to the accelerometers you will get a sum of gravity and external force vectors. That's why IMU's use a combination of both acc and gyros.
Hi! I can't build it,It tells me it can't create dummy.o when compiling dummy.c (no such file or directory)
Pleae help!
Luca Davidian Do you have mkdir? If not, create bin, bin/chocdoom, bin/stm32, bin/usb and bin/fatfs manually.
thanks! it works!
You could make a little Doom only handheld like this! Put it inside one of those awful Chinese emulation consoles you can get for almost nothing.
Check out my other project daddelkischde 2: www.daddelkischde.de/?lang=en
You can play Doom on it, too ;)
@dll_floppes
Doesbt this game need like 16 mb of ram? How much ram or sram does stm32 discovery has?
Machin396 That's right, the full version (doom.wad) needs more than the 8 MB RAM available on the discovery board. That's why only the shareware version (doom1.wad) containing the first episode will run.
+floppes The PC version only needed 4MB for Doom 1, and 8MB for Doom 2. Bit of a shame. Perhaps some virtual memory? Would be quite a lot of tinkering, but if Doom keeps it's map and graphics data in a particular area of RAM (depends on whether it uses virtual memory, though if it does, adding paging in isn't hard), might be possible.
Actually Doom only loaded the levels in one at a time from disk anyway. So why's it so greedy for RAM? Is it to do with ARM code being less dense? Maybe someone could re-write the engine, although that's no easy task even with source available.
It's a shame. Is the 8MB on the board on-chip, or on the actual PCB? Do they make versions with more RAM?
Even the Gameboy Advance had Doom and Doom 2, and that had something like 384KB RAM, the rest being cart ROM. The ROM image for Doom is 8MB. And it's ARM, of course. Maybe that'd be some help.
+greenaum The code is executed from ROM, no need to load the binary into RAM. The (double) screen buffer is stored in RAM, which takes 300 K. The Doom engine itself needs another few hundred K. But when Doom is starting, it loads all lumps into RAM and with doom.wad this exceeds the remaining 7892 K.
You are right, virtual memory would solve the problem. You are invited to add it ;)
The external 8 MB RAM is an external chip on the PCB. There are no other variants of the board available.
Okay, maybe I'll let you do the virtual memory in your own time!
Seems odd though, because between levels Doom puts up a loading screen. I suppose most of the resources like texture and sound are needed for all maps. Could one, perhaps, look into what's loaded and where, and control it more tightly?
Doom I worked on a 4MB PC. Just. You had to use a bit of Memmaker, squeeze things tight as you could, but it worked.
ARM-M3 next?
This also created a video to teach me step out? I'm interested in it .
+Black ship I don't get what you are trying to say...
+floppes I do this and I want it taught me a favor.
+Black ship Sorry, I still don't understand what you are saying.
+floppes they would like you to create a video which is a tutorial, showing how you did this and how they can also do it themselves.
+bobdvd I see Michael Banville has put some instructions above.
wow! my oscilloscope can run it!
A prerecorded video of Doom on Stm32f4?
It's not a recording, check the GitHub repository for the sources.
Sorry, it's true! Unbelievable! Run really smooth, is it 60fps? Seem to have just a little bit of tearing. Excellent work! What is the licence?
Michael Banville
Thanks :) It's 30-35 fps, but that's enough to look smooth. You may use the code anyway you want, but check the licenses in the source file headers in /lib
+Michael Banville It actually probably uses less CPU power to render Doom live than it would to play back a recording. Plus of course, the graphics are perfectly crisp, no compression artefacts.
Is it possible to play (using usb hub) with keyboard and mouse?
Not with this firmware. You are free to implement it ;)
Awesome! I am new about programming STM and I have stm32f407, how can I upload this code, can anyone help me?
+Tunahan HAN If you are new to STM32 I suggest you start with a smaller project ;) On the Github project you will find a link to the compiler I used. If you have any of the ST discovery boards, you can use ST-Link utility to flash the firmware.
+floppes I did LED and LCD project, which project do you suggest for learning STM and very thanks to answer. :)
Note: I have experience about PIC and Arduino.
+Tunahan HAN This website has some helpful tutorials and code examples: www.stm32f4-discovery.com
Great - would You like to publish the source code?
At 1:42, gun fire was before the click button, seem a fake So, do not expect the code.
The sources and binaries are finally online at GitHub: github.com/floppes/stm32doom
It took a while because I wanted to make sure I comply to all the licenses for the libraries I used.
How i can download the code ?
Go to the GitHub project at github.com/floppes/stm32doom and click on "Code", "Download ZIP".
Created this video tutorial , do me a favor .
Hi, I ported your code to hal libs, added hub and sound capabilities, also got heretic game running on stm32f7.
th-cam.com/video/zn9-NjbVlNc/w-d-xo.html
Source code: github.com/Julioyevenes/doom_f7
Regards.
Hey floppes, thanks for the source code. I just got an STM32F469I-DISC and will try to make a port starting tomorrow.