#17833 - Shadow - Mon Mar 15, 2004 5:34 pm
Hi,
I've been wondering about efficiency lately, and there are things I am unsure of concerning VisualBoy Advance and gcc.
(1) VisualBoy Advance
This is the emulator I use. I also have Boycott Advance, but I found VBA to be the most accurate. However, because it has so many options, I'm not quite sure which will make it run programs exactly as on the GBA. Usually, I have the VSync option set, along with the DirectDraw render method, and this seems to work perfectly for small demo programs. For instance, I had a simple program that moved around a box sprite on the screen, using a WaitForVSync() function, and it worked fine. If I unchecked the VSync option on VBA, or if I removed the call to the WaitForVSync() function, the animation wouldn't be as smooth, and there would be a "tearing" effect.
Now to see how accurate VBA really is, I downloaded the ROM of Megaman Zero, which is a game I own, and tested it on my computer (an Intel Celeron 1.2GHz with 128MB RAM, running Windows XP). Even on the GBA, the game sometimes slows down, and I would assume it pushes the hardware quite a bit, so I thought it was a good game to test. On VBA, the game runs almost like the original, except a lot slower, when the VSync option is enabled. On the other hand, with the option disabled, the game runs at a much better speed, but there are slight glitches in the animation (which isn't the case in the original); this made me wonder if the code of the game even synchronizes with VBlank in the first place... So how do you get the emulator to work fine for every piece of code you run on it? Do you have to switch settings for each program? And the question that's been on my mind for a while : could someone explain to me what the VSync option of VBA actually does?
(2) gcc
I tried to understand gcc's options but I'm not too sure about a few things. First, is it a good idea to use the optimize option (-O)? I've heard that using -O3 could cause some trouble, sometimes not translating code properly, but I've found that -O2 does optimize the speed in general... so I would like to know the truth about this. Also, is it best to compile in Thumb or ARM mode? I've found contradictory information about the subject so I thought it was best to ask. I understand the basic difference between the two, but at what point (or under what circumstances) does one become more efficient than the other? Also, I would like to know what other options are used in general for maximum efficiency.
Well I know that's a lot of questions, but I need to understand how the basic tools work before I get too involved. That way, if I ever see that a piece of code is running too slow, I will know that the problem is in the code, not in the compiler or the emulator.
Thanks for your patience.
I've been wondering about efficiency lately, and there are things I am unsure of concerning VisualBoy Advance and gcc.
(1) VisualBoy Advance
This is the emulator I use. I also have Boycott Advance, but I found VBA to be the most accurate. However, because it has so many options, I'm not quite sure which will make it run programs exactly as on the GBA. Usually, I have the VSync option set, along with the DirectDraw render method, and this seems to work perfectly for small demo programs. For instance, I had a simple program that moved around a box sprite on the screen, using a WaitForVSync() function, and it worked fine. If I unchecked the VSync option on VBA, or if I removed the call to the WaitForVSync() function, the animation wouldn't be as smooth, and there would be a "tearing" effect.
Now to see how accurate VBA really is, I downloaded the ROM of Megaman Zero, which is a game I own, and tested it on my computer (an Intel Celeron 1.2GHz with 128MB RAM, running Windows XP). Even on the GBA, the game sometimes slows down, and I would assume it pushes the hardware quite a bit, so I thought it was a good game to test. On VBA, the game runs almost like the original, except a lot slower, when the VSync option is enabled. On the other hand, with the option disabled, the game runs at a much better speed, but there are slight glitches in the animation (which isn't the case in the original); this made me wonder if the code of the game even synchronizes with VBlank in the first place... So how do you get the emulator to work fine for every piece of code you run on it? Do you have to switch settings for each program? And the question that's been on my mind for a while : could someone explain to me what the VSync option of VBA actually does?
(2) gcc
I tried to understand gcc's options but I'm not too sure about a few things. First, is it a good idea to use the optimize option (-O)? I've heard that using -O3 could cause some trouble, sometimes not translating code properly, but I've found that -O2 does optimize the speed in general... so I would like to know the truth about this. Also, is it best to compile in Thumb or ARM mode? I've found contradictory information about the subject so I thought it was best to ask. I understand the basic difference between the two, but at what point (or under what circumstances) does one become more efficient than the other? Also, I would like to know what other options are used in general for maximum efficiency.
Well I know that's a lot of questions, but I need to understand how the basic tools work before I get too involved. That way, if I ever see that a piece of code is running too slow, I will know that the problem is in the code, not in the compiler or the emulator.
Thanks for your patience.