? Gameboy Emulator (Page 7) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Gameboy Emulator

1 2 3 4 5 6 7 8
  • #121 ✎ 85 Vakore It's fine. Honestly I know very little about emulation besides the dumber down version of how it works. Posted
  • #122 ✎ 1037 Yttria I mean, I've never written a gb emulator, but I'm guessing you haven't either. It's a bytecode (plus headers and data regions and whatever) but "you can't do this" isn't really correct. The work required for an emulator and the work required for a transpiler are very similar in this case, um, and the reason it wouldn't be a good idea is because setting up arbitrary jumps is a dumb hack and you'd just end up writing 7/8ths of an emulator anyway. with emulators the problem isn't really instruction interpretation so much as emulating the timings and quirks of the original machine: running generic z80 code in smilebasic is (probably) not difficult, running "Nintendo GameBoy" needs a lot more attention to all the little quirks or nothing will run correctly. So part of the challenge is doing it right, which is a lot harder if you try to compile to another language. and assembly vs. bytecode doesn't really matter. The point of an assembly language is to map very closely to the bytecode: they encode the same information. You can't read the Demotic part of the Rosetta Stone, but that doesn't mean that it can't be read or isn't useful. Since any assembly syntax you find isn't going to be valid SmileBASIC (if it were, you could approach the problem as "make a library that implements these instructions"), that doesn't help: you're either parsing and interpreting assembly mnemoniccs or interpreting bytecode. Bytecode is easier. Posted
  • #123 ✎ 85 Vakore Yttria, are you referencing to my idea or something else? Because emulation is just interpreting, and if you are interpreting javascript from c++ to draw a rectangle, it is much quicker to just draw the rectangle in c++(that isnt what javascript is for, but it shows the point) I'm not saying dont write a working emulator. while slow, it would be impressive. However, I do think the gameboy to smilebasic would be an interesting thing to persue. Someone did an almost exact port of celeste classic doing it manually, and I know this because some of the bugs that are in the original are also in the port. Posted
  • #124 ✎ 49 SaladFingers
    hi
    It’s a family reunion
    Hehehe… I haven’t really been working on my emulator much. I need a new battery for my 3DS because my current one is very swollen. Once I return home, I may either work on it some more or post the code to GitHub: I haven’t had much motivation to work on it. Most of the CPU and GPU is finished. I think I really only need to work on special registers, timers, improve interrupt handeling, and implement memory banking.
    [ Sorry for the massive misinformation, I guess. Guess I had some information mixed up or something.
    .gb files hold machine code, which is the assembled form of assembly, as well as data of the ROM.
    Posted
  • #125 ✎ 245 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    I have an idea for how you could "emulate" a gameboy on smilebasic. Instead of reading the ROM of a game and converting it in real time, you could create a script to convert the entire thing into smilebasic code and sprites/backgrounds(in smilebasic of course). You wouldn't be truly emulating a gameboy, but it would(in theory) truly emulate a gameboy game, and it would run very well. You could potentially totally so this for nes/SNES games, but I'm not the one making emulators here.
    Like a "Virtual Gameboy", NOT a "Gameboy Emulator".
    Posted
  • #126 ✎ 56 Zypher Impressive. Hope you get it working. So my idea, is people make ports to the game, and it is run by this virtual gameboy? Posted
  • #127 ✎ 49 SaladFingers Window and MBC1 implemented Posted Edited by SaladFingers
  • #128 ✎ 107 codinginept Beginner Programmer I'm just starting out! I'm still trying to grasp the basics. Programming Strength Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself so like uh i don't quite wanna go way back through this thread, how's this intended to work? Posted
  • #129 ✎ 85 Vakore It's just supposed to be a gameboy emulator. I just recommended a gameboy-to-SmileBASIC converted so that the framerates would be playable, but they want true emulation, which is probably fun to program, but not supposed to be playable. Posted
  • #130 ✎ 245 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    I have an idea for how you could "emulate" a gameboy on smilebasic. Instead of reading the ROM of a game and converting it in real time, you could create a script to convert the entire thing into smilebasic code and sprites/backgrounds(in smilebasic of course). You wouldn't be truly emulating a gameboy, but it would(in theory) truly emulate a gameboy game, and it would run very well. You could potentially totally so this for nes/SNES games, but I'm not the one making emulators here.
    What about QIX?
    Posted
  • #131 ✎ 101 Tarudahat OSP Contest 3 Contest Participant I participated in the third SmileBASIC Source OSP Contest! Forum Contributor Hidden Achievements Avatar Embargo I didn't change my avatar for 90 days Website
    What about QIX?
    Well I don't know why you quoted what Vakore said, but yes if the emulator is done you will probably be able to play it on there.
    Posted Edited by Tarudahat
  • #132 ✎ 245 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    What about QIX?
    Well I don't know why you quoted what Vakore said, but yes if the emulator is done you will probably be able to play it on there.
    That's because it's my favorite game, thats why I'm asking to.
    Posted
  • #133 ✎ 185 seggiepants I always liked Qix too, anyone know how the fill algorithm in that game works? Posted
  • #134 ✎ 245 the_squat1115 Minecraft Is Awesome! I love Minecraft! Express Yourself Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies
    I always liked Qix too, anyone know how the fill algorithm in that game works?
    I was thinking to make a port of it. Because it's addictive And fun And cool
    Posted Edited by the_squat1115
  • #135 ✎ 185 seggiepants Maybe this will help. https://youtu.be/_5W5sYjDBnA I look forward to your QIX port. Posted
  • #136 ✎ 101 Tarudahat OSP Contest 3 Contest Participant I participated in the third SmileBASIC Source OSP Contest! Forum Contributor Hidden Achievements Avatar Embargo I didn't change my avatar for 90 days Website @SaladFingers, which things haven't been implemented yet, that you still need to do? (Other people might be able to help you with those things) Posted Edited by Tarudahat
  • #137 ✎ 199 Perska Summer 2016 Contest Winner I won the SmileBASICSource Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Great Page Hidden Achievements Compiling GBz80 machine code to SmileBASIC code isn't as viable as you'd think for several reasons:
    1. Executable code is not always aligned. Instructions on the GBz80 are variable width, and the code might also come after data the program might read. You might end up compiling completely incorrect code.
    2. Programs that execute from non-ROM areas won't work. A lot of software more than likely at some point will run code from WRAM/VRAM/HRAM/OAM. For example, Pokémon Red/Blue/Yellow store the current map script in External RAM. This also means that Arbitrary Code Execution won't work.
    3. The memory map is not static. The Game Boy can access up to 32KB ROM at a time, so by telling the Memory Bank Controller cartridges have to swap banks, the latter 16KB bank is swapped out for another bank. This also applies to External RAM on the cartridge (usually battery packed), you can only access 8KB of External RAM at a given time. Additionally, the Game Boy Color includes extra VRAM and WRAM. (8KB VRAM on GB, can be swapped for another 8KB, and 8KB WRAM, latter 4KB can be swapped for 6 other 4KB banks)
    Posted
  • #138 ✎ 242 CyberYoshi64 Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Great Page Hidden Achievements To be honest, if Gameboy games should run on SB, it'd be better to just port over and convert the code to native SB even though ACE would become impossible as you could easily fix these bugs and also working... Also, with portings you could use the whole screen instead of just the small square. Posted
  • #139 ✎ 85 Vakore
    Compiling GBz80 machine code to SmileBASIC code isn't as viable as you'd think for several reasons:
    1. Executable code is not always aligned. Instructions on the GBz80 are variable width, and the code might also come after data the program might read. You might end up compiling completely incorrect code.
    2. Programs that execute from non-ROM areas won't work. A lot of software more than likely at some point will run code from WRAM/VRAM/HRAM/OAM. For example, Pokémon Red/Blue/Yellow store the current map script in External RAM. This also means that Arbitrary Code Execution won't work.
    3. The memory map is not static. The Game Boy can access up to 32KB ROM at a time, so by telling the Memory Bank Controller cartridges have to swap banks, the latter 16KB bank is swapped out for another bank. This also applies to External RAM on the cartridge (usually battery packed), you can only access 8KB of External RAM at a given time. Additionally, the Game Boy Color includes extra VRAM and WRAM. (8KB VRAM on GB, can be swapped for another 8KB, and 8KB WRAM, latter 4KB can be swapped for 6 other 4KB banks)
    You obviously know more than me, but allow my lac-of-knowledge to give some ideas that probably wont work at all and I'm miss g something completely. A: I'm sure someone could figure that out. Doesnt even have to be I. SmileBASIC, could be in Javascript. B:Functions and arrays to handle that maybe? Easy, no, possible, eh? C: So... have separate script files?
    Posted
  • #140 ✎ 169 banana RNG Hidden Easter Eggs Third Year My account is over 3 years old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength
    Compiling GBz80 machine code to SmileBASIC code isn't as viable as you'd think for several reasons:
    1. Executable code is not always aligned. Instructions on the GBz80 are variable width, and the code might also come after data the program might read. You might end up compiling completely incorrect code.
    2. Programs that execute from non-ROM areas won't work. A lot of software more than likely at some point will run code from WRAM/VRAM/HRAM/OAM. For example, Pokémon Red/Blue/Yellow store the current map script in External RAM. This also means that Arbitrary Code Execution won't work.
    3. The memory map is not static. The Game Boy can access up to 32KB ROM at a time, so by telling the Memory Bank Controller cartridges have to swap banks, the latter 16KB bank is swapped out for another bank. This also applies to External RAM on the cartridge (usually battery packed), you can only access 8KB of External RAM at a given time. Additionally, the Game Boy Color includes extra VRAM and WRAM. (8KB VRAM on GB, can be swapped for another 8KB, and 8KB WRAM, latter 4KB can be swapped for 6 other 4KB banks)
    You obviously know more than me, but allow my lac-of-knowledge to give some ideas that probably wont work at all and I'm miss g something completely. A: I'm sure someone could figure that out. Doesnt even have to be I. SmileBASIC, could be in Javascript. B:Functions and arrays to handle that maybe? Easy, no, possible, eh? C: So... have separate script files?
    A: Sounds theoretically feasible B: It wouldn't be convenient for compiled code to depend on runtime stuff. C: No. Sometimes code gets executed dynamically, meaning you can't simply put 'scripts', as it's behavior isn't usually deterministic.
    Posted
1 2 3 4 5 6 7 8