Ecernosoft Posted June 29, 2022 Share Posted June 29, 2022 Hi! So I'm no expert, ok? I've been working on It's Conner time! for the atari 7800 and wanted to include a POKEY soundtrack. But because I had trouble getting it to work on my 7800 emulator, I thought that maybe I had the header wrong. (I wanted POKEY at $800) So I tried doing a POKEY test for the 5200. But no matter what, all I could get is a simple beep. Does anyone have 5200 or 7800 source code (If it is a 7800 source code, please include the header!) for POKEY? Anything would work. I'm not sure what I'm doing wrong! What I tried to do was write Ax to AUDC0 and set AUDF0 to some random number. But instead of hearing a square wave, I got NOTHING. (I also had AUDCTL set to $00, that might be the problem) Just a simple plucking sound. I've never coded for POKEY so any help would be greatly appreciated! Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted June 29, 2022 Author Share Posted June 29, 2022 Basically, all I want to know is how to get a square wave and a noise wave with POKEY. Even just the hex values for AUDCx, and AUDTCL would work. (will setting AUDTCL to $00 work though?) What is weird is all the documentations on POKEY don't seem to work in my emulator, OR my 5200 one. To be sure, I tested Mountain king (5200) on my 5200 emulator and IT works... Quote Link to comment Share on other sites More sharing options...
Eagle Posted June 29, 2022 Share Posted June 29, 2022 Did you reset Pokey? lda #$03 sta skctl Quote Link to comment Share on other sites More sharing options...
Eagle Posted June 29, 2022 Share Posted June 29, 2022 (edited) example Pokey = $800 lda #$00 sta Pokey+$08 sta Pokey+$0F lda #$3 sta Pokey+$0F ldx #$08 lda #$00 loop sta Pokey,x dex bpl loop Edited June 29, 2022 by Eagle 1 Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted June 29, 2022 Author Share Posted June 29, 2022 (edited) 1 hour ago, Eagle said: Did you reset Pokey? lda #$03 sta skctl OOOOHHHHHHH!! (Gosh, it didn't say that in the documentary I used!!!) No I didn't. I will try. Yes, It works. Thanks. ? Edited June 29, 2022 by Ecernosoft Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted June 29, 2022 Author Share Posted June 29, 2022 Thanks. Yes, it now works. Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted June 29, 2022 Author Share Posted June 29, 2022 (edited) On the 5200 it does at least... Still can't get the 7800 to work. ? Edit: Now I've got it working on the 7800 using POKEY@450 but.... not the concerto. ( I do have a POKEY, an origonal POKEY, in my concerto) Edited June 30, 2022 by Ecernosoft Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted June 30, 2022 Share Posted June 30, 2022 Most 7800 homebrews want the POKEY to be at $450 or $4000 so you may have to tweak that. 2 Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted July 1, 2022 Author Share Posted July 1, 2022 ok. Well, I've been traveling and I don't have my 7800 with me at the moment.. ? Quote Link to comment Share on other sites More sharing options...
+Propane13 Posted December 27, 2022 Share Posted December 27, 2022 On 6/29/2022 at 2:10 PM, Eagle said: Did you reset Pokey? lda #$03 sta skctl I just ran into this exact same problem and was lucky enough to find this post-- the above 2 commands are the key to suddenly making everything work. I'll admit that I don't really understand the magic, though. According to the POKEY wikipedia page: Bit 0: Enable "debounce" scanning which is intended to eliminate noise or jitter from mechanical switches. A value of 1 enables POKEY to use an internal comparison register while scanning keys. A key must be detected in two simultaneous scans before it is identified as pressed, and it must be seen released for two consecutive scans to be considered released. This should be enabled to maintain normal keyboard handling with the Operating System. Bit 1: Set to 1 to enable keyboard scanning. This should be enabled to maintain normal keyboard handling with the Operating System. Those seem to have nothing to do with getting sound to play, but assuredly they must. Can anyone explain it? 1 Quote Link to comment Share on other sites More sharing options...
Eagle Posted December 27, 2022 Share Posted December 27, 2022 Quote 5.2 Initialization Power-up state POKEY does not have a RESET line and therefore powers up in indeterminate state. Although various circuits within the chip are biased toward particular states from a cold start, the initial state is not guaranteed and may include interrupts being enabled in IRQEN and asserted in IRQST. Thus, IRQEN must be reset prior to clearing the I bit on the CPU to avoid stray IRQs. Initialization mode Bits 0 and 1 of SKCTL normally control the keyboard scan and debounce features. However, clearing both of those bits also activates another initialization function, which resets various clocks and state machines throughout the chip. The following logic circuits are reset: • 15KHz clock • 64KHz clock • 4-bit and 5-bit polynomial noise generators • 9/17-bit polynomial noise generator (which includes RANDOM) • Serial port input state machine and shift register • Serial port output state machine • The SEROUT valid flip-flop • Keyboard scan (due to clearing bit 1) These circuits are held in reset state until initialization mode is exited. For instance, while SKCTL bits 0 and 1 are both cleared, any sound/timer channels using the 15KHz or 64KHz clocks will not count, as those clocks will be frozen, and RANDOM will lock at $FF. Initialization mode does not reset: 1 1 Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted December 27, 2022 Author Share Posted December 27, 2022 7 hours ago, Eagle said: Thanks!!!..... but I've already got this covered... In fact, right now I'm composing the music for ICT3. Conner&Anthony-atari8-800 (1).atr; use with an Atari 8bit emulator ConnerandAnthony_VB7.0.a; Source code Enjoy. 😃 Merry christmas! (Fun fact- I'm working on a full-screen video for Atari 8bit as well.) 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.