<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://7800.8bitdev.org/index.php?action=history&amp;feed=atom&amp;title=Detecting_POKEY</id>
		<title>Detecting POKEY - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://7800.8bitdev.org/index.php?action=history&amp;feed=atom&amp;title=Detecting_POKEY"/>
		<link rel="alternate" type="text/html" href="https://7800.8bitdev.org/index.php?title=Detecting_POKEY&amp;action=history"/>
		<updated>2026-05-13T03:26:09Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://7800.8bitdev.org/index.php?title=Detecting_POKEY&amp;diff=93&amp;oldid=prev</id>
		<title>MSaarna at 23:48, 7 November 2015</title>
		<link rel="alternate" type="text/html" href="https://7800.8bitdev.org/index.php?title=Detecting_POKEY&amp;diff=93&amp;oldid=prev"/>
				<updated>2015-11-07T23:48:29Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 23:48, 7 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot; &gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following code (taken from 7800Basic, and originally adapted from [http://atariage.com/forums/topic/146725-detecting-pokey/ GroovyBee's POKEY detection routine]) checks both common POKEY locations ($450, and $4000) for the presence of a POKEY chip.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following code (taken from 7800Basic, and originally adapted from [http://atariage.com/forums/topic/146725-detecting-pokey/ GroovyBee's POKEY detection routine]) checks both common POKEY locations ($450, and $4000) for the presence of a POKEY chip.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The code requires a pair of zero page locations (pokeybaselo and pokeybasehi) and another location (pokeydetected). If a POKEY chip is found, pokeydetected=0 and (pokeybaselo) will point at the POKEY memory location, through which you can access the POKEY registers indirectly.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The code requires a pair of zero page locations (pokeybaselo and pokeybasehi) and another location (pokeydetected). If a POKEY chip is found, pokeydetected=0 and (pokeybaselo) will point at the POKEY memory location, through which you can access the POKEY registers indirectly&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;. The POKEY will be left in an initialized ready-to-use state&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MSaarna</name></author>	</entry>

	<entry>
		<id>https://7800.8bitdev.org/index.php?title=Detecting_POKEY&amp;diff=89&amp;oldid=prev</id>
		<title>MSaarna: Created page with &quot;==Detection Code for POKEY in different locations==  The following code (taken from 7800Basic, and originally adapted from [http://atariage.com/forums/topic/146725-detecting-p...&quot;</title>
		<link rel="alternate" type="text/html" href="https://7800.8bitdev.org/index.php?title=Detecting_POKEY&amp;diff=89&amp;oldid=prev"/>
				<updated>2015-11-07T23:02:09Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Detection Code for POKEY in different locations==  The following code (taken from 7800Basic, and originally adapted from [http://atariage.com/forums/topic/146725-detecting-p...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Detection Code for POKEY in different locations==&lt;br /&gt;
&lt;br /&gt;
The following code (taken from 7800Basic, and originally adapted from [http://atariage.com/forums/topic/146725-detecting-pokey/ GroovyBee's POKEY detection routine]) checks both common POKEY locations ($450, and $4000) for the presence of a POKEY chip.&lt;br /&gt;
&lt;br /&gt;
The code requires a pair of zero page locations (pokeybaselo and pokeybasehi) and another location (pokeydetected). If a POKEY chip is found, pokeydetected=0 and (pokeybaselo) will point at the POKEY memory location, through which you can access the POKEY registers indirectly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; Pokey register relative locations, since its base may be different&lt;br /&gt;
; depending on the hardware.&lt;br /&gt;
PAUDF0   = $0    ; extra audio channels and frequencies&lt;br /&gt;
PAUDC0   = $1&lt;br /&gt;
PAUDF1   = $2&lt;br /&gt;
PAUDC1   = $3&lt;br /&gt;
PAUDF2   = $4&lt;br /&gt;
PAUDC2   = $5&lt;br /&gt;
PAUDF3   = $6&lt;br /&gt;
PAUDC3   = $7&lt;br /&gt;
PAUDCTL  = $8    ; Audio Control&lt;br /&gt;
PRANDOM  = $A    ; 17 bit polycounter pseudo random&lt;br /&gt;
PSKCTL   = $F    ; Serial Port control&lt;br /&gt;
&lt;br /&gt;
detectpokeylocation&lt;br /&gt;
         ;XBoard/XM...&lt;br /&gt;
         lda #%00010000&lt;br /&gt;
         sta $470 ; tell XCTRL to enable the POKEY&lt;br /&gt;
         ldx #1&lt;br /&gt;
detectpokeyloop&lt;br /&gt;
         lda POKEYCHECKLO,x&lt;br /&gt;
         sta pokeybaselo&lt;br /&gt;
         lda POKEYCHECKHI,x&lt;br /&gt;
         sta pokeybasehi&lt;br /&gt;
         jsr checkforpokey&lt;br /&gt;
         lda pokeydetected&lt;br /&gt;
         beq foundpokeychip&lt;br /&gt;
         dex&lt;br /&gt;
         bpl detectpokeyloop&lt;br /&gt;
foundpokeychip&lt;br /&gt;
         sta pokeydetected&lt;br /&gt;
         rts&lt;br /&gt;
&lt;br /&gt;
POKEYCHECKLO&lt;br /&gt;
        .byte &amp;lt;$4000, &amp;lt;$0450&lt;br /&gt;
POKEYCHECKHI&lt;br /&gt;
        .byte &amp;gt;$4000, &amp;gt;$0450&lt;br /&gt;
&lt;br /&gt;
checkforpokey&lt;br /&gt;
         ldy #$0f&lt;br /&gt;
         lda #$00&lt;br /&gt;
         sta pokeydetected&lt;br /&gt;
resetpokeyregistersloop&lt;br /&gt;
         sta (pokeybase),y&lt;br /&gt;
         dey&lt;br /&gt;
         bpl resetpokeyregistersloop&lt;br /&gt;
&lt;br /&gt;
         ldy #PAUDCTL&lt;br /&gt;
         sta (pokeybase),y&lt;br /&gt;
         ldy #PSKCTL&lt;br /&gt;
         sta (pokeybase),y&lt;br /&gt;
&lt;br /&gt;
         ; let the dust settle...&lt;br /&gt;
         nop&lt;br /&gt;
         nop&lt;br /&gt;
         nop&lt;br /&gt;
&lt;br /&gt;
         ; we're in reset, so the RANDOM register should read $ff...&lt;br /&gt;
         ldy #PRANDOM&lt;br /&gt;
         lda (pokeybase),y&lt;br /&gt;
         cmp #$ff&lt;br /&gt;
         bne nopokeydetected&lt;br /&gt;
&lt;br /&gt;
         ; take pokey out of reset...&lt;br /&gt;
         ldy #PSKCTL&lt;br /&gt;
         lda #3&lt;br /&gt;
         sta (pokeybase),y&lt;br /&gt;
         ldy #PAUDCTL&lt;br /&gt;
         lda #0&lt;br /&gt;
         sta (pokeybase),y&lt;br /&gt;
&lt;br /&gt;
         ; let the dust settle again...&lt;br /&gt;
         nop&lt;br /&gt;
         nop&lt;br /&gt;
         nop&lt;br /&gt;
&lt;br /&gt;
         ; we're out of reset, so RANDOM should read non-$ff...&lt;br /&gt;
         ldy #PRANDOM&lt;br /&gt;
         lda (pokeybase),y&lt;br /&gt;
         cmp #$ff&lt;br /&gt;
         beq checkpokeyoncemore ;one $ff might be a fluke. try again...&lt;br /&gt;
         rts&lt;br /&gt;
&lt;br /&gt;
checkpokeyoncemore&lt;br /&gt;
         lda (pokeybase),y&lt;br /&gt;
         cmp #$ff&lt;br /&gt;
         beq nopokeydetected&lt;br /&gt;
         rts&lt;br /&gt;
&lt;br /&gt;
nopokeydetected&lt;br /&gt;
         dec pokeydetected&lt;br /&gt;
         rts&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>MSaarna</name></author>	</entry>

	</feed>