DSx86 v0.05 released

tempBOT

The GBAtemp Robot
OP
Editorial Team
Joined
Nov 21, 2007
Messages
27
Trophies
2
XP
4,270
DSx86 v0.05 released

'sup guys! Popular but young updated version of the x86 emulator has been released! Thanks Pate!

Changelog below

Finally I got version 0.05 released! The biggest changes since 0.04 are the improved EGA support (so that Commander Keen 4 runs), and I also added the blitted screen update mode for CGA graphics mode. In earlier version only the Direct mode was supported, now you can select whether you want to use blitted (60 FPS, 30 FPS or 15 FPS) or direct screen update.

Speaking of screen update modes, I don't think I have properly described what the differences between those direct and blitted modes are, and how they relate to the different graphics modes that DSx86 supports, so I think it is time I do that. First, the difference:

Direct mode writes directly to the Nintendo DS display memory (VRAM) at physical memory address 0x06000000. The way this works is that I detect whether the ES segment address points to the emulated x86 display memory (addresses between 0xA000-0xBFFF), and if it does, the segment prefix (or MOVS/STOS opcode) switches to use a different (duplicated) set of opcodes that do not store data to the emulated x86 RAM but instead write directly to the corresponding pixel(s) of the physical NDS VRAM. How the written data is converted to pixels is different in each graphics mode, so this mode needs as many different handlers for the same opcode as there are supported graphics modes.


The advantage of this mode is that it is generally much faster than the blitted mode, as the pixels are written only once, and only the actually changed pixels are handled. The drawback is that it needs duplicate versions of all the opcodes that can write to memory (and in the x86 architecture most of the opcodes can!) and it only detects screen address by ES segment. If the display memory is addressed by the DS segment it won't be detected (except in MOVS opcode) and thus the game won't work properly. In practice it is almost always the ES segment that is used to point to graphics memory (as it is the only generally unassigned "free" segment register) and the number of opcodes actually used is very limited. However, when using direct mode, I can never be sure that the next game won't use some new opcode I haven't yet handled in direct mode.

Blitted mode in turn uses the emulated x86 display memory at 0xA000-0xBFFF just like any other memory, so that all the normal memory operations are supported. It needs no special opcodes, and all segment registers can be used to access the display memory, so this mode will not cause "unsupported opcode" errors, nor should the game behave strangely.


Depending on the selected blitting speed (60 FPS, 30 FPS or 15 FPS) the emulated display memory is scanned every, every other, or every forth frame in full, and all the pixels are copied to the actual Nintendo DS hardware VRAM. This process is as slow as it sounds like, as all the pixels are copied even if nothing has changed on the screen. Every pixel is in fact written to twice, first into the emulated memory and then again when it is copied to the actual hardware display memory. Thus this mode is generally much slower than the direct mode.


Next, let's look at the different graphics modes supported by DSx86, and how they use those screen update modes:

Text modes (80x25 and 40x25) currently only support Direct mode (regardless of what you select as Screen Update method). That is because I thought the text mode displays would become annoyingly sluggish if the display memory (which only contains the character code and attribute per each byte pair) is scanned and converted to bitmapped 6x8 pixel characters per each frame. With direct mode the data is written both to the emulated VRAM at x86 segment 0xB800 (so that the character code is easily accessible) and also directly to the NDS VRAM as a 6x8 pixel font.
CGA mode 320x200x4 supports both Direct and Blitted modes (starting from version 0.05). Earlier only the Direct mode was supported. If I need to decrease the memory usage of DSx86 code at some point I might actually remove the CGA direct mode support, as I believe the games that use CGA mode will probably run fast enough also using the blitted mode, and keeping the direct mode creates quite a bit of code bloat.
EGA modes actually use a combination of Direct and Blitted mode (again regardless of what is selected as Screen Update method), which is a bit sad as it brings the drawbacks of both of the modes, and none of the advantages can be used. This is because of the complexity of the EGA graphics modes; they do not write directly to the display memory even on the x86 architecture, instead they use the EGA graphics registers to modify and expand the written byte to the 32-bit output value, as I explained below in the Jan 17th blog entry. This also means that EGA supports needs a lot of duplicated opcodes, many of which are still missing. Also not nearly all the EGA register fatures are yet supported, and I'm actually thinking of refactoring much of the current EGA code to be able to support the features in the next version.
MCGA mode supports both direct and blitted mode, so you can try with the the direct mode first, and if you get unsupported opcode errors, fall back to the blitted mode. Some games (like Solar Winds) use the DS segment register to write to the graphics memory, so they will always need to use the blitted mode.


In the future I will continue working on the EGA mode, and at some point I'll expand this to the VGA Mode-X style graphics modes (as used by Wolfenstein 3D and Master of Orion, for example). Those modes also need a combination of direct and blitted mode, as they use the VGA registers and the full 256KB of VGA VRAM. They are faster to blit to the screen though, as they use the same 8-bit pixels as the Nintendo DS VRAM, so no conversion is needed. I'm also thinking of switching to a "dirty buffer" approach with the text mode support, so that I could drop the direct mode support and switch to blitted mode, without killing all the performance.

Anyways, hope you like the new version, and sorry I haven't had time to go through all the debug logs you have sent me. I'll continue working on those reports for the 0.06 version, and please keep on sending the log files from 0.05!

Download Link
Contributed by fgghjjkll
 

iFish

Slower than a 90s modem
Member
Joined
Jul 11, 2009
Messages
4,233
Trophies
1
Age
29
Location
Montreal, QC
XP
593
Country
Canada
ah thanks new hadrian *cough*better one*cough*
tongue.gif


joking but that... i thought it was a gba emu for ds
tongue.gif
 

jeklnoo

Well-Known Member
Member
Joined
Oct 20, 2006
Messages
339
Trophies
0
Website
Visit site
XP
155
Country
United States
cool, anyone have any reports of any games being playable at full or near full speed? It mentions Keen 4, if that plays well, I'll be very happy
 
B

BryceOne

Guest
I have Oregon Trail. Dont remember if it's a DOS or Windows game though. Is there a version of PC's Oregon Trail that would work on this, or some other way to play it on DS?

EDIT: I know it's on DSi but we only have the original DS.

2nd EDIT: Nevermind.. Looking at the description of the emulator, i highly doubt it will run well enough (if at all)
 

phoenixclaws

Well-Known Member
Member
Joined
Oct 10, 2007
Messages
497
Trophies
0
Age
40
Location
USA
XP
203
Country
United States
More and more games are getting playable and some are showing more stuff for those that aren't playable yet. I'm hoping he can get Galactix working. It's a fun little shooter game
smile.gif
.
 
D

Deleted_11405

Guest
great emu i tried Lotus 3 - the Ultimate Challenge its works perfect for one player
smile.gif
 

q2k2k

Active Member
Newcomer
Joined
Nov 19, 2008
Messages
38
Trophies
0
Location
My House
Website
gouki.tastyspleen.net
XP
112
Country
Canada
Games that i have tried which does not work
COmmander keen 4(when starting new game and even paddle war)
crystal caves
moraff's revenge
zzt
super zzt
jazz jackrabbit 2

working games:
duke nukem 1

these are the games i used to play in the past and would be awesome if i could play them again on the go
 

drake7707

Active Member
Newcomer
Joined
Feb 12, 2006
Messages
33
Trophies
0
Age
37
Website
Visit site
XP
222
Country
Belgium
http://dsx86.patrickaalto.com/

put DSx86.ini in /data/dsx86/
put 4DOS.com in /data/dsx86/4dos/

then once the shell is loaded c:\ is the root of the flash card, so navigate like dos to your games


Btw I can confirm that Lotus III : Turbo challenge works.

OMF, Outrun, Trolls, Jazz Jackrabbit 1, Highway hunter, Zone 66 do not though.
 

Pliskron

Banned!
Banned
Joined
Jul 22, 2009
Messages
1,276
Trophies
0
XP
48
Country
United States
I started the game in my root dir but could someone tell me how to navigate folders in dos. Ok I figued it all out. Thanks for pointing me in the right direction.

This is a lot better than I thought it would be. I can't wait to get into it.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    [He will] only make $1.5 million per night after taxes. Poor guy
  • BigOnYa @ BigOnYa:
    My stupid computer chair keeps slowly going down, but I don't notice it goes down, until I'm like reaching up to my desk. I just bought this f er last year.
  • BakerMan @ BakerMan:
    Does Bruno Mars is gay?
  • BigOnYa @ BigOnYa:
    K3nv2 would know...
  • K3Nv2 @ K3Nv2:
    Only for Bakers
    +1
  • BigOnYa @ BigOnYa:
    I heard he has a Wario fetish, but only if no Wizards are around.
  • BigOnYa @ BigOnYa:
    jk with you Bakerman, much love. fist bump.
  • K3Nv2 @ K3Nv2:
    He really knows how to kneed the dough
  • BigOnYa @ BigOnYa:
    Man. I can't wait til CTGP 8 comes out on Switch, been waiting forever.
  • BigOnYa @ BigOnYa:
    Boners Makes me wanna play Duck Hunt NES
    +1
  • K3Nv2 @ K3Nv2:
    Pooping nice
  • BigOnYa @ BigOnYa:
    What is a "Poop de Boop"? I've heard it mentioned several times now but have no idea and can't find anything online bout it. Is it a British term for restroom/bathroom or something?
  • Psionic Roshambo @ Psionic Roshambo:
    It is a perfume
    +1
  • K3Nv2 @ K3Nv2:
    Why do we have virgin islands if it's populated
    +1
  • BigOnYa @ BigOnYa:
    They should change the name to K3Nv2's Mom islands. (Or before he responds, My Wifeys Islands)
  • K3Nv2 @ K3Nv2:
    Nah me saying that's more predictable than you talking about my mom
    +1
  • K3Nv2 @ K3Nv2:
    Hence urewifes so predictable she'd buy every man on the virgin islands
  • K3Nv2 @ K3Nv2:
    Or they buy her
  • BigOnYa @ BigOnYa:
    true dat, on that note I'ma try go get some myself, peace!
  • K3Nv2 @ K3Nv2:
    Guess she doesn't need to be bought she has your money
    +1
    K3Nv2 @ K3Nv2: https://youtube.com/shorts/-GDjDECLDG0?si=MNEjk8rkmioj1xE2