Need help from people with a +2A/+3

Started a topic here to get a broader reach, but will repost here with a more sophisticated description.

I’m trying to solve the mystery of the elusive floating bus on these machines, and no emulator (that I have) is of any help. In the program, I’m doing a simple port scan (port 4093) and see if I can fetch a bus value from it. Now, I’m going with what @chernandezba said in this thread, but FUSE, Retro Virtual Machine, and zesarUX alike seem to return different (and from my point of view, arbitrary) values.

I could simply detect which hardware my code is running on (I need to do this anyway), and skip ULA/bus polling on a +2A/3, but if @chernandezba’s observation is correct, I’d like to simply use a different port number for these machines, rather than cause my game run erratically or freeze altogether.

So, if anyone could help me out, I’d really appreciate it.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

A few Spectrum game fixes.
Thanked by 1weiv
«1345678

Comments

  • So you need people with a +2A/+3 run your test?
  • @chernandezba Exactly.
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • I'm interested in this as well. I remember making a (somewhat srs) test for this, here it is in case anyone's willing to try it

    Summary: hexadecimal values represent bytes read off the floating bus port, #0FFD in this case. Decimal values at the left may or may not correspond to T states at which these bytes are read. The listing should normally start from the point where a 'non-empty' value is read off the fb port for the first time. You can press 6 and 7 in the test, although there's probably little point. If the screen remains blank for more than a couple of minutes, this too should be considered a kind of result
    Thanked by 1weiv
  • I can try on my +3 later tonight if nobody else does earlier. I can run both the TAP and WAV files. Does it matter to load in either Loader(128k mode), or 48 Basic? I've also got divEnjoy, Smartcard interface, and Multiface 3 if any of those tools are needed.
  • Thanks! For the time being, it doesn’t matter whether you’re running it in 128K or 48K mode. As for the interfaces you have, I’ll be interested to see if having them attached makes any difference. But do start with a vanilla setup, i.e. no interfaces attached, and the audio fed to the input.
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Well, reports are coming in, and it doesn’t seem to be as cut and dried as @chernandezba suggests, unless I’m missing something.
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • For the time being, it doesn’t matter whether you’re running it in 128K or 48K mode.

    For the record, it's been mentioned in that thread that it only works with 128K paging enabled, i.e. either 128K or 'USR0' mode.

    Running my test should hopefully shed more light on this :)
  • D’oh, you’re right. Sorry, @Your Spec-chum . 128K mode only, for the time being.
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Hi mate I've first tried the wav file in both 128k Loader, and 48 Basic and I'm just getting a yellow bar about a quarter up from the bottom on the screen area. This is on white paper, and white border area. When I press any keys nothing seems to be happening, even holding them down doesn't get a response. I also tried the tap file with divEnjoy, and it gave the same results. Should it do something when the keys are pressed?
    Thanked by 1Ast_A_Moore
  • edited September 2017
    It's not what you asked for, and I don't have any original hardware, but maybe it's useful anyway.

    Out of all the emulators I tried, only SpecEmu gives me a flickering blue border as well as a yellow bar.

    Yet more arbitrary values, or has Woody based this on something?

    floating-bus-1.png?dl=1

    edit: Oh, and that only happens in 48K mode. Oops.
    Post edited by colonel32 on
    Robin Verhagen-Guest
    SevenFFF / Threetwosevensixseven / colonel32
    NXtel NXTP ESP Update ESP Reset CSpect Plugins
  • Hikaru wrote: »
    I'm interested in this as well. I remember making a (somewhat srs) test for this, here it is in case anyone's willing to try it

    Summary: hexadecimal values represent bytes read off the floating bus port, #0FFD in this case. Decimal values at the left may or may not correspond to T states at which these bytes are read. The listing should normally start from the point where a 'non-empty' value is read off the fb port for the first time. You can press 6 and 7 in the test, although there's probably little point. If the screen remains blank for more than a couple of minutes, this too should be considered a kind of result

    I'll give yours a try tomorrow and let you know the results.
  • Hi mate I've first tried the wav file in both 128k Loader, and 48 Basic and I'm just getting a yellow bar. . . . Should it do something when the keys are pressed?
    Thanks! Well, I thought the altered timing when you press a key would somehow make the blue bars appear in the border area. Then I could manually adjust the timing in software. But technically, this shouldn’t be necessary. (And it isn’t on any other Spectrum model.)
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • colonel32 wrote: »
    It's not what you asked for, and I don't have any original hardware, but maybe it's useful anyway.
    edit: Oh, and that only happens in 48K mode. Oops.
    Holy cow of Moscow! This is totally bizarre, as the behavior is opposite from from how @chernandezba describes it. According to his description, the blue border should only appear in 128K mode.

    Thanks for testing!
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Hikaru wrote: »
    I'm interested in this as well. I remember making a (somewhat srs) test for this, here it is in case anyone's willing to try it

    Summary: hexadecimal values represent bytes read off the floating bus port, #0FFD in this case. Decimal values at the left may or may not correspond to T states at which these bytes are read. The listing should normally start from the point where a 'non-empty' value is read off the fb port for the first time. You can press 6 and 7 in the test, although there's probably little point. If the screen remains blank for more than a couple of minutes, this too should be considered a kind of result

    I'll give yours a try tomorrow and let you know the results.

    Thank you. If there's anything similar to floating bus functionality on the +2A/+3 models, I believe it should pick up at least some of it. Ideally a screenshot of the screen with the numbers is preferrable, that is to say if the test makes it to that part (a couple minutes of delay at the beginning is normal though). If it doesn't, well, too bad!
  • edited September 2017
    This is what I get on ZEsarUX, by the way. The timings are way off and not all the values are correct, I believe. The pixel bytes are correct but duplicated, and attribute bytes have (as described) bit 0 set, but also duplicated.
    5cqqw.png
    Post edited by Ast_A_Moore on
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Forget ZEsarUX behaviour with floating bus port on +2A, it does an aproximation, not the real behaviour
    I did some tests in the past on my real +2A, as you may see on the video, but using Basic, not machine code. So the exact behaviour is still unknown for me.
    It has, some kind of a floating bus, but I still don't know exactly how it works
  • This is what I get on ZEsarUX, by the way. The timings are way off and not all the values are correct, I believe. The pixel bytes are correct but duplicated, and attribute bytes have (as described) bit 0 set, but also duplicated.
    5cqqw.png

    Some of it might have to do with ZEsarUX (not too keen on the duplicated values myself), and some of it might also have to do with this test. For one, I wasn't sure what the point of reference for timings should be when it comes to this sorta thing. I don't remember all the details but in the end I basically picked the most straightforward option, i.e. just print the T state at which the next command begins after an IN A,(C) at which a particular value was read. I was mainly testing it with the Spectrum 48 configuration in SpecEmu and that's what the T state numbers should correspond to. Idk whether this would translate well to a real +2A/+3. Like I said, semi serious :)

    As an aside, the test values are coded as %PXXX XXXL, which means:
    P: 1 if pixel byte, 0 if attribute
    X: character 1~32 from the left
    L: for pixel bytes: 0 if odd line, 1 if even line (ass backwards OK). However, this should always be 1 according to chernandezba.
  • Sorry to bother you all again @chernandezba and @Your Spec-chum and whoever else is willing to help me out. I’ve made some changes, so could you redownload and retest this, please? Thanks.

    Download link: Let’s go to the bar, take 2.
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Hikaru I've tried your test. I see the same what is shown in Ast_A_Moore sreenshot when loaded in the Loader 128k mode. The columns of addresses(I think) do change when either keys 6 or 7 are pressed. Once loaded there was a wait of about 5 seconds before the columns start to cascade and appear down the screen. In 48 Basic mode, only the top multi-coloured bar appears. I waited about a minute, but no columns appear below the bar like in 128k mode. If you need me to take a photo of the screen I can do that, I just need to sort out somewhere to upload photos as I only have free Photobucket account, which is now as good as a chocolate teapot.
    Thanked by 1Hikaru
  • My screenshot above is hosted on tinypic.com. It’s basically just a drag-and-drop service. No registration needed.
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Sorry to bother you all again @chernandezba and @Your Spec-chum and whoever else is willing to help me out. I’ve made some changes, so could you redownload and retest this, please? Thanks.

    Download link: Let’s go to the bar, take 2.

    I haven't run any recent test, apart from that video last year:
    https://www.worldofspectrum.org/forums/discussion/51886/

    I will try to run in on my +2A but need much time to do it, I'm too busy with ZEsarUX ;)
    Thanked by 1weiv
  • edited September 2017
    @Ast_A_Moore I've tried your 2nd version and this time I got the blue bar in the border on my +2a (in 128k mode only). It looks pretty much like it does in colonel32's picture above. The left hand side had a slight white line in it whereas the right was pretty much just solid, if that's of any relevance? I can try and take a pic if it's of any help.

    I've just realised that someone else has probably said pretty much the same thing in your other thread (which I should have probably checked first!). I guess two independent verifications are better than one, however! ;)
    Post edited by richl on
    Thanked by 1Ast_A_Moore
  • Thank you, @richl! No need to take a picture. Your description matches my expectations exactly.
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Hikaru I've tried your test. I see the same what is shown in Ast_A_Moore sreenshot when loaded in the Loader 128k mode. The columns of addresses(I think) do change when either keys 6 or 7 are pressed. Once loaded there was a wait of about 5 seconds before the columns start to cascade and appear down the screen. In 48 Basic mode, only the top multi-coloured bar appears. I waited about a minute, but no columns appear below the bar like in 128k mode. If you need me to take a photo of the screen I can do that, I just need to sort out somewhere to upload photos as I only have free Photobucket account, which is now as good as a chocolate teapot.

    Thanks again for taking the time. Well, seems like something's up. :) And yes I'd appreciate a photo as I want to confirm if it has the same fetch pattern as the Sinclair models after all, and if not, then how it is different. FWIW I'm normally using tinypic as well, which mostly works, I think.
    Spoiler:
  • Okay, I made an experimental version of A Yankee in Iraq that uses the floating bus for syncing on all Spectrum models. As a visual indicator, the ground level is extended into the border area (won’t be featured in the final release).

    Desired effect: the yellow border should remain more or less steadily on the same level as the ground; it may disappear when a sound is played.

    Undesired effect: it may occasionally jump above the ground level for an extremely brief period of time; may also cause some sprite flicker.

    Complete blunder: the game freezes (in 128K mode, that is).

    Download link: A Yankee in Iraq 1.0.2 Beta

    Ta!
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Bumbpity-bumb, @Your Spec-chum and @richl . See above.
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Here's a simple (and not very pretty!) test program that should sync to exact cycles on a +2A/+3 and read data from port #0FFD.

    https://1drv.ms/u/s!AmOOhLw8lDDygQTgACzb-YoUa2fp
  • Hey, @Woody do you have a +2A/3? Could you give the beta of my game a try (see two posts above)?
    Every man should plant a tree, build a house, and write a ZX Spectrum game.

    Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
    and zasm Z80 Assembler syntax highlighter.
    Member of the team that discovered, analyzed, and detailed the floating bus behavior on the ZX Spectrum +2A/+3.

    A few Spectrum game fixes.
  • Sorry, I don't have any real Spectrums these days. I've only tested my program under emulation to see if it helps with finding exactly what display/attribute data is returned on which cycle on real hardware if anyone can test it :)
  • Woody wrote: »
    Here's a simple (and not very pretty!) test program that should sync to exact cycles on a +2A/+3 and read data from port #0FFD.

    https://1drv.ms/u/s!AmOOhLw8lDDygQTgACzb-YoUa2fp

    Yeah, you're not quite a UI person :p

    So far, so meh :)
Sign In or Register to comment.