Page 3 of 14 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 133

Thread: Gameboy Advance

  1. #21
    EmuTalk Member
    Join Date
    Feb 2014
    Location
    Niedersachsen, Germany
    Posts
    87
    Mentioned
    8 Post(s)
    Thanks for this info, I will implement it this way asap hehe
    Looks like you did a lot of progress with your emulator Can it play any game of the Pokémon series, yet? They were my favourite games when I was a child
    My next steps are to write a proper mmu, currently I only have a big array of memory with all the stuff like rom in it, fixing overflow stuff and beginning with implementing ARM. Have you tested how fast you cpu emulation is able to run? Mine is currently able to run at ~100Mhz on a Linux machine with an i7 processor. But I tested it with your tv screen demo, so it has a endless loop at the end. Therefore I don't know how accurate this value is. On the one side it's not executing any complex instructions like add, sub, ldmia etc but on the other hand branches are time consuming because pipeline must be cleared each time. I think for me a big overhead is the instruction decoding :/ Maybe I'll optimize it at some time..

    Last edited by Flerovium; November 2nd, 2014 at 21:22.

  2. #22
    EmuTalk Member
    Join Date
    Mar 2014
    Location
    Chicago, IL
    Posts
    166
    Mentioned
    28 Post(s)
    Haven't tried to run any Pokemon game just yet. I'm pretty sure those games (like many Nintendo games on the GBA) use EEPROM. I found this out the hard way. Super Mario Advance won't boot without some form of EEPROM emulation. GBATEK isn't very clear on how this operates (at least it makes little sense when I last looked at it) but I'll handle that eventually.

    I've been very busy these past few weeks (see my GitHub activity log ) I want to have a lot of things done by the end of this year. This time next year, I want a lot of games to boot and play without issue. I'm definitely going faster than I was programming a GB/GBC emulator. Gotta go fast.

    As for speed, most games (without limits) can run 110~130 FPS with my i5-2500K @ 3.8GHz. That's not really good, but for the time being, speed isn't a priority. Once things start working and games can play normally, I'll get back to optimizations.

  3. #23
    EmuTalk Member
    Join Date
    Feb 2014
    Location
    Niedersachsen, Germany
    Posts
    87
    Mentioned
    8 Post(s)
    Wrote a small demo ROM in ASM, too. ARM Part can be skipped if not (fully) implemented yet ( as in my case), just go directly to 0x08000100 in thumb mode.
    It's thought to be a little more complex than your previous tests. Therefore it uses things like functions (and must therefore use operations such as push and pop). What it basically shows up is what you see in this video:


    Source: http://pastebin.com/uJi4FHfc (It's not very well documented yet)
    ROM: Look at the attachments

    I'm thinking about writing small tests for specific things such as:
    - Correct altering of CPSR flags
    - Correct emulation of Stack and Load / Store multiple instructions
    This list isn't finished (yet). I'm already thinking about some other tests I could write.

    ~Flerovium

    PS: I found out a small thing about timing yesterday. I took an open source GBA emulator in javascript and I removed most of the timing. Then I was testing how it was running with Pokemon Firered. It seems that the game still works but it actually is running slower (this sounds crazy , you would except it to run faster in the the first moment)
    Attached Files Attached Files
    Last edited by Flerovium; November 8th, 2014 at 00:37.

  4. #24
    EmuTalk Member
    Join Date
    Mar 2014
    Location
    Chicago, IL
    Posts
    166
    Mentioned
    28 Post(s)
    That's a pretty cool demo you made. I can run it without issues, so that's good. Perhaps we should both start making a collection of test ROMs for others. I've been focusing on getting commercial games to work, which is basically some of the most challenging forms of testing (that is to say, real-world code). I think I would like to make more test ROMs though since 1) it's fun and 2) it would be nice to have a comprehensive array of tests. I know there is ARMWrestler and another CPU test suite (google "cpu test by deadbody") but it would be great to have specific tests that work on all of the GBA's major features (DMAs, lots of LCD rendering features, input, memory read/writes).

    I see your test ROM actually does some interesting things: you use the BG Palette #0, Color #0 (0x5000000-0x5000001) as the backdrop color to quickly fill the screen (smart move). You also have misaligned halfword writes during the draw function (the misaligned bits are ignored by the hardware, so it's no problem, but it's a neat trick) and you use your own "timer" as a delay. Rather than a sprite, you just write values to the BG map for animation. Good stuff all-around

    Here's a list of what I have running. Apparently I boosted compatibility over the last couple of days.

    Super Mario Advance: Displays something now (was a black screen). Complains about corrupted saves; EEPROM emulation necessary.
    Advance Wars: Displays 1st frame of the game, freezes, then quits, which is an improvement (was a black screen).
    Bomberman Tournament: Works fairly well, goes in-game, except a lot of sprites are invisible for some reason. Technically playable.
    Kirby - Nightmare in Dreamland: Works very well. Few graphical glitches, most everything works except advanced LCD stuff, saving. Technically playable from start to finish (probably, if it didn't randomly crash, like most games).
    Mega Man Battle Network 4 - Blue Moon: Works fairly well, goes in game. Prone to crashing when switching scenes, but otherwise seems playable. Text is weird, but that seems to be the only graphical glitch.
    Super Dodgeball Advance - Works well. Plays just fine until a dodgeball match actually starts. Player sprites are completely glitched. Needs BIOS math functions (arctan2 and sqrt) to work properly.
    Kingdom Hearts - Chain of Memories - Boots (to my surprise) and tries to start a new game, but instead goes into the game's Debug Mode (which you usually need cheats to do). Heavy graphical glitches and the main game won't start (stuck in debug mode). Better than a black screen
    Riviera - The Promised Land - Works very well, until I try to start a new game. Keeps writing to unused memory and hangs after that. Before that, the intro works wonderfully with no issues.
    Pokemon Fire Red - This game doesn't actually boot yet, but it looks like it needs timers (specifically, Timer 3), so if you want to play this game, implement Timer 3!

  5. #25
    EmuTalk Member
    Join Date
    Feb 2014
    Location
    Niedersachsen, Germany
    Posts
    87
    Mentioned
    8 Post(s)
    Thanks. That thing with the misaligned halfwords actually wasn't itended to be misaligned but well that happens if you write asm code at 00:30 pm. But well this way the test got another "complication" to manage for an emulator
    Your list looks pretty good. Currently I am only dreaming of getting so far. Still have to implement ARM opcodes although I struggle a little bit with decoding it. Is it correct that the GBA cpu only implements ARMv4? I read on wikipedia that there actually are some arm7tdmis that implement some ARMv5 opcodes..
    Last edited by Flerovium; November 8th, 2014 at 10:32.

  6. #26
    EmuTalk Member
    Join Date
    Mar 2014
    Location
    Chicago, IL
    Posts
    166
    Mentioned
    28 Post(s)
    Some ARMTDMI variants implement ARMv5, however, the GBA CPU is not one of them. One the other hand, the Nintendo DS does have an ARMv5 CPU (but it also has an ARM7TDMI as well). If you're like me and plan to go onto DS emulation after the GBA, then that's when you'll need to worry about ARMv5 (ARM9 support), but not immediately. So on the GBA, there is no such thing as BLX (since it's an ARM9 thing). Technically, the GBA is ARMv4T, for reference.

    I think I'll work on a V-Blank test/demo that manipulates BG scrolling. I already made a simple test ROM that changes the BG color every V-Blank (which I'll share with you later) but I want something a bit more fancy. Hopefully it will go well. This should be fun though.

  7. #27
    EmuTalk Member
    Join Date
    Feb 2014
    Location
    Niedersachsen, Germany
    Posts
    87
    Mentioned
    8 Post(s)
    Hey, haven't been active here for some time =D
    Anyways, my project is not dead even though I took several breaks. I think I'm able to finish ARMv4 in the next days.
    Current progress can be watched here: https://github.com/rhbros/kinage

    How is your progress going shonumi?

    EDIT: I have your test ROMs in my repository for testing. I hope this is okay with you.

  8. #28
    EmuTalk Member
    Join Date
    Mar 2014
    Location
    Chicago, IL
    Posts
    166
    Mentioned
    28 Post(s)
    I really haven't stopped working on my emulator (not once, not for a single day). I guess Github keeps me motivated to make at least 1 useful commit every day. As for my progress, most games boot and run with the only problem being graphical glitches (due to unimplemented LCD features, such a sprite scaling/rotation). Recently I got the Pokemon games (Ruby, Sapphire, Emerald, Fire Red, Leaf Green) to run. Just implemented FLASH ROM saving and loading as well, so I can fully play my version of Sapphire now The saves are also compatible with VBA-M. Basically, I just need to finish up more LCD emulation, then work on sound, and I should have a fully functional emulator on my hands. After that, I just need to increase the speed and accuracy.

    Good luck with your work btw. I'll be watching your progress. It's alright to use the test ROMs. They're essentially Public Domain, so do whatever you want with them.

    EDIT: For reference, I'll just cross-post the images I've already shared elsewhere of my current progress:

      Spoiler:













    That's all the stuff I've done since mid-November. Didn't think I'd get this far this early. I took forever to get original Gameboy games working in my first attempt at an emulator, so I assumed I wouldn't get things running this well until May or something. By the way, the Pokemon Fire Red picture is from a randomized version where everything gets flipped around (based on TwitchPlaysFireRed from last year). That's why I'm fighting a lvl 2 Gengar
    Last edited by Shonumi; January 30th, 2015 at 06:05.

  9. #29
    EmuTalk Member
    Join Date
    Feb 2014
    Location
    Niedersachsen, Germany
    Posts
    87
    Mentioned
    8 Post(s)
    Well that looks pretty neat shonumi. I'm currently searching for bugs in my ARMv4 emulation. Because weird things happen in control flow in ARM mode lol. When I finish the cpu core I will create an extra branch to rewrite it more efficiently. I'm thinking of a better way of decoding and I also thought about implementing something like a decoding cache where I store the decoded data for each instruction. I want to make it run faster this way. But of course this would also require a bigger amount of memory.

  10. #30
    EmuTalk Member
    Join Date
    Mar 2014
    Location
    Chicago, IL
    Posts
    166
    Mentioned
    28 Post(s)
    What a coincidence, I was about to implement a decoding cache some time next week myself. I had already made a prototype months ago, but I never merged the code to my master branch. However, I only did it for instruction fetching in ROM, not RAM. Currently I'm looking for little design decisions to make CPU emulation faster, e.g. using switch statements when possible, using less branching C++, high-level stuff that the compiler really can't optimize.

    My goal is to make it so that every game can at least run at 120 FPS on my computer. It's a 3.8 GHz i5-2500K, so if I can run the GBA @ 200%, any comparable computer (Sandy Bridge @ 1.9GHz). I'd like to think that my emulator is just being demanding like bsnes, but the truth is I need to optimize it a lot more

Page 3 of 14 FirstFirst 1234513 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •