• Gmod Gameboy and Intel 8080 emulators.
    209 replies, posted
Can anybody explain how this works? I read through the code, but don't quite grasp how it's drawing the information from the rom. The GMod part I understand. I just don't quite understand how the rom is being read properly, then drawn.
[QUOTE=Drak_Thing;33785788]Can anybody explain how this works? I read through the code, but don't quite grasp how it's drawing the information from the rom. The GMod part I understand. I just don't quite understand how the rom is being read properly, then drawn.[/QUOTE] Here's the jist of it. In Gameboy.lua it loads the rom file into the ROM area of memory. It then iterates through the memory performing diferent intstructions depending on the value in that area of memory, the instructions are in gmb_opcodes.lua and gmb_cb_opcodes.lua. It then draws it to the screen using gmb_gpu.lua (Assuming you have the latest version), which processes the raw tile data (Which is generated by the instructions as the rom is run) into sprites, maps, and renders it to an RT screen. That's a really simplified explaination, if you'd like more detail on any area please ask.
How do you find all opcodes and that from the start?
[QUOTE=Donkie;33786590]How do you find all opcodes and that from the start?[/QUOTE] [url]http://nocash.emubase.de/pandocs.htm[/url] [url]http://www.pastraiser.com/cpu/gameboy/gameboy_opcodes.html[/url]
[QUOTE]Could everyone who's tried this mind posting their performance results (FPS) along with their hardware? I'm trying to determine if Gameboy colour is worth it. @technicolour[/QUOTE] 40 range in fps in pokemon red in startup 70 ingame No game loaded gives me 150 FPS Map i tested on is sb_gooniverse HW: CPU:Intel(R) Core(TM) i7 CPU GFX:NVIDIA GeForce GTX 295 RAM:12GB
Could you just read the date of the post above you please?
Hey James xX, if you look back in the earlier posts sometimes they went a month without talking. technicolour is still working on this project, and is mostlikly converting it for Gmod 13. As to technicolour's request. No game: 94FPS game (pokemon red): intro screen 25-30 FPS, playing 40 - 50FPS Map: gm_construct CPU:Intel(R) Core(TM) i3 CPU GFX:Intel Integrated RAM:4GB
Real sorry about the bump here but I found this on googlecode and went looking through it, its actually quite amazing. Unfortunately its broken as the script uses a bitwise operators and other things that do not exist currently in Garry's Mod and some occasional errors from deprecated functions. It would be amazing if someone who had a better knowledge of these things would try to fix it!
[QUOTE=Exho;47394970]Real sorry about the bump here but I found this on googlecode and went looking through it, its actually quite amazing. Unfortunately its broken as the script uses a bitwise operators and other things that do not exist currently in Garry's Mod and some occasional errors from deprecated functions. It would be amazing if someone who had a better knowledge of these things would try to fix it![/QUOTE] Can you provide a link to the GoogleCode repo you found it from?
Pretty sure Exho means the one on the front page: [url]http://garryboy.googlecode.com/svn/trunk/GEM/[/url] It would be a good idea to back up as much as possible since we already lost gmod org, now Google Code is shutting down so... Edit: I wish there was export to BitBucket too; oh well... I started the backup to here: [url]https://github.com/Acecool/garryboy/[/url] but I don't know if I'll keep it on github ( limits, etc.. ) so I may move it to bitbucket: [url]https://bitbucket.org/Acecool/[/url] I don't really have the time to mess with it right now, but the export page said it'll take a while before it all is over ( I'd recommend downloading as zip or cloning it )
Thanks to whomever bumped GarryBoy. Shame it's quite dead. Would love if there was an overlay version.
When I get home tonight I will have a crack at it. So far all I think that needs doing is re-enumerating the keys (those that were stored in _E, and can be found [url=https://github.com/AlexSwift/Ananke/blob/master/gamemode/modules/Binds/module/init.lua#L2]here[/url] ), change the FindInLua to Find with the 'LUA' parameter, and change all the bitwise operators to their respective functions (though if there is a way to add new operators, I might try that first and save myself a lot of work).
I don't see the point. It's too slow. If it was faster and had multiplayer support then it would be worth having. Imagine garrysmod pokemon trading/battling servers.
Got the Intel8080 emulator working. A bit slow or it might just be my computer. [IMG]http://puu.sh/gSrwm/84a5acb936.jpg[/IMG]
Thats amazing!
It's quite simple. Along side the modifications I outlined in my previous post, the only other modification needed was updating the rendering code. If anyone could help me with some regex patterns to replace parts of the code in one go, that would be great. These are the replacements I used: [code] ([a-zA-Z_0-9.]+)\s?\&\s?([a-zA-Z_0-9.]+) -> bit.band\($1,$2\) self.SP & 0xFF -> bit.band(self.SP,0xFF) // but won't recognise ((self.SP>>8) & 0xFF) [/code] I am now just working on the GameBoy emulator. I think I might have made an error while updating the opcode definitions, but shouldn't be long now until it's fully fixed.
Awesome. Its amazing to think that you can create an emulator in Garry's Mod that reads hex from txt files. How do you even learn how to do that kind of stuff?
[QUOTE=Exho;47412493]Awesome. Its amazing to think that you can create an emulator in Garry's Mod that reads hex from txt files. How do you even learn how to do that kind of stuff?[/QUOTE] There's no real difference between a text file and a rom file, text files themselves are made of different hex values that coorespond with letters and numbers (these are agreed upon by standards like ASCII, Unicode, etc). Compiled programs like the games in gameboy rom files are just hex values that represent a instructions. These instructions are interpreted by a processor which in turn performs the many steps it takes to make the game work. I haven't read this person's code, but likely how it works is it emulates the processor's relatively simple instruction set and interprets it like the processor would. That's how many game system emulators work. Game rom files also contain data like sprites and music, and this data is stored in a set format. Once you can figure out how to read and display that data as well as interpret and run the game's code, you can then run pretty much any game you want. Most older gaming platforms have opensource emulators written for them, so you can read for yourself how they work. They are really awesome programs.
Intel8080 fully fixed. I need to look into optimisation, as currently my laptop does not handle this very well (Although I am running on an incredibly slow laptop at 1.4GHz, and a HD300). I will post the code to my repo on [URL="https://github.com/AlexSwift/garryboy"]github[/URL]. I will update the GBZ80 tonight. My first attempt at fixing the GBZ80 did not go so well as the stack pointer is being corrupted (during the return call after the loading screen has finished). I have no idea what is causing this, nor do I have the time to reverse engineer and dump the instruction history of a correctly emulated ROM to identify which instruction corrupts the SP. As of now, only the 8080 cpu will work, and the other files will throw errors, I will update the other files before the end of the night. [B]------------------------------------------------ EDIT ----------------------------------------------------- [/B]Both the Intel8080 and the GBZ80 are working as they were at the time of this was released. [url=https://github.com/AlexSwift/garryboy/]Download Here[/url]
This would be awesome to get fully working again and possibly set up an arcade kind of like Gmod Tower has.
It is fully working again. I posted a link to thw github repository in my previous post. It's entirely possible, although other people would not be able to see what you are playing, and if multiple people are playing their own game, then it would drag client's fps right down. And depending on its implementation you would either have problems with security (if we let the owner of the game store the information and network it went required) or performance (letting the server handle the emulation and send memory and registers to the spectators. There is no easy multipler support.
[QUOTE=dingusnin;47424942]It is fully working again. I posted a link to thw github repository in my previous post. It's entirely possible, although other people would not be able to see what you are playing, and if multiple people are playing their own game, then it would drag client's fps right down. And depending on its implementation you would either have problems with security (if we let the owner of the game store the information and network it went required) or performance (letting the server handle the emulation and send memory and registers to the spectators. There is no easy multipler support.[/QUOTE] Hey, Does this work with servers? I mean my friend had the old version, So I had him install the new version and it gives this error in a X on the left SboxLimitGEMemulators Or something close. Got any solutions? ----- EDITED: So I just read your other post. It wouldn't be easy, But does this still work.
Haven't tested it since. Should still work there have been no updates that should effect it. If anyone has any problems (although I doubt anyone is still using it) post them here and I'll sort it. Should work on servers although no multiplayer suppport. Although I am going to attempt to get spectator support working. The problem is that some games will not be deterministic so there is little to no way of actually getting it to be fully functional on a spectator level. If garrysmod had internal socket support then it would be quite simple but not right now. Any suggestions are welcome.
[QUOTE=dingusnin;48971427]Haven't tested it since. Should still work there have been no updates that should effect it. If anyone has any problems (although I doubt anyone is still using it) post them here and I'll sort it. Should work on servers although no multiplayer suppport. Although I am going to attempt to get spectator support working. The problem is that some games will not be deterministic so there is little to no way of actually getting it to be fully functional on a spectator level. If garrysmod had internal socket support then it would be quite simple but not right now. Any suggestions are welcome.[/QUOTE] it isn't native support, but gm_bromsock is a nice binary module for socket connections
I am following in the ideology that it shouldn't have any modules. If it did all of this would be easy. I'll figure something out with what I've got
To be fair, the lack of modules is an impressive feat, but I think people care more about the end product. It was a nice proof-of-concept, but eh, I dunno.
[QUOTE=dingusnin;48971427]Haven't tested it since. Should still work there have been no updates that should effect it. If anyone has any problems (although I doubt anyone is still using it) post them here and I'll sort it. Should work on servers although no multiplayer suppport. Although I am going to attempt to get spectator support working. The problem is that some games will not be deterministic so there is little to no way of actually getting it to be fully functional on a spectator level. If garrysmod had internal socket support then it would be quite simple but not right now. Any suggestions are welcome.[/QUOTE] on my friend's server it still won't let me spawn it :( Also if I force spawn it, It won't have the the hover over press E interface.
In the midst of updating this for multiplayer support, and letting other players be able to see what you are playing, but wanted to get an idea for how welcome this would be. It will have to use a module (on the server, not the clients), and will be an optional feature. Will be posting a few updates soon and see how it plays out.
[QUOTE=dingusnin;49766052]In the midst of updating this for multiplayer support, and letting other players be able to see what you are playing, but wanted to get an idea for how welcome this would be. It will have to use a module (on the server, not the clients), and will be an optional feature. Will be posting a few updates soon and see how it plays out.[/QUOTE] Hi, any new news? I am interested to see how this project continues!
Sorry, you need to Log In to post a reply to this thread.