Emuforums.com

Go Back   Emuforums.com > Handheld Emulation > VBA-M Discussion
Home Register Downloads FAQ Members List Calendar Arcade Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
Old October 30th, 2007   #81 (permalink)
Registered User
 
Join Date: Oct 2007
Location: Valencia, CA
Posts: 52
I have HQ4X assembler working. It works *very* well, I get 100% sync'd FPS on my Pentium D (dual 2.8ghz). I could barely pull off HQ3x with VBA-Smooth on this box.

I will check out your SVN and commit to it.

Quote:
BTW: atm I am writing a little help file in the style of the Rice Video help file of mudlord, to support the work of you both!
Your work in collecting sources has been very helpful and is much appreciated. Do you mean an .INI to translate the UI elements? That should be fairly easy to do since the VBA code was written using resource strings rather than hardcoded strings.
djrobx is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old October 30th, 2007   #82 (permalink)
Emulation Master
 
MasterPhW's Avatar
 
Join Date: Mar 2004
Location: in-hell
Posts: 389
Quote:
Originally Posted by djrobx View Post
Do you mean an .INI to translate the UI elements? That should be fairly easy to do since the VBA code was written using resource strings rather than hardcoded strings.
Yeah, a translation trough INI entries and INI translation, not through DLL translations like it's done with the official and all other builds, because with every new release, I had to recreate the DLL to have all the new options translated, with an INI it should possible to just add the new entries easier and faster!
Btw: found a new source of a Rom Translation VBA, called VBAEd... probably the source is also handy to have!
Here's the link, also added it to my main post
__________________
The Future of Emulation: Emulate a High End Computer on a Low End System
Current PC specs:
Portable: Intel C2D T7250 (2x2.0Ghz, 800Mhz) | 2048 MB DDR2 PC800 | Geforce Go 7950 GTX PCI-E | Realtek HD Audio |
180Gbyte Internal SATA2 + 4x500GB external | Windows Vista Business X64 MSDNAA
Desktop: AMD Athlon 64 X2 4200+ (2x2.5Ghz, S939) | MSI KbT Neo2-F V2.0
| 2x1GB Corsair Value VS1GBKIT400 | MSI Geforce NX 7800GS-TD256/AGP8x
| Creative SB Audigy LS | 2,5TB (4 SATA2 HDDs in Raid0) | Windows Vista Business MSDNAA


Visit my Blog

Last edited by MasterPhW; October 30th, 2007 at 22:47..
MasterPhW is offline   Reply With Quote
Old October 31st, 2007   #83 (permalink)
Registered User
 
Join Date: Oct 2007
Location: Valencia, CA
Posts: 52
mudlord,

I have committed my HQ4X changes to the SVN. The "linking" code was crashing in Link.cpp due to linkmem being null. I added a comment and a check for NULL which allows the program to run, but you might want to check the source you merged from to find where linkmem is supposed to be initialized.

I have also updated the project files with some trivial other fixes so the project compiles in debug mode successfully.

Quote:
Yeah, a translation trough INI entries and INI translation, not through DLL translations like it's done with the official and all other builds, because with every new release, I had to recreate the DLL to have all the new options translated, with an INI it should possible to just add the new entries easier and faster!
I agree INI is the way to go. Although DLL has an advantage in allowing dialog customization, people shouldn't need to learn to build DLLs just to translate text!

Last edited by djrobx; October 31st, 2007 at 01:36.. Reason: Automerged Doublepost
djrobx is offline   Reply With Quote
Old October 31st, 2007   #84 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Thanks for the tip, I'll check it out.

EDIT: Looked through the VBALink patch. Seems that all references to the pointer linkmem (of the struct LINKDATA) are just in plain ol' Link.cpp. First occurance of linkmem is in StartLink(), though it doesnt seem to be explicitly initialised anywhere tho in the original VBALink sources..

