Synthpopalooza Posted November 23, 2020 Author Share Posted November 23, 2020 Double POKEY preview! This is the famous Brinstar theme from the NES metroid. Here is the desired setup: POKEY1: AUDCTL1=$78 00 and 01 - $Cx 16-bit (sawtooth, harmony, RMT E) 02 and 03 - $Cx 16-bit (sawtoth, lead, RMT E) POKEY2: AUDCTL2=$50 00 and 01 - $Ax square 16-bit (bass) 02 - $8x 8-bit percussion 03 - free I am still enlisting help in rendering code to play double POKEY ... a new SD cart called dragonfly which has double POKEY, plus Covox (for samples) is the target hardware. Below is a rendered mixed wav using output from two Prosystem emulators. Advantages to double POKEY: You can play four 16-bit channels in all distortions without tuning errors. The $Cx channels make a reasonable emulation of the NES pulse wave, while $Ax stands in for the triangle channel. One 8-bit channel for percussion, and one 8-bit channel is free for sound fx. Fingers crossed this comes off ... Also including, code for the two POKEY's, seperately. These should be played in Prosystem. The goal is to merge these two into a single double POKEY binary, with POKEY1 at $440 and POKEY2 at $450. metroid - atari.wav metroid - nes.wav metroid-brinstar-bass-perc.A78 metroid-brinstar-bass-perc.asm metroid-brinstar-lead-harmony.A78 metroid-brinstar-lead-harmony.asm 3 Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted November 23, 2020 Author Share Posted November 23, 2020 In the planning: Double POKEY for the "Deep Brinstar" Metroid music. This one will use double 16-bit and double hi pass filter on the first POKEY. While this will eat up all 4 channels on POKEY1, the SID like swirling effects will be worth it! ? Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted November 29, 2020 Author Share Posted November 29, 2020 Another preliminary double POKEY preview ... the famous Krayt lair music from Metroid. The planned setup: POKEY 1: AUDCTL=$7A (double 16-bit, 1.79 mhz on 0 and 2, plus hi pass filter channel 3 over channel 1) 00 and 01 - $Ax 16 bit - lead 02 and 03 - silent - filter modulation over first two channels POKEY 2: AUDCTL=$50 (16-bit on 0 and 1, 1.79 mhz on 0) 00 and 01 - $Ax 16-bit bass 02 - $Ax standard - lead 03 - $Ax standard - delayed lead How this works: On POKEY 1, we burn all four channels to make a SID type filter in 16-bit. Notes from the $Ax 16-bit table are played, but transposed down an octave. The same notes are also played in the filtered channels 02 and 03, but stepped up by 2, to make the swirling filter. 0's are introduced into all four channels, to control the swirling effect. This makes for a better effect than 8-bit mode, because you have finer control over the modulation. On POKEY 2, we have a 16-bit $Ax bass on the first two channels. The lead on the third channel is a standard $Ax square in 8-bit, and the 4th plays the same as the third channel, but decreased in volume and delayed by 8 cycles, to make an echo delay like in the original NES tune. Emulator issues: Only happens with POKEY1. Prosystem won't do the filtering and plays it an octave too low. A7800 plays it exactly like real hardware. POKEY2, both emulators play without error. Attached are binaries for POKEY1 and POKEY2. Also $450 binaries. Please test on real hardware. Also: A mixed .wav from Altirra emulator, what it should sound like with a double POKEY binary. Again, the goal will be to merge the two binaries into one binary, with POKEYs located at $440 and $450, for testing on the dragonfly cart. An.y ideas on how to do this would be appreciated metroid-krayt-bass-lead.A78 metroid-krayt-bass-lead.asm metroid-krayt-bass-lead.bin metroid-krayt-bass-lead-450.A78 metroid-krayt-bass-lead-450.asm metroid-krayt-bass-lead-450.bin metroid-krayt-filtered-lead.asm metroid-krayt-filtered-lead-450.A78 metroid-krayt-filtered-lead-450.asm metroid-krayt-filtered-lead-450.bin metroid-krayt-filtered-lead.A78 metroid - krayt's lair - double pokey mix.wav 1 Quote Link to comment Share on other sites More sharing options...
+Pat Brady Posted November 29, 2020 Share Posted November 29, 2020 18 minutes ago, Synthpopalooza said: Again, the goal will be to merge the two binaries into one binary, with POKEYs located at $440 and $450, for testing on the dragonfly cart. An.y ideas on how to do this would be appreciated Sounds great! I think the easiest way to merge the players is replace all of the labels (both definitions and references) with specialized labels and update the main loop to call both players. Not beautiful or space-efficient, but that's okay for a gameless audio player. I can take a stab at that if you want. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted November 29, 2020 Author Share Posted November 29, 2020 Yes, if you would ... just remember we'll need duplicates for AUDCTL, AUDCx, AUDFx, SKCTLS, and STIMER (should we need to reset polycounters on both POKEY's) ... for now, we can probably just ignore updating the POLY reset code. This is just for demo purposes. If someone then decides to port Metroid to 7800 using double POKEY, then we'll need to rethink things Quote Link to comment Share on other sites More sharing options...
rj1307 Posted November 29, 2020 Share Posted November 29, 2020 On real hardware it sounds very good, I only have a note for Pokey files for $0450 - the header is wrong and the cartridge is trying to play music for $4000. You have to set $0x36 in the header to 40 and you'll be fine. Quote Link to comment Share on other sites More sharing options...
gambler172 Posted November 29, 2020 Share Posted November 29, 2020 15 minutes ago, rj1307 said: On real hardware it sounds very good, I only have a note for Pokey files for $0450 - the header is wrong and the cartridge is trying to play music for $4000. You have to set $0x36 in the header to 40 and you'll be fine. Hi Rafal i see,you checked it Quote Link to comment Share on other sites More sharing options...
rj1307 Posted November 29, 2020 Share Posted November 29, 2020 Corrected files in the attachment. metroid-krayt-bass-lead-450.A78 metroid-krayt-filtered-lead-450.A78 1 Quote Link to comment Share on other sites More sharing options...
+Pat Brady Posted November 29, 2020 Share Posted November 29, 2020 14 hours ago, Synthpopalooza said: Yes, if you would ... just remember we'll need duplicates for AUDCTL, AUDCx, AUDFx, SKCTLS, and STIMER (should we need to reset polycounters on both POKEY's) ... for now, we can probably just ignore updating the POLY reset code. This is just for demo purposes. If someone then decides to port Metroid to 7800 using double POKEY, then we'll need to rethink things Right, need to do those POKEY labels and also the code that uses them. I don't see any STIMER — is that the same as RANDOM? The real problem is that the .a78 header format does not currently support dual-POKEY. It supports POKEY@450 and POKEY@4000, but even if we enable both, I doubt a7800 or Dragonfly will treat those as separate POKEY chips. I know some single-POKEY games blindly write to both sets of addresses for maximum compatibility. @RevEng any thoughts? Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted November 29, 2020 Author Share Posted November 29, 2020 STIMER is only used when we do polycounter resets, when using $Cx distortion mod 3 notes. It randomly outputs 3 timbres unless you do polycounter reset before each note play. It's at $459 or $4009 using conventional 7800 mappings. I may have a solution ... someone on the 8-bit forum has coded a dual POKEY modification. Will post this momentarily. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted November 29, 2020 Author Share Posted November 29, 2020 (edited) This post: It's an. xex 8-bit binary. Will check tonight after work. Do you think this can be modified for our purposes, putting POKEY at $440 and $450? Yes, dragonfly specifically requires $440 and $450 for both POKEYs. Edited November 29, 2020 by Synthpopalooza Quote Link to comment Share on other sites More sharing options...
RevEng Posted November 29, 2020 Share Posted November 29, 2020 3 hours ago, Pat Brady said: The real problem is that the .a78 header format does not currently support dual-POKEY. It supports POKEY@450 and POKEY@4000, but even if we enable both, I doubt a7800 or Dragonfly will treat those as separate POKEY chips. I know some single-POKEY games blindly write to both sets of addresses for maximum compatibility. @RevEng any thoughts? Yeah, for sure. This would require a new bit allocated in the a78 header, and emulator+device support coded. While it's doable for a7800 in theory, I don't have time to take it on right now. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted November 30, 2020 Author Share Posted November 30, 2020 5 hours ago, RevEng said: Yeah, for sure. This would require a new bit allocated in the a78 header, and emulator+device support coded. While it's doable for a7800 in theory, I don't have time to take it on right now. Can we still get a .bin file that will work on real hardware? If so, I don't mind a bit to keep cross developing on Altirra like I have been, and then test it on real HW. Emulator support for double POKEY would be great down the road, once we have a stable POKEY emulation in A7800. Quote Link to comment Share on other sites More sharing options...
RevEng Posted November 30, 2020 Share Posted November 30, 2020 I don't see why you couldn't. It should just be a matter of changing your double pokey driver to access the pokeys where dragonfly has them. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted November 30, 2020 Author Share Posted November 30, 2020 So anyway, here's the code ... Atari XL .asm and executable. This requires Altirra emulator or real double POKEY Atari 8-bit The only step now, is to convert this from Atari XL .asm to 7800 .asm, and I think we're a go. krayt.zip Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted November 30, 2020 Author Share Posted November 30, 2020 Also next demo: Double POKEY using double SKCTL mode ... SKCTL two tone over two POKEYs ... Quote Link to comment Share on other sites More sharing options...
+Pat Brady Posted November 30, 2020 Share Posted November 30, 2020 (edited) On 11/29/2020 at 9:00 PM, Synthpopalooza said: Can we still get a .bin file that will work on real hardware? If so, I don't mind a bit to keep cross developing on Altirra like I have been, and then test it on real HW. Emulator support for double POKEY would be great down the road, once we have a stable POKEY emulation in A7800. On 11/29/2020 at 9:43 PM, RevEng said: I don't see why you couldn't. It should just be a matter of changing your double pokey driver to access the pokeys where dragonfly has them. OK, I will continue with it, hope to find time tomorrow to finish it. EDIT: I got it to a point where it can be tested. One of the routines works correctly, the other doesn't. I will sort that out. Edited December 1, 2020 by Pat Brady 2 Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted December 5, 2020 Author Share Posted December 5, 2020 On 11/30/2020 at 12:51 AM, Pat Brady said: OK, I will continue with it, hope to find time tomorrow to finish it. EDIT: I got it to a point where it can be tested. One of the routines works correctly, the other doesn't. I will sort that out. Meantime: I may have a go at porting the .xex assembly source I now have, to 7800 and see where that gets me as well. We're close ... I fully expect double POKEY games to come from these experiments, now. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted December 8, 2020 Author Share Posted December 8, 2020 OK, I think I have hacked out something ... including the .bin and .a78 files Someone try putting this into Dragonfly and see what we get. If this doesn't work, attached is the source .asm to hack around with and see what's going on metroid-brinstar-lead-harmony-dblpokey.A78 metroid-brinstar-lead-harmony-dblpokey.asm metroid-brinstar-lead-harmony-dblpokey.bat metroid-brinstar-lead-harmony-dblpokey.bin Quote Link to comment Share on other sites More sharing options...
Trebor Posted March 31, 2022 Share Posted March 31, 2022 @Synthpopalooza when you have the opportunity, try giving your demos a listen under the newly released v5.0 of A7800. Previously noted issues have been rectified and thank you for providing them. They were leveraged as part of the testing towards the improved POKEY emulation. Huge thanks to @RevEng as he performed his magic once again. 1 1 Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted April 1, 2022 Author Share Posted April 1, 2022 Eager to test 3 Quote Link to comment Share on other sites More sharing options...
+-^CrossBow^- Posted April 1, 2022 Share Posted April 1, 2022 I will try and give the latest build of EXO a try under v5.0 also since the previous ones did have some offness about them in regards to pokey music. 3 Quote Link to comment Share on other sites More sharing options...
Trebor Posted April 1, 2022 Share Posted April 1, 2022 46 minutes ago, -^CrossBow^- said: I will try and give the latest build of EXO a try under v5.0 also since the previous ones did have some offness about them in regards to pokey music. @Muddyfunster recommended. 2 Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted April 1, 2022 Author Share Posted April 1, 2022 My power was out for 11 hours today. ? Can't try it yet ... 3 Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted April 2, 2022 Author Share Posted April 2, 2022 OK, the verdict: Much improved! There are still a few minor imperfections, but nothing that makes the ears bleed too much ... I listened to Bubble Bobble ... the inaccuracy with this one, happens when you use $2x distortion at 1.79 mhz. It plays the channel an octave too high. I may also check any tunes that use $Cx distortion the same way. EXO area 1, area 2, area 3, area 4, and area 5 ... sound a lot closer to the actual hardware. On area 1, there are still a few high pitched tings that show up on the $2x hi pass channel. On area 2, a bit closer, though the two tone channel on $4x has a few inaccuracies, and the fuzz distortion isn't there. But it does sound a lot more pleasant to listen to! Improvement Area 5 ... the same issues with the $2x 1.79 channel (octave too high) and some of the two tone notes miss a little bit. But it is sounding a lot better! On area 3, the 1.79+64 two tone $Ax distortion: The CSAVE bell sound is perfect, when it gets to the saw wave table though, there are a few notes that still miss some. Everything else is great. Area 4: Wow. You got that crunchy sounds on $4x 1.79 plus 15khz two tone, and those guitars. Still a bit of tinging going on there, but otherwise great! I'll go through all my examples when I get more time, and compile a list. So far, everything is much better! Oh also: two-tone mode with $Ax distortion at the standard 64khz clock, sounds 100% like real hardware. You have nailed that perfectly, no issues at all! Bravo ... I tested it with the Zanac music. 4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.