![]() |
|
Programming Discussion Thread - Printable Version +- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org) +-- Forum: Offtopic (https://forums.dolphin-emu.org/Forum-offtopic) +--- Forum: Delfino Plaza (https://forums.dolphin-emu.org/Forum-delfino-plaza) +--- Thread: Programming Discussion Thread (/Thread-programming-discussion-thread) |
RE: Programming Discussion Thread - Garteal - 02-22-2013 Quote:You haven't asked any question about JList though. Obviously people won't care about your problems if you don't take the time to explain properly.This. Be more specific so we know what to help you with. RE: Programming Discussion Thread - Shonumi - 02-23-2013 (02-21-2013, 10:44 AM)ExtremeDude2 Wrote: I'm pretty sure that's because it's made by jabo... The Android port is written in Java. :p EDIT: Well, maybe not, I have no way to tell. HalfNES, however, is an NES emulator written in Java for sure. RE: Programming Discussion Thread - ExtremeDude2 - 02-23-2013 I was about to ask how you know this then I saw your edit XD RE: Programming Discussion Thread - Shonumi - 02-23-2013 (02-23-2013, 02:42 AM)ExtremeDude2 Wrote: I was about to ask how you know this then I saw your edit XD Most Android apps are written in Java, but you can use C or C++. I'm not familiar with the Android app dev community, but I get the feeling a majority use Java. JNES isn't open-source, so unless you ask Jabo himself, or try to disassemble the program, it isn't immediately obvious what he programmed the Android port in. RE: Programming Discussion Thread - AnyOldName3 - 02-23-2013 Basically I had no clue at all about JLists, and there was a bit more information in the original version of the question. Anyway, I've got hold of the java GUI 'cheat sheet' my teacher made, which, somehow, is much simpler than anything else I can find. RE: Programming Discussion Thread - ZLRK - 03-11-2013 Hi all. It's been long since last time I was here, and just saw this thread and I hoped perhaps I could get some advise... I'm trying to implement exponentiation of a number in assembler language (for the 8051 processor in this case). I'm trying by using the MUL instruction, which does the multiplication of 2 numbers stored in registers A (accumulator) and B, and puts the lower 8 bits in A and the upper ones in B. So the exercise is, I have initially numbers in A and B, and we want the operation A^B leaving lower 8 bits in A and upper ones in B. I'm trying first with a particular case: 3^10. I already have part of the overall idea, I'm making a loop that multiplies A itself B number of times, making 8 bit multiplications (obviously storing previous results in other R registers). When I reach the 6th power the upper 8 bits (register B) begins to be used. I did the following binary multiplications in calculator apart in 2 ways: taking all the 8+ bits and taking only the lower 8 bits. Compared and realized that in both cases the lower 8 bits remain the same, only the upper 8 bits changing. So the idea of doing 8-bit multiplications seems good. My problems are, I just have no clue of how to gradually do the arrangements on the upper 8 bits, nor I know how to stop the program if the result exceeds the 16 total bits (according to MUL's instruction manual, the overflow flag sets when the product exceeds 255, not 65535, where it's actually needed!). Can you help me by chance? Thank you beforehand. RE: Programming Discussion Thread - delroth - 03-17-2013 8 bits * 8 bits can never overflow 16 bits: the largest value contained on 8 bits is 255 and 255 * 255 = 65025 which is less than 65535. RE: Programming Discussion Thread - ExtremeDude2 - 03-26-2013 Writing a tic-tac-toe program for school (highly WIP): https://code.google.com/p/cmd-tic-tac-toe/ RE: Programming Discussion Thread - NaturalViolence - 03-26-2013 >all those else if statements RE: Programming Discussion Thread - Garteal - 03-26-2013 Damn NaturalViolence. And here I thought you were analyzing and writing up a detailed analysis of yours of what he did wrong and how he could do it better. This piece of code for example, makes no sense. Code: unsigned short playing = 1; //removed other variables for readabilityFirst, you have declared playing as an unsigned short. Better practice is it to make it a bool. Then you have the function from above which accepts an integer as a parameter which you then check locally if it's true or false. If you do it this way, you could render the playing variable above useless, as you might as well pass a 0 or 1 to it. Don't forget about the different datatypes. You are currently passing a short to the function. You're also checking your parameter redundantly. If you're making checks, you only have to check if a variable is true, otherwise return false. For better practice, which you'll definitely want when you're working with objects and classes, is to have getters and setters. Getters to receive the value of the variable and setters to set a value to it. So something like this: Code: bool isPlaying = true;Also, if you declare variables, you should declare them individually and name the properly. It makes it easier to follow. Now master this and enter the beauty of Object Oriented Programming. |