Matchlocks? didn't. Matchlocks existed for about a 100-200 years in countries like china, japan, france, "turkey" before guns started showing up a lot in the battlefields.
If you are thinking about muskets and the more modern weapons, you are really misthinking how much research would go into...