NEXT FAQ’s

The Speccy's spritely young offspring. Discuss everything from FPGA to ZX
User avatar
cmal
Manic Miner
Posts: 630
Joined: Fri Jun 05, 2020 1:05 am
Location: California

Re: NEXT FAQ’s

Post by cmal »

What is the best way to report a bug/issue related to the KS2 Next?
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

cmal wrote: Thu Feb 01, 2024 6:59 pm What is the best way to report a bug/issue related to the KS2 Next?
NextBASIC/NextZXOS/dot command/distro issues: https://gitlab.com/thesmog358/tbblue/-/issues

FPGA core issues: https://gitlab.com/SpectrumNext/ZX_Spec ... A/-/issues

Physical hardware issues (loose keys, broken feet, etc): email info at specnext dot com.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
cmal
Manic Miner
Posts: 630
Joined: Fri Jun 05, 2020 1:05 am
Location: California

Re: NEXT FAQ’s

Post by cmal »

Thanks for that, @Seven.FFF. I looked to see if the issue was reported, but couldn't find it.

Before I post the issue, could someone else with a KS2 accelerated Next please try it out to see if it's really an issue and not just me doing something silly.

Here are the steps:

Issue: TZX files do not load when keyboard Issue 2 is selected:

1. Go to the Browser to browse for any 48K TZX file
2. In the initial settings screen, press A for Advanced hardware options
3. Press K to select keyboard Issue 2, then press space to get back to the main settings screen
4. Press 4 to load in 48K mode

After the file gets transferred to the Pi, the loading should start. But instead of loading, it shows a red border/white paper and gets stuck. The loading noise can be heard but nothing is loaded.

5. Reset the Next and go back to browse for the same TZX file. Hold symbol shift while pressing enter so that it lets you change the settings
6. Press A for Advanced hardware options, then press K to switch back to keyboard issue 3. Press Space to go back and then press 4 to load the game.
The game should load fine now.
User avatar
flatduckrecords
Manic Miner
Posts: 787
Joined: Thu May 07, 2020 11:47 am
Location: Oban, Scotland
Contact:

Re: NEXT FAQ’s

Post by flatduckrecords »

cmal wrote: Fri Feb 02, 2024 6:26 pm Before I post the issue, could someone else with a KS2 accelerated Next please try it out to see if it's really an issue and not just me doing something silly.
Yeah, same thing happens on mine. Fine with model 3; but static red border and no loading with model 2 selected.
jamesh
Dizzy
Posts: 83
Joined: Thu Jul 06, 2023 6:36 pm

Re: NEXT FAQ’s

Post by jamesh »

cmal wrote: Fri Feb 02, 2024 6:26 pm After the file gets transferred to the Pi, the loading should start. But instead of loading, it shows a red border/white paper and gets stuck. The loading noise can be heard but nothing is loaded.
+1, that's exactly how it does not work. Red static border with keyboard issue 2 but loads fine with issue 3.
User avatar
cmal
Manic Miner
Posts: 630
Joined: Fri Jun 05, 2020 1:05 am
Location: California

Re: NEXT FAQ’s

Post by cmal »

Thanks for testing and confirming the behavior.

BTW, I didn't mention above, but this issue also happens in real tape mode. I'll post this as an issue.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

cmal wrote: Fri Feb 02, 2024 6:26 pm Issue: TZX files do not load when keyboard Issue 2 is selected:
Thanks for reporting this, and everyone else who confirmed it! I can also reproduce. We are discussing the possible causes.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
cmal
Manic Miner
Posts: 630
Joined: Fri Jun 05, 2020 1:05 am
Location: California

Re: NEXT FAQ’s

Post by cmal »

It's been just over a month since receiving my KS2 Next, and it's been an absolute pleasure using it during this time. It's a fantastic machine and I'll reiterate that the team behind it have earned my utmost respect. The novelty of receiving it has not worn off yet and it's become my main go-to Spectrum.
In wanting to preserve the keyboard, I've mostly been using an external PS2 keyboard. I did run into a strange issue, but wanted to see if anyone else could reproduce the issue on their Next. I've confirmed that my brother is also experiencing the same issue with his Next and with a different PS2 keyboard.