Last edited by mudlord; October 31st, 2007 at 02:36..
mudlord is offline   Reply With Quote
Old October 31st, 2007   #85 (permalink)
Behind ur girlfriend :D
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Sydney, Australia
Posts: 18,851
Quote:
Originally Posted by djrobx View Post
Thank you for confirming that I'm not the only one with that issue. There is code for D3D Triple Buffering, it just doesn't seem to change the output much (it still tears). I can even force vsync in the driver and it makes no difference.
thats because its not a vsync issue :P, vsync locks the frame rate to the monitors refresh rate, but the emulators when running at 100% usually lock to either 60hz (60fps) or 50hz (50fps) the only exception is N64 which has a variable FPS (20-60fps or 18-50fps). the tiling/tearing occurs due to the difference in how the console outputs compared to a pc.

by default, most drivers default to double buffering, this is where the problem comes in, consoles of these types don't have a display buffer as such, and are rendered straight to screen, the default double buffering causes visual artifacts., by enabling triplebuffering, the third buffer somehow corrects the graphics and the tearing is removed.

the reason the opengl mode doesn't have tearing is that opengl uses the Triplebuffering mode set in the drivers options, where as Direct3D requires triplebuffering be requested, the emulator does not have an option to enable/disable Triplebuffering for D3D, so it can't be enabled., i have 100% faith that mudlord will be able to fix it, given the chance, considering his work in both D3D and OGL.
__________________


VBA-M | Xtemu | NGOHQ | Post Impact Productions | TNHW | XBCD 0.2.6 | Satanic666's Emulator Compiles
Don't be a NOOB, READ THE NGEmu/EmuForums Rules of Conduct
Need Help with ePSXe? This is your first stop!.

If you don't post all the required information, you don't get help.
Everytime someone posts a romsite, God kills a beautiful woman.
Squall-Leonhart is offline   Reply With Quote
Old October 31st, 2007   #86 (permalink)
Registered User
 
Join Date: Oct 2007
Location: Valencia, CA
Posts: 52
I do understand how refresh rates and vsync are supposed to work. The driver is correctly selecting 60hz (and I also added a fix for the DirectDraw mode so you can speciify 60hz as well, actually that was the reason I got involved in this in the first place ... the current builds left me absolutely no way to set 60hz in Vista without using special refresh rate locking software).

"VSync" in most emulators means that an emulator will prepare its frame. It will then get to the point of refreshing the screen, and then do nothing until the display card gets to the Vblank area. This will create horrible performance if the computer can't quite keep up with the framerate, or the sync rate doesn't match the desired output (eg monitor is at 75hz but you are emulating a 60fps system).

"Triple buffering" typically means that there are three buffers, two for the display hardware, and a third that the software application can work on. The display hardware will automatically flip between the two back buffers when it's the appropriate time.

If VSync or triple buffering is on, the display should never tear, period. In either of those modes, the frame display is only to be refreshed at vsync. If the refresh rate of the emulator and display don't match, you should get a display that's jumpy, but not tearing. If tearing is happening with vsync mode ... it's just not working. If tearing is happening with triple buffer mode, then the application must be writing to one of the front buffers.
djrobx is offline   Reply With Quote
Old October 31st, 2007   #87 (permalink)
Behind ur girlfriend :D
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Sydney, Australia
Posts: 18,851
its not that its writing to the front buffers, atleast i don't think it is, but more the fact that the code isn't 100% for D3D Triplebuffering
there is some code in their for it, but theres no option to enable it, going from a convo i had with spacy in pm, the basics are there, but its not 100% complete.
the DDraw triplebuffering doesn't effect D3D triplebuffering, i did read some notes showing the different methods on calling for TB in both Ddraw and D3d once,.. just have to find them again.

i actually, don't have Vsync enabled in the emulator, just triplebuffering in the NVCP and for DDraw and the changes are obvious, thats why i think the tearing isn't exactly a vsync issue.

Triple Buffer - Tutorial - Introduction to Direct3D
d3dpp.BackBufferCount = 1; = double buffering
d3dpp.BackBufferCount = 2; = triple buffering
thats how DxTweaker works anyway :\

looking at the VBA source, the only thing vba needs is a menu item and related coding to allow the emulator to use TB
__________________


