Sixthhokage2 / ohboy

Automatically exported from code.google.com/p/ohboy
GNU General Public License v2.0
0 stars 1 forks source link

"About" section in the menu. Patch for /menu.c #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Added "about" section in the menu. Contains info such as gnuboy version or 
ohboy build version.

A "Build" file is required, to easily change build version before compiling.

Original issue reported on code.google.com by hiban1...@gmail.com on 12 Aug 2011 at 8:50

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I had some time, so i've improved the patch. The changes are:

-Added an "About" section in the menu, with gnuboy version and ohboy build info.

-Added a "Build" file (contains only the build version) to easily change 
version number before compiling.

-Added a "Controls" section in the menu. (currently it only works for caanoo, 
for others it does nothing) 

You can configure buttons A,B,X,Y,L and R. (i think it's a waste of time to 
make the code for binding the directional keys)In each button you can choose 
between None, A, B, Select, Start, Reset and Quit. 

I need all the names of the buttons (A,B,X,Y,L,R) of WIZ, Dingoo and GP2X, to 
add support for them.

The keybindings are stored in a "keybindings.rc" file.

-Added the "keybindings.rc file"

-Updated the "ohboy.rc" file with showfps data and additional lines.

Original comment by hiban1...@gmail.com on 14 Aug 2011 at 6:19

Attachments:

GoogleCodeExporter commented 9 years ago
Oh, i forgot a couple more:

-Rearranged ingame menu options.

-Added a "Reset Game" option in the ingame menu.

And now, some screenshots:

Original comment by hiban1...@gmail.com on 14 Aug 2011 at 6:27

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Updated the menu.c.patch. Now there is full support for Caanoo, Wiz, GP2X and 
Dingoo.

Original comment by hiban1...@gmail.com on 14 Aug 2011 at 4:50

Attachments:

GoogleCodeExporter commented 9 years ago
This is a feature that is sorely needed!

I just tried it on the Dingoo and one problem is that every time the options 
screen is brought up, the controls get reset to None for all the buttons listed 
(on the left). There is no cancel button either. I've not had chance to try the 
x86 linux/windows port but I have an idea on that (display the hard coded 
settings with no option to change).

The about screen is nice, the press a key didn't work for me (only select and 
start work), so maybe do without the press a key message as it is redundant.

I don't have time to work on this otherwise I'd work on the changes you 
provided and submit it.

Don't forget you can simply issue "hg diff" to generate a single patch and 
attach that to the issue, this is easier for you to create and easier for me to 
apply :-)

Thanks again for working on this and supplying patches.

Original comment by clac...@gmail.com on 14 Aug 2011 at 5:12

GoogleCodeExporter commented 9 years ago
OK, just saw the new menu.c from a few mins ago. The addition of "host" and 
"gameboy" text to options is great :-) I was thinking of adding then once the 
change was complete and you saved me the work!

A few other changes slipped in too (like sound and fps menu changes). The 
indentation is off in a few places too (compared with the existing code).

I have some concerns over where all the key settings will end up on disk (in 
the .rc files) but I've not had chance to review/think about it.

Original comment by clac...@gmail.com on 14 Aug 2011 at 5:25

GoogleCodeExporter commented 9 years ago
the cancel button is the one used for going a step back in the menu (select or 
start in the dingoo, i think).

Did you copy the new ohboy.rc and the keybindings.rc to ohboy folder?
i've set a "source keybindings.rc" command in ohboy.rc.
Gnuboy must read (and write)both rc files. If not, the keys will be reset in 
the menu.(although ohboy is supposed to create the rc files if needed....)

In the controls menu, there are left and right fields. I've made it so if you 
have a caanoo, it says "caanoo", if you have a dingoo, it says "dingoo", etc... 
If there is no "dingoo" word in your dingoo, then i know why the keys are 
reset, and i can fix it.

Also, could you send me your dingoo build for me to test it in my dingoo? it 
will be easier that way...

Original comment by hiban1...@gmail.com on 14 Aug 2011 at 5:48

GoogleCodeExporter commented 9 years ago
I made the configuration in 2 separate rc files because i had no chance. The 2 
"options" and "controls" menus save its own settings separately. But when i 
attempted to write the "Controls" settings in the ohboy.rc file, the existing 
Options settings (palette, scaler...) were REPLACED with the "Controls" 
settings.

I thought about using fseek to set the position to write everything in 
ohboy.rc, but that will add too much work if we some day add more options (we 
would be forced to use fseek in each new option we add, or rewrite everything 
from scratch)
and the data could become corrupted if there is an option which can vary the 
number of digits of its value (for example values 1-10).