The problem happens when the control keys for a game use symbol shift and space. (Tested on a KS2 model)
Here's how to reproduce the issue:
1. With the Spectrum Next turned off, plug a PS2 keyboard into the PS2 socket. In my case, I tested by directly plugging the keyboard into the PS2 socket and also by using a PS2 Y cable. In both cases I see the issue.
2. Press Space when booting up, go into the Spectrum Next settings and make sure Keyboard is selected
3. Open the game Wild West Hero and run it in 48K mode (press 4 when prompted to load). This game uses Q/A for up/down, Symbol Shift (Ctrl on keyboard) for left and space bar for right.
4. Play the game on the PS2 keyboard. After not too long, the controls stop working correctly and your character drifts towards the left, and you're unable to control him properly.
5. Reset the Next. The browser shows, but the arrow keys do not work.
6. You can make the keyboard work normally again by pressing the Pause/Break key on the PS2 keyboard. For some reason, this key gets the PS2 keyboard working normally again.

I then tried this with a different game to rule out Wild West Hero as being the cause. I loaded up Chuckie Egg and pressed R to redefine the keys. For up and down, any keys were selected, but I picked Symbol Shift for left and Space for right. After a short while on level one, the issue happened again. While in-game, I'm able to press the Pause/Break key to fix the issue.

This behavior does not happen with the Spectrum Next keyboard. It seems to just be an issue while using a PS2 keyboard.
Is anyone else able to reproduce this issue? I'd be interested to know if there's a remedy for it or if I'm just doing something wrong. Maybe there's a way to remap keys on the PS2 keyboard.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

It's a known bug/limitation in the ps/2 hardware state machine, unfortunately: https://gitlab.com/thesmog358/tbblue/-/issues/86

It's on Allen's fix list to do a rewrite of the ps/2 keyboard module, but a few other things have to happen first, so it may not happen immediately. There isn't much of a simple workaround, but you could redefine keys in the game to something different, use keyjoy keyboard emulation, use a matrix keyboard, or possibly even define a different ps/2 keymap.bin just for this game, that mapped non-modifier ps/2 keys to the required matrix keys.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
cmal
Manic Miner
Posts: 630
Joined: Fri Jun 05, 2020 1:05 am
Location: California

Re: NEXT FAQ’s

Post by cmal »

Seven.FFF wrote: Sat Feb 24, 2024 6:12 pm It's a known bug/limitation in the ps/2 hardware state machine, unfortunately: https://gitlab.com/thesmog358/tbblue/-/issues/86
Thanks for linking to the original bug report, @Seven.FFF . Good to know that it's a known issue. I'll try the PS2 keyboard map method that you suggested.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

If you wanted to play with the ps/2 keymap, it's not especially well documented, but this should start you off.

The keymap lives in c:/machines/next/keymap.bin, and is loaded at power on and cold reset. It's a 1024 byte file containing 512 pairs of bytes, even one being a 16 bit big-endian keycode mapping. The first 256 pairs are regular codes as seen here, and the second 256 pairs are extended codes, as seen here. The easiest thing would be to start with the existing file, and then just change bytes for the keys you want to change.

Each code in those links has a comment that says what key it represents. Each entry in those links are 9 bit numbers in string format, so for example "000111011" for the N key has the first digit (9th bit) of 0, and the other eight bits are 00111011 binary = 59 decimal. So in keymap.bin that pair would be 0, 59. Don’t ask me why they’re 9bit - something to do with how FPGA block RAM is organized internally inside the chip.

So what do those pairs of numbers mean? Well firstly the Next keyboard has an 8x7 matrix rather than an 8x5 matrix that regular speccies have. How we arrived at that is a long story, which I won't get distracted with right now. But it means there are eight half-rows and seven columns. Five of the columns are exactly like the speccy matrix columns, but there are two extra ones containing the ten extended keys (which are generated with compound keypresses on 48K+/128K/+2/+2A/+3).

The mapping for regular matrix keys is CASE 1 here. Where that refers to bit 8, that is the 9th bit that going into the first byte of the mapping pair, so that byte is always going to be 0 for regular matrix keys. Bits 7..0 go into the other byte of the mapping pair, as you'd expect. So bit 7 is a modifier for if SYM is also pressed when you press the ps/2 key. Bit 6 is a modified for if CAPS is also pressed when you press the key. Bits 5..3 are the half-row (values 0..7), bits 2..0 are the column (values 0..6). The half-row and column values for the entire 8x7 matrix are shown here. Again, rows 0..7 and cols 0..5 will look very familiar to you from a regular speccy matrix, and only cols 5 and 6 are new for the Next.

THe mapping for logical function keys is CASE 2 here. Bit 8 is also 0 (so first byte is always 0 also), bits 7..6 are always 11, bits 5..3 are aways 000, and bits 2..0 are one of the possible logical function keys. There will be more logical functions in future, when we add things like tape transport controls for the Pi TZX playback (tzxduino-esque functionality).
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
cmal
Manic Miner
Posts: 630
Joined: Fri Jun 05, 2020 1:05 am
Location: California