VBA-M | Xtemu | NGOHQ | Post Impact Productions | TNHW | XBCD 0.2.6 | Satanic666's Emulator Compiles
Don't be a NOOB, READ THE NGEmu/EmuForums Rules of Conduct
Need Help with ePSXe? This is your first stop!.

If you don't post all the required information, you don't get help.
Everytime someone posts a romsite, God kills a beautiful woman.

Last edited by Squall-Leonhart; October 31st, 2007 at 20:08..
Squall-Leonhart is offline   Reply With Quote
Old October 31st, 2007   #88 (permalink)
Registered User
 
Join Date: Oct 2007
Location: Valencia, CA
Posts: 52
*Edit*

Okay, I figured out the problem. The issue is the backbuffer was being created with D3DPRESENTFLAG_LOCKABLE_BACKBUFFER being set. Removing that corrects the issue for vsync mode completely. I don't see anywhere in the code where the backbuffer actually gets locked (just the texture, as you would expect), perhaps it was a remnant of an early version of the code or something. Regardless, it's fixed.

I will look into adding the triple buffering mode present in the newer Spacy code. I suspect that lockable backbuffer setting also broke its ability to sync as well.
djrobx is offline   Reply With Quote
Old October 31st, 2007   #89 (permalink)
Behind ur girlfriend :D
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Sydney, Australia
Posts: 18,851
ah ok, so now it takes on the DDraw TB setting right? will have to rename that and move it

also, will save type > enhanced detection, ever be made to work :\
__________________


VBA-M | Xtemu | NGOHQ | Post Impact Productions | TNHW | XBCD 0.2.6 | Satanic666's Emulator Compiles
Don't be a NOOB, READ THE NGEmu/EmuForums Rules of Conduct
Need Help with ePSXe? This is your first stop!.

If you don't post all the required information, you don't get help.
Everytime someone posts a romsite, God kills a beautiful woman.
Squall-Leonhart is offline   Reply With Quote
Old October 31st, 2007   #90 (permalink)
Registered User
 
Join Date: Oct 2007
Location: Valencia, CA
Posts: 52
According to Microsoft's documentation about lockable backbuffers, the impact of its use varies depending on the hardware used. I'm guessing it worked OK on Spacy's hardware, but disables hardware synchronization (regardless of buffering method) on yours and mine.

The 1.7.6 Spacy version that we are working off of has no triple buffer code in Direct3D. We do have the code you refer to, it's in the newer beta (the one where he removed the OpenGL and DirectDraw code). So we can merge it back in but it's not there at the moment. VSync option now works very well though. I think you'll be happy with it. I need to fix a small issue (see below), once I do I will post a compiled copy for you to test with and then you can tell me if it improves the situation for you.

