badline 0.8.0 → 0.9.0

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.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/README.md +22 -16
  4. data/doc/library.md +10 -3
  5. data/doc/media.md +11 -2
  6. data/doc/pinned-behaviour.md +53 -9
  7. data/doc/sid-player.md +8 -4
  8. data/doc/snapshots.md +66 -33
  9. data/lib/badline/address_bus/roms.rb +32 -0
  10. data/lib/badline/address_bus.rb +4 -4
  11. data/lib/badline/audio/bare_player.rb +24 -0
  12. data/lib/badline/audio/checkpoints.rb +42 -0
  13. data/lib/badline/audio/jukebox.rb +11 -4
  14. data/lib/badline/audio/machine_player.rb +16 -0
  15. data/lib/badline/audio/renderer.rb +80 -9
  16. data/lib/badline/audio/stereo.rb +3 -5
  17. data/lib/badline/audio.rb +1 -0
  18. data/lib/badline/computer/attachments.rb +5 -5
  19. data/lib/badline/computer.rb +12 -10
  20. data/lib/badline/core.rb +48 -0
  21. data/lib/badline/data_path.rb +37 -0
  22. data/lib/badline/datasette.rb +24 -9
  23. data/lib/badline/drive1541/disk.rb +3 -3
  24. data/lib/badline/drive1541/disk_state.rb +14 -5
  25. data/lib/badline/frontend/app.rb +4 -3
  26. data/lib/badline/frontend/boot.rb +9 -4
  27. data/lib/badline/frontend/confirmation.rb +17 -11
  28. data/lib/badline/frontend/menu_dialogs.rb +52 -14
  29. data/lib/badline/frontend/menu_media.rb +36 -7
  30. data/lib/badline/frontend/menu_pages.rb +24 -2
  31. data/lib/badline/frontend/name_field.rb +88 -0
  32. data/lib/badline/frontend/pause_menu.rb +25 -7
  33. data/lib/badline/frontend/player_window.rb +3 -3
  34. data/lib/badline/frontend/snapshots.rb +145 -17
  35. data/lib/badline/frontend/sound.rb +11 -5
  36. data/lib/badline/frontend.rb +1 -0
  37. data/lib/badline/kernal_trap/load.rb +10 -0
  38. data/lib/badline/kernal_trap/routine.rb +28 -0
  39. data/lib/badline/kernal_trap/serial.rb +19 -7
  40. data/lib/badline/media/disk_list.rb +75 -0
  41. data/lib/badline/media/disk_set.rb +13 -3
  42. data/lib/badline/media.rb +8 -3
  43. data/lib/badline/model.rb +62 -0
  44. data/lib/badline/options/event.rb +5 -3
  45. data/lib/badline/options/help.rb +16 -12
  46. data/lib/badline/options/table.rb +5 -1
  47. data/lib/badline/options/validation.rb +9 -0
  48. data/lib/badline/options.rb +7 -4
  49. data/lib/badline/region.rb +16 -4
  50. data/lib/badline/reu/ram.rb +27 -0
  51. data/lib/badline/reu/saved_state.rb +27 -0
  52. data/lib/badline/roms/README +10 -0
  53. data/lib/badline/roms/kernal-sx64.rom +0 -0
  54. data/lib/badline/sid/decimator.rb +13 -0
  55. data/lib/badline/sid/filter.rb +6 -3
  56. data/lib/badline/sid.rb +19 -0
  57. data/lib/badline/snapshot/fields.rb +1 -0
  58. data/lib/badline/snapshot/setup.rb +20 -8
  59. data/lib/badline/snapshot/state.rb +14 -7
  60. data/lib/badline/snapshot/vice/main_cpu.rb +1 -1
  61. data/lib/badline/snapshot/vice/peripherals.rb +12 -2
  62. data/lib/badline/snapshot/vice/restore.rb +3 -1
  63. data/lib/badline/snapshot/vice/reu1764.rb +55 -0
  64. data/lib/badline/snapshot/vice/vicii.rb +59 -13
  65. data/lib/badline/snapshot/vice/vicii_import.rb +14 -3
  66. data/lib/badline/snapshot/vice.rb +25 -23
  67. data/lib/badline/storage/t64.rb +7 -4
  68. data/lib/badline/storage/tap.rb +7 -5
  69. data/lib/badline/storage/unavailable.rb +1 -1
  70. data/lib/badline/storage.rb +5 -5
  71. data/lib/badline/version.rb +1 -1
  72. data/lib/badline/vic/sprite/timing.rb +5 -9
  73. data/lib/badline/vic/sprite.rb +4 -3
  74. data/lib/badline.rb +2 -38
  75. metadata +10 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Badline
4
4
  module Storage