Re: NEXT FAQ’s

Post by cmal »

Thanks @Seven.FFF for the detailed write-up on how the keyboard mapping works. I looked at the mapping details on Gitlab and it's interesting to see which ps/2 keys are mapped to the Next keyboard. For example, I didn't know that the tilde button on the ps/2 keyboard is mapped to the Edit key(useful for browsing), and the left Alt key is mapped to Extend mode, right Alt is mapped to the Graph key. This info is probably in the manual but I haven't seen it yet.

I decided it's not worth mapping the keyboard differently to get a single game to use different keys. Instead I used keyjoy mapping(admittedly for the first time) and that worked really well. Most games offer a Kempston option but Wild West Hero does not, so keyjoy made sense.
User avatar
sludge
Drutt
Posts: 33
Joined: Sat Feb 24, 2024 4:38 pm

Re: NEXT FAQ’s

Post by sludge »

Quite a few things I'm struggling with regarding the Next.

1) Apparently you cant use USB mouse via an adaptor but you can via the Pi micro USB port. Although it warns not to connect anything via those ports.

2) When will you be able to add extra cores? Will there be email notification or will we have to check the Next website on a regular basis for updates?

3) Is there any way to lower the beeper volume and/or raise the AY as the beeper is way louder on mine.

4) My old telly doesnt reproduce the colours very well, is it the telly or is HDMI output just really poor like I have heard?

5) Can you access the Next's hardware upgrades (sprites, layer2, scrolling, extra memory etc) from 48/128 mode using OUT commands or can they only be used via NextOS?

6) Can 48/128 Z80 code be assembled/loaded into NextOS? And will it work normally?

7) Can audio/music MP3's be converted to WAV and played without problems as every attempt I've made has sounded garbled.

8) That awful SD card slot, I guess we're stuck with it right?

9) Do I really have to go to the joystick menu to set it up again after every reset? I've selected my joystick option of choice on the boot screen but it just doesnt seem to register.

10) The RTC suggests to me there must be a battery in there, will this degenerate over time and cause a problem? Would it be sensible to remove it?

Apologies if my list of questions seem more of a moan/rant.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: NEXT FAQ’s

Post by Seven.FFF »

@sludge:

1) Mouse: The Next only uses ps/2 mice that plug into the ps/2 socket. These are converted to Kempston protocol in the FPGA core. It's purely a hardware thing, there's no software drivers or USB stack. You're thinking of some mice that were made 20-25 years ago that could speak both USB and ps/2 protocol, and had a USB plug with an adaptor. The adaptor just passively passes through the four USB pins to the four ps/2 pins, with some resistors so that the mouse could detect when to switch to ps/2 protocol instead of USB protocol. Almost no modern USB mice speak ps/2 protocol, so just ramming an adaptor on one of these does nothing. There are plenty of modern ps/2-only mice available though, as well as second-hand dual USB/ps2 mice. The USB port on the Pi is for... plugging USB devices into the Pi. The Next won't do anything with those unless you write special software and run it at both the Pi and Next end. The warning not to connect anything is for the PI power port, which looks like a USB socket but isn't one. The Pi does not need external powering because it's powered by the Next. Plugging in random powered stuff into this power port bypasses the Next power regulators and power management chip, which is why the warning is there.

2) Alt cores: When the alt core authors have written them and made them available. None of them got their ks2 boards until you did, so they have only just started work on it. As soon as the first one is ready, there'll be a firmware release that enables users to load them. Until then it's disabled, because the file format of the ks1 alt cores didn't distinguish between the type of FPGA it should be run on, so you could actually brick your ks2 board by loading an old alt core intended for a ks1 board. The file format will be changed so that alt cores are safe to use everywhere.

3) Beeper volume: No. It's mixed in hardware with a fixed algorithm. Possibly it could be changed in future. The one thing you can do is Yellow NMI >> Settings >> Sound >> BEEPer = Int. This removes the nine AY channels, four DAC channels and two I2S Pi audio channels from the beeper mix, allowing it to be mixed much hotter without the risk of clipping.

4) HDMI colours: The HDMI output has pretty much perfect colours. I can't tell any difference between VGA, RGC and HDMI on my screen. You will see some people say they are slightly less saturated, but they are meaning by just a tiny tiny amount. What you are seeing is almost certainly some post-processing in the display. Lots of displays have game mode, cinema mode, natural lighting mode, extra sharpening, etc, that are turned on by default, and they really mess with the output from 80s micros. Turn all that stuff off, it's counterproductive.

