Skip to content

Commit a98492b

Browse files
committed
Added YM2203 support
1 parent 00373a1 commit a98492b

File tree

5 files changed

+446
-469
lines changed

5 files changed

+446
-469
lines changed

README.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,24 @@
11
# jt12
2-
FM sound source written in Verilog, fully compatible with YM2612
2+
3+
FM sound source written in Verilog, fully compatible with YM2612 and YM2203.
4+
5+
The implementation tries to be as close to original hardware as possible. Low usage of FPGA resources has also been a design goal. Except in the operator section (jt12_op) where an exact replica of the original circuit is done. This could be done in less space with a different style but because this piece of the circuit was reversed engineered by Sauraen, I decided to use that knowledge.
6+
7+
Directories:
8+
9+
hdl -> all relevant RTL files, written in verilog
10+
ver -> test benches
11+
ver/verilator -> test bench that can play vgm files
12+
13+
Usage:
14+
15+
YM2612: top level file "jt12.v". Use jt12.qip to automatically get all relevant files in Quartus.
16+
YM2612 should have parameters set like:
17+
use_lfo = 1
18+
use_psg = 0
19+
20+
YM2203: top level file "jt12.v". Use jt03.qip to automatically get all relevant files in Quartus.
21+
YM2203 should have parameters set like:
22+
use_lfo = 0
23+
use_psg = 1
24+

hdl/jt03.qip

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) jt12.vhd ]
2+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12.v ]
3+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_acc.v ]
4+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_eg.v ]
5+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_eg_cnt.v ]
6+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_eg_comb.v ]
7+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_eg_step.v ]
8+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_eg_pure.v ]
9+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_eg_final.v ]
10+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_eg_ctrl.v ]
11+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_exprom.v ]
12+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_kon.v ]
13+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_lfo.v ]
14+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_limitamp.v ]
15+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_mmr.v ]
16+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_mod.v ]
17+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_op.v ]
18+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_opram.v ]
19+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_pg.v ]
20+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_pg_inc.v ]
21+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_pg_dt.v ]
22+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_pg_sum.v ]
23+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_pg_comb.v ]
24+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_pm.v ]
25+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_phrom.v ]
26+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_reg.v ]
27+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_sh.v ]
28+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_sh_rst.v ]
29+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_sh24.v ]
30+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_sumch.v ]
31+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) jt12_timers.v ]
32+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) ../jt49/hdl/jt49.h ]
33+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) ../jt49/hdl/jt49_div.h ]
34+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) ../jt49/hdl/jt49_eg.h ]
35+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) ../jt49/hdl/jt49_exp.h ]
36+
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) ../jt49/hdl/jt49_noise.h ]

hdl/jt03.v

-85
This file was deleted.

hdl/jt12.v

+4-2
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ jt12_sh #(.width(10),.stages(4)) u_egpad(
315315
.drop ( eg_IX )
316316
);
317317

318-
wire [8:0] op_result;
318+
wire [ 8:0] op_result;
319+
wire [13:0] full_result;
319320

320321
jt12_op u_op(
321322
.rst ( rst ),
@@ -336,7 +337,8 @@ jt12_op u_op(
336337
.use_prev2 ( use_prev2 ),
337338
.use_prev1 ( use_prev1 ),
338339
.zero ( zero ),
339-
.op_result ( op_result )
340+
.op_result ( op_result ),
341+
.full_result ( full_result )
340342
);
341343

342344
wire signed [11:0] fm_snd_left, fm_snd_right;

0 commit comments

Comments
 (0)