Giter VIP home page Giter VIP logo

jotego / jt12 Goto Github PK

View Code? Open in Web Editor NEW
117.0 117.0 20.0 116.48 MB

FM sound source written in Verilog, fully compatible with YM2612, YM3438 (JT12), YM2203 (JT03) and YM2610 (JT10)

License: GNU General Public License v3.0

C++ 21.24% Verilog 58.83% SystemVerilog 5.47% C 1.78% Assembly 3.79% Forth 0.48% Shell 2.68% MATLAB 0.29% HTML 2.82% VHDL 0.21% Scilab 0.74% Makefile 0.42% Python 0.13% Tcl 1.11%

jt12's People

Contributors

birdybro avatar greyrogue avatar gyurco avatar jeremyherbert avatar jotego avatar paulb-nl avatar sorgelig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jt12's Issues

Correct PCM scaling

According to Sauraen

$2C:3 - Ch6 DAC ninth (least significant) bit. Yup, I remember reading about this in this thread, someone theorized this bit's existence, and here it is! It goes into the ninth bit of the DAC output register block, in an exactly corresponding place as where the eight signals from $2A go into the first eight bits. Even better, since it doesn't look like BUSY affects the chip-global registers ($2X) at all, you should be able to write the eight MSBs into $2A and write the LSB into $2C:3 as soon as the Z80 will let you. As long as you get them both in before the YM2612 gets around to the Ch6 cycle again, you should be able to get full-precision 9-bit output without missing samples.

Fix CSM

Change CSM selection to 2'b10 and not 2'b01

Scooby Doo

Bad sound on intro of Scooby Doo Mistery, JT12 version 0.51

Channel issue with Neo Geo jingle

Me again ๐Ÿ™ˆ

So I've downloaded the latest Winamp and in_vgm plugin to see what's going on here and I've isolated all the channels. I've found that actually, with the Art of Fighting Neo Geo jingle, PSG isn't used at all.

The problem seems to be that FM channel 3 isn't playing anything. It should play the same notes as channel 2 just slightly pitched down to give that "chorus" effect I was talking about.

Does this mean FM channel 3 isn't working at all or just in Neo Geo? I'm certain this is the issue now.

I will upload some examples if I can when I'm at my laptop again.

About the ADPCM's active5 signal.

I have a question about the HDL code on this line.

wire active5 = (en_ch[1] && cur_ch[4]) || (en_ch[2] && cur_ch[5]) || (en_ch[2] && cur_ch[0]) || (en_ch[3] && cur_ch[1]) || (en_ch[4] && cur_ch[2]) || (en_ch[5] && cur_ch[3]);//{ cur_ch[3:0], cur_ch[5:4] } == en_ch;

This combinational logic looks asymmetric. Because..

(en_ch[1] && cur_ch[4])   โ† diff = 3
(en_ch[2] && cur_ch[5])  โ† diff = 3
(en_ch[2] && cur_ch[0])  โ† diff = 4
(en_ch[3] && cur_ch[1])  โ† diff = 4
(en_ch[4] && cur_ch[2])  โ† diff = 4
(en_ch[5] && cur_ch[3])  โ† diff = 4

Of course, I haven't fully understood the pipeline logic, but I believe this logic is incorrect.

Could you please inform me if there are any reasons why it is asymmetric?

Genesis ym2612: Add Ladder Effect

The ladder effect currently does not seem to exist within jt12 (unless I'm missing something and it's called something else). I was able to restore the functionality with what I thought was minimal impact to your design:

https://github.com/MiSTer-devel/Genesis_MiSTer/pull/210/files

This method restores the ladder effect to Genesis, but sorgelig does not want to deviate from your module but instead would prefer if the ladder effect were implemented in your core directly. I am working on it to learn about it, but I would have no problem if it were done by someone other than me because I may miss something or make a big mistake.

Additionally the audio balance controls between FM, PSG, PCM, etc... might need to be extended to the jt12 module, if they aren't already, I'm not sure if they are or aren't totally. sorry if I'm a bit of an amateur.

ADPCMB end address check should be not equal

According to MAME, the end address comparison should be != instead of <. I think that means if end is less than start, it wraps:
https://github.com/Rakashazi/emu-ex-plus-alpha/blob/master/NEO.emu/src/gngeo/ym2610/ym2610.c#L2710
-Required for World Heroes Perfect guitar sample on ADPCMB (Jukebox = 0xFC25).