5
- # Stands in for a directory or archive a detached restore leaves out
5
+ # Stands in for a directory a detached restore leaves out
6
6
  # (Snapshot::StateReader): it finds no files and refuses every write
7
7
  # as a write-protected disk does.
8
8
  class Unavailable
@@ -45,16 +45,16 @@ module Badline
45
45
  T64_ARCHIVE = 4
46
46
 
47
47
  class << self
48
- # Opens the storage a save_setup wrote: the same directory or archive
49
- # by its path, or a disk image with the bytes it held, writes and
50
- # all. A detached reader gets the image write-protected, and
51
- # Unavailable for a directory or archive.
48
+ # Opens the storage a save_setup wrote: the same directory by its
49
+ # path, an archive with the bytes it held, or a disk image with the
50
+ # bytes it held, writes and all. A detached reader gets the image
51
+ # write-protected, and Unavailable for a directory.
52
52
  def reopen(input)
53
53
  kind = input.int
54
54
  path = input.string
55
55
  case kind
56
56
  when HOST_DIRECTORY then input.detached? ? Unavailable.new : HostDirectory.new(path)
57
- when T64_ARCHIVE then input.detached? ? Unavailable.new : T64.new(path)
57
+ when T64_ARCHIVE then T64.new(path, bytes: input.blob)
58
58
  else reopen_image(kind, path, input)
59
59
  end
60
60
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Badline
4
- VERSION = "0.8.0"
4
+ VERSION = "0.9.0"
5
5
  end
@@ -11,10 +11,9 @@ module Badline
11
11
  # fetches or the compare run a cycle later than on the 6569, what
12
12
  # hangs off them moves 8 pixels with them.
13
13
  class Timing
14
- # The X counter's value where it holds on a raster of more than 512
15
- # pixels, and the four values it repeats from there.
14
+ # The X counter's value where it steps back on a raster of more than
15
+ # 512 pixels, to run over the eight values below it again.
16
16
  HOLD_AT = 0x188
17
- HOLD_BASE = 0x184
18
17
 
19
18
  attr_reader :columns, :sprite_cycle, :display_off_x, :x_pixels
20
19
 
@@ -36,14 +35,11 @@ module Badline
36
35
  def reload_x(index) = RELOAD_X + (8 * @shift) + (RELOAD_STEP * index)
37
36
 
38
37
  # The X counter at a raster pixel: X_OFFSET behind it, wrapping at
39
- # the end of the line, less the pixels it held for past HOLD_AT,
40
- # where it ran over $184-$187 again instead.
38
+ # the end of the line, less the pixels it held for from HOLD_AT on,
39
+ # where it ran over $180-$187 a second time.
41
40
  def self.xpos(pixel, width, hold)
42
41
  count = (pixel - X_OFFSET) % width
43
- return count if count < HOLD_AT
44
- return count - hold if count >= HOLD_AT + hold
45
-
46
- HOLD_BASE + ((count - HOLD_AT) % 4)
42
+ count < HOLD_AT ? count : count - hold
47
43
  end
48
44
 
49
45
  # The raster pixels at which the X counter reads each coordinate, 512
@@ -37,8 +37,9 @@ module Badline
37
37
  # The s-accesses reload the shift register partway through the line,
38
38
  # at raster pixel 459 for sprite 0 and 16 later for each sprite after
39
39
  # it. A sprite still shifting there loses the rest of its row, and the
40
- # comparator is ignored for the twelve pixels from it (the spritescan
41
- # dump). Its output holds the last pixel for seven, through K+6
40
+ # comparator is ignored for the twelve pixels from it, running on into
41
+ # the next line from a reload near the end of this one (the spritescan
42
+ # dumps). Its output holds the last pixel for seven, through K+6
42
43
  # (spritefetchbug).
43
44
  RELOAD_X = 459
44
45
  RELOAD_STEP = 16
@@ -275,7 +276,7 @@ module Badline
275
276
  end
276
277
 
277
278
  def sequence_hit(log, start, reload_bits)
278
- return if (@stop_x && start >= @stop_x) || start < @show_from
279
+ return if (@stop_x && start >= @stop_x) || start < @show_from || start < @reload_x + RELOAD_DEAD - @width
279
280
 
280
281
  if start < @reload_x
281
282
  sequence_early(log, start)
data/lib/badline.rb CHANGED
@@ -1,43 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "badline/version"
3
+ require "badline/core"
4
4
  require "badline/options"