Disabling lockable buffers has introduced a glitch with the menus (you can't see them, probably because the hardware acceleration is actualy working and the DX display seems to sit infront of the bar). The menus have blackout problems even on the official builds.

I'm going to try and work out a more reliable way to display the menus. Then I will post a build that you can test out.

Quote:
also, will save type > enhanced detection, ever be made to work :\
Personally I'm focusing on UI / Graphics / Sound issues right now.
djrobx is offline   Reply With Quote
Old October 31st, 2007   #91 (permalink)
Behind ur girlfriend :D
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Sydney, Australia
Posts: 18,851
the Triplebuffering code was also in the original 1.72 source, but it doesn't work in 1.72 either, and i can't find D3DPRESENTFLAG_LOCKABLE_BACKBUFFER in there

the issue you speak of, with the menus, also occurs to an extent in Snes9x though it was more a flickering of the menu
__________________


VBA-M | Xtemu | NGOHQ | Post Impact Productions | TNHW | XBCD 0.2.6 | Satanic666's Emulator Compiles
Don't be a NOOB, READ THE NGEmu/EmuForums Rules of Conduct
Need Help with ePSXe? This is your first stop!.

If you don't post all the required information, you don't get help.
Everytime someone posts a romsite, God kills a beautiful woman.
Squall-Leonhart is offline   Reply With Quote
Old November 1st, 2007   #92 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Anywayz, I have started the task of implementing the functionality of nitsuja's re-recording support to our VBA build. I might look into adding VBA-H at the same time too..I'll also upload all VBA modifications I can find, as posted by MasterPhW, to my personal homepage (I might mirror them on my university personal homepage too, as I got unlimited bandwidth there).

Quote:
Personally I'm focusing on UI / Graphics / Sound issues right now.
Ah okay, any issues in particular? Other than the Vsync problems?
mudlord is offline   Reply With Quote
Old November 1st, 2007   #93 (permalink)
Registered User
 
Join Date: Oct 2007
Location: Valencia, CA
Posts: 52
I'm happy with the D3D vsync performance now. It's the menu bar I want to clean up. I'm also part way into adding multiple key assignments to controller buttons (e.g. joystick UP OR joystick-hat UP OR arrow-up) instead of the current one-key limitation.

D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is present in both versions of Spacy's code. I never really tried D3D on the official 1.72 build, on my Vista box it wouldn't go into fullscreen mode for some reason.

Lockable backbuffers and menu issues are related in that GDI wants the backbuffer lockable in order to write to the display. It is probably why Spacy added it. If you look through Nestopia's 1.23 changelogs they seem to have run into identical issues with it disrupting vertical sync. They "Solved" the issue by reinitializing the display when the menu bar is brought up. We will probably have to do the same. Unfortuantely there isn't a really simple "menu on" and "menu off" function to hook into.

see NES: Nestopia v1.23 :: AEP Emulation Page - Emulation News :: Online seit dem 1. April 1998

Last edited by djrobx; November 1st, 2007 at 01:32..
djrobx is offline   Reply With Quote
Old November 1st, 2007   #94 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Ah okay, cool. Thanks for letting me know.

I have uploaded all the VBA builds I can find here:
Code:
http://mudlord.phpnet.us/vba/
mudlord is offline   Reply With Quote
Old November 1st, 2007   #95 (permalink)
Behind ur girlfriend :D
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Sydney, Australia
Posts: 18,851
been looking at that lockable buffer code. from what i read, you can lock and unlock the buffer, so setup an if statement for when the menu is showing to lock the buffer, and then unlock it when the menu is hidden.

i figure it would theoretically work :\
__________________


VBA-M | Xtemu | NGOHQ | Post Impact Productions | TNHW | XBCD 0.2.6 | Satanic666's Emulator Compiles
Don't be a NOOB, READ THE NGEmu/EmuForums Rules of Conduct
Need Help with ePSXe? This is your first stop!.

If you don't post all the required information, you don't get help.
Everytime someone posts a romsite, God kills a beautiful woman.

Last edited by Squall-Leonhart; November 1st, 2007 at 01:34..
Squall-Leonhart is offline   Reply With Quote
Old November 1st, 2007   #96 (permalink)
Emulation Master
 
MasterPhW's Avatar
 
Join Date: Mar 2004
Location: in-hell
Posts: 389
Quote:
Originally Posted by mudlord View Post
Ah okay, cool. Thanks for letting me know.

I have uploaded all the VBA builds I can find here:
Code:
http://mudlord.phpnet.us/vba/
You forget the newly added VisualBoyAdvanceEd!
Btw: I have a long weekend, beginning now and I'll reformat my Laptop, after that I will continue to work on the help file. It's 25% done in my opinion.
__________________
The Future of Emulation: Emulate a High End Computer on a Low End System
Current PC specs:
Portable: Intel C2D T7250 (2x2.0Ghz, 800Mhz) | 2048 MB DDR2 PC800 | Geforce Go 7950 GTX PCI-E | Realtek HD Audio |
180Gbyte Internal SATA2 + 4x500GB external | Windows Vista Business X64 MSDNAA
Desktop: AMD Athlon 64 X2 4200+ (2x2.5Ghz, S939) | MSI KbT Neo2-F V2.0
| 2x1GB Corsair Value VS1GBKIT400 | MSI Geforce NX 7800GS-TD256/AGP8x
| Creative SB Audigy LS | 2,5TB (4 SATA2 HDDs in Raid0) | Windows Vista Business MSDNAA


Visit my Blog
MasterPhW is offline   Reply With Quote
Old November 1st, 2007   #97 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Sorry about missing that.

I'll upload it as soon as I get back from university today.

I can't wait to see the finished help file I bet it will be really nice ^^
mudlord is offline   Reply With Quote
Old November 1st, 2007   #98 (permalink)
Registered User
 
Join Date: Oct 2007
Location: Valencia, CA
Posts: 52
D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is a parameter in the CreateDevice function where you set the video mode. Looking at the Nestopia sources there is a "Reset()" function that can be used to toggle it.

Ok, menu problem is fixed! Squall, give this version a try. As noted you must close the menu in order to enter fully hardware accelerated mode. On my system emulation runs slowly until the menu is closed. Personally, I think we should pause the emulation whenever the menu is opened and resume it when its closed.

http://www.djrobx.com/misc/VBAM-alpha-build13.zip

"13' corresponds to the SVN revision number, if anyone is interested.

NOTE: I have not tested the vba linking code at all, it most likely does not work yet.

Last edited by djrobx; November 1st, 2007 at 11:48.. Reason: Automerged Doublepost
djrobx is offline   Reply With Quote
Old November 1st, 2007   #99 (permalink)
Behind ur girlfriend :D
 
Squall-Leonhart's Avatar
 
Join Date: Feb 2006
Location: Sydney, Australia
Posts: 18,851
djrobx, indeed, that would be the best way to go about it, all other emulators i use pause when a menu or setting dialogue is opened (snes9x, Pj64(+1.7)) so it would for in this case too.

djrobx, you might want to look at the snes9x source and try fixing thier issue with triplebuffering, when its enabled, opening a dialogue box sends the screen blank, i figure its the same issue. reason for this is i enjoy watching those jerks getting shown up :P.

i wonder what it will take to make TGB Duals linking method work for VBA, it'd be cool to have GB link support finally.

hey mudlord, how about implementing one of your nice AF filters

edit
ok, tested that build,
the Direct3D mode isn't stretched to fit the full screen, there are black lines along the top and bottom, which aren't there in GDI, DDraw, or OpenGL.
i did notice the menu doesn't show up everytime i pressed escp to raise it. and there was obvious graphical corruption in the D3D mode when trying to raise the menu

i just realised, that this new version won't have the same SA* save format so you can't load 2 of the same rom with different save files without creating seperate directories for each.

mudlord, can you port over VBA-Links saving system, it uses some kind of detection system basically it assigns the first VBA window to *.sa1 and any other windows opened to *.sa2 *.sa3

OR

modify the detection method, so that when it detects more then 1 VBA-M open, it uses a specific folder for battery saves for Linked games.

so.. say for instance

if 1 window is open it saves/loads battery/state files to Battery/Savestate and uses the .SAV file type
if 2+ windows are open save/load battery/state files to Battery Linked/Savestate Linked. and uses the .SA* file type
if you don't get the gist of what im saying i'll explain it better on WLM.

its possible, it'll just take some heavy modification of the original VBA-L save methods :\


edit2
actually this looks to be useless for linking on a single pc,
unlike VBA-L, keyboard doesn't work in this one when its an inactive window, and from what i've seen it can't have 2 windows open at the same time, and still run at 100%, unlike VBA-L (yes, i disabled the filters.)
__________________


VBA-M | Xtemu | NGOHQ | Post Impact Productions | TNHW | XBCD 0.2.6 | Satanic666's Emulator Compiles
Don't be a NOOB, READ THE NGEmu/EmuForums Rules of Conduct
Need Help with ePSXe? This is your first stop!.

If you don't post all the required information, you don't get help.
Everytime someone posts a romsite, God kills a beautiful woman.

Last edited by Squall-Leonhart; November 1st, 2007 at 23:14..
Squall-Leonhart is offline   Reply With Quote
Old November 1st, 2007   #100 (permalink)
Banned
 
Join Date: Feb 2007
Location: Lost.
Posts: 1,767
Quote:
hey mudlord, how about implementing one of your nice AF filters
Thank you for your suggestion, it has been noted and most likely will be implemented in the OpenGL renderer first, and then the Direct3D renderer.

Jeeez...I sound like a recorded message
mudlord is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:32.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5