badline 0.4.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c5aff63e93f3b5e40dfee64086b8e633e0a523d5c82403f0c64270701dc701b
4
- data.tar.gz: 5e1b663ccbc425e672bfd569360740f6d9dd7911a2747e8ca8e86d4575d5aba2
3
+ metadata.gz: 3a05f51e8da6e71ad0d80cc763b3daa5d806245164be400d4736ab63de9c0006
4
+ data.tar.gz: 58353de430b44bec2aff4f1b401186f1684b7a1898a1f3bb903d2e43b2abbe88
5
5
  SHA512:
6
- metadata.gz: a4cf2f04c4ad639baf9c03ef4d1140aaa6cda90b8f4d2468950f87018072aeb98610a2c268f871a9c211b9b893a10a0d65a7ee242fbfaf9979e0356b6e3df4b5
7
- data.tar.gz: 0a74de512d21d0cbb905b3c8b0851dfd76ab501333a878fa7a9abcc8f104b688b25b8ee9ee651e8ba990cde98202237eaa408c491d8e8fce1b4cd2b85e38bb3a
6
+ metadata.gz: d58d47e49a8618017a7cf36ed5c7627a4cd3b88f0a0862497ced34d67935be5d96276d5ab2b8cccb2f07a69c9a48acc4188eeac308839a94d68c20e6ac0435b8
7
+ data.tar.gz: caa5504d1cd1f9ebacd1661a85b1ea39e86756d91fc2a0b276a4a416113510b836f9f0f61643712a99874c7c0e0ced5b40b35f84696e77bd36dec159c875c7c9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.2](https://github.com/elektronaut/badline/compare/v0.4.1...v0.4.2) (2026-09-28)
4
+
5
+ ### Features
6
+
7
+ * print setup details, frame reports and badline-ruby's closing CPU state only with --verbose ([0e3f940](https://github.com/elektronaut/badline/commit/0e3f940996d38c9b597d68f81c64e775a09b98e8)), closes [#336](https://github.com/elektronaut/badline/issues/336)
8
+
9
+ ### Bug Fixes
10
+
11
+ * read HVSC song lengths in the native badline ([cef76f2](https://github.com/elektronaut/badline/commit/cef76f22f8fdd435776d07464e656732bb3aab94))
12
+
13
+ ## [0.4.1](https://github.com/elektronaut/badline/compare/v0.4.0...v0.4.1) (2026-09-28)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * build the Homebrew pack with Spinel d3182102 ([42b42d5](https://github.com/elektronaut/badline/commit/42b42d506270f16cfb033c7d538e75131f7c74c2))
19
+
3
20
  ## [0.4.0](https://github.com/elektronaut/badline/compare/v0.3.0...v0.4.0) (2026-09-28)
4
21
 
5
22
  ### Upgrading
data/README.md CHANGED
@@ -85,6 +85,10 @@ mutes and unmutes it. `--no-sound` turns it off. The window is paced by
85
85
  the display's vsync; `--no-vsync` paces it by a timer, or by the sound
86
86
  while it plays.
87
87
 
88
+ `--verbose` prints the display's refresh rate, the sound's sample rate
89
+ and the game controllers found as the window opens. In `badline` it also
90
+ prints the frame rate and the time each frame takes, once a second.
91
+
88
92
  In `badline-ruby` sound is off by default, and `--sound` turns it on.
89
93
  The machine runs below real time there, so the sound stutters: it plays
90
94
  in bursts with silent gaps between them, at the right pitch, and never
@@ -134,8 +138,8 @@ badline-ruby --headless --sid 8580 tune.sid
134
138
  badline-ruby --filter-chunk 1 tune.sid --audio-out out.wav # exact filter, slower
135
139
  ```
136
140
 
137
- Both modes take the same options. The window's own, `--no-autostart`
138
- and `--sound`, don't apply to them. `--song` (or `-s`) picks the
141
+ Both modes take the same options. The window's own, `--no-autostart`,
142
+ `--sound` and `--verbose`, don't apply to them. `--song` (or `-s`) picks the
139
143
  subtune, counting from 1 as HVSC does, and defaults to the tune's own
140
144
  start song. Playback asks the device for 44.1 kHz and takes whatever rate it
141
145
  offers, unless `--rate` says otherwise. Ctrl-C stops it.
data/exe/badline-ruby CHANGED
@@ -48,7 +48,8 @@ end
48
48
  begin
49
49
  application = Badline::GUI::Application.new(media_path: options.media_path, autostart: options.autostart?,
50
50
  song: options.song, sid_model: options.sid_model,
51
- sound: options.sound?, disk: { read_only: options.read_only? })
51
+ sound: options.sound?, verbose: options.verbose?,
52
+ disk: { read_only: options.read_only? })
52
53
  rescue Badline::Storage::SIDFile::FormatError, Badline::Storage::T64::FormatError,
53
54
  Badline::Storage::TAP::FormatError, Badline::Storage::CRTFile::FormatError,
54
55
  Badline::Cartridge::UnsupportedTypeError => e
@@ -111,8 +111,9 @@ module Badline
111
111
  def songlength(song) = songlengths&.at(song - 1)
112
112
 
113
113
  def songlengths
114
- return @songlengths if defined?(@songlengths)
114
+ return @songlengths if @songlengths_read
115
115
 
116
+ @songlengths_read = true
116
117
  path = @options.songlengths || Storage::SongLengths.locate(@options.tune_path)
117
118
  @songlengths = path && Storage::SongLengths.new(path).lengths(tune.md5)
118
119
  end
@@ -29,7 +29,8 @@ module Badline
29
29
  MOUSE_BUTTONS = { 1 => :left, 3 => :right }.freeze
30
30
 
31
31
  # The media options (autostart:, song:, disk:) go to Media.attach.
32
- def initialize(media_path: nil, sid_model: nil, sound: false, **media)
32
+ def initialize(media_path: nil, sid_model: nil, sound: false, verbose: false, **media)
33
+ @verbose = verbose
33
34
  @computer = Computer.new(sid_model: sid_model || Media.sid_model(media_path))
34
35
  puts Media.attach(@computer, media_path, **media) if media_path
35
36
 
@@ -44,7 +45,7 @@ module Badline
44
45
  vsync: @paced && !@stream
45
46
  )
46
47
  @gamepads = Gamepads.new(@computer)
47
- @gamepads.names.each { |name| puts "Gamepad: #{name}" }
48
+ @gamepads.names.each { |name| report "Gamepad: #{name}" }
48
49
  fit_frame
49
50
  end
50
51
 
@@ -62,7 +63,7 @@ module Badline
62
63
  @stream&.close
63
64
  @gamepads.close
64
65
  @window.close
65
- puts @computer.cpu.inspect
66
+ report @computer.cpu.inspect
66
67
  end
67
68
 
68
69
  private
@@ -155,7 +156,7 @@ module Badline
155
156
 
156
157
  def open_stream
157
158
  sink = Audio::SDLSink.new(rate: Audio::Renderer::DEFAULT_RATE)
158
- puts "Sound at #{sink.rate} Hz, F10 mutes"
159
+ report "Sound at #{sink.rate} Hz, F10 mutes"
159
160
  Audio::Stream.new(sink, @computer.sid,
160
161
  on_underrun: -> { puts "Running below real time, so the sound will stutter." })
161
162
  rescue Audio::SDLSink::Error => e
@@ -167,7 +168,11 @@ module Badline
167
168
  clock_hz = @computer.region.clock_hz
168
169
  @cycles_per_frame = clock_hz / rate
169
170
  @frame_seconds = @cycles_per_frame.fdiv(clock_hz)
170
- puts "Display #{rate} Hz -> #{@cycles_per_frame} cycles/frame"
171
+ report "Display #{rate} Hz -> #{@cycles_per_frame} cycles/frame"
172
+ end
173
+
174
+ def report(line)
175
+ puts line if @verbose
171
176
  end
172
177
 
173
178
  def attach_pot_device
@@ -53,6 +53,7 @@ module Badline
53
53
  @autostart = true
54
54
  @read_only = false
55
55
  @sound = false
56
+ @verbose = false
56
57
  @headless = false
57
58
  @jit = true
58
59
  @quiet = false
@@ -96,6 +97,8 @@ module Badline
96
97
 
97
98
  def sound? = @sound
98
99
 
100
+ def verbose? = @verbose
101
+
99
102
  def quiet? = @quiet
100
103
 
101
104
  def tui? = @tui
@@ -165,6 +168,9 @@ module Badline
165
168
  opts.on("--sound", "Play the SID through the host's audio device (F10 mutes)") do
166
169
  window_only("--sound") { @sound = true }
167
170
  end
171
+ opts.on("--verbose", "Print the display, sound and gamepad setup and the frame timing") do
172
+ window_only("--verbose") { @verbose = true }
173
+ end
168
174
  end
169
175
 
170
176
  def define_headless_options(opts)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Badline
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: badline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inge Jørgensen