NextPlayer (ZX Spectrum 128k + EsxDos)

NextPlayer is a music player for AY-3-8912 chiptune files, built for the classic ZX Spectrum 128K with an esxdos/DivMMC interface. It reads your music straight off an SD card, so there's no need to fiddle with tape loading or split your collection across dozens of disks.

This edition runs on real, unexpanded 128K hardware - classic bank switching only, no ZX Spectrum Next features required. If you own a Next, see the Next edition instead, which adds long file name support and mouse control.
Supported formats

    PT2
    PT3
    STC
    STP
    SQT
    TS (TurboSound)

Features

    On-screen file browser for navigating folders on your SD card
    Search/filter files by name
    Shows the currently playing file name, and the song title, author and year when the module contains them
    Shows the file count, your position in the list, and the current directory name
    Keyboard controls with auto-repeat for quick navigation

Controls

    Cursor keys - move through the file list
    Enter - play the selected song
    Space - skip to the next song
    S - search/filter files
    R - reload the current directory
    Break - stop playback

Requirements

A ZX Spectrum 128K with an esxdos-compatible interface (e.g. DivMMC) and an SD card containing your music files.
Credits

Main program: Shrek. AY playback routines: mborik.


https://shrek128.itch.io/nextplayer


NextPlayer 0.72

Directories named like a supported file (e.g. "MUSIC.STP")

The file browser matches PT2/PT3/SQT/STC/STP files by their extension, but it was checking the extension before checking whether the entry was actually a directory. A folder whose name happened to end in one of those extensions (say, "BULBA.STC") was misclassified as a file and you couldn't enter it. Directories are now always recognized as directories first, regardless of their name.
128K bank switching no longer goes through a BASIC system variable

The paging code used to read and update the BASIC ROM's system variable at $5B5C (the "last value written to port $7FFD") every time it needed to switch memory banks - including in the two hottest routines, called on practically every screen redraw. That's an unnecessary dependency on BASIC/ROM bookkeeping for a program that's meant to run standalone.

Those two routines now compute the exact port value they need and write it directly, no read-modify-write dance required. The program still keeps its own private shadow copy of the last value written (needed by a few routines that temporarily switch banks and then restore whatever was selected before), but that shadow is entirely under the program's own control now - nothing reads or depends on the BASIC system variable anymore.
Removed dead code that could disconnect the 48K ROM

An old, unreachable routine (leftover from an earlier +3DOS-style directory-change implementation, long since replaced by a clean esxdos call) used to switch the ROM select bit over to the 128K editor ROM in order to call an old +3DOS-only ROM routine that doesn't even exist on plain 128K hardware. Since nothing in the program called this routine anymore, it's been deleted outright.
Leftover characters in the filename bar

When browsing the file list, the bottom bar shows the name of the currently selected file or directory. If the current name was shorter than the previous one, trailing characters from the previous name could remain on screen instead of being cleared. The name buffer is blanked with spaces before each redraw, but the copy routine was writing an extra zero byte right after the name, which made the print routine stop one step too early and skip over those blanking spaces. Fixed - the display now always clears out to the full width before printing.


NextPlayer 0.73

This update is mostly about making the 128K version feel better on real hardware, especially when browsing larger folders from an SD card.
File browser paging fix

The file list had an ugly edge case on the last page of a long directory. When the final page contained fewer entries than a full screen, paging down could move the selection onto an empty row. In some cases the browser would also show a stale filename from a previous, longer directory because the remaining rows were not cleared properly.

The browser now clamps the current position to the real last file, draws only the entries that actually exist on the current page, and clears the unused rows. The old highlight is also cleaned up before the new one is drawn, so the last page should no longer leave a red cursor bar on empty space.
Better controls on a rubber-key 48K keyboard

The controls have been expanded so the player is easier to use on a classic ZX Spectrum keyboard, including the rubber-key layout where cursor keys are less convenient.

    O - page up in the file list, same as cursor left
    P - page down in the file list, same as cursor right
    1 - stop playback, same as Break

The playback help text was updated too, so the stop control is now shown as Break/1 and the line is centered inside the playback frame.
STP player fix

One STP module exposed a compatibility problem in the STP playback initialisation. Some STP files do not include a relocation table, but still store their pattern, ornament and sample pointers as offsets relative to the module start. The old init code treated those pointers as already absolute, which meant the player read the wrong memory. The result was silence, then an automatic skip to the next song.

NextPlayer now detects that kind of STP file and relocates the pointer tables during initialisation. Existing STP files with normal relocation data keep using the original path.
