Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Game Gear stereo and Mega Drive

Reply to topic
Author Message
Martin
  • Guest
Reply with quote
Game Gear stereo and Mega Drive
Post Posted: Sun Aug 06, 2000 11:34 am
Hello

Can anyone explain me how I can program Game Gear stereo sound?

I'd also like to know how I can change the Mod2PSG source to support the Mega Drive. Someone mentioned here that this wouldn't be very much I think.
 
  • Joined: 24 Jun 1999
  • Posts: 1732
  • Location: Paris, France
Reply with quote
Post Posted: Sun Aug 06, 2000 11:59 am
Quote
> Can anyone explain me how I can program Game Gear stereo sound?

Port 6 is a bitmask for what channel is played on the left or right side.
Bits 0 to 3 are the four channels played on left side, bits 4 to 7 are the left side equivalent.
So writing 0x0F to that port would disable the right channel.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Sun Aug 06, 2000 4:49 pm

Quote
> I'd also like to know how I can change the Mod2PSG source to support the Mega Drive. Someone mentioned here that this wouldn't be very much I think.

The Z80 has a different memory map for the Mega Drive:

0000-1FFF : RAM
2000-3FFF : RAM (mirror)
4000-4003 : YM2612 FM chip
6000 : Bankswitch register for 8000-FFFF
7F11 : PSG (also at port $7F)
8000-FFFF : Bankswitched ROM

The Z80 always gets an IRQ (no NMI) at the end of each frame,
so you can think of the vertical interrupt always being
enabled.

The idea is that the player+data is stored in ROM, and the
68000 will initialize the Z80 RAM and transfer the program
to it, then reset the Z80 so the player starts up.

If the module data and player fit within 8K, you could just
change all references to variables to start near the end
of RAM, instead of starting at C000h.

If you need more space than 8K, you could have the module
data in ROM, and use the bankswitch register to load a 32K page
of ROM into 8000-FFFF. This is done by writing the upper 9
bits of the entire 24 bit address into 6000h, bit 0, in
a serial fashion.

Most players I've seen will poll a byte of RAM until it is
set to one, then play a bit of music. The idea is that the
68000 will set that byte once it is OK to let the Z80
access the PSG, FM sound chips, and the bankswitched ROM
area which are shared with the 68000. This prevents any
race conditions where both CPU's are trying to access the
same memory or devices at once.

In retrospect, porting MOD2PSG to the Mega Drive sounds
more difficult than I thought. ;)


  View user's profile Send private message Visit poster's website
Martin
  • Guest
Reply with quote
Post Posted: Sun Aug 06, 2000 5:51 pm
Quote
> Port 6 is a bitmask for what channel is played on the left or right side.
> Bits 0 to 3 are the four channels played on left side, bits 4 to 7 are the left side equivalent.
> So writing 0x0F to that port would disable the right channel.

Wow, cool, 4 bits for the left side and 4 other bits for the left side too ;)

Thanks.
 
  • Joined: 24 Jun 1999
  • Posts: 1732
  • Location: Paris, France
Reply with quote
*Grin* You the point (NT)
Post Posted: Sun Aug 06, 2000 9:02 pm
Quote
> > Port 6 is a bitmask for what channel is played on the left or right side.
> > Bits 0 to 3 are the four channels played on left side, bits 4 to 7 are the left side equivalent.
> > So writing 0x0F to that port would disable the right channel.

> Wow, cool, 4 bits for the left side and 4 other bits for the left side too ;)

> Thanks.
  View user's profile Send private message Visit poster's website
Martin
  • Guest
Reply with quote
Post Posted: Mon Aug 07, 2000 12:00 pm
Quote
> In retrospect, porting MOD2PSG to the Mega Drive sounds
> more difficult than I thought. ;)

Thanks :)

At least I know 68k asm :)
Let's see if I could do that...
 
Reply to topic



Back to the top of this page

Back to SMS Power!