Line 307 of validate20.cpp is wrong. It says "if (flags & 0x40)" but it should be "if (flags & 0x20)".
(There are also a few bugs in player20.cpp having to do with playback of files containing MIDI instruments, although you may consider that to be unimportant for MegaZeux.)
| Report ID | 777 | Title | Bug in validate20.cpp |
| Product | Archived MegaZeux Bugs | Status | Fixed (Severity 2 - Fair) |
| Version | GIT | Fixed in | GIT |
| Introduced In Version | GIT | Operating System | N/A |
Page 1 of 1
Report ID #777: Bug in validate20.cpp
Page 1 of 1
Replies (1 - 6)
#2
Lachesis
Posted 13 July 2019 - 06:49 PM
Updating status to: Confirmed
Updating severity to: 2 - Fair
Good catch, I'll fix this soon. I can patch the MIDI issues too, though I doubt MZX will ever support MIDI instruments.
For reference, the corresponding line in the original source is 151. Did you report this to Reality too? If not, I can go ahead report it to them. I'll also report it to AdPlug if needed, as last I checked they have a pending PR using their own modification of the original code.
Updating severity to: 2 - Fair
Good catch, I'll fix this soon. I can patch the MIDI issues too, though I doubt MZX will ever support MIDI instruments.
For reference, the corresponding line in the original source is 151. Did you report this to Reality too? If not, I can go ahead report it to them. I'll also report it to AdPlug if needed, as last I checked they have a pending PR using their own modification of the original code.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#3
zzo38
Posted 13 July 2019 - 09:01 PM
Lachesis, on 13 July 2019 - 11:49 AM, said:
Good catch, I'll fix this soon. I can patch the MIDI issues too, though I doubt MZX will ever support MIDI instruments.
- When loading a MIDI instrument in player20.cpp (in the Init function), it has "s += 6" even though it should be 5. (One byte is already skipped by "uint8_t alg = *s++;". In validate20.cpp, 6 is correct, since that byte is not already skipped.) (I don't know if this bug can potentially cause MegaZeux to crash.)
- In the PlayNote function, if it is a MIDI instrument, it will skip checking for a cmJumpToLine command. (This bug probably won't result in crashing, but will cause it to play rows that should be skipped.)
Quote
For reference, the corresponding line in the original source is 151. Did you report this to Reality too? If not, I can go ahead report it to them. I'll also report it to AdPlug if needed, as last I checked they have a pending PR using their own modification of the original code.
This post has been edited by zzo38: 13 July 2019 - 09:02 PM
In Capitalist America, law violates YOU!
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
"Potion of Confusing": Solve all the puzzles, hold second one as you hold a pencil, and save gibbering mouthers from the king's army.
#4
Lachesis
Posted 14 July 2019 - 01:22 AM
I've looked at all three issues. The tempo flag and MIDI instrument skip are pretty trivial fixes (and I think the latter is quite possibly a potential MZX crash), the MIDI instrument command check less so. I think the correct fix here might actually be to remove 709 through 713 and wrap 715 through 748 in an "if (inst->Algorithm < 7)" check. This would let the rest of the effects work too, though I think the only other effect that matters might be riffs (which I think can trigger other instruments).
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#5
Lachesis
Posted 21 July 2019 - 07:06 AM
I have an update on the MIDI loader bug. The player is actually correct and the documentation and validator are wrong; if you check the two example tracks provided by Reality or save a MIDI track with the official tracker, the MIDI instruments are 7 bytes long. There is an undocumented "volume" byte after the documented bytes.
The pull request for my fixes is here, but needs further verification for the MIDI effect issue. Both MIDI tracks provided with the official tracker also have custom BPM values so that issue is also verified fixed.
The pull request for my fixes is here, but needs further verification for the MIDI effect issue. Both MIDI tracks provided with the official tracker also have custom BPM values so that issue is also verified fixed.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#6
Lachesis
Posted 21 July 2019 - 08:11 PM
Updating status to: Fixed
Issue fixed in: GIT
Fixed in GIT 7ea4e8be and reported to Reality and Adplug (pending reply from either).
Issue fixed in: GIT
Fixed in GIT 7ea4e8be and reported to Reality and Adplug (pending reply from either).
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
Page 1 of 1
0 User(s) are reading this issue
0 Guests and 0 Anonymous Users
Powered by IP.Tracker 1.3.2 © 2026 IPS, Inc.

Help
This issue is locked