I didn't realize there appear to be some changes made to MiSTer where it's out of sync with this master version related to start/stop samples:
See the commits from Nov 11,2019 and Aug 27,2019.
Like this issue, I think I sourced those changes from MAME, but I don't know if they're accurate to hardware.

Timbal sound in SOR 1, round 4

Streets of Rage 1, round 4 music (selectable from options menu)
Timbals sound different from real hardware (as recorded here)
Timbals, drums, etc. are made with non-linear sounds so they tend to sound different unless you make everything equal.
Phase generator and operator are identical to hardware. Maybe there is some little tweak that can be done to the envelope generator.

Timers

In version v0.1
Timer B takes 1/2 of the time it should. According to YM2608 documentation is correct but Ghouls'n Ghosts has accelerated music because of this.
If I add one more bit to timer B, GnG sounds correct.

How about Timer A?
Check with real hardware/emulators...

PSG Sustain seems too short

01 Neo-Geo Logo.zip

As the title suggests, this instantly sounded wrong to me, if you listen to the 5th note on real hardware (and indeed the attached VGM) it sounds slightly discordant with the previous note as it lingers. JT12 (JT49?) doesn't seem to let the note run long enough.

I don't know of another Neo Geo track with a similar PSG envelope but I bet there is one. I'm going to assume this affects other sounds on many other systems too.

Why does jt10_acc.v discard FM data for channels 0 and 4?

I used this core in 6-channel mode (by setting .num_ch(6)), but I noticed that the sound of some channels was slightly different from the real chip.

Upon further investigation, I came across the following comment:

// uses channels 0 and 4 for ADPCM data, throwing away FM data for those channels

At this line, there is a comment stating uses channels 0 and 4 for ADPCM data, throwing away FM data for those channels.

However, I wanted to utilize all 6 FM channels, so I commented out lines 82 to 103, and it seems to be working fine now.

Could you please explain why jt10_acc.v discards some FM data?"

Try Mega Turrican track #3

  • Mega Turrican track #3
  • Spiderman Separation Anxiety, stage 1
  • Buba 'n' Stix track 5
  • Alisia Dragon, stage 1
  • Battletech track 12
  • ComixZone track 5
  • After Burner II
  • Super Stripe
    -Water Diving practice mode in Barcelona Olympics --> SSG-EG

Thunder Force IV

ingame music stalls until the player's ship fires. Then music seems to be playing at the shooting pace.

PCM sounds louder than FM

In version v0.1
Check with real hardware. Emulators have PCM sound softer.
TL may not be as aggressive (?)

Sound issue in Neo geo core

Hi Jotego,
It has come to my notice that the JT12 is used in the Neo geo core for the MiSTer and me including other people have noticed some issues with the sound. I believe this has been reported before but not sure what was concluded. It is something with the PCM and the pitch that is not correct.

Kind regards

Keyon broken for CSM signal

jt12_kon cannot recognize the overflow signal if it only lasts for a clock cycle:

always @(posedge clk) if( clk_en ) begin
	keyon_II <= (csm&&cur_ch==2'd2&&overflow_A) || drop;
end

overflow_A should be latched somehow for a whole round of operators.

Add more amplification

v0.1 only supports up to x7 amplification. More may be needed, but wait until PCM/FM volume is balanced

DR of accumulator

Test that the recommendation of YM3438_APL.pdf makes sense with jt12_acc.v

In this manner, the tone data between the OPN2/OPN2C and OPN/OPNA are not 100% compatible. Accordingly, the standards when creating OPN2 or OPN2C tone data based on that of the OPN, OPNA, and YM2610 (OPNB) are listed below. This is the same even when using the OPN2/OPN2C to perform sound production.

โ‘  Confirm the connection (algorithm) data. If these data are zero (0) through three (3), then the waveform does not distort, even at TL=0.

โ‘ก When con. = 4, set the TL of the second individual carrier so that it will be negative six (-6) [dB] or more.

โ‘ข When con. = 5 or 6, set the TL of the third individual carrier so that it will be negative nine and one half (-9.5) [dB] or more.

โ‘ฃ When con. = 7, set all TLโ€™s to negative twelve (-12) or more.

Wrong initial values

Some games have wrong sound for a while or forever depending on initial value of registers.

Note that initial values of jt12_opram may not get implemented correctly when using initial. There is a warning from Xilinx ISE:

WARNING:PhysDesignRules:2410 - This design is using one or more 9K Block RAMs
(RAMB8BWER). 9K Block RAM initialization data, both user defined and
default, may be incorrect and should not be used. For more information,
please reference Xilinx Answer Record 39999.

I don't know if Quartus also has a similar problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.