GenDev SpritesMind Website SpritesMind.Net
Sega Megadrive/Genesis development
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Gameboy on 32X
Goto page 1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Demos
View previous topic :: View next topic  
Author Message
mic_
Very interested


Joined: 12 Aug 2008
Posts: 250
Location: Sweden

PostPosted: Wed Jan 21, 2009 10:37 am    Post subject: Gameboy on 32X Reply with quote

Here's something I've been tinkering with a bit lately:



It's dog slow right now, because the code is all plain C that hasn't been optimized or tweaked for the 32X. There's also some weird bug that seems to corrupt the ROM if I add a .gb file larger than 128kB (this doesn't happen with the PC version).
Back to top
View user's profile Send private message Visit poster's website
ob1
Very interested


Joined: 06 Dec 2006
Posts: 359
Location: Aix-en-Provence, France

PostPosted: Wed Jan 21, 2009 11:19 am    Post subject: Reply with quote

Hey ! Looks interesting.
;)
Any way to look into your sources ?
Back to top
View user's profile Send private message
mic_
Very interested


Joined: 12 Aug 2008
Posts: 250
Location: Sweden

PostPosted: Wed Jan 21, 2009 11:47 am    Post subject: Reply with quote

Perhaps after I've cleaned it up a bit and fixed some bugs. Right now it's quite useless.
Back to top
View user's profile Send private message Visit poster's website
TmEE co.(TM)
Very interested


Joined: 05 Dec 2006
Posts: 1945
Location: Estonia, Mahtra village

PostPosted: Wed Jan 21, 2009 2:06 pm    Post subject: Reply with quote

wow, this is awesome Ö
_________________
Mida sa loed ? Nagunii aru ei saa Wink
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
AamirM
Very interested


Joined: 18 Feb 2008
Posts: 470

PostPosted: Wed Jan 21, 2009 6:57 pm    Post subject: Reply with quote

Dude, that is just so cool and awesome!!
Back to top
View user's profile Send private message Visit poster's website
Jorge Nuno
Very interested


Joined: 11 Jun 2007
Posts: 329
Location: Azeitão, PT

PostPosted: Wed Jan 21, 2009 9:05 pm    Post subject: Reply with quote

W00t! Surprised

Doesn't the gameboy have the Z80 as a CPU? maybe it could be ran "almost" natively on the megadrive.
Back to top
View user's profile Send private message MSN Messenger
Shiru
Very interested


Joined: 07 Apr 2007
Posts: 786
Location: Russia, Moscow

PostPosted: Wed Jan 21, 2009 9:12 pm    Post subject: Reply with quote

Jorge Nuno wrote:
Doesn't the gameboy have the Z80 as a CPU?

Not, it has it's own unique CPU, something between 8080 and Z80, partially compatible.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Jorge Nuno
Very interested


Joined: 11 Jun 2007
Posts: 329
Location: Azeitão, PT

PostPosted: Wed Jan 21, 2009 9:16 pm    Post subject: Reply with quote

Well what if the 68k supervises the code for z80 unknown instructions and handle them, while it feeds the z80 with pure code. I don't know if it is possible to do that fast enough, doing the address translation at the same time.
Back to top
View user's profile Send private message MSN Messenger
mic_
Very interested


Joined: 12 Aug 2008
Posts: 250
Location: Sweden

PostPosted: Thu Jan 22, 2009 5:17 pm    Post subject: Reply with quote

I've looked at the SH2 assembly that gcc generates (I'm compiling with -O2) for my emulator, and it's a real piece of crap compared to what even an SH novice like me could accomplish. To achieve any kind of decent speed - especially for the CPU emulation - it'd probably be necessary to write the whole thing from scratch in assembly.
Back to top
View user's profile Send private message Visit poster's website
mic_
Very interested


Joined: 12 Aug 2008
Posts: 250
Location: Sweden

PostPosted: Thu Jan 22, 2009 5:22 pm    Post subject: Reply with quote

Just as an example; a function that contains only "return 0;" gets compiled into:

Code:
   mov.l   r14,@-r15
   mov   #0,r0
   mov   r15,r14
   mov   r14,r15
   rts     
   mov.l   @r15+,r14


Plain awesomeness.. Rolling Eyes That could be reduced by 67%. And it just goes on like that.
Back to top
View user's profile Send private message Visit poster's website
TMorita
Interested


Joined: 29 May 2008
Posts: 17

PostPosted: Thu Jan 22, 2009 8:36 pm    Post subject: Reply with quote

mic_ wrote:
Just as an example; a function that contains only "return 0;" gets compiled into:

Code:
   mov.l   r14,@-r15
   mov   #0,r0
   mov   r15,r14
   mov   r14,r15
   rts     
   mov.l   @r15+,r14


Plain awesomeness.. Rolling Eyes That could be reduced by 67%. And it just goes on like that.


GCC is creating a stack frame. You need to use -fomit-frame-pointer to disable this.

Toshi
Back to top
View user's profile Send private message
mic_
Very interested


Joined: 12 Aug 2008
Posts: 250
Location: Sweden

PostPosted: Thu Jan 22, 2009 8:43 pm    Post subject: Reply with quote

Quote:
GCC is creating a stack frame.

Yes, I know, it's the same on most processors. That was just an example of the overall (lack of) quality of the code.
Back to top
View user's profile Send private message Visit poster's website
Chilly Willy
Very interested


Joined: 17 Aug 2007
Posts: 1955

PostPosted: Thu Jan 22, 2009 10:15 pm    Post subject: Reply with quote

mic_ wrote:
Quote:
GCC is creating a stack frame.

Yes, I know, it's the same on most processors. That was just an example of the overall (lack of) quality of the code.


Except that IS quality code... for code with a stack frame. It's not gcc's fault you made no use of the stack frame when you told it to make one. I'm not saying a compiler can beat hand-done assembly, but the code produced is much better than you're saying.
Back to top
View user's profile Send private message
tomaitheous
Very interested


Joined: 11 Sep 2007
Posts: 236

PostPosted: Fri Jan 23, 2009 7:56 am    Post subject: Reply with quote

Awesome project Very Happy Let's hope you can get GBC cpu core running full speed as well.
Back to top
View user's profile Send private message
mic_
Very interested


Joined: 12 Aug 2008
Posts: 250
Location: Sweden

PostPosted: Fri Jan 23, 2009 8:36 am    Post subject: Reply with quote

Code:
Let's hope you can get GBC cpu core running full speed as well.

The CPU is the same, it just runs at twice the clock frequency. I don't see a system with an 8MHz gb-z80 being emulated at full speed on the 32X. Even at normal frequency it's very far from full speed.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Demos All times are GMT
Goto page 1, 2, 3, 4, 5, 6  Next
Page 1 of 6

 
Jump to:  
You can post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group