So i decided to separate the files: 2 menus, 2 rc files. Its easier, and more 
simple.

Original comment by hiban1...@gmail.com on 14 Aug 2011 at 8:00

GoogleCodeExporter commented 9 years ago
I agree, 2 files is the way to go. :-) Custom parsing of the rc file is not 
worth the extra pain/effort.

I'm wondering about simple things like renaming keybindings.rc to keys.rc (as 
well as having good defaults if the only thing present is the binary, it is 
very common to have inexperienced users ONLY copy the binary and if one is 
adding error checking code to handle those cases it is best practice to use 
good defaults so that errors are rare.

Original comment by clac...@gmail.com on 15 Aug 2011 at 12:47

GoogleCodeExporter commented 9 years ago
Also if we do not ship a key bindings file, each platform can default to a 
sensible default (we do not want to maintain lots of key rc files for building).

NOTE for anyone else reading this, Hi-Ban is working on default values for 
bindings.

Original comment by clac...@gmail.com on 15 Aug 2011 at 12:48

GoogleCodeExporter commented 9 years ago
I've replaced the "Apply" and "Apply & Save" options with "Save Changes" and 
"Cancel" (in both the "options" and "Controls" menu).

Added default keybindings when no rc file is present (for GP2X, WIZ, CAANOO and 
DINGOO):
Button A - Button B
Button B - Button A
Button X - Button B
Button Y - Button A
Button L - Select
Button R - Start

Renamed "Keybindings.rc" to "bindings.rc"
Renamed "Build" to "ohboy_ver" (there is already a "ohboy_version" written 
somewhere in the code)

Removed the "press a key" text in "About" menu.

I've looked into changing the menu keys for dingoo, but i just don't find them. 
maybe  it is in the gnuboy code? if you could point me to the file, i'll do the 
rest.
Also, it seems that the "esc" key is hardcoded to bring up the menu... that's 
no good, because the select key of the dingoo is mapped to "esc", so we need to 
have the option to bind that to other keys.

Take a look at the diff, i think everything you said is fixed. 

If you compile it for dingoo please send me the binary and your dingoo makefile 
to test it. i've downloaded the dingoo sdk and toolchain, but i'm getting 
errors when building. So if i solve this and i'm able to compile for dingoo, i 
will be able to do the same testing as with the caanoo before submitting 
things....

Original comment by hiban1...@gmail.com on 15 Aug 2011 at 1:23

Attachments:

GoogleCodeExporter commented 9 years ago
Good news: i can finally compile for dingoo, so no need to send me the binaries 
;)

Original comment by hiban1...@gmail.com on 15 Aug 2011 at 4:05

GoogleCodeExporter commented 9 years ago
More good news: i've managed to change all the menu keys. :-)
I've thought about this button layout:

-Power Up Button - Bring up the menu
-A Button - Accept (in the menu)
-B Button - Back (in the menu)

(Select and start would be normal select and start keys)

what do you think?

Original comment by hiban1...@gmail.com on 15 Aug 2011 at 5:17

GoogleCodeExporter commented 9 years ago
NOTE: Don`t merge the current changes yet, i'm working on dingoo related 
things...

Original comment by hiban1...@gmail.com on 15 Aug 2011 at 5:51

GoogleCodeExporter commented 9 years ago
Here is the final diff. The changes are all the avobe mentioned, plus:

-Fixed a bug in which, if only the Controls config was saved, it wouldn't load 
the changes on next startup.

-Changed dingoo keys to those mentioned above.

Tested in Dingoo and Caanoo.

Original comment by hiban1...@gmail.com on 15 Aug 2011 at 7:27

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for working on the button mapping.

select=select and start=start (for Dingoo) sounds good! This is a great 
improvement.

I'm not super enthused about power being the menu button but it seems the only 
option (without adding multiple button press detection code).

I've attached a diff which tweaks the version header file (as well as sample 
auto generation).

I quickly tested the Linux x86 and that looks fine.

I like the explicit Cancel on screen menu item, but the Apply (with no save) is 
now missing. Could you add that back please?

Thanks

Original comment by clac...@gmail.com on 16 Aug 2011 at 3:49

Attachments:

GoogleCodeExporter commented 9 years ago
I've added the Apply (with no save) option to the diff:

Original comment by hiban1...@gmail.com on 16 Aug 2011 at 9:58

Attachments:

GoogleCodeExporter commented 9 years ago
Closed by change 61:6b43635efaf6

Original comment by clac...@gmail.com on 20 Aug 2011 at 5:00