5
- require "badline/integer_helper"
6
- require "badline/region"
7
- require "badline/addressable"
8
- require "badline/memory"
9
- require "badline/color_memory"
10
- require "badline/rom"
11
- require "badline/ram_expansion"
12
- require "badline/address_bus"
13
- require "badline/instruction"
14
- require "badline/instruction_set"
15
- require "badline/status"
16
- require "badline/keyboard"
17
- require "badline/joystick"
18
- require "badline/control_ports"
19
- require "badline/input"
20
- require "badline/cycleable"
21
- require "badline/datasette"
22
- require "badline/time_of_day"
23
- require "badline/cia"
24
- require "badline/via"
25
- require "badline/sid"
26
- require "badline/debug_register"
27
- require "badline/reu"
28
- require "badline/interrupts"
29
- require "badline/traps"
30
- require "badline/cpu"
31
- require "badline/vic"
32
- require "badline/keyboard_buffer"
33
- require "badline/iec_bus"
34
- require "badline/drive1541"
35
- require "badline/computer"
36
- require "badline/checkpoint"
37
- require "badline/storage"
38
- require "badline/cartridge"
39
- require "badline/kernal_trap"
40
- require "badline/chrout_trap"
41
- require "badline/media"
5
+ require "badline/data_path"
42
6
  require "badline/snapshot"
43
7
  require "badline/audio"
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.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Inge Jørgensen
@@ -50,6 +50,7 @@ files:
50
50
  - lib/badline.rb
51
51
  - lib/badline/address_bus.rb
52
52
  - lib/badline/address_bus/extra_sids.rb
53
+ - lib/badline/address_bus/roms.rb
53
54
  - lib/badline/address_bus/saved_state.rb
54
55
  - lib/badline/address_bus/sid_slots.rb
55
56
  - lib/badline/address_bus/ultimax_pages.rb
@@ -57,6 +58,7 @@ files:
57
58
  - lib/badline/audio.rb
58
59
  - lib/badline/audio/aiff.rb
59
60
  - lib/badline/audio/bare_player.rb
61
+ - lib/badline/audio/checkpoints.rb
60
62
  - lib/badline/audio/cli.rb
61
63
  - lib/badline/audio/console.rb
62
64
  - lib/badline/audio/jukebox.rb
@@ -108,6 +110,7 @@ files:
108
110
  - lib/badline/computer/attachments.rb
109
111
  - lib/badline/computer/saved_state.rb
110
112
  - lib/badline/control_ports.rb
113
+ - lib/badline/core.rb
111
114
  - lib/badline/cpu.rb
112
115
  - lib/badline/cpu/addressing.rb
113
116
  - lib/badline/cpu/boundary.rb
@@ -117,6 +120,7 @@ files:
117
120
  - lib/badline/cpu/saved_state.rb
118
121
  - lib/badline/cpu/stack_operations.rb
119
122
  - lib/badline/cycleable.rb
123
+ - lib/badline/data_path.rb
120
124
  - lib/badline/datasette.rb
121
125
  - lib/badline/debug_register.rb
122
126
  - lib/badline/drive1541.rb
@@ -154,6 +158,7 @@ files:
154
158
  - lib/badline/frontend/menu_dialogs.rb
155
159
  - lib/badline/frontend/menu_media.rb
156
160
  - lib/badline/frontend/menu_pages.rb
161
+ - lib/badline/frontend/name_field.rb
157
162
  - lib/badline/frontend/pacer.rb
158
163
  - lib/badline/frontend/pad_port.rb
159
164
  - lib/badline/frontend/painter.rb
@@ -208,10 +213,12 @@ files:
208
213
  - lib/badline/keyboard.rb
209
214
  - lib/badline/keyboard_buffer.rb
210
215
  - lib/badline/media.rb
216
+ - lib/badline/media/disk_list.rb
211
217
  - lib/badline/media/disk_set.rb
212
218
  - lib/badline/media/queue.rb
213
219
  - lib/badline/media/true_drive.rb
214
220
  - lib/badline/memory.rb
221
+ - lib/badline/model.rb
215
222
  - lib/badline/options.rb
216
223
  - lib/badline/options/event.rb
217
224
  - lib/badline/options/help.rb
@@ -238,6 +245,7 @@ files:
238
245
  - lib/badline/roms/eapi/LICENSE.md
239
246
  - lib/badline/roms/eapi/README
240
247
  - lib/badline/roms/eapi/eapi-am29f040-14
248
+ - lib/badline/roms/kernal-sx64.rom
241
249
  - lib/badline/roms/kernal.rom
242
250
  - lib/badline/sdl.rb
243
251
  - lib/badline/sid.rb
@@ -266,6 +274,7 @@ files:
266
274
  - lib/badline/snapshot/vice/main_cpu.rb
267
275
  - lib/badline/snapshot/vice/peripherals.rb
268
276
  - lib/badline/snapshot/vice/restore.rb
277
+ - lib/badline/snapshot/vice/reu1764.rb
269
278
  - lib/badline/snapshot/vice/sid_extended.rb
270
279
  - lib/badline/snapshot/vice/sid_registers.rb
271
280
  - lib/badline/snapshot/vice/vicii.rb