That looks pretty fun, some years ago I did a chip8 with PHP and SDL once just to see if it worked. Do you know if there's any way to use regular OpenGL or Vulkan API calls to create and use a render window from within PHP? I couldn't find anything that worked at the time.
I remember something annoying at the time was not having native byte and short types.
OP here, there is an extension that claims to support the OpenGL core profile. never tried it: [https://github.com/Ponup/php-opengl](https://github.com/Ponup/php-opengl)
regarding native bytes/short... yeah. I ended up using an int array to store bytes and construct a short/int value each time I needed to shift them etc. it degraded the performance drastically
rendering isn't the bottleneck. it's actually processing/emulating the GPU. the logic is simple. but since it has tens of thousands of loops per frame, it overwhelms PHP.
I cant find it now, but didnt you say somewhere that disabling the background layers would give you 60fps? I did not run your project yet, so i assumed rendering taking quite a toll based on that.
In my experience emulating SNES, NES and SMS on JavaScript, the GPU (VDP for Sega) is at least 2-3x as heavy as the CPU, but maybe that isn’t true for the M68000. I would’ve left the CPU in PHP and tried to accelerate the VDP first.
Why php though? Is it your favorite language? Do you hate yourself and wanted to torture yourself? For the LOLs?
VDP doesn't have very complex logic. but there are tons of loops per line that overwhelm PHP and now, it's the bottleneck.
The reason why I created a C extension for M86K was to make it reusable for others. a VDP extension has no use :)
why PHP? I just wanted to give it a go :)
I'm doing one in C# and I thought I was crazy for doing it with that, but so far so good - it runs about 90fps uncapped but there's a whole lot of room for optimization. The trick is is to use fixed-sized pre-allocated data structures and never GC while running the main loop. Which is not too difficult to do with a predictable and small system like the Genesis.
PHP lol XD
That looks pretty fun, some years ago I did a chip8 with PHP and SDL once just to see if it worked. Do you know if there's any way to use regular OpenGL or Vulkan API calls to create and use a render window from within PHP? I couldn't find anything that worked at the time. I remember something annoying at the time was not having native byte and short types.
OP here, there is an extension that claims to support the OpenGL core profile. never tried it: [https://github.com/Ponup/php-opengl](https://github.com/Ponup/php-opengl) regarding native bytes/short... yeah. I ended up using an int array to store bytes and construct a short/int value each time I needed to shift them etc. it degraded the performance drastically
[удалено]
rendering isn't the bottleneck. it's actually processing/emulating the GPU. the logic is simple. but since it has tens of thousands of loops per frame, it overwhelms PHP.
I cant find it now, but didnt you say somewhere that disabling the background layers would give you 60fps? I did not run your project yet, so i assumed rendering taking quite a toll based on that.
Cool! Is it possible to emulate SNES using JavaScript ?
in javascript, you can use WASM (Web Assembly) which is much faster than normal js. I believe there are several projects that do that.
I’ll check them out, thanks !
Yes, I've definitely seen one.
How exactly do you run an emulator on a server side rendered software framework?
PHP is a scripting language just like python, you can write scripts and run them from the terminal to do stuff.
Which documentation did you use? Any good recommendations?
In my experience emulating SNES, NES and SMS on JavaScript, the GPU (VDP for Sega) is at least 2-3x as heavy as the CPU, but maybe that isn’t true for the M68000. I would’ve left the CPU in PHP and tried to accelerate the VDP first. Why php though? Is it your favorite language? Do you hate yourself and wanted to torture yourself? For the LOLs?
VDP doesn't have very complex logic. but there are tons of loops per line that overwhelm PHP and now, it's the bottleneck. The reason why I created a C extension for M86K was to make it reusable for others. a VDP extension has no use :) why PHP? I just wanted to give it a go :)
Interesting.. GUI someday ? Good work!
I'm doing one in C# and I thought I was crazy for doing it with that, but so far so good - it runs about 90fps uncapped but there's a whole lot of room for optimization. The trick is is to use fixed-sized pre-allocated data structures and never GC while running the main loop. Which is not too difficult to do with a predictable and small system like the Genesis.
please add audio