-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix enumeration of avr8 register index values #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix enumeration of avr8 register index values #182
Conversation
The header changes are OK but the changes to the source are dubious at best. Also please stop mixing tab and space indentation. |
The enumeration fix results in the replicator1 driver printing the unimplemented warning thousands of times. The patch provided here makes sure that the unimplemented warning shows up, but only once. Also, it disables other timer #5 related log messages, since these are there only for debugging purposes and should not be enabled by default. |
what does MAME use as a default for indentation: tabs or spaces? If it is spaces, then how many spaces per indentation level? |
I'm not sure if there are particular guidelines but generally MAME code is periodically run through srcclean (one of the tools built with make TOOLS=1), which cleans up spaces/tabs and such. |
it would be really good to specify a default tab/spaces style for everybody to use always. Letting scripts cleanup the whole codebase will probably messup with git blame, for instance. I'd rather preffer to setup my code editor with one good setting and make sure none of my commits mess up with indentation any more. |
MAME code generally uses tabs for initial indents only and spacing for other alignment. View the code with four spaces per tab if you want to see it aligned properly. You can work this out by opening pretty much any driver source file. |
I'm curious to understand the rationale behind the idea of it being considered "most definitely unacceptable" to you. What are the bad consequences of it? Isn't it actually doing what it is designed to do? What are the drawbacks that make it so bad in your eyes? I'm just asking because it sounds a bit harsh when someone calls something unnaceptable, so I'd expect to learn more about your reasoning. After all... it is just a simple "unimplemented" log message. Can't be that harmfull at all... :-) |
@cuavas: IMHO the very basic, most important things about source code formatting (such as that) should be in the top-level readme, in a section labeled "Contributing". I'm not sure what they are or I'd add them. @felipesanches: other than it being rather ugly (at least to me), I'm not sure. That missing mode probably should be implemented, but I'll let @cuavas answer your question. |
On Sun, May 17, 2015 at 1:19 AM, Felipe Corrêa da Silva Sanches <
|
I don't see what you're problem with the word "unacceptable" is. The code will not be accepted by MAMEdev in its current form -- it is by definition "unacceptable". This is basic English. If you expect everyone to go out of my way not to say anything negative, you’re coming to the wrong place. It's my job to ensure contributions don't lower standards; ensuring fragile egos aren't bruised is not my job. First of all, if you're thinking of using a function static variable, you're probably doing it wrong. It introduces inaccessible state within a function. It won't handle multiple instances, and it won't even handle multiple runs within the same process. But putting that aside, you've completely changed what the statement does. The statement is there to log each time the software tries to use an unimplemented timer mode, and what the mode is each time. You've changed it to only log the first unimplemented timer mode used. That's far less useful as with your change one can no longer take the output, pass it through a text filter and get a list of all unimplemented timer modes used by a system. Your change doesn't bring the code any closer to a working state, and just attempts to put brokenness out of sight and out of mind. It doesn't help in any way. It might be OK to change it from a printf to osd_printf_error, but simply suppressing it like that is not a useful change, even ignoring the unacceptable implementation. If you don't want to cooperate, I'll just close this pull request. It's less work for me than writing long-winded explanations, anyway. |
Thanks for providing a clearer reasoning. I think it makes sense and I can (and will) adapt the code in this pull request accordingly. More specifically, the consideration presented by @etabeta78 was something I wasn't aware of yet. Finally, I'd like to make it clear that I want indeed to collaborate. My only concern was that it was not clear exactly what the criticism was. Now I understand it. Thanks. |
* minor fix to indentation levels * propper handling of error logging
d8920f5
to
90fed9e
Compare
I've just updated the commit, removing the static variable. Please review and merge if considered appropriate. cheers, |
The changes to indentation are not good:
Switch statements should look like this:
The switch statement itself and the compound statement inside it introduce scope. Case labels by themselves do not. |
@cuavas has updated the README to mention indentation standards (which should make it easier for contributors). Generally it's best to not muck too much with indentation; I usually do a git diff after making changes to ensure this is the case. As for this? I'd just do the register enumeration and that's all. |
I have just updated the commit to include exclusivelly the registers indexing fixes and the minor handling of debug messaging to avoid flooding the terminal. Log messages will only show up if a developer turn it on by setting the appropriate logging #define. All fixes to broken indentation were now intentionally left aside, so that we can move on to merge this tiny avr8 bugfix. |
Nevermind... I just noticed that the registers fixes were already merged into master. The log flood issue still remains, though. So I opened a new pull request specifically for that: |
You'll be credited with the register fixes. |
Thanks :-) Happy hacking! |
- Balalín (type-in, MicroHobby mamedev#125) [Ignacio Prini] - Magnus Zone (type-in, MicroHobby mamedev#126) [Ignacio Prini] - Oráculo Egipcio (type-in, MicroHobby mamedev#127) [Ignacio Prini] - Demolition (type-in, MicroHobby mamedev#128) [Ignacio Prini] - Basket Trainer (type-in, MicroHobby mamedev#129) [Ignacio Prini] - Galaxy Fun (type-in, MicroHobby mamedev#130) [Ignacio Prini] - Micro Draw (type-in, MicroHobby mamedev#131, mamedev#132) [Ignacio Prini] - El Alambrista (type-in, MicroHobby mamedev#133) [Ignacio Prini] - Ranamirez (type-in, MicroHobby mamedev#134) [Ignacio Prini] - Fórmula Suicida (type-in, MicroHobby mamedev#135) [Ignacio Prini] - Phantasmas (type-in, MicroHobby mamedev#136) [Ignacio Prini] - Dardos (type-in, MicroHobby mamedev#137) [Ignacio Prini] - S.E.M.I.S.I.S. (type-in, MicroHobby mamedev#138, mamedev#139) [Ignacio Prini] - Alley's Gun (type-in, MicroHobby mamedev#140) [Ignacio Prini] - Kleingeld (type-in, MicroHobby mamedev#141, mamedev#142) [Ignacio Prini] - Caribe’s Day (type-in, MicroHobby mamedev#143) [Ignacio Prini] - Rally (type-in, MicroHobby mamedev#144) [Ignacio Prini] - La Profecía (type-in, MicroHobby mamedev#145) [Ignacio Prini] - Mine Alert (type-in, MicroHobby mamedev#146, mamedev#147) [Ignacio Prini] - Freddy (type-in, MicroHobby mamedev#148) [Ignacio Prini] - Russian's Attack (type-in, MicroHobby mamedev#149, mamedev#150) [Ignacio Prini] - En Ruta (type-in, MicroHobby mamedev#151) [Ignacio Prini] - Zinco (type-in, MicroHobby mamedev#152) [Ignacio Prini] - Ruffo’s Dream (type-in, MicroHobby mamedev#153) [Ignacio Prini] - Crozet (type-in, MicroHobby mamedev#154) [Ignacio Prini] - Rock Animation (type-in, MicroHobby mamedev#155) [Ignacio Prini] - Bunker (type-in, MicroHobby mamedev#156) [Ignacio Prini] - Telepuzzle (type-in, MicroHobby mamedev#157) [Ignacio Prini] - Golfo Pérsico (type-in, MicroHobby mamedev#158) [Ignacio Prini] - Mad Drivers (type-in, MicroHobby mamedev#159) [Ignacio Prini] - Bowling Star (type-in, MicroHobby mamedev#160) [Ignacio Prini] - Gas-Car (type-in, MicroHobby mamedev#161) [Ignacio Prini] - Ghost Like (type-in, MicroHobby mamedev#162) [Ignacio Prini] - Sky Invaders (type-in, MicroHobby mamedev#163) [Ignacio Prini] - Perico Jones (type-in, MicroHobby mamedev#164) [Ignacio Prini] - Brad Zotes (type-in, MicroHobby mamedev#165) [Ignacio Prini] - Striker (type-in, MicroHobby mamedev#166) [Ignacio Prini] - Indy (type-in, MicroHobby mamedev#167) [Ignacio Prini] - Topin (type-in, MicroHobby mamedev#168) [Ignacio Prini] - Starlike (type-in, MicroHobby mamedev#169) [Ignacio Prini] - Tres en Raya (type-in, MicroHobby mamedev#170) [Ignacio Prini] - Goteras (type-in, MicroHobby mamedev#171) [Ignacio Prini] - Parvision (type-in, MicroHobby mamedev#172) [Ignacio Prini] - Furax (type-in, MicroHobby mamedev#173) [Ignacio Prini] - Duck Shooting (type-in, MicroHobby mamedev#174) [Ignacio Prini] - Nomen Rosae (type-in, MicroHobby mamedev#175) [Ignacio Prini] - PunkyMan (type-in, MicroHobby mamedev#176) [Ignacio Prini] - El Retorno del Yedi (type-in, MicroHobby mamedev#177) [Ignacio Prini] - Sky Warrior (type-in, MicroHobby mamedev#178) [Ignacio Prini] - Reptkon (type-in, MicroHobby mamedev#179) [Ignacio Prini] - Intro (type-in, MicroHobby mamedev#180) [Ignacio Prini] - Keops (type-in, MicroHobby mamedev#181) [Ignacio Prini] - Sir Gawain (type-in, MicroHobby mamedev#182) [Ignacio Prini] - Snake (type-in, MicroHobby mamedev#183) [Ignacio Prini] - Microbowl (type-in, MicroHobby mamedev#184) [Ignacio Prini] - God Save the Punk (type-in, MicroHobby mamedev#185) [Ignacio Prini]
No description provided.