 D r a g o n   3 2   ( a n d   6 4 )   E n h a n c e d   R O M s   v 3 . 0 
 
 B y   S t e p h e n   J   W o o l h a m . 
 
 1 0 t h   J a n u a r y ,   2 0 1 2 . 
 
 
 
 
 
 T h e s e   e n h a n c e d   D r a g o n   3 2 / 6 4   B A S I C   R O M s   h a v e   t h e   f o l l o w i n g   e n h a n c e m e n t s : 
 
 
 
 *   	 A p p l i e d   a l l   k n o w n   d o c u m e n t e d   a n d   u n d o c u m e n t e d   D r a g o n   3 2 / 6 4   b u g   f i x e s 
 
 * 	 S u p p o r t   f o r   b o t h   p a d d e d   ( X = U S R 0 1 ( X ) )   a n d   u n p a d d e d   ( X = U S R 1 ( X ) )   U S R   c a l l s 
 
 * 	 I m p r o v e d   k e y b o a r d   a u t o - r e p e a t   r o u t i n e   f o r   D 6 4   R O M s 
 
 * 	 A d d e d   i m p r o v e d   D 6 4   k e y b o a r d   a u t o - r e p e a t   r o u t i n e   t o   D 3 2   R O M 
 
 * 	 A d d e d   t h e   a b i l i t y   t o   t o g g l e   k e y b o a r d   a u t o - r e p e a t   o n / o f f   w i t h   D L O A D   c o m m a n d   o n   D 3 2   a n d   D 6 4   i n   3 2 K   M o d e 
 
 * 	 I m p r o v e d   k e y b o a r d   r o u t i n e   w i t h   u s e r   s e l e c t a b l e   ' E n h a n c e d   M o d e '   f o r   f a s t e r   t y p i n g   w i t h o u t   m i s s i n g   k e y s 
 
 * 	 A d d e d   t h e   a b i l i t y   t o   e a s i l y   d i s a b l e   a n y   D O S   o r   g a m e   c a r t r i d g e   a t   p o w e r - o n   o r   a f t e r   a   h a r d w a r e   r e s e t 
 
 * 	 I m p r o v e d   P C L E A R   c o m m a n d   ( P C L E A R   0   - >   m a x i m u m   f r e e   m e m o r y   l i m i t ) 
 
 * 	 P a t c h e d   j o y s t i c k   r o u t i n e   t o   h e l p   p r e v e n t   b a c k g r o u n d   n o i s e   ( c l i c k i n g )   w h e n   p l a y i n g   s o m e   m / c   g a m e s 
 
 	 ( O n l y   e f f e c t i v e   w h e n   g a m e s   c a l l   t h e   j o y s t i c k   r o u t i n e   v i a   $ 8 0 1 2   o r   i n d i r e c t l y   v i a   $ A 0 0 A ) 
 
 * 	 S u p p o r t   f o r   6 3 x 0 9 e   e r r o r   t r a p p i n g 
 
 
 
 
 
 T h e   i m p r o v e d   k e y b o a r d   r o u t i n e 
 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 T h e   k e y b o a r d   r o u t i n e   h a s   b e e n   m o s t l y   r e w r i t t e n   a n d   n o w   f e a t u r e s   a   u s e r   s e l e c t a b l e   e n h a n c e d   m o d e .   T h e   e n h a n c e d   m o d e   i s 
 
 d e s i g n e d   t o   a l l o w   f o r   f a s t e r   t y p i n g   w i t h o u t   m i s s i n g   k e y s .   T h e   d e f a u l t   m o d e   i s   1 0 0 %   c o m p a t i b l e   w i t h   t h e   o r i g i n a l   D 3 2 / 6 4 
 
 k e y b o a r d   r o u t i n e . 
 
 
 
 ( 1 )   T h e   e n h a n c e d   m o d e   o n   i t s   o w n   o r   w i t h   t h e   k e y b o a r d   a u t o - r e p e a t   i s   i d e a l   f o r   s o f t w a r e   d e v e l o p m e n t   a n d   o t h e r   p r o j e c t s 
 
         w h e r e   a   l o t   o f   t y p i n g   i s   r e q u i r e d .   I t   c a n   a l s o   b e   u s e d   w i t h   g a m e s   a n d   o t h e r   s o f t w a r e   t h a t   u s e   t h e   k e y b o a r d   r o u t i n e 
 
         l o c a t e d   w i t h i n   t h e   D r a g o n   B A S I C   R O M .   N o   m o r e   m i s s e d   k e y s ! ! ! 
 
 
 
 ( 2 )   P O K E 1 5 2 , 2 5 5   t o   e n a b l e   t h e   e n h a n c e d   k e y b o a r d   m o d e .   P O K E 1 5 2 , 0   t o   d i s a b l e   ( d e f a u l t ) . 
 
 
 
 ( 3 )   E n h a n c e d   k e y b o a r d   m o d e   i s   a u t o m a t i c a l l y   e n a b l e d   w h e n   k e y b o a r d   a u t o - r e p e a t   i s   t u r n e d   o n . 
 
 
 
 
 
 
 
 T h e   i m p r o v e d   k e y b o a r d   a u t o - r e p e a t   r o u t i n e 
 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 T h e   n e w   k e y b o a r d   a u t o - r e p e a t   r o u t i n e   i s   D O S   c o m p a t i b l e   w h e n   t u r n e d   o n / o f f   u s i n g   t h e   D L O A D   c o m m a n d . 
 
 
 
 ( 1 )   D L O A D   c o m m a n d   c a n   b e   u s e d   t o   t o g g l e   t h e   k e y b o a r d   a u t o - r e p e a t   o n / o f f   o n   D 3 2   a n d   D 6 4   i n   3 2 K   m o d e . 
 
         ( N o r m a l   D L O A D   c o m m a n d   f u n c t i o n   i s   r e t a i n e d   o n   D 6 4   i n   6 4 K   m o d e ) 
 
 
 
 ( 2 )   A l t h o u g h   t h e   k e y b o a r d   a u t o - r e p e a t   c a n   s t i l l   b e   t u r n e d   o n   b y   t h e   v e r y   s a m e   p o k e s   l i s t e d   i n   t h e   D r a g o n   6 4   s u p p l e m e n t 
 
         i t   i s   b e s t   t o   s e t   u p   t h e   I R Q   v e c t o r   t o   p o i n t   t o   t h e   r o u t i n e   a t   $ 9 F F 0   ( $ D F F 0   i n   6 4 K   m o d e )   i f   y o u   p r e f e r   t o   u s e   y o u r 
 
         o w n   p r o g r a m   r a t h e r   t h a n   t h e   D L O A D   c o m m a n d .   T h e   e x t r a   c o d e   a t   $ 9 F F 0   b y p a s s e s   t h e   k e y b o a r d   a u t o - r e p e a t   c o d e   w h e n e v e r 
 
         a   P L A Y   o r   S O U N D   c o m m a n d   i s   i n   u s e   t o   p r e v e n t   s o u n d   d i s t o r t i o n . 
 
 
 
 H e r e   a r e   a   f e w   e x a m p l e s   o f   h o w   t o   s a f e l y   t u r n   o n / o f f   t h e   k e y b o a r d   a u t o - r e p e a t   f r o m   w i t h i n   y o u r   o w n   p r o g r a m : 
 
 
 
 [ D r a g o n   3 2   a n d   D r a g o n   6 4   i n   3 2 K   m o d e ] 
 
 	 	 
 
 1 0   ' E N A B L E   K E Y B O A R D   A U T O - R E P E A T 
 
 2 0   ' 
 
 3 0   I F   P E E K ( & H 1 0 D ) + P E E K ( & H 1 0 E ) = 3 9 9   T H E N 8 0 
 
 4 0   P O K E & H F F 0 3 , P E E K ( & H F F 0 3 ) A N D & H F E 
 
 5 0   P O K E & H 1 1 D , P E E K ( & H 1 0 D ) : P O K E & H 1 1 E , P E E K ( & H 1 0 E ) 
 
 6 0   P O K E & H 1 0 D , & H 9 F : P O K E & H 1 0 E , & H F 0 
 
 7 0   P O K E & H F F 0 3 , P E E K ( & H F F 0 3 ) O R 1 
 
 8 0   C L S : P R I N T " K E Y B O A R D   A U T O - R E P E A T   E N A B L E D . . . " 
 
 
 
 1 0   ' D I S A B L E   K E Y B O A R D   A U T O - R E P E A T 
 
 2 0   ' 
 
 3 0   I F   P E E K ( & H 1 0 D ) + P E E K ( & H 1 0 E ) < > 3 9 9   T H E N 8 0 
 
 4 0   P O K E & H F F 0 3 , P E E K ( & H F F 0 3 ) A N D & H F E 
 
 5 0   P O K E & H 1 0 D , P E E K ( & H 1 1 D ) : P O K E & H 1 0 E , P E E K ( & H 1 1 E ) 
 
 6 0   P O K E & H F F 0 3 , P E E K ( & H F F 0 3 ) O R 1 
 
 7 0   P O K E 1 5 2 , 0 
 
 8 0   C L S : P R I N T " K E Y B O A R D   A U T O - R E P E A T   D I S A B L E D . . . " ; 
 
 
 
 
 
 [ D r a g o n   6 4   i n   6 4 K   m o d e ] 
 
 
 
 1 0   ' E N A B L E   K E Y B O A R D   A U T O - R E P E A T 
 
 2 0   ' 6 4 K   M O D E 
 
 3 0   ' 
 
 4 0   I F   P E E K ( & H 1 0 D ) + P E E K ( & H 1 0 E ) = 4 6 3   T H E N 9 0 
 
 5 0   P O K E & H F F 0 3 , P E E K ( & H F F 0 3 ) A N D & H F E 
 
 6 0   P O K E & H 1 1 D , P E E K ( & H 1 0 D ) : P O K E & H 1 1 E , P E E K ( & H 1 0 E ) 
 
 7 0   P O K E & H 1 0 D , & H D F : P O K E & H 1 0 E , & H F 0 
 
 8 0   P O K E & H F F 0 3 , P E E K ( & H F F 0 3 ) O R 1 
 
 9 0   C L S : P R I N T " K E Y B O A R D   A U T O - R E P E A T   E N A B L E D . . . " 
 
 
 
 1 0   ' D I S A B L E   K E Y B O A R D   A U T O - R E P E A T 
 
 2 0   ' 6 4 K   M O D E 
 
 3 0   ' 
 
 4 0   I F   P E E K ( & H 1 0 D ) + P E E K ( & H 1 0 E ) < > 4 6 3   T H E N 9 0 
 
 5 0   P O K E & H F F 0 3 , P E E K ( & H F F 0 3 ) A N D & H F E 
 
 6 0   P O K E & H 1 0 D , P E E K ( & H 1 1 D ) : P O K E & H 1 0 E , P E E K ( & H 1 1 E ) 
 
 7 0   P O K E & H F F 0 3 , P E E K ( & H F F 0 3 ) O R 1 
 
 8 0   P O K E 1 5 2 , 0 
 
 9 0   C L S : P R I N T " K E Y B O A R D   A U T O - R E P E A T   D I S A B L E D . . . " ; 
 
 
 
 A l l   o f   t h e   a b o v e   e x a m p l e   p r o g r a m s   a r e   i n c l u d e d   a s   . C A S   f i l e s . 
 
 
 
 
 
 
 
 D i s a b l e   D O S   o r   g a m e   c a r t r i d g e   a t   p o w e r - o n   o r   r e s e t 
 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 H o l d i n g   d o w n   t h e   S H I F T   k e y   a t   p o w e r - o n   o r   a f t e r   a   h a r d w a r e   r e s e t   w i l l   d i s a b l e   a n y   a t t a c h e d   D O S   o r   g a m e   c a r t r i d g e . 
 
 
 
 ( 1 )   T h i s   f e a t u r e   i s   i d e a l   f o r   b y p a s s i n g   D O S   w i t h o u t   h a v i n g   t o   k e e p   u n p l u g g i n g   t h e   c o n t r o l l e r   c a r t r i d g e . 
 
 
 
 ( 2 )   C a n   a l s o   b e   u s e d   t o   d i s a b l e   a u t o - s t a r t i n g   g a m e ,   a s s e m b l e r ,   o r   o t h e r   c a r t r i d g e s . 
 
 
 
 
 
 
 
 S u p p o r t   f o r   6 3 x 0 9 e   e r r o r   t r a p p i n g 
 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 S u p p o r t   f o r   6 3 x 0 9 e   e r r o r   t r a p p i n g   h a s   b e e n   a d d e d   t o   t h e   R O M s   i n   c a s e   y o u   d e c i d e   a t   s o m e   p o i n t   t o   r e p l a c e   y o u r   D r a g o n ' s 
 
 M o t o r o l a   M C 6 8 0 9 E P   C P U   w i t h   t h e   s u p e r i o r   H i t a c h i   H D 6 3 B 0 9 E P   o r   H D 6 3 C 0 9 E P .   T h e   H i t a c h i   H D 6 3 B 0 9 E P   o r   H D 6 3 C 0 9 E P   i s   a   d i r e c t 
 
 p i n - f o r - p i n   r e p l a c e m e n t   f o r   t h e   6 8 0 9 E   f o u n d   i n   a l l   D r a g o n   C o m p u t e r s .   B e s i d e s   b e i n g   a   C M O S   c h i p ,   w h i c h   r u n s   m u c h   c o o l e r 
 
 t h a n   t h e   M o t o r o l a   6 8 0 9 E ,   t h e   H i t a c h i   6 3 x 0 9 E   a l s o   c o n t a i n s   a n   e n h a n c e d   i n s t r u c t i o n   s e t   a n d   a d d i t i o n a   C P U   r e g i s t e r s   t h a t 
 
 b r i n g   s i g n i f i c a n t   p e r f o r m a n c e   b e y o n d   w h a t   a   6 8 0 9   c a n   p r o v i d e .   
 
 
 
 B y t e s   $ 0 0 9 5 : 0 0 9 6   a r e   n o w   u s e d   a s   a   s e c o n d a r y   v e c t o r   f o r   6 3 x 0 9 e   e r r o r   t r a p p i n g .   T h e   d e f a u l t   a d d r e s s   s i m p l y   p o i n t s   t o   a n 
 
 R T I   i n s t r u c t i o n   t o   p r e v e n t   a n y   r u n n i n g   s o f t w a r e   t h a t   i n c l u d e s   i l l e g a l   o p - c o d e s   f r o m   c r a s h i n g   t h e   m a c h i n e . 
 
 
 
 
 
 ( 1 )   H i t a c h i   6 3 B 0 9 E / 6 3 C 0 9 E   p r o c e s s o r s   c a n   b e   p u r c h a s e d   f r o m   h t t p : / / w w w . c l o u d 9 t e c h . c o m /   f o r   $ 2 2   +   s h i p p i n g . 
 
 
 
 
 
 
 
 C h a n g e s   t o   B A S I C   m e m o r y   m a p 
 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 
 
 T h e s e   e n h a n c e d   R O M s   a l s o   i n c l u d e   s o m e   c h a n g e s   t o   t h e   B A S I C   m e m o r y   m a p :   
 
 
 
 $ 0 0 9 5 : 0 0 9 6 	 6 3 x 0 9 e   s e c o n d a r y   e r r o r   t r a p   v e c t o r   ( 0 x b 4 6 e ) 
 
 
 
 $ 0 0 9 7 	 	 % C N T D W N %   K e y b o a r d   a u t o - r e p e a t   c o u n t d o w n   b y t e 
 
 
 
 $ 0 0 9 8 	 	 K e y b o a r d   m o d e   c o n t r o l   b y t e   ( 0 x 0 0 - 0 x 7 f   =   D e f a u l t   m o d e ,   0 x 8 0 - 0 x f f   =   E n h a n c e d   m o d e ) 
 
 
 
 
 
 $ 0 1 1 d : 0 1 1 e 	 K e y b o a r d   a u t o - r e p e a t   I R Q   i n t e r r u p t   s e r v i c e   r o u t i n e   j u m p   v e c t o r   
 
 	 	 ( D r a g o n   3 2   a n d   D r a g o n   6 4   i n   3 2 K   m o d e   =   0 x 9 d 3 d ,   D r a g o n   6 4   i n   6 4 K   m o d e   =   0 x d d 3 d ) 
 
 
 
 $ 0 1 1 f 	 	 % R E P D L Y %   K e y b o a r d   a u t o - r e p e a t   i n t e r - r e p e a t   d e l a y   v a l u e   ( 0 x 0 5 ) 
 
 
 
 $ b e f d : b e f e 	 R O M   I D   b y t e s :   D r a g o n   3 2   ( 0 x 3 3 3 2   " 3 2 " ) ,   D r a g o n   6 4   ( 0 x 3 6 3 4   " 6 4 " ) 
 
 
 
 $ f e 0 2 : f e 0 3 	 R O M   I D   b y t e s :   D r a g o n   6 4   i n   6 4 K   m o d e   ( 0 x 3 6 3 4   " 6 4 " ) 
 
   
 
 $ f f f 0 : f f f 1 	 6 3 x 0 9 e   e r r o r   t r a p   v e c t o r   ( 0 x f f e c ) 
 
 
 
 
 
 
 
 N o t e s 
 
 - - - - - 
 
 
 
 T h i s   i s   i n t e n d e d   t o   b e   t h e   f i n a l   r e l e a s e   v e r s i o n   o f   m y   e n h a n c e d   D r a g o n   R O M s .   A l t h o u g h   I   c a n ' t   g u a r a n t e e   t h a t   t h e s e   R O M s 
 
 a r e   n o w   t o t a l l y   b u g   f r e e   I   h a v e   t a k e n   a   g r e a t   d e a l   o f   c a r e   t o   m a k e   s u r e   t o   t h e   b e s t   o f   m y   a b i l i t y   t h a t   n o   b u g s   e x i s t   i n 
 
 t h i s   f i n a l   v 3 . 0   r e l e a s e .   I   s t r o n g l y   r e c o m m e n d   t h a t   y o u   d e l e t e   a l l   p r e v i o u s   v e r s i o n s   a n d   d i s t r i b u t e / u s e   o n l y   t h e s e . 
 
 
 
 P l e a s e   i n f o r m   m e   v i a   S t e v e   E v a n s   ( Z e p h y r )   a t   " T h e   D R A G O N   A r c h i v e "   f o r u m s   i f   y o u   d o   h a p p e n   t o   f i n d   a n y   b u g s . 
 
 
 
 T h e   D R A G O N   A r c h i v e   h t t p : / / a r c h i v e . w o r l d o f d r a g o n . o r g / 
 
 T h e   D R A G O N   A r c h i v e   f o r u m s   h t t p : / / a r c h i v e . w o r l d o f d r a g o n . o r g / p h p B B 3 / 
 
 
 
 P l e a s e   f e e l   f r e e   t o   d i s t r i b u t e   m y   e n h a n c e d   D r a g o n   3 2 / 6 4   R O M s   f r e e   o f   c h a r g e   t o   a l l   D r a g o n   u s e r s . 
 
 
 
 
 
 R e g a r d s , 
 
 
 
 S t e p h e n   J   W o o l h a m 
 
