PDA

View Full Version : Trekmo running in DS2x86!



wraggster
November 14th, 2010, 20:57
Pate has posted more news concerning his Dos emulator for DS:


During the last week I kept adding opcode after opcode, with seemingly no change in how far Trekmo progressed in DS2x86. Trekmo uses a lot of trigonometric calculations and other algorithms before it actually draws anything on the screen, so it was rather boring adding all of these, and not even being sure whether I left some bugs in them or not. Then this Friday, after I had added yet another opcode, Trekmo suddenly began drawing the actual space scenes! So, here are some pictures of Trekmo running in DS2x86, to make up for the lack of screen copies in the last couple of blog posts. :-)


The interesting (and pleasently surprising) thing was that everything seemed to work properly! I had assumed that I must have coded at least some bugs in the arithmetic opcodes, so I expected to see broken polygons and possibly a complete crash after a few frames. There did not seem to be any problems, though. Trekmo progressed fine for several seconds, and then reached a yet another unsupported opcode. I thought this was enough for Friday, though, so I left adding the remaining opcodes later.

On Saturday morning I worked a while with an improved IRQ system (as the current system is far from optimized), but could not get it to work properly. I always have trouble with the IRQ system, it is by far the most difficult thing to get working in my emulator. In the end I had to roll back my changes, and decided to let the IRQ system be like it is for now, and work on getting Trekmo to run all the way thru to the end. Trekmo has a framerate calculator, so it can be used for benchmarking the combined CPU and graphics card system of a PC. In my Trekmo documentation I have a table of results from the systems I ran it on (back in 1994). The table has the following values:

Machine CPU Graphics Bus Framerate
Compaq Prolinea 4/66 486DX2/66 ET4000 VLB 40.7 fps
No-name clone 486DX2/66 Cirrus VLB 38.0 fps
Developed on this one: 486/33 ATI ISA 20.5 fps
AST Bravo LC 4/25s 486SX/25 Cirrus VLB 19.6 fps
Hyundai S386-C 386/20 S3 ISA 6.5 fps


Finally today I managed to get Trekmo to run all the way to the end, so I was able to get a benchmark reading. Trekmo runs in DS2x86 (with the DSTwo MIPS processor running at 360MHz) at an average speed of 11.9 fps, which makes it noticeably slower than a 486SX/25 machine, but nearly twice as fast as a 386/20 machine. So, my original estimate of "a bit faster than a 386/33" machine is still valid. And, if I get the IRQ handling improved, it might still get a bit faster. However, I still have no audio support, and that in turn will make the emulation run slower, as I can not offload the audio handling to another CPU as I did in the original DSx86.


So, now that Trekmo is running, I need to find a new program to test. It would be interesting to try to get Windows 95 running, but I believe that is a bit too big a project to tackle at this point. DS2x86 still lacks a lot of protected mode opcodes, so perhaps I should instead try to make some 386-specific games (Zone 66, Doom) running. I should also start working on audio emulation, but it just feels so boring. I have already coded an AdLib emulation once, so coding it again for a different assembler does not feel like an interesting task.

http://dsx86.patrickaalto.com/DSblog.html