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 - [Coding competition 2024] SN76489 TestRom by JoppyFurr

Reply to topic

Rate this entry!

1 (Terrible) 0% 0%
2 0% 0%
3 0% 0%
4 0% 0%
5 23% 23%
6 0% 0%
7 47% 47%
8 23% 23%
9 0% 0%
10 (Excellent) 5% 5%
This poll has expired.
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
[Coding competition 2024] SN76489 TestRom by JoppyFurr
Post Posted: Tue Mar 26, 2024 1:03 pm
Last edited by Maxim on Tue Apr 02, 2024 9:06 am; edited 1 time in total
https://www.smspower.org/Homebrew/SN76489TestRom-SMS
https://www.smspower.org/Homebrew/SN76489TestRom-GG
https://www.smspower.org/Homebrew/SN76489TestRom-SG



Quote
Seeing as my first entry is for testing a somewhat uncommon piece of hardware, I figured I'd make a second entry, for the SN76489/compatible sound chip available in all Master Systems.

This tool is intended to help testing real hardware against emulators to help spot differences in behaviour.

Seeing as the SN76489 doesn't have a key-on register, the volume of each channel is held at 15 (silent) until a button/key is pressed. The 'const' mode allows the volume to be passed to the chip without a key/button being pressed.

Both PAL and NTSC versions of the roms are generated, the only difference being the frequency values associated with the keyboard notes, as the clock frequency is slightly different.
A Game Gear version is also included which adds toggles for the stereo bits.

Because the SG-1000 / SC-3000 use different versions of the chip compared to the Master System, I have made builds of this ROM for them, using Mode-0 to draw to the graphics.

With flash carts being less common for the SG-1000 / SC-3000, the Mode-0 build is also available as a .wav file that can be played into the SC-3000's cassette port using a BASIC IIIa or BASIC IIIb cartridge. The following steps are needed to run this over the cassette interface:
1. Run the command `LOAD` at the BASIC prompt
2. Play the .wav file into the cassette port. You may need to adjust the volume if the filename isn't detected after the first ~5 seconds.
3. Run the command `CALL &H9800` at the BASIC prompt

To get the compiled code running over the cassette port, a few changes were made to crt0_sg and SGlib, to change the memory layout and remove the reliance on interrupts.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Mar 2022
  • Posts: 671
  • Location: London, UK
Reply with quote
Post Posted: Sat Mar 30, 2024 4:36 pm
Useful!

Just one thing that is very minor - it appeared that the controls didn't work when I tested using Emulicious, but it turned out I had both controller A and B set to use the same keyboard mappings, meaning that when I pressed the down key it would presumably register both controller A and B's down keys as being depressed; and I suppose your control handling code maybe does strict equality comparisons rather than bitmasked.
  View user's profile Send private message Visit poster's website
  • Joined: 11 Mar 2018
  • Posts: 66
  • Location: New Zealand
Reply with quote
Post Posted: Mon Apr 08, 2024 12:35 pm
Update:

I have now pushed the code to GitHub:
https://github.com/JoppyFurr/SN76489-TestRom

I've also attached an updated build (24.04) for the SG-1000/SC-3000 version.

The update affects only the cassette version. The modified SGlib that polled the status register to detect interrupts is now removed. Instead, it now uses the recently upstreamed crt0_BASIC, which uses interrupt-mode 2.

  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3828
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Apr 18, 2024 12:07 pm
Very useful tool and I love the art style!
Also, great work supporting three systems!
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!