5) Hardware: Yes, all the hardware is available from OUTs everwhere. Everytime you see a reference to nextreg x, y, REG x, y (writing) or y = REG x (reading) you can replace this with OUT 9275, x:OUT 9531, y (writing) or OUT 9275, x:y = IN 9531 (reading). The TAP and TZX loader screens have options to disable additional hardware, for the cases where internal Next hardware conflicts with what the program is expecting (just one example: lots of games make use of floating bus to sync the screen, by reading port 255, but the built in ULA-plus feature lets you read back ULA plus data on port 255, so we give you the ability to disable ULAplus). These disabling things happen when you pick 4 (48K mode), 1 (128K mode) or P (Pentagon mode) in the loaders options. But if you pick N (Next mode) you get the full hardware enabled.

6) 48K/128K assembly code: Yes, 48K/128K assembly code works just fine. There are a few Next-specific opcodes in the ED xx range, which is the traditional expansion space Zilog themselves used for Z180, Z800, Z280, Z380, and eZ80 (and also the third party Rabbit CPU family). Unless other undocumented opcodes, which have similar functionality in the prefixed and unprefixed space, the unused opcodes in the ED space are plain nops in a regular Z80. So they are not used for pathological NOPs in regular Z80 code nearly as much as undocumented real opcodes are. Of course it is possible for somebody to deliberately release a program that uses Next opcodes, and writesit so that it breaks on a Next or a new Zilog CPU, but works on a vanilla Z80. But this is a real edge case that would be done to make a point about compatibility, and such programs could be patched if you wanted to.

7) DAC playback: Yes, the Next has four 8bit DACs, and they can play back at any sampling rate up to about 48KHz that the player supports. You might be experiencing problems wit the tools rather than the hardware - .playwav only supports three specific formats, and hasn't been worked on for 3.5 years. Hopefully somebody will volunteer to write a more capable player. If you are talking about using PCM audio in your own programs, be aware that audacity export doesn't work that well for raw data. Maybe take a look at SoX, which can convert to raw 8 bit samples at any sample rate.

8) SD card tight: The SD socket on the board and the slot in the plastic case are actually fine. The problem is the Next-branded micro to full size adaptor, which is fatter than the SD association specifications describe. It's a manufacturing tolerance issue, and the samples the manufacturer gave to the Next team when the contract was signed did not have this problem. Most people are keeping their branded adaptor safe in the box, and using a Sandisk or Kingston adaptor for daily use. These are a much looser in the SD socket on the board.

9) Joystick mapping: The joystick menu on the boot screen is in two sections: always used and not used by NextZXOS. The joystick settings are in this second section. The intention is that you choose the joystick setting that's right for each game you are playing in the TAP/TZX/SNA/Z80 options screen, where it will be remembered next time you play that game. Since not every game has the same requirements, it makes more sense to remember this per game than have a global default. Press J for Joystick Settings on the loader screen to see your options. The thing you are finding inconvenient to do every time is just there as an extra, to allow you to change it on the fly if you need to for a specific reason. If you find yourself needing to go into the options screen a second time, after the options have been remembered for that game, do SYM+ENTER in the browser instead of ENTER.

10) RTC battery: It's a CR2032 lithium battery (non-rechargeable), and they just don't leak like old nicads do in Amigas etc. And they last for years, and just go dead without leaking when they die. You can of course remove it anyway, if you like. If you put something like this in your c:/nextzxOS/autoexec.bas then you would be able to set the clock on every boot, and it would be remembered until you next powered off and rerun the autoexec.bas.

Code: Select all

10 .nxtp time.nxtel.org 12300
20 ERASE

REM save with:
SAVE "c:/NextZXOS/autoexec.bas" LINE 10
Assuming you're in the UK you will get GMT or BST by default, taking summer time into account, If you are in any other zone you can ask for the time in your zone, as documented on the wiki.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
User avatar
sludge
Drutt
Posts: 33
Joined: Sat Feb 24, 2024 4:38 pm

Re: NEXT FAQ’s

Post by sludge »

Thanks for the heads up.

lots of useful info there.
flange
Drutt
Posts: 49
Joined: Tue Dec 12, 2023 5:27 pm

Re: NEXT FAQ’s

Post by flange »

I find the cheap and cheerful USB mouse as sold by the likes of Asda are PS2 compatible, unlike the expensive Logitech devices,and works well on my Atari STE which requires PS2 compatibility.

For example..

https://groceries.asda.com/product/comp ... 0370064353

Not advertising just showing one option, others are available.
Post Reply