Skip to content

Commit 381fdbb

Browse files
committed
Fixed example CSVs first resets
1 parent 30fa953 commit 381fdbb

24 files changed

+42
-24
lines changed

018-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
10,0
23
24,0
34
31,0

018-v2.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
35,0
23
65,0
34
101,0

022-v11.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
8,0
23
12,0
34
17,0

022-v22.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
70,1
23
129,1
34
188,1

024-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
122,0
23
180,0
34
220,0

029-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
56,0
23
92,0
34
123,0

030-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
34,0
23
63,0
34
99,0

050-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
101,0
23
141,0
34
179,0

068-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
37,0
23
70,0
34
120,0

068-v2.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
294,0
23
627,0
34
741,0

093-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
8,0
23
16,0
34
35,0

200-v4.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
110,1
23
283,1
34
456,1

201-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
123,0
23
246,0
34
369,0

202-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
40,0
23
47,0
34
55,0

224-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
511,0
23
547,0
34
625,0

224-v2.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
83,0
23
512,0
34
1024,0

236-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
13,0
23
40,0
34
79,0

236-v2.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
10,0
23
1536,1
34
1637,1

241-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
125,0
23
138,0
34
151,0

245-v1.csv

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
0,0
12
101,0
23
125,0
34
155,0

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
# NeoADPCMEx
22
GUI tool for extracting ADPCM samples from V ROMs
33

4+
For Python 3 only. Requires a few libs such as PyQt5 and pyaudio. Run main.py and you'll quickly know if there are any missing :)
5+
6+
FF or 00 padding look like sawtooth waveforms when decoded, that's invalid data.
7+
48
# Usage
59

6-
* `Open` opens an uncrypted V ROM or .PCM file.
10+
* `Open` opens an uncrypted V ROM or .PCM file. If an associated CSV file is found, it is also loaded.
711
* `Play` reads the sample in which the detail cursor falls, with a 5s duration limit.
8-
* `Save` saves a .csv with the reset data for future loading.
12+
* `Save` saves a CSV with the reset data for future loading.
913
* `Export` exports the entire .raw s16 mono audio file and individual .wav files for each sample.
1014

1115
## Overall view
1216
The top view shows the entire waveform. Bright red is the hover cursor. Bright green is the detail cursor, set with a left click.
1317
Brown are ADPCM-A resets, dark green are ADPCM-B resets.
1418

1519
## Detail view
16-
* Left click toggles an ADPCM-A reset
20+
The bottom view shows a magnified view of where the top cursor is placed.
21+
22+
* Left click toggles an ADPCM-A reset
1723
* Right click toggles an ADPCM-B reset
18-
* Mouse scroll moves cursor
19-
* Left and right keys move cursor faster
24+
* Mouse scroll moves cursor
25+
* Left and right keys move cursor faster

main.py

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,8 @@
11
# GUI tool for extracting ADPCM samples from V ROMs by manually setting boundaries
22
# Furrtek 2025
33

4-
# On overiew:
5-
# Left click sets cursor for the detail view and sample playback
6-
# On detail view:
7-
# Left click toggles an ADPCM-A reset
8-
# Right click toggles an ADPCM-B reset
9-
# Mouse scroll moves cursor
10-
# Left and right keys moves cursor faster
11-
# Playback reads the sample in which the cursor falls, with a 5s duration limit
12-
# Save saves a .csv with the boundary data for future reloading
13-
# Export saves a .raw s16 mono audio file and individual .wav files for each sample
14-
15-
# BUG: Because the reset at block 0 is implicit (never saved in csv), its type is always set to ADPCM-A on load
164
# TODO: Auto helper that detects sudden amplitude changes
5+
# TODO: Way to mark range as invalid/padding data
176

187
# See https://github.com/mamedev/mame/blob/master/3rdparty/ymfm/src/ymfm_adpcm.cpp
198
# UI waveform navigation and display, reset placement, loading/saving works fine
@@ -29,11 +18,11 @@
2918
import wave
3019
import time
3120
import struct
21+
import pyaudio
3222
from vfile import Vfile
3323
from wavecanvas import waveCanvas
34-
import pyaudio
3524

36-
from PyQt5 import QtCore, QtGui, QtWidgets #, uic
25+
from PyQt5 import QtCore, QtGui, QtWidgets
3726
from PyQt5.QtCore import QSize, Qt, pyqtSignal
3827
from PyQt5.QtWidgets import QWidget, QApplication, QMainWindow, QPushButton, QVBoxLayout, QFileDialog
3928

vfile.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# V ROM object with raw and decoded PCM buffers
22
# Decoding code from MAME
3+
# Furrtek 2025
34

45
class Vfile():
56
def __init__(self, filepath):

wavecanvas.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
# waveCanvas widget
2+
# Furrtek 2025
3+
4+
import time
5+
16
from PyQt5 import QtCore, QtGui, QtWidgets
27
from PyQt5.QtCore import QSize, Qt, pyqtSignal
38
from PyQt5.QtWidgets import QWidget
49

5-
import time
6-
710
class waveCanvas(QWidget):
811
clicked = pyqtSignal(int, bool)
912
scrolled = pyqtSignal(int)
1013

11-
#def __init__(self, parent = None):
1214
def __init__(self, sampleCount, showCursor, enableScrolling):
1315
QWidget.__init__(self)
1416
self.setMouseTracking(True)
@@ -146,7 +148,7 @@ def paintEvent(self, e):
146148
# Block stripes, if enabled
147149
if self.blockView:
148150
blockColorAlt = 0 if self.sampleStart & 512 else 1 # Start color
149-
blockCount = (self.sampleCount // 2) >> 8
151+
blockCount = self.sampleCount >> 9
150152
blockOffset = int((512 - (self.sampleStart & 511)) / self.XDelta)
151153
blockWidth = width / blockCount
152154

@@ -179,7 +181,7 @@ def paintEvent(self, e):
179181
pen_a = QtGui.QPen(QtGui.QColor('darkRed'))
180182
pen_b = QtGui.QPen(QtGui.QColor('darkGreen'))
181183
for reset in self.vfile.resets:
182-
v = ((reset[0] * 2) << 8) - self.sampleStart
184+
v = (reset[0] << 9) - self.sampleStart
183185
if v >= 0 and v < self.sampleStart + self.sampleCount:
184186
x_pos = int(v / self.XDelta)
185187
painter.setPen(pen_b if reset[1] else pen_a)

0 commit comments

Comments
 (0)