Repository navigation
XTA: Restore the missing break in the WDXT-150 case - #7925
Merged
Merged
Conversation
The WDXT-150 case in xta_init_common() lost its break when the Amstrad PC3086 case was inserted between the end of that case's body and the break that used to terminate it, so setting up the standalone card fell straight through into the PC3086 case. Every value case 0 had just computed was overwritten, which discarded the IRQ and BIOS address settings from the card's own configuration dialog and replaced the BIOS image chosen by the BIOS Revision setting. Even at the dialog defaults the card loads roms/machines/pc3086/c800.bin instead of the selected WDXT-150 BIOS. The PC3086 machine is unaffected because it enters case 1 directly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adding the "WDXT-150 (XTA)" ISA controller to a machine discards its BIOS address and IRQ settings and loads the wrong ROM for whichever BIOS revision is selected. The card instead loads
roms/machines/pc3086/c800.binat 0xC8000 on IRQ 5, or fails to load any option ROM if the PC3086 machine's ROM set is absent.This is not limited to users who change a setting. At the dialog defaults (Revision 1.0, IRQ 5, C800H) the IRQ and BIOS address happen to match the values that get substituted, but the ROM file does not, so the card still loads the Amstrad image instead of
roms/hdd/xta/idexywd2.bin.The cause is a missing
break;in the per-controller-type switch inxta_init_common(). Case 0 at src/disk/hdc_xta.c:1030 setsdev->name,fnfrom the selected BIOS revision,dev->base,dev->irq,dev->rom_addranddev->dma, then falls straight through intocase 1, the Amstrad PC3086 case at src/disk/hdc_xta.c:1045, which overwrites every one of those values.fnis what gets loaded at src/disk/hdc_xta.c:1292, so the generic card ends up with the Amstrad machine's ROM image.dev->typeitself is not clobbered, so the later switch-byte encoding still takes the type 0 path at src/disk/hdc_xta.c:1127 and still readsbios_rev, pairing the switch table for the selected revision, revision 1 by default, with the PC3086 ROM. All line numbers here are on master, before the change.git show b5cb6ab894ac00e33e0d48eccb1a30f3810353ebshows where this came from: the PC3086 case was inserted between the end of case 0's body and thebreak;that used to terminate it, so thatbreak;now ends case 1 and case 0 has none. The generic card is reachable from the UI through the controller list at src/disk/hdc.c:74, while the PC3086 variant is only added by the machine itself at src/machine/m_amstrad.c:3078, so only the generic card is affected.This gives case 0 its own
break;again. Nothing else in the case needs to change, since case 0 already assigns everything it uses. Case 1 is entered directly for.local = 1, so PC3086 behaviour is identical.Clang reports the fall-through with
-Wimplicit-fallthrough, which is not in the default build flags:One warning before the change, none after, and no new warnings under plain
-Wall -Wextra.To check the effect without a full build, I compiled the switch body from both revisions into a small standalone harness with the config getters stubbed to return what the dialog returns. With Revision 2.0, IRQ 4 and CA00H selected, type 0 came out before the change as IRQ 5, ROM address 0C8000, file
roms/machines/pc3086/c800.bin, and after it as IRQ 4, ROM address 0CA000, fileroms/hdd/xta/infowdbios.rom; at the defaults only the file changed, fromroms/machines/pc3086/c800.bintoroms/hdd/xta/idexywd2.bin. Type 1 was identical both ways. This is a code-level check rather than a guest boot.Noticed while reading this but not changed here, since they look like separate decisions:
xta_wdxt150_pc3086_devicecarries.config = wdxt150_configeven though case 1 ignores every option in it, and it shares.internal_name = "xta_wdxt150"withxta_wdxt150_device.Checklist
References
Commit that introduced the fall-through: b5cb6ab - dated 2025-08-18, so the standalone card has been affected on master since then.
ROM files the card should be loading: https://github.com/86Box/roms/tree/master/hdd/xta