1. Post #81
    dag10's Avatar
    January 2009
    1,038 Posts
    Within a few years I expect to see Garry's Mod within itself.


    ... within it self within itself within it self ...
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Late Late x 3Dumb Dumb x 1 (list)

  2. Post #82
    jfmherokiller's Avatar
    January 2010
    114 Posts
    What about gameboy advance is that possible

  3. Post #83
    CmdrMatthew's Avatar
    August 2010
    1,180 Posts
    Our aims are to get all the classics working up, First Tetris then Zelda and the Pokemon games.
    In theory you should be able to get everything working at once, if you don't mess up somewhere. (when you finish the core + opcodes + graphics)

  4. Post #84
    technicolour's Avatar
    January 2008
    108 Posts
    In theory you should be able to get everything working at once, if you don't mess up somewhere. (when you finish the core + opcodes + graphics)
    Not quite, most games use a technique called cart banking whereby they swap in banks of cart data in order to have roms larger than 32KB on a 16Bit address bus. This is a feature not used in Tetris to ensure the Core/Graphics/Interupts are all working as intended.

    I'm introducing each feature once the feature done prior to it is 100% working and tested working to make bug hunting easier.

    What about gameboy advance is that possible
    Possible sure, worth bothering with? Not really.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Disagree Disagree x 1 (list)

  5. Post #85
    CmdrMatthew's Avatar
    August 2010
    1,180 Posts
    Not quite, most games use a technique called cart banking whereby they swap in banks of cart data in order to have roms larger than 64KB on a 16Bit address bus.
    Is that how Pokemon Gold Version can have a 2048kb ROM?

  6. Post #86
    technicolour's Avatar
    January 2008
    108 Posts
    Is that how Pokemon Gold Version can have a 2048kb ROM?
    Indeed it is

  7. Post #87
    Poesidan [GAG]'s Avatar
    October 2009
    1,649 Posts
    Possible sure, worth bothering with? Not really.
    I think its worth bothering with.

    Its up to you though, so I won't pester.

    But if you could implement gameboy advanced after you finish that would be fantastic.
    Reply With Quote Edit / Delete Reply Windows Vista United States Show Events Agree Agree x 1Optimistic Optimistic x 1 (list)

  8. Post #88
    technicolour's Avatar
    January 2008
    108 Posts
    I think its worth bothering with.

    Its up to you though, so I won't pester.

    But if you could implement gameboy advanced after you finish that would be fantastic.
    I meant that it wouldn't be playable at any kind of decent speed on even very high end systems, the display is almost twice the size of the original Gameboy, this alone is already bordering on prohibitive as we're already "cheating" to get what we can to keep the Gameboy emulator playable. Let alone the obviously considerably more beefy ARM processor running alongside a Z80 co-processor in the GBA.

    Perhaps when LuaJIT is implemented and Lua is done in a separate thread than the source engine.

  9. Post #89
    Poesidan [GAG]'s Avatar
    October 2009
    1,649 Posts
    I meant that it wouldn't be playable at any kind of decent speed on even very high end systems, the display is almost twice the size of the original Gameboy, this alone is already bordering on prohibitive as we're already "cheating" to get what we can to keep the Gameboy emulator playable. Let alone the obviously considerably more beefy ARM processor running alongside a Z80 co-processor in the GBA.

    Perhaps when LuaJIT is implemented and Lua is done in a separate thread than the source engine.
    I see. Well whatever. It'll be a pleasure just to play classic games anyways.

  10. Post #90
    Gold Member
    Joker169's Avatar
    April 2009
    520 Posts
    I must admit this is very impressive.
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Informative Informative x 1Late Late x 1 (list)

  11. Post #91
    technicolour's Avatar
    January 2008
    108 Posts
    Made some HUGE progress over the last day. The CPU core is now almost complete and boasts superior emulation than Visual Boy Advance. The GPU has been re-written and accurately reflects what a real Gameboy would display. All Interrupts are now emulated. Input is now fully emulated. Tetris now runs flawlessly.


    Yes there are currently a few performance issues but they're entirely Lua based and we hope to weed out an additional 2 to 3 x performance by optimising the think() routine based on scanline cycles and converting various else-if stacks to lookups.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Winner Winner x 12Lua King Lua King x 6 (list)

  12. Post #92
    Poesidan [GAG]'s Avatar
    October 2009
    1,649 Posts
    What's the next game you'll implement?

  13. Post #93
    Rayjingstorm's Avatar
    June 2010
    1,536 Posts
    What's the next game you'll implement?
    Our aims are to get all the classics working up, First Tetris then Zelda and the Pokemon games.

  14. Post #94
    CmdrMatthew's Avatar
    August 2010
    1,180 Posts
    Do you plan to release this anytime soon? If you use SVN you can update it very easily. Also, many of us don't care if we have a only partially working version.

  15. Post #95
    QuickSnap'z Boy-Toy
    Titz's Avatar
    August 2011
    1,067 Posts
    Do you plan to release this anytime soon? If you use SVN you can update it very easily. Also, many of us don't care if we have a only partially working version.
    I don't really give a shit if it only plays tetris right now, I would still use it.

    Edited:

    I also really want to take a look at the code.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 2 (list)

  16. Post #96
    technicolour's Avatar
    January 2008
    108 Posts
    Pokemon Red is fully working from what I can tell, there's a several GPU glitches but the CPU is holding up perfectly. I'm hoping for a preliminary release today or tomorrow

    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Winner Winner x 16Lua King Lua King x 3 (list)

  17. Post #97
    King Penisless's Avatar
    July 2011
    431 Posts
    I'm hoping for a preliminary release today or tomorrow
    I can't wait to catch em all
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 3 (list)

  18. Post #98
    Poesidan [GAG]'s Avatar
    October 2009
    1,649 Posts
    Pokemon Red is fully working from what I can tell, there's a several GPU glitches but the CPU is holding up perfectly. I'm hoping for a preliminary release today or tomorrow

    have my children.
    Reply With Quote Edit / Delete Reply Windows Vista United States Show Events Agree Agree x 4 (list)

  19. Post #99
    CmdrMatthew's Avatar
    August 2010
    1,180 Posts
    Is there data saving? Or are we not able to save our games yet.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  20. Post #100
    technicolour's Avatar
    January 2008
    108 Posts
    Is there data saving? Or are we not able to save our games yet.
    Not yet but saving is exceedingly easy.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Informative Informative x 1Winner Winner x 1 (list)

  21. Post #101
    CmdrMatthew's Avatar
    August 2010
    1,180 Posts
    Are you going to add color? Or is it all just black and white? Still waiting on that release :D

  22. Post #102
    technicolour's Avatar
    January 2008
    108 Posts
    Colour... maybe... eventually, not until non-colour is emulated to perfection though.

    Edited:

    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Winner Winner x 7Lua King Lua King x 4 (list)

  23. Post #103
    Gold Member
    marvincmarvin's Avatar
    January 2011
    795 Posts
    I love you. Btw I saw your e2 emulator... Fucking epic.

  24. Post #104
    Fight for justice, fight for Manning and Snowden.
    Persious's Avatar
    April 2010
    2,592 Posts
    This is amazing. Playing Pokémon in GMod sounds great.

  25. Post #105
    technicolour's Avatar
    January 2008
    108 Posts
    a few preliminary optimisations and Pokemon is playing excellently, from 10fps in the video above to now 20-40fps with a 30fps average. Pokemon is essentially realtime on my i3, most Gameboy games should be now too.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Winner Winner x 3 (list)

  26. Post #106
    QuickSnap'z Boy-Toy
    Titz's Avatar
    August 2011
    1,067 Posts
    a few preliminary optimisations and Pokemon is playing excellently, from 10fps in the video above to now 20-40fps with a 30fps average. Pokemon is essentially realtime on my i3, most Gameboy games should be now too.
    So how does the hole rom thing work? Does the server require the rom? Does the client? What if someone has a slow connection and they receive the rom slower then others?

  27. Post #107
    technicolour's Avatar
    January 2008
    108 Posts
    In multiplayer each client runs their own instance of the emulator, there's no syncing at all currently. That's the feature we plan to add after we've finished the first optimisation pass.

    However the way it'll likely work is that each "frame" the emulator runs the key-presses will be stored and sent to the server along with a frame ID. The server will store around 3600 frame's at any one time, sending them in packets of 100 or so to the clients (so clients will be a second or two behind the person playing, there's no issue if there's no interaction). Every minute the playing client will upload a keyframe which will be the entirity of the processors current state, a good ~60-70kb.

  28. Post #108
    Gold Member
    Divran's Avatar
    April 2008
    2,625 Posts
    With little editing, I could make the emulator available client side so that the server doesn't need to have it installed. It'd be a little odd standing in the middle of a server apparently doing nothing (so like an average day in a wiremod server with E2) :P

    The server does nothing apart from spawn the entity to render on at the moment.
    Soon, it will help in handling key syncing and status checking (regular hashes of the emulator state sent to all clients to make sure they are at the same state), so everyone can see what you see.

  29. Post #109
    QuickSnap'z Boy-Toy
    Titz's Avatar
    August 2011
    1,067 Posts
    In multiplayer each client runs their own instance of the emulator, there's no syncing at all currently. That's the feature we plan to add after we've finished the first optimisation pass.

    However the way it'll likely work is that each "frame" the emulator runs the key-presses will be stored and sent to the server along with a frame ID. The server will store around 3600 frame's at any one time, sending them in packets of 100 or so to the clients (so clients will be a second or two behind the person playing, there's no issue if there's no interaction). Every minute the playing client will upload a keyframe which will be the entirity of the processors current state, a good ~60-70kb.
    -snip read it wrong-

    Wow you guys thought of everything... can't wait to test it.

  30. Post #110
    technicolour's Avatar
    January 2008
    108 Posts
    Release 1:
    http://garryboy.googlecode.com/svn/trunk/GEM

    Release Notes:
    Speed is still an issue but it should run at real time or close to real time at a decent frame rate on any modern processor.
    It'll work in MP kinda, everyone will run their own instance of the emulator with no syncing.
    The GPU code is prone to glitches, unless it's something major don't report it.
    Only MBC3, MBC1 and ROM games are supported and there's no "bounds", if a game makes a rom banking mistake that a real Gameboy would check for the emulation will likely fail and crash with the stack pointer or program counter overflowing.
    Tetris and Pokemon are confirmed to be 100% working, at least at the start. If you find any MBC1, 3 or ROM games which glitch report it to me.
    Rom files are currently stored in plain text hex (see below), no rom files are given away in the emulator. Once converted into plain text hex rom files should be stored in GEM/Data/GBZ80 for gameboy.
    No saving currently.
    Please do not upload this elsewhere.

    If you have any issues, glitches or just general questions add me on steam: http://steamcommunity.com/id/fafasafaffagr/home/, please don't contact me if you can't get SVN to work or something.

    Rom files are currently read in plain text hex because Lua's binary reading support is incomplete and cannot load roms with the 0D0A character in. a plain text hex file is just that, with each byte being represented by two ASCII hexadecimal character in capitals with no other information. One method to convert to Plain Text Hex is to download the hex editor FlexHex, load the rom there, copy all the hex into NP++ and find replace the spaces. All rom files should be .txt. If someone would like to write a quick python script for the public to convert to plain text hex that'd be great, I'd do it but I'm hoping this is just a temporary measure until binary reading is fixed.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Winner Winner x 9 (list)

  31. Post #111
    gunguy765's Avatar
    April 2010
    1,836 Posts
    Oh god, yes!
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  32. Post #112
    CmdrMatthew's Avatar
    August 2010
    1,180 Posts
    What would it take to add color capability? Just wondering how the color works.

  33. Post #113
    technicolour's Avatar
    January 2008
    108 Posts
    What would it take to add color capability? Just wondering how the color works.
    Twice the processor speed, several more palettes, main ram banking, 8 fold, Vram banking, using vram banking to access the tile tables and sprite data. Increased Window/Sprite/BG priority.

    It's not going to be a focus for quite some time as it's a large undertaking which will require a lot more overhead.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Informative Informative x 1Optimistic Optimistic x 1 (list)

  34. Post #114
    CmdrMatthew's Avatar
    August 2010
    1,180 Posts
    Twice the processor speed, several more palettes, main ram banking, 8 fold, Vram banking, using vram banking to access the tile tables and sprite data. Increased Window/Sprite/BG priority.

    It's not going to be a focus for quite some time as it's a large undertaking which will require a lot more overhead.
    -snip- I can't believe it takes that much overhead.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Artistic Artistic x 1 (list)

  35. Post #115
    technicolour's Avatar
    January 2008
    108 Posts
    There's a menu that allows you to bind them.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Informative Informative x 2 (list)

  36. Post #116
    QuickSnap'z Boy-Toy
    Titz's Avatar
    August 2011
    1,067 Posts
    You're my lua god.

  37. Post #117
    jfmherokiller's Avatar
    January 2010
    114 Posts
    what about the ability to upload your own roms avdupe style
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  38. Post #118
    QuickSnap'z Boy-Toy
    Titz's Avatar
    August 2011
    1,067 Posts
    what about the ability to upload your own roms avdupe style
    I like the idea, but it could most likely be exploitable.

  39. Post #119
    Gold Member
    Loures's Avatar
    February 2009
    2,153 Posts
    Did you use any reference documents for the CPU/GPU workings or did you find these out by yourself?

  40. Post #120
    jfmherokiller's Avatar
    January 2010
    114 Posts
    I hope sound gets implemented soon on The gb side even if the sound is basically sine waves

    Edited:

    I like the idea, but it could most likely be exploitable.
    how would it be exploitable