Jump to content


Photo

Gameboy color emulator


  • This topic is locked This topic is locked
6 replies to this topic

#1 joshuaallen64

joshuaallen64

    GMC Member

  • GMC Member
  • 778 posts
  • Version:GM:Studio

Posted 23 March 2016 - 11:56 PM

If you just want to see what I’ve done:

 

Source

 

I don’t know if it is legal for me to give this out with the roms so I took the game roms out but left the test roms in.

To run a game: add the rom to the included files, go to obj_rom -> create event -> code named “rom file info”, and look at the commented out code to see what to do.

Also I think this should really go without saying but in order for it to run at a decent FPS it needs to be compiled.

 

 

A bit of history:

After I wrote a chip 8 emulator, I made a Gameboy emulator and used it for my AI class by having a neural network play tetras over the internet. That went really well but there were some really big problems with how I actually coded it.

So at the start of this semester I tried again but this time making it a Gameboy color because they really are not different. It was a lot easier this time around because of how much I've learned from my first try. But sadly I did not know enough. Timing, sound, and a few miner errors are forcing me to start again from scratch. But before I start programming I would like to know more about how sound works.

 

Sound confuses the hell out of me.

 

Question 1:
Gameboy has 2 sound channels. Just what is a sound channel? How I see it is that there are two sound buffers that are written to by the programmer, is that correct?

 

Question 2:
The Gameboy allows producing sound in four different ways:
Quadrangular wave patterns with sweep and envelope functions. Quadrangular wave patterns with envelope functions. Voluntary wave patterns from wave RAM. White noise with an envelope function.
So what I think this means is that I'm going to have to make those waves myself and read the Gameboy memory on how to change the waves, I really don't know.

 

Question 3:
How does all of this work with game maker? I’m pretty sure there has to be an audio buffer that is constantly being written to and constantly being read but what values will I be putting in it? Can game maker even do what I want?

 

 

I’ve tried looking at some open source emulators to see how they do it but they are always the most complicated part. I know this is a complex problem but if you have any idea on how any of this stuff works can you please give me some idea on where to start because I’m at a complete loss.


  • 3

#2 RujiK

RujiK

    GMC Member

  • GMC Member
  • 841 posts
  • Version:GM:Studio

Posted 24 March 2016 - 01:12 PM

Emulators are against the rules... :( But Mike Daily made one so maybe it changed or something...

 

Maybe his tech blog on C64 sound emulation will help you:

https://www.yoyogames.com/blog/87

 

 

I would love to hear progress about this if it gets closed! In PM's or whatever.


  • 0

#3 joshuaallen64

joshuaallen64

    GMC Member

  • GMC Member
  • 778 posts
  • Version:GM:Studio

Posted 25 March 2016 - 02:48 PM

 

Emulators are against the rules... :(  But Mike Daily made one so maybe it changed or something...

I don't think they are, I looked at the game maker eula and looked if the projects is allowed. If i'm incorrect and missing something that would really be a shame because I've learned more from creating this thing I did getting my bachelors in computer science.

 

 

 

Maybe his tech blog on C64 sound emulation will help you:
https://www.yoyogames.com/blog/87

 Thanks that has really helped me understand how game maker handles the audio. 

 

 

I would love to hear progress about this if it gets closed! In PM's or whatever.

I don't think this will get closed but if it does I will be sure to keep you updated.


  • 0

#4 Mike.Dailly

Mike.Dailly

    Evil YoYo Games Employee

  • Administrators
  • 5277 posts
  • Version:GM:Studio

Posted 25 March 2016 - 11:05 PM

Emulators are fine....


  • 1

#5 djk164

djk164

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM:Studio

Posted 26 March 2016 - 01:04 AM

Hurra!

 

This is awesome by the way!


  • 0

Bye old GMC!


#6 RujiK

RujiK

    GMC Member

  • GMC Member
  • 841 posts
  • Version:GM:Studio

Posted 28 March 2016 - 12:20 PM

I tried running your emulator and got an illegal buffer size error. "Cannot create buffer of size xxx."

 

What version of GM are you using?


  • 0

#7 joshuaallen64

joshuaallen64

    GMC Member

  • GMC Member
  • 778 posts
  • Version:GM:Studio

Posted 28 March 2016 - 01:45 PM

I'm using 1.4.1749 


  • 0