dMZX Forums: Bug in validate20.cpp -> Archived MegaZeux Bugs -> Tracker

Jump to content

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 GITOperating System N/A

Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Report ID #777: Bug in validate20.cpp

#1 User is offline  
zzo38 

  • Registered members
  • PipPipPip
  • Group: Members
  • Posts: 445
  • Joined: 16-May 08
  • Gender:Not Telling

Posted 13 July 2019 - 05:54 PM

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.)
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.


Page 1 of 1  
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Replies (1 - 6)

#2 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

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.
"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

#3 User is offline  
zzo38 

  • Registered members
  • PipPipPip
  • Group: Members
  • Posts: 445
  • Joined: 16-May 08
  • Gender:Not Telling

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.
Fixing it will at least allow files with MIDI instruments to load, and for the parts using FM to play back correctly, although the MIDI instruments will be silent. Although I mentioned the bugs elsewhere, I will also mention them here for reference:
  • 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.
I have not reported it to anyone else.

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.

#4 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

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

#5 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

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.
"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

#6 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

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).
"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

#7 User is offline  
Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,960
  • Joined: 12-October 00
  • Gender:Male

Posted 23 July 2019 - 12:37 AM

Moving to: Archived MegaZeux Bugs


Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

0 User(s) are reading this issue
0 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2026  IPS, Inc.