badline 0.7.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +48 -0
- data/CLAUDE.md +3 -1
- data/README.md +104 -292
- data/doc/library.md +69 -0
- data/doc/media.md +78 -0
- data/doc/pinned-behaviour.md +53 -9
- data/doc/sid-player.md +136 -0
- data/doc/snapshots.md +102 -0
- data/lib/badline/address_bus/roms.rb +32 -0
- data/lib/badline/address_bus.rb +4 -4
- data/lib/badline/audio/bare_player.rb +24 -0
- data/lib/badline/audio/checkpoints.rb +42 -0
- data/lib/badline/audio/jukebox.rb +11 -4
- data/lib/badline/audio/machine_player.rb +16 -0
- data/lib/badline/audio/renderer.rb +80 -9
- data/lib/badline/audio/stereo.rb +3 -5
- data/lib/badline/audio.rb +1 -0
- data/lib/badline/cartridge/freezer.rb +2 -0
- data/lib/badline/cartridge.rb +3 -0
- data/lib/badline/computer/attachments.rb +5 -5
- data/lib/badline/computer.rb +12 -10
- data/lib/badline/core.rb +48 -0
- data/lib/badline/data_path.rb +37 -0
- data/lib/badline/datasette.rb +24 -9
- data/lib/badline/drive1541/disk.rb +3 -3
- data/lib/badline/drive1541/disk_state.rb +14 -5
- data/lib/badline/frontend/app.rb +41 -37
- data/lib/badline/frontend/boot.rb +16 -4
- data/lib/badline/frontend/buttons.rb +101 -7
- data/lib/badline/frontend/confirmation.rb +56 -0
- data/lib/badline/frontend/controls.rb +44 -32
- data/lib/badline/frontend/file_browser.rb +225 -0
- data/lib/badline/frontend/frame_report.rb +52 -0
- data/lib/badline/frontend/menu_dialogs.rb +160 -0
- data/lib/badline/frontend/menu_media.rb +157 -0
- data/lib/badline/frontend/menu_pages.rb +220 -0
- data/lib/badline/frontend/name_field.rb +88 -0
- data/lib/badline/frontend/painter.rb +10 -0
- data/lib/badline/frontend/pause_menu.rb +264 -0
- data/lib/badline/frontend/player_window.rb +3 -3
- data/lib/badline/frontend/snapshots.rb +146 -18
- data/lib/badline/frontend/sound.rb +11 -6
- data/lib/badline/frontend/timeline.rb +5 -1
- data/lib/badline/frontend.rb +8 -0
- data/lib/badline/kernal_trap/load.rb +10 -0
- data/lib/badline/kernal_trap/routine.rb +28 -0
- data/lib/badline/kernal_trap/serial.rb +19 -7
- data/lib/badline/media/disk_list.rb +75 -0
- data/lib/badline/media/disk_set.rb +118 -0
- data/lib/badline/media.rb +9 -3
- data/lib/badline/model.rb +62 -0
- data/lib/badline/options/event.rb +5 -3
- data/lib/badline/options/help.rb +16 -12
- data/lib/badline/options/table.rb +6 -2
- data/lib/badline/options/validation.rb +9 -0
- data/lib/badline/options.rb +10 -7
- data/lib/badline/region.rb +16 -4
- data/lib/badline/reu/ram.rb +27 -0
- data/lib/badline/reu/saved_state.rb +27 -0
- data/lib/badline/roms/README +10 -0
- data/lib/badline/roms/kernal-sx64.rom +0 -0
- data/lib/badline/sid/decimator.rb +13 -0
- data/lib/badline/sid/filter.rb +6 -3
- data/lib/badline/sid.rb +19 -0
- data/lib/badline/snapshot/fields.rb +1 -0
- data/lib/badline/snapshot/setup.rb +20 -8
- data/lib/badline/snapshot/state.rb +14 -7
- data/lib/badline/snapshot/vice/main_cpu.rb +1 -1
- data/lib/badline/snapshot/vice/peripherals.rb +12 -2
- data/lib/badline/snapshot/vice/restore.rb +3 -1
- data/lib/badline/snapshot/vice/reu1764.rb +55 -0
- data/lib/badline/snapshot/vice/vicii.rb +59 -13
- data/lib/badline/snapshot/vice/vicii_import.rb +14 -3
- data/lib/badline/snapshot/vice.rb +25 -23
- data/lib/badline/storage/t64.rb +7 -4
- data/lib/badline/storage/tap.rb +7 -5
- data/lib/badline/storage/unavailable.rb +1 -1
- data/lib/badline/storage.rb +5 -5
- data/lib/badline/version.rb +1 -1
- data/lib/badline/vic/sprite/timing.rb +5 -9
- data/lib/badline/vic/sprite.rb +4 -3
- data/lib/badline.rb +2 -38
- metadata +22 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2916044b89e174698de9dd60a2a72121dc6aa91058a9de914dfbaa5e70170f29
|
|
4
|
+
data.tar.gz: 56adae369f806a6adb31dea00b5164d6e02e4b88d6a6cc08209808abdae0392b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cac3c6ba20fff4bbabd7e77dd8eae4e53cb12a3785f946908407627eb29783764684c0e2cf208b6a8030ad31bcfb35811526873119d51cb5badd0f2598257b41
|
|
7
|
+
data.tar.gz: 93cecca78dbb7f4ca6393a629d113fa80a68a573359193ae4bcc54b87aadea883fdba0f84ad3ccb8acbad54539867b676e82e9f940420b50365f0fc7b93c33ff
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.9.0](https://github.com/elektronaut/badline/compare/v0.8.0...v0.9.0) (2026-10-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add a per-user data folder for badline's own files ([27bdf0e](https://github.com/elektronaut/badline/commit/27bdf0edc16d95fc57dea940741cc0b7de74bbb1))
|
|
9
|
+
* add the Drean C64, PAL-N with the 6572, as --model drean ([0562d8e](https://github.com/elektronaut/badline/commit/0562d8eb5b11239039eac934fd21eb7824868f98))
|
|
10
|
+
* add the SX-64 as --model sx64 ([e947cba](https://github.com/elektronaut/badline/commit/e947cba8ff46f0f01eeb6e1a49c0bd4bf91324ea))
|
|
11
|
+
* autosave, and a Snapshots page in the pause menu ([78aede9](https://github.com/elektronaut/badline/commit/78aede9a6052ce6c32184952a7b1d380e7c129e2))
|
|
12
|
+
* keep five quicksave slots in the data folder ([6043543](https://github.com/elektronaut/badline/commit/6043543632aa61a42ff69bdff8ea15ae354ce810))
|
|
13
|
+
* pick the C64 to run with --model ([d5539c8](https://github.com/elektronaut/badline/commit/d5539c8ade245b1e96e78765f15906ce4a80da5b))
|
|
14
|
+
* restore snapshots without their tape, .t64 or true drive disk files ([0c0733a](https://github.com/elektronaut/badline/commit/0c0733a5c7eaf9c217466f7569769eb005c5248f))
|
|
15
|
+
* run the testlist's Drean rows as testbench-drean ([dc8a075](https://github.com/elektronaut/badline/commit/dc8a07524168d399fb7c0305c661ab694c53bc2c))
|
|
16
|
+
* save NTSC, Drean and REU machines as .vsf snapshots ([c4126cf](https://github.com/elektronaut/badline/commit/c4126cfa878d8efe7aaaa9e5113c4ee2a4886e6b))
|
|
17
|
+
* seek within a subtune from checkpoints kept as it plays ([3ac57be](https://github.com/elektronaut/badline/commit/3ac57beac448a43a76387a0ff1f370cd07d06d81))
|
|
18
|
+
* take disk sets from .m3u and .vfl lists ([b4e6845](https://github.com/elektronaut/badline/commit/b4e6845eb04cde80f87c1fcb372987311bf1dd97))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* describe F11's quicksave slots, F12 and the autosave in --help ([6cbf148](https://github.com/elektronaut/badline/commit/6cbf148d327699070ef4fba4f2b3e3dd39d41348))
|
|
24
|
+
* keep the board's low-pass stable for long filter steps ([c5af022](https://github.com/elektronaut/badline/commit/c5af0224aad60dbb665e6804bb536746e354da96))
|
|
25
|
+
* leave CIA 1's timer B and the serial lines as the KERNAL's LOAD does ([b4f1a41](https://github.com/elektronaut/badline/commit/b4f1a4173b9413fd59b05bab12d173e0679c4c17))
|
|
26
|
+
* play an NTSC machine's sound at its own clock ([510aab1](https://github.com/elektronaut/badline/commit/510aab1052a58a54b1790802e2a5705fcb208c5c))
|
|
27
|
+
* put CIA 2's port A on the serial bus without a drive ([31f8a4f](https://github.com/elektronaut/badline/commit/31f8a4fad0ea210d4272b4672a84414527b68e31))
|
|
28
|
+
* run the 6567R8 and 6572 X counter over $180-$187 twice ([08a4da3](https://github.com/elektronaut/badline/commit/08a4da33d4bd68a85d61895dcf8c1ea5fa5b539c))
|
|
29
|
+
* set CIA 1's timer B for each byte the serial traps stand in for ([f98e6d7](https://github.com/elektronaut/badline/commit/f98e6d7666d2326ce4d8d3ab7f938dc4fd60cbd1))
|
|
30
|
+
* take .m3u and .vfl lists of disks in --at's insert ([d1e771e](https://github.com/elektronaut/badline/commit/d1e771e6781fc5560dda2e10e6d76abb53be0807))
|
|
31
|
+
|
|
32
|
+
## [0.8.0](https://github.com/elektronaut/badline/compare/v0.7.0...v0.8.0) (2026-10-03)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### ⚠ BREAKING CHANGES
|
|
36
|
+
|
|
37
|
+
* F9 opens the pause menu instead of swapping the joysticks, which the Ports page does now, and Tab no longer steps through the mouse and paddle modes.
|
|
38
|
+
* --read-only is gone, and disks are write-protected by default. Pass --writable to let the machine write to a disk image.
|
|
39
|
+
|
|
40
|
+
### Features
|
|
41
|
+
|
|
42
|
+
* find the disks of a set by their names ([b2a4ba4](https://github.com/elektronaut/badline/commit/b2a4ba47bb4c9d4175130104c4dd2d3d2d5e570a))
|
|
43
|
+
* pause the machine in a menu on F9 ([8b2568c](https://github.com/elektronaut/badline/commit/8b2568c8ebe894c3da56d404217189dc7b27db84))
|
|
44
|
+
* put disks in write-protected unless --writable ([aed9fa1](https://github.com/elektronaut/badline/commit/aed9fa173007c85a5b9c19840e011d34f5b6b615))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* stop printing that the window runs below real time ([86a57a6](https://github.com/elektronaut/badline/commit/86a57a635189a8e46e285773ce62ecbf1dd5adde))
|
|
50
|
+
|
|
3
51
|
## [0.7.0](https://github.com/elektronaut/badline/compare/v0.6.1...v0.7.0) (2026-10-02)
|
|
4
52
|
|
|
5
53
|
|
data/CLAUDE.md
CHANGED
|
@@ -164,7 +164,9 @@ the rows your change can't reach tell you nothing about it.
|
|
|
164
164
|
- A pull request's CI is the verdict. It runs every suite on the Spinel
|
|
165
165
|
build, compared row by row against
|
|
166
166
|
`test/baselines/`, and every job is a required check. A row that moved
|
|
167
|
-
fails it.
|
|
167
|
+
fails it. A pull request that changes only docs, or only a release's
|
|
168
|
+
version bump, skips the specs and suites; pushes to main always run
|
|
169
|
+
them. Re-record only those rows, in the same change:
|
|
168
170
|
`rake "regression:record:<suite>[filter,...]"` (quote it, because zsh
|
|
169
171
|
globs the brackets). It runs only the matching tests on CRuby and
|
|
170
172
|
splices their rows into the baseline, and every other row keeps its
|
data/README.md
CHANGED
|
@@ -73,12 +73,13 @@ differences noted in the table. `--help` lists the options for either.
|
|
|
73
73
|
| Option | Effect |
|
|
74
74
|
| --- | --- |
|
|
75
75
|
| `--no-autostart` | Attach the media and stop at `READY.`, so you can type the `LOAD` yourself |
|
|
76
|
-
| `--
|
|
76
|
+
| `--writable` | Let the machine write to disk images. Without it, a disk goes in write-protected: the drive reports `26,WRITE PROTECT ON` for any write and the image file stays as it was |
|
|
77
77
|
| `--true-drive` | Put an emulated 1541 on device 8 instead of the KERNAL traps. See [Media](#media) |
|
|
78
78
|
| `-s`, `--subtune N` | Pick a subtune of a `.sid` file, counting from 1 |
|
|
79
79
|
| `--sid 6581`, `--sid 8580` | Fit the older or newer SID. `--sid auto`, the default, takes a `.sid` tune's own |
|
|
80
80
|
| `--reu SIZE` | Plug in a RAM Expansion Unit of `SIZE` K: 128, 256, 512 (a 1750) or up to 16384 |
|
|
81
|
-
| `--
|
|
81
|
+
| `--model NAME` | Run another C64, named as in VICE: `c64` (the default, a PAL C64 with the 6569 VIC-II, 6526 CIAs and the 6581 SID), `c64c` (the PAL C64C, with the 8565, 6526As and the 8580), `ntsc` (the 6567R8), `newntsc` (the NTSC C64C, with the 8562, 6526As and the 8580), `oldntsc` (the first NTSC C64s' 6567R56A), `drean` (the Drean C64 of Argentina, PAL-N with the 6572) or `sx64` (the portable SX-64, with its own KERNAL and no datasette). `--sid` or a `.sid` tune's own SID takes the model's place |
|
|
82
|
+
| `--ntsc` | Run an NTSC C64, as `--model ntsc` does |
|
|
82
83
|
| `--no-sound` | Don't play the SID (`badline` only, where sound is on by default) |
|
|
83
84
|
| `--sound` | Play the SID (`badline-ruby`, where sound is off by default) |
|
|
84
85
|
| `--no-vsync` | Pace the window by a timer, or by the sound while it plays, instead of the display's vsync |
|
|
@@ -87,12 +88,6 @@ differences noted in the table. `--help` lists the options for either.
|
|
|
87
88
|
| `--version` | Show the version and what built it (`badline` only) |
|
|
88
89
|
| `-h`, `--help` | List the options |
|
|
89
90
|
|
|
90
|
-
Both run the same window. `badline` plays the SID through the host's
|
|
91
|
-
audio device, and `F10` mutes and unmutes it. In `badline-ruby` the
|
|
92
|
-
machine runs below real time, so the sound stutters: it plays in bursts
|
|
93
|
-
with silent gaps between them, at the right pitch, and never slows the
|
|
94
|
-
emulation down.
|
|
95
|
-
|
|
96
91
|
### Scripted runs
|
|
97
92
|
|
|
98
93
|
| Option | Effect |
|
|
@@ -113,234 +108,61 @@ badline --unpaced --frames 12000 --true-drive disk1.d64 \
|
|
|
113
108
|
`--help` lists the events, and [native/README.md](native/README.md#running)
|
|
114
109
|
describes them.
|
|
115
110
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
The KERNAL, BASIC and character ROMs come with the gem. To run other
|
|
119
|
-
images, such as a patched KERNAL, point `BADLINE_ROM_PATH` at a
|
|
120
|
-
directory that holds `kernal.rom`, `basic.rom` and `character.rom`,
|
|
121
|
-
plus `eapi/eapi-am29f040-14` if you attach EasyFlash cartridges. From
|
|
122
|
-
Ruby, `Badline.rom_path = dir` does the same before a
|
|
123
|
-
`Badline::Computer` is built, and `nil` restores the bundled set.
|
|
111
|
+
Other KERNAL, BASIC or character ROMs, and using badline as a Ruby
|
|
112
|
+
library, are covered in [doc/library.md](doc/library.md).
|
|
124
113
|
|
|
125
114
|
## Media
|
|
126
115
|
|
|
127
116
|
| Format | Handling |
|
|
128
117
|
|--------|----------|
|
|
129
118
|
| `.prg`, `.p00` | Loaded into memory after boot. A program at the BASIC start (`$0801`) is `RUN`, anything else is left for you to `SYS` |
|
|
130
|
-
| `.d64`, `.d71`, `.d81` | Mounted
|
|
131
|
-
| `.g64` | Put in a true 1541,
|
|
119
|
+
| `.d64`, `.d71`, `.d81` | Mounted as device 8, then `LOAD"*",8,1` and `RUN`. Write-protected unless `--writable` |
|
|
120
|
+
| `.g64` | Put in a true 1541, then `LOAD"*",8,1` and `RUN`. It holds the disk's raw GCR, so copy protection that reads it works. Write-protected unless `--writable` |
|
|
121
|
+
| `.m3u`, `.vfl` | A list of disk images, one path a line, relative to the list: an `.m3u` playlist, or a VICE flip list, which only unit 8's entries are taken from. Its first disk goes in as above, and the list is its set for the pause menu |
|
|
132
122
|
| `.t64` | Mounted read-only as device 8 and loaded like a disk image. The files load by name, and no tape is involved |
|
|
133
123
|
| `.tap` | Inserted in the datasette with PLAY pressed, then `LOAD` and `RUN`. It loads at the speed of a real tape |
|
|
134
124
|
| `.crt` | The hardware types listed under [Cartridges](#whats-emulated). Other types are rejected |
|
|
135
125
|
| `.sid` | PSID and RSID tunes, started through a small driver after boot |
|
|
136
126
|
| `.vsf` | A snapshot of a running machine, badline's own or one VICE's x64sc saved. See [Snapshots](#snapshots) |
|
|
137
|
-
| A directory | Mounted
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
`@0:` to replace a file), files opened for writing or appending, `S` to
|
|
147
|
-
scratch, `U2` and `B-W` block writes, and `B-A` and `B-F`. Loaders that
|
|
148
|
-
upload their own code to the drive with `M-W` and `M-E`, and copy
|
|
149
|
-
protection that reads raw GCR, won't work there, but do on a true
|
|
150
|
-
drive.
|
|
151
|
-
|
|
152
|
-
`--true-drive` puts an emulated 1541 on device 8 instead, running its
|
|
153
|
-
own DOS ROM on its own 6502 and talking to the machine over the serial
|
|
154
|
-
bus. It reads `.d64` and `.g64` images, which it autostarts with the
|
|
155
|
-
same `LOAD"*",8,1` and `RUN`, but not `.d71`, `.d81` or `.t64` images
|
|
156
|
-
or directories. `--read-only` puts the disk in write-protected. Loading
|
|
157
|
-
runs at the speed of a real 1541, and the drive's red LED lights in the
|
|
158
|
-
bottom right corner of the border. Both executables take it.
|
|
159
|
-
|
|
160
|
-
`Badline::Media.insert_disk(computer, path)` swaps the disk image or
|
|
161
|
-
directory in device 8 while the machine runs, for software that asks for
|
|
162
|
-
another disk. It takes `read_only: true`, and `Badline::Media.attach`
|
|
163
|
-
takes `disk: { read_only: true }`, to mount a disk image write-protected,
|
|
164
|
-
as the test harnesses under `bin/` do. A `.g64` goes in the true 1541,
|
|
165
|
-
and takes out a disk mounted through the traps, so `LOAD` and `SAVE`
|
|
166
|
-
reach the 1541 too. With the 1541 in device 8, a `.d64` goes in its
|
|
167
|
-
drive as well.
|
|
127
|
+
| A directory | Mounted as device 8. It serves the `.prg` and `.p00` files in it and the contents of any `.t64`, and `SAVE` writes a new `.prg` |
|
|
128
|
+
|
|
129
|
+
Without `--true-drive`, device 8 is no drive at all but traps on the
|
|
130
|
+
KERNAL's disk routines. Loading is instant, but fast loaders and copy
|
|
131
|
+
protection that run code on the drive need `--true-drive`, which puts
|
|
132
|
+
an emulated 1541 there, running its own DOS at a real 1541's speed. Its
|
|
133
|
+
red LED lights in the bottom right corner of the border.
|
|
134
|
+
[doc/media.md](doc/media.md) has the details, and how to attach media
|
|
135
|
+
from Ruby.
|
|
168
136
|
|
|
169
137
|
## Snapshots
|
|
170
138
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
was built and restores it. `computer.snapshot` and
|
|
180
|
-
`computer.restore(state)` do the same in memory, without a file. A
|
|
181
|
-
restore that fails leaves the machine as it was.
|
|
182
|
-
|
|
183
|
-
A snapshot holds the machine as it was on the cycle it was saved: the
|
|
184
|
-
chips down to the instruction step and the pixel pipeline, the RAM and
|
|
185
|
-
any +60K or +256K expansion, the cartridge with its RAM and flash, a
|
|
186
|
-
GEO-RAM, a true 1541 with its RAM, its VIAs and the disk under the head,
|
|
187
|
-
a disk or directory mounted through the traps with its open channels,
|
|
188
|
-
and the tape with its place on it. A restored machine runs on exactly
|
|
189
|
-
as the saved one would have. A directory, a tape and a true drive's
|
|
190
|
-
disk image open again from their paths when the snapshot is restored,
|
|
191
|
-
the disk with its tracks as the drive last saw them. A disk image mounted through the traps comes back
|
|
192
|
-
with its contents from the snapshot. What the host holds stays the host's: the keyboard, the
|
|
193
|
-
joysticks, the mouse and paddles, sound, and blocks given to `on_init`
|
|
194
|
-
that hadn't run yet, which a restore reports. A snapshot only restores
|
|
195
|
-
in the badline version that wrote it, into a machine with the same
|
|
196
|
-
chip models, RAM expansion and REU. `computer.snapshot` holds an REU's
|
|
197
|
-
RAM, registers and transfer too, but a machine with an REU doesn't save
|
|
198
|
-
to a file yet, as badline doesn't write VICE's REU module.
|
|
199
|
-
|
|
200
|
-
Snapshots use VICE's `.vsf` format. badline writes VICE's modules for
|
|
201
|
-
the CPU, RAM and CPU port, both CIAs, the SID and the VIC-II, plus the
|
|
202
|
-
ones x64sc needs to open the file, with nothing attached to the
|
|
203
|
-
cartridge, tape or user ports and no true drive. A `BADLINE` module,
|
|
204
|
-
which VICE skips, holds the whole machine, and badline restores its own
|
|
205
|
-
snapshots from it.
|
|
206
|
-
|
|
207
|
-
x64sc 3.10 opens badline's snapshots, taken at the end of the
|
|
208
|
-
instruction the CPU was in, as long as its VIC-II model matches
|
|
209
|
-
(`-model c64` for the default machine). It keeps its own drives and
|
|
210
|
-
leaves out the cartridge, the expansions and the tape. Snapshots x64sc
|
|
211
|
-
saves open in badline through the same modules: the CPU at its
|
|
212
|
-
instruction boundary, RAM, the CPU port, the CIAs' registers, timers and
|
|
213
|
-
clocks, the SID's registers and reSID voice state, and the VIC-II's
|
|
214
|
-
registers, beam position, counters and colour RAM. The VIC-II's pixel
|
|
215
|
-
pipeline starts empty. badline reads the modules x64sc 3.7 to 3.10
|
|
216
|
-
write, and VICE's development versions' `MAINC64CPU` and `VIC-IISC`. A module version
|
|
217
|
-
it doesn't know is left out, or fails the restore for the CPU and RAM.
|
|
218
|
-
It reports the modules it leaves out, such as the 1541 drives, the
|
|
219
|
-
cartridge, the datasette and the keyboard, and carries on without them.
|
|
220
|
-
An NTSC snapshot fails, as badline runs PAL only. Restored into a
|
|
221
|
-
running machine, a VICE snapshot fails for a machine built another way,
|
|
222
|
-
such as a C64C's snapshot in a C64, and otherwise takes the cartridge
|
|
223
|
-
out and switches the machine off and on.
|
|
139
|
+
`F11` quicksaves the whole machine to the next of five slots in
|
|
140
|
+
badline's data folder, replacing the oldest, and `F12` restores the
|
|
141
|
+
newest, even after badline has quit and started again. badline also
|
|
142
|
+
autosaves every two minutes of play, and the pause menu's Snapshots page
|
|
143
|
+
saves under a name and loads any of them. Snapshots use
|
|
144
|
+
VICE's `.vsf` format: badline opens those x64sc saves, and x64sc opens
|
|
145
|
+
badline's. See [doc/snapshots.md](doc/snapshots.md) for where they're
|
|
146
|
+
kept, what they hold and how far the two agree.
|
|
224
147
|
|
|
225
148
|
## Playing and rendering SID tunes
|
|
226
149
|
|
|
227
|
-
`badline-ruby --headless` plays a `.sid` tune on the host's audio
|
|
228
|
-
device without opening the window, and `--audio-out` renders it to a
|
|
229
|
-
16-bit stereo PCM file instead. The file's extension picks the format, `.wav`
|
|
230
|
-
or `.aiff`. The native `badline` has both modes too.
|
|
231
|
-
|
|
232
150
|
```sh
|
|
233
|
-
badline sid
|
|
234
|
-
badline sid
|
|
235
|
-
badline
|
|
236
|
-
badline
|
|
237
|
-
badline-ruby --headless --all-subtunes tune.sid # play on through every subtune
|
|
238
|
-
badline-ruby --seconds 180 tune.sid --audio-out out.aiff
|
|
239
|
-
badline-ruby -s 3 --rate 48000 tune.sid --audio-out out.wav
|
|
240
|
-
badline-ruby --headless --sid 8580 tune.sid
|
|
241
|
-
badline-ruby --filter-chunk 1 tune.sid --audio-out out.wav # exact filter, slower
|
|
151
|
+
badline tune.sid # play a tune in the SID player
|
|
152
|
+
badline sid ~/C64Music/MUSICIANS/H/Hubbard_Rob # play every tune below a directory
|
|
153
|
+
badline sid --headless tune.sid other.sid # play a queue in the terminal
|
|
154
|
+
badline --seconds 180 tune.sid --audio-out out.wav # render to a .wav or .aiff
|
|
242
155
|
```
|
|
243
156
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
takes
|
|
251
|
-
the options below except `--audio-out`, and `--subtune` picks the first
|
|
252
|
-
tune's subtune. `--sid auto`, the default, fits each of a tune's SIDs
|
|
253
|
-
the model its header names. A tune written for 2 or 3 SIDs plays on as
|
|
254
|
-
many, at the addresses its header gives, in stereo: SID 1 on the left,
|
|
255
|
-
SID 2 on the right and SID 3 in the centre. A tune on one SID plays the
|
|
256
|
-
same on both channels. A file that isn't a tune is skipped.
|
|
257
|
-
`badline tune.sid` plays the tune in the SID player too, unless an
|
|
258
|
-
option of the emulator's window, such as `--ntsc` or `--reu`, asks for
|
|
259
|
-
the machine: then a tune for one SID runs on the emulated C64, started
|
|
260
|
-
through a small driver after boot.
|
|
261
|
-
|
|
262
|
-
Both modes take the same options. The window's own, `--no-autostart`,
|
|
263
|
-
`--read-only`, `--sound`, `--true-drive`, `--reu`, `--ntsc` and
|
|
264
|
-
`--verbose`, don't apply to them. `--subtune` (or `-s`) picks the subtune, counting from 1 as HVSC
|
|
265
|
-
does, and defaults to the tune's own start subtune. Playback asks the
|
|
266
|
-
device for 44.1 kHz and takes whatever rate it offers, unless `--rate`
|
|
267
|
-
says otherwise. Ctrl-C stops it.
|
|
268
|
-
|
|
269
|
-
Played on a terminal, `--headless` and `sid` show each tune's name,
|
|
270
|
-
author and release as it starts, then the tune's place in the queue,
|
|
271
|
-
the subtune number and the time played against the subtune's length. `--headless`
|
|
272
|
-
queues just the one tune. Each tune plays its own subtune: `--subtune`, or
|
|
273
|
-
the tune's start subtune. When that subtune ends the player goes on to the next
|
|
274
|
-
tune, and it stops after the last. `a`, or `--all-subtunes`, turns on
|
|
275
|
-
playing all subtunes, so that a subtune that ends goes on to the tune's next
|
|
276
|
-
subtune, and a tune stepped to starts on its first subtune.
|
|
277
|
-
|
|
278
|
-
→ and ← step to the tune's next and previous subtune, stopping at its
|
|
279
|
-
first and last. `n` and `p` step to the next and previous tune. `s`
|
|
280
|
-
turns shuffle on and off, which plays the queue's tunes in a random
|
|
281
|
-
order, and `l` turns looping on and off, so that the end of the queue
|
|
282
|
-
goes on to its start. `,` and `.` seek 10 seconds back and forward
|
|
283
|
-
within the subtune, which plays it again from its start and runs silently
|
|
284
|
-
up to the point asked for. Space pauses and `q` quits. The status line
|
|
285
|
-
shows which modes are on, and they last until the player quits.
|
|
157
|
+
The SID player plays a queue of tunes, looking up each subtune's length
|
|
158
|
+
and STIL entry in an HVSC collection. Its window shows each voice's
|
|
159
|
+
note and output, the SID's registers, envelopes and filter, and the
|
|
160
|
+
tune's STIL entry, and is worked with the mouse. Tunes for 2 or 3 SIDs
|
|
161
|
+
play in stereo. [doc/sid-player.md](doc/sid-player.md) covers the
|
|
162
|
+
options, the keys and the window.
|
|
286
163
|
|
|
287
164
|

|
|
288
165
|
|
|
289
|
-
The SID player's window is worked with the mouse. Its header shows the
|
|
290
|
-
tune's name, author and release, the tune the subtune covers at the
|
|
291
|
-
moment when HVSC's STIL credits one, following the times STIL gives, and
|
|
292
|
-
buttons that switch between three views and between the tune's own SID
|
|
293
|
-
model, the 6581 and the 8580, which changes the chips playing on the
|
|
294
|
-
spot. Its footer shows the time played on a bar you can click to seek,
|
|
295
|
-
and buttons that pause, step between tunes and between a tune's
|
|
296
|
-
subtunes, and turn shuffle, looping and all subtunes on and off. The
|
|
297
|
-
visualizer view shows each voice's note, and how far off it is in cents,
|
|
298
|
-
over a scope of the voice's output, and the mixed output below them. A
|
|
299
|
-
tune on more than one SID gets a row of voices for each SID, and the mix
|
|
300
|
-
splits into its left and right. The SID view shows one SID at a time,
|
|
301
|
-
and for a tune on more than one, a row of SID 1, 2 and 3 buttons at its
|
|
302
|
-
top picks which. It shows each voice's waveforms and the shape
|
|
303
|
-
they make, its control bits, pulse width, envelope settings, and the
|
|
304
|
-
envelope's level and stage, and the filter's modes, cutoff, resonance,
|
|
305
|
-
volume and its response on the chip playing. The INFO view shows the
|
|
306
|
-
tune's STIL entry and the subtune's, with a scroll bar, the mouse wheel
|
|
307
|
-
or the up and down keys for the long ones. The terminal's keys work in
|
|
308
|
-
the window too, along with Tab to switch views and `c` to step through
|
|
309
|
-
the SID models.
|
|
310
|
-
|
|
311
|
-
`--no-tui`, or output that isn't a terminal, gives plain progress
|
|
312
|
-
output instead and plays through the queue without the keys, while
|
|
313
|
-
`--audio-out` renders just the one subtune.
|
|
314
|
-
|
|
315
|
-
A `.sid` file doesn't store its length, so `badline-ruby` looks the
|
|
316
|
-
tune up by MD5 in HVSC's `Songlengths.md5`. It finds the database
|
|
317
|
-
through `--songlengths`, in a `DOCUMENTS` directory in any of the
|
|
318
|
-
tune's parent directories (the layout of an HVSC collection), or under
|
|
319
|
-
`$HVSC_BASE/DOCUMENTS`. Without a database or `--seconds` it runs for
|
|
320
|
-
60 seconds, but a subtune that falls silent for 5 seconds before then
|
|
321
|
-
ends there, when played and when rendered alike. Silent means the
|
|
322
|
-
output holds within 16 steps of one level, since a 6581 idles at a DC
|
|
323
|
-
offset rather than at zero. A subtune with a known length plays to its
|
|
324
|
-
length whatever it sounds like.
|
|
325
|
-
|
|
326
|
-
A tune in an HVSC collection also gets its entry in HVSC's `STIL.txt`,
|
|
327
|
-
found the same way: comments, covers, and subtune names and composers.
|
|
328
|
-
The tune's own fields follow its header, and each subtune's print as it
|
|
329
|
-
starts.
|
|
330
|
-
|
|
331
|
-
PSID tunes run on a CPU and RAM with only the SID clocked, at about
|
|
332
|
-
twice real time, so they play smoothly. RSID tunes set up their own
|
|
333
|
-
interrupts, so they boot a full C64 first and run at about half real
|
|
334
|
-
time. They render fine but stutter when played, and `badline-ruby` says
|
|
335
|
-
so when it falls behind. The filter steps four cycles at a time;
|
|
336
|
-
`--filter-chunk 1` steps it every cycle, which is exact and takes about
|
|
337
|
-
twice as long. `badline-ruby --help` lists the options.
|
|
338
|
-
|
|
339
|
-
The native `badline` takes the same options and runs the same code, so
|
|
340
|
-
it renders the same file sample for sample, and it plays RSID tunes
|
|
341
|
-
without stuttering. See
|
|
342
|
-
[native/README.md](native/README.md#without-the-window).
|
|
343
|
-
|
|
344
166
|
## Input
|
|
345
167
|
|
|
346
168
|
Keys map by their position on a US keyboard, whatever the host's layout,
|
|
@@ -362,109 +184,99 @@ types `"`. These keys have no same-named host key:
|
|
|
362
184
|
| `+` / `*` | Keypad `+` / Keypad `*` |
|
|
363
185
|
| `RESTORE` | `Page Up` |
|
|
364
186
|
|
|
365
|
-
`Tab`
|
|
366
|
-
window title shows
|
|
187
|
+
`Tab` switches the keys between the C64 keyboard and the joysticks. The
|
|
188
|
+
window title shows where they go, and any device plugged into a control
|
|
189
|
+
port:
|
|
367
190
|
|
|
368
|
-
|
|
|
369
|
-
|
|
191
|
+
| Title | What the host drives |
|
|
192
|
+
|-------|----------------------|
|
|
370
193
|
| (none) | The keyboard |
|
|
371
|
-
| `[JOY 2]` / `[JOY 1]` | Arrows and Space (or Right Ctrl) are the joystick named, `WASD` and Left Shift the other.
|
|
194
|
+
| `[JOY 2]` / `[JOY 1]` | Arrows and Space (or Right Ctrl) are the joystick named, `WASD` and Left Shift the other. SWAP JOYSTICKS on the pause menu's Ports page swaps them |
|
|
372
195
|
| `[MOUSE 1]` / `[MOUSE 2]` | A 1351 mouse in control port 1 or 2 |
|
|
373
196
|
| `[PADDLE 1]` / `[PADDLE 2]` | A pair of paddles in control port 1 or 2 |
|
|
374
197
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
198
|
+
A 1351 mouse or a pair of paddles plugs into either port on the pause
|
|
199
|
+
menu's Ports page, and stays there whichever way `Tab` sends the keys.
|
|
200
|
+
While one is plugged in it holds the host mouse, and opening the pause
|
|
201
|
+
menu lets go. Moving it moves the 1351 or turns the two paddle knobs,
|
|
202
|
+
and the left and right buttons are the 1351's buttons, or the fire
|
|
203
|
+
buttons of paddles A and B. Games differ in which port they read.
|
|
380
204
|
|
|
381
205
|
Game controllers work in every mode. The first one is joystick 2 and
|
|
382
206
|
the second is joystick 1. The D-pad and left stick steer, the face and
|
|
383
207
|
shoulder buttons fire, and controllers can be connected or removed while
|
|
384
208
|
the emulator runs.
|
|
385
209
|
|
|
386
|
-
Control port 1's fire line is also the VIC-II's light pen input, so
|
|
387
|
-
joystick 1's fire button and the 1351's left button in port 1 latch the
|
|
388
|
-
light pen registers.
|
|
389
|
-
|
|
390
210
|
`F10` mutes and unmutes the sound, and the window title shows `[MUTED]`
|
|
391
211
|
while it's off.
|
|
392
212
|
|
|
213
|
+
## The pause menu
|
|
214
|
+
|
|
215
|
+
`F9` pauses the machine and opens a menu over the frozen picture, and
|
|
216
|
+
`F9` or `Esc` closes it again. On a Mac, hold `Fn` for `F9`, unless the
|
|
217
|
+
function keys are set to work as standard function keys. Up and Down move
|
|
218
|
+
through the rows, Right goes into a page and Left back out, and Return or
|
|
219
|
+
Space presses a row. A row with choices steps to the next. The mouse works
|
|
220
|
+
too.
|
|
221
|
+
|
|
222
|
+
| Page | What it holds |
|
|
223
|
+
|------|---------------|
|
|
224
|
+
| Snapshots | Quicksave, save under a name, load a named save, and the latest quicksaves and autosaves |
|
|
225
|
+
| Drive 8 | The disk: insert, eject, the previous or next disk of its set, and whether it's writable |
|
|
226
|
+
| Datasette | The tape: insert, eject, PLAY and REWIND |
|
|
227
|
+
| Expansion port | The cartridge: insert, remove, and its freeze button if it has one |
|
|
228
|
+
| Ports | The device in each control port, and where the keys go |
|
|
229
|
+
| Sound | Mute, and the SID's model |
|
|
230
|
+
| Power | Reset, power cycle and quit |
|
|
231
|
+
|
|
232
|
+
INSERT opens a file browser. A disk's set is the `.m3u` or `.vfl` list it
|
|
233
|
+
was opened from, or one in its folder that lists it. Without one, it comes
|
|
234
|
+
from the names in its folder: `Disk 1`, `Side B`, `d2`, TOSEC's
|
|
235
|
+
`(Disk 1 of 2)`, or a trailing `_1`, `_2` when the first of the set is
|
|
236
|
+
there. WRITABLE starts as
|
|
237
|
+
`--writable` sets it and stays as set for the next disk. Quick open starts
|
|
238
|
+
a file in a new machine, as the command line does. It asks first, as
|
|
239
|
+
inserting or removing a cartridge does, since each power cycles the
|
|
240
|
+
machine.
|
|
241
|
+
|
|
242
|
+
A disk, list of disks or tape dropped on the window goes into its drive. A cartridge,
|
|
243
|
+
program or `.sid` dropped on it opens the menu to ask first.
|
|
244
|
+
|
|
393
245
|
## What's emulated
|
|
394
246
|
|
|
395
247
|
- **6510**: every opcode, documented and undocumented, with per-cycle
|
|
396
248
|
bus behaviour checked against the
|
|
397
249
|
[65x02 single step tests](https://github.com/SingleStepTests/65x02).
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
- **
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
machine instead: the 6567R8's 65 cycles by 263 lines at 1,022,727 Hz,
|
|
412
|
-
with its later sprite fetches and its X counter, and TOD clocks on
|
|
413
|
-
60 Hz mains. `Badline::Region::NTSC_OLD` is the first NTSC C64s'
|
|
414
|
-
6567R56A, 64 cycles by 262 lines. The stock KERNAL tells them from PAL
|
|
415
|
-
by the raster, so every region boots the same ROMs. `--ntsc` picks the
|
|
416
|
-
6567R8.
|
|
417
|
-
- **CIA 1 and 2**: timers, time-of-day clocks with alarms, the serial
|
|
418
|
-
shift register, interrupts, the keyboard matrix with its ghost keys,
|
|
419
|
-
the control ports and the paddle multiplexer. The machine has the
|
|
420
|
-
original 6526s; `Badline::Computer.new(cia_model: :mos6526a)` fits the
|
|
421
|
-
C64C's 6526As instead, whose interrupt register timing differs.
|
|
422
|
-
- **SID**: the 6581 and the 8580, with oscillators, ring modulation and
|
|
423
|
-
sync, the envelope generator including the ADSR delay bug, the filter,
|
|
424
|
-
and the RC network on the board that removes the DC offset from the
|
|
425
|
-
output. The machine has a 6581 unless a `.sid` tune asks for an 8580
|
|
426
|
-
in its header, and `--sid 6581` or `--sid 8580` overrides either.
|
|
427
|
-
- **REU**: the 1700, 1764 and 1750 RAM Expansion Units, and the bigger
|
|
428
|
-
units up to 16M built on the same REC chip, with DMA timed against the
|
|
429
|
-
VIC's bad lines and sprites. `--reu SIZE` plugs one in, and
|
|
430
|
-
`Badline::Computer.new(reu: 512)` does the same from Ruby. An
|
|
431
|
-
REU beside a cartridge loses I/O 2 to the cartridge.
|
|
432
|
-
- **Datasette**: `.tap` playback into CIA 1's FLAG line, with the motor
|
|
433
|
-
and sense lines on the 6510 port.
|
|
250
|
+
- **Memory**: banking through the 6510 port, the cartridge lines and
|
|
251
|
+
Ultimax mode, and the +60K and +256K RAM expansions.
|
|
252
|
+
- **VIC-II**: the PAL 6569, the C64C's 8565, NTSC's 6567R8, 8562 and
|
|
253
|
+
6567R56A, and the Drean's PAL-N 6572 (`--model`): every graphics mode, sprites, collisions, bad lines,
|
|
254
|
+
sprite DMA, the border and the light pen.
|
|
255
|
+
- **CIA 1 and 2**: the 6526 and the C64C's 6526A, with timers,
|
|
256
|
+
time-of-day clocks, the serial shift register, the keyboard matrix
|
|
257
|
+
and the control ports.
|
|
258
|
+
- **SID**: the 6581 and the 8580, filter and all.
|
|
259
|
+
- **REU**: the 1700, 1764 and 1750 and bigger units up to 16M
|
|
260
|
+
(`--reu`), with DMA timed against the VIC's bad lines and sprites.
|
|
261
|
+
- **Datasette**: `.tap` playback.
|
|
262
|
+
- **1541**: an emulated drive running its own DOS (`--true-drive`).
|
|
434
263
|
- **Cartridges**: standard 8K, 16K and Ultimax, Simons' BASIC, Ocean,
|
|
435
|
-
Fun Play / Power Play, Super Games, Epyx FastLoad, Westermann
|
|
436
|
-
Rex Utility, C64 Game System / System 3, Dinamic, Zaxxon /
|
|
437
|
-
Magic Desk, Comal-80, EasyFlash, Mach 5, Pagefox, RGCD
|
|
438
|
-
the freezers Action Replay (v4.2 to v6), Atomic
|
|
439
|
-
Retro Replay / Nordic Replay, Final Cartridge III
|
|
440
|
-
Power Cartridge.
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
the Am29F040 EAPI on attach, as VICE does. The writes stay in memory
|
|
445
|
-
and are lost when the emulator quits: the `.crt` file is never
|
|
446
|
-
overwritten. The Retro Replay's flash
|
|
447
|
-
works the same way in flash mode, which the flash jumper enables:
|
|
448
|
-
`Media.attach(computer, path, cartridge: { flash_jumper: true })`, with
|
|
449
|
-
`bank_jumper: true` to run from the second 64K of a 128K image. The
|
|
450
|
-
GMod2 EEPROM and the Retro Replay clock port aren't there.
|
|
451
|
-
- **GEO-RAM**: 64K to 4M of RAM seen through the `$DE00` page, with the
|
|
452
|
-
`$DFFE`/`$DFFF` page and block registers. It takes the expansion port,
|
|
453
|
-
so it can't sit alongside a cartridge:
|
|
454
|
-
`computer.attach_cartridge(Badline::Cartridge::GeoRAM.new(size: 512))`.
|
|
455
|
-
Its contents are lost when the emulator quits.
|
|
264
|
+
Fun Play / Power Play, Super Games, Epyx FastLoad, Westermann
|
|
265
|
+
Learning, Rex Utility, C64 Game System / System 3, Dinamic, Zaxxon /
|
|
266
|
+
Super Zaxxon, Magic Desk, Comal-80, EasyFlash, Mach 5, Pagefox, RGCD,
|
|
267
|
+
GMod2 and GEO-RAM, and the freezers Action Replay (v4.2 to v6), Atomic
|
|
268
|
+
Power / Nordic Power, Retro Replay / Nordic Replay, Final Cartridge III
|
|
269
|
+
/ III+ and the KCS Power Cartridge. Flash writes stay in memory.
|
|
270
|
+
|
|
271
|
+
Chip combinations `--model` doesn't name, and the cartridges' jumpers,
|
|
272
|
+
are built from Ruby: see [doc/library.md](doc/library.md).
|
|
456
273
|
|
|
457
274
|
Known gaps:
|
|
458
275
|
|
|
459
|
-
- `badline-ruby` runs below real time, so its
|
|
460
|
-
|
|
461
|
-
`badline-ruby --headless`.
|
|
276
|
+
- `badline-ruby` runs below real time, so its sound, which `--sound`
|
|
277
|
+
turns on, stutters: it plays in bursts with silent gaps between them.
|
|
462
278
|
- Without `--true-drive`, fast loaders and anything else that runs code
|
|
463
|
-
on the drive won't work
|
|
464
|
-
doesn't rename, copy, format or validate disks.
|
|
465
|
-
- No PAL-N (Drean) machine.
|
|
466
|
-
- The emulator window has no freeze button yet, so a freezer cartridge
|
|
467
|
-
runs its menu but can't freeze a program.
|
|
279
|
+
on the drive won't work.
|
|
468
280
|
|
|
469
281
|
## Contributing
|
|
470
282
|
|
data/doc/library.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Using badline from Ruby
|
|
2
|
+
|
|
3
|
+
The gem is also a library, which runs a `Badline::Computer` from Ruby
|
|
4
|
+
without a window.
|
|
5
|
+
|
|
6
|
+
```ruby
|
|
7
|
+
require "badline"
|
|
8
|
+
|
|
9
|
+
computer = Badline::Computer.new
|
|
10
|
+
Badline::Media.attach(computer, "game.d64") # attaches and autostarts
|
|
11
|
+
computer.on_init { computer.type_text("print 6*7\r") } # once the machine has booted
|
|
12
|
+
3_500_000.times { computer.cycle! }
|
|
13
|
+
computer.address_bus.peek(0x0400) # screen RAM starts at $0400
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
[media.md](media.md) covers attaching and swapping media, and
|
|
17
|
+
[snapshots.md](snapshots.md) saving and restoring the machine.
|
|
18
|
+
|
|
19
|
+
## Building a machine
|
|
20
|
+
|
|
21
|
+
`Badline::Computer.new` builds the default machine: a PAL C64 with the
|
|
22
|
+
6569 VIC-II, 6526 CIAs and a 6581 SID. Its keywords build others, and
|
|
23
|
+
`Badline::Model.named("c64c")` gives the ones `--model` names for each
|
|
24
|
+
model (`Badline::Model::ALL`):
|
|
25
|
+
|
|
26
|
+
- `vic_model: :mos8565` fits the C64C's 8565, with its grey dots on
|
|
27
|
+
colour register writes and its own timing for mode splits, sprite
|
|
28
|
+
multicolour splits and the light pen.
|
|
29
|
+
- `region: Badline::Region::NTSC` builds an NTSC machine: the 6567R8's
|
|
30
|
+
65 cycles by 263 lines at 1,022,727 Hz, with its later sprite fetches
|
|
31
|
+
and its X counter, and TOD clocks on 60 Hz mains.
|
|
32
|
+
`Badline::Region::NTSC_OLD` is the first NTSC C64s' 6567R56A, 64 cycles
|
|
33
|
+
by 262 lines, and `Badline::Region::DREAN` the Drean C64's PAL-N
|
|
34
|
+
6572, 65 cycles by 312 lines at 1,023,440 Hz. The stock KERNAL tells them from PAL by the raster, so
|
|
35
|
+
every region boots the same ROMs.
|
|
36
|
+
- `cia_model: :mos6526a` fits the C64C's 6526As, whose interrupt
|
|
37
|
+
register timing differs.
|
|
38
|
+
- `sid_model: :mos8580` fits the 8580.
|
|
39
|
+
- `ram_expansion: :plus60k` or `:plus256k` fits the +60K or +256K RAM
|
|
40
|
+
expansion, banked through its register at `$D100`.
|
|
41
|
+
- `reu: 512` plugs in a RAM Expansion Unit of that many K.
|
|
42
|
+
- `kernal: :sx64` fits the SX-64's KERNAL, and `datasette: false`
|
|
43
|
+
leaves the cassette port empty, so inserting a tape raises
|
|
44
|
+
`Badline::Datasette::Missing`. The SX-64 has both.
|
|
45
|
+
|
|
46
|
+
## Cartridges
|
|
47
|
+
|
|
48
|
+
`Media.attach(computer, path, cartridge: { flash_jumper: true })` sets
|
|
49
|
+
the Retro Replay's flash jumper, which makes its flash take writes, and
|
|
50
|
+
`bank_jumper: true` runs it from the second 64K of a 128K image.
|
|
51
|
+
EasyFlash and GMod2 flash take writes through the chip's command set
|
|
52
|
+
(program, sector and chip erase, autoselect), so games and EAPI can save
|
|
53
|
+
to it. An EasyFlash image's EAPI is swapped for a bundled copy of the
|
|
54
|
+
Am29F040 EAPI on attach, as VICE does. Flash writes stay in memory and
|
|
55
|
+
are lost when the emulator quits: the `.crt` file is never overwritten.
|
|
56
|
+
|
|
57
|
+
A GEO-RAM takes the expansion port, so it can't sit alongside a
|
|
58
|
+
cartridge: `computer.attach_cartridge(Badline::Cartridge::GeoRAM.new(size: 512))`.
|
|
59
|
+
Its contents are lost when the emulator quits.
|
|
60
|
+
|
|
61
|
+
## ROMs
|
|
62
|
+
|
|
63
|
+
The KERNAL, BASIC and character ROMs come with the gem. To run other
|
|
64
|
+
images, such as a patched KERNAL, point `BADLINE_ROM_PATH` at a
|
|
65
|
+
directory that holds `kernal.rom`, `basic.rom` and `character.rom`, plus
|
|
66
|
+
`kernal-sx64.rom` for the SX-64 and `eapi/eapi-am29f040-14` if you
|
|
67
|
+
attach EasyFlash cartridges.
|
|
68
|
+
`Badline.rom_path = dir` does the same before a `Badline::Computer` is
|
|
69
|
+
built, and `nil` restores the bundled set.
|