Index: common/a8core/atari800core.vhd
===================================================================
--- common/a8core/atari800core.vhd	(revision 12)
+++ common/a8core/atari800core.vhd	(revision 13)
@@ -59,6 +59,10 @@
 		KEYBOARD_RESPONSE : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
 		KEYBOARD_SCAN : OUT STD_LOGIC_VECTOR(5 DOWNTO 0);
 
+		-- Pokey pots
+		POT_IN : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
+		POT_RESET : OUT STD_LOGIC;
+		
 		-- PBI
 		PBI_ADDR : out STD_LOGIC_VECTOR(15 DOWNTO 0);
 		PBI_WRITE_ENABLE : out STD_LOGIC; -- currently only for CART config...
@@ -97,6 +101,9 @@
 		CONSOL_START : IN STD_LOGIC;
 		GTIA_TRIG : IN STD_LOGIC_VECTOR(3 downto 0);
 
+		-- ANTIC lightpen
+		ANTIC_LIGHTPEN : IN std_logic;
+		
 		-----------------------
 		-- After here all FPGA implementation specific
 		-- e.g. need to write up RAM/ROM
@@ -163,7 +170,7 @@
 
 		-- Special config params
    		RAM_SELECT : in std_logic_vector(2 downto 0); -- 64K,128K,320KB Compy, 320KB Rambo, 576K Compy, 576K Rambo, 1088K, 4MB
-    		ROM_SELECT : in std_logic_vector(5 downto 0); -- 16KB ROM Bank - 0 is illegal (slot used for BASIC!)
+    		ROM_SELECT : in std_logic_vector(5 downto 0); -- 16KB ROM Bank - 0 is illegal (slot used for BASIC!) TODO FIXME, change stupid slot 0 thing...
 		CART_EMULATION_SELECT : in std_logic_vector(6 downto 0); -- from where
 		CART_EMULATION_ACTIVATE : in std_logic; -- to where? TODO, these needs redoing and wiring up!
 		PAL :  in STD_LOGIC;
@@ -177,7 +184,6 @@
 ARCHITECTURE bdf_type OF atari800core IS 
 
 -- ANTIC
-SIGNAL	LIGHTPEN :  STD_LOGIC;
 SIGNAL	ANTIC_ADDR :  STD_LOGIC_VECTOR(15 DOWNTO 0);
 SIGNAL	ANTIC_AN :  STD_LOGIC_VECTOR(2 DOWNTO 0);
 SIGNAL	ANTIC_COLOUR_CLOCK_OUT :  STD_LOGIC;
@@ -219,8 +225,6 @@
 
 -- POKEY
 SIGNAL	POKEY_IRQ :  STD_LOGIC;
-SIGNAL	POT_IN :  STD_LOGIC_VECTOR(7 DOWNTO 0);
-SIGNAL	POT_RESET :  STD_LOGIC;
 
 SIGNAL	POKEY_DO :  STD_LOGIC_VECTOR(7 DOWNTO 0);
 SIGNAL	CACHE_POKEY_DO :  STD_LOGIC_VECTOR(7 DOWNTO 0);
@@ -313,7 +317,7 @@
 		 MEMORY_READY_CPU => MEMORY_READY_CPU,
 		 ANTIC_ENABLE_179 => ANTIC_ENABLE_179,
 		 PAL => PAL,
-		 lightpen => LIGHTPEN,
+		 lightpen => ANTIC_LIGHTPEN,
 		 ADDR => PBI_ADDR_INT(3 DOWNTO 0),
 		 CPU_DATA_IN => WRITE_DATA(7 DOWNTO 0),
 		 MEMORY_DATA_IN => MEMORY_DATA(7 DOWNTO 0),
Index: common/a8core/atari800core_helloworld.vhd
===================================================================
--- common/a8core/atari800core_helloworld.vhd	(revision 12)
+++ common/a8core/atari800core_helloworld.vhd	(revision 13)
@@ -46,8 +46,8 @@
 		AUDIO_R : OUT std_logic_vector(15 downto 0);
 
 		-- JOYSTICK
-		JOY1_n : IN std_logic_vector(4 downto 0); -- FUPLR, 0=pressed
-		JOY2_n : IN std_logic_vector(4 downto 0); -- FUPLR, 0=pressed
+		JOY1_n : IN std_logic_vector(4 downto 0); -- FRLDU, 0=pressed
+		JOY2_n : IN std_logic_vector(4 downto 0); -- FRLDU, 0=pressed
 
 		-- KEYBOARD
 		PS2_CLK : IN STD_LOGIC;
Index: common/a8core/atari800core_simple_sdram.vhd
===================================================================
--- common/a8core/atari800core_simple_sdram.vhd	(revision 12)
+++ common/a8core/atari800core_simple_sdram.vhd	(revision 13)
@@ -48,8 +48,8 @@
 		AUDIO_R : OUT std_logic_vector(15 downto 0);
 
 		-- JOYSTICK
-		JOY1_n : IN std_logic_vector(4 downto 0); -- FUPLR, 0=pressed
-		JOY2_n : IN std_logic_vector(4 downto 0); -- FUPLR, 0=pressed
+		JOY1_n : IN std_logic_vector(4 downto 0); -- FRLDU, 0=pressed
+		JOY2_n : IN std_logic_vector(4 downto 0); -- FRLDU, 0=pressed
 
 		-- Pokey keyboard matrix
 		-- Standard component available to connect this to PS2
@@ -136,11 +136,14 @@
 SIGNAL	PORTA_DIR_OUT :  STD_LOGIC_VECTOR(7 DOWNTO 0);
 SIGNAL	PORTB_IN :  STD_LOGIC_VECTOR(7 DOWNTO 0);
 SIGNAL	PORTB_OUT :  STD_LOGIC_VECTOR(7 DOWNTO 0);
-SIGNAL	PORTB_DIR_OUT :  STD_LOGIC_VECTOR(7 DOWNTO 0);
+--SIGNAL	PORTB_DIR_OUT :  STD_LOGIC_VECTOR(7 DOWNTO 0);
 
 -- GTIA
 signal GTIA_TRIG : std_logic_vector(3 downto 0);
 
+-- ANTIC
+signal ANTIC_LIGHTPEN : std_logic;
+
 -- CARTRIDGE ACCESS
 SIGNAL	CART_RD4 :  STD_LOGIC;
 SIGNAL	CART_RD5 :  STD_LOGIC;
@@ -172,11 +175,14 @@
 CA2_IN <= CA2_OUT when CA2_DIR_OUT='1' else '1';
 CB2_IN <= CB2_OUT when CB2_DIR_OUT='1' else '1';
 SIO_COMMAND <= CB2_OUT;
-PORTA_IN <= ((JOY1_n(3)&JOY1_n(2)&JOY1_n(1)&JOY1_n(0)&JOY2_n(3)&JOY2_n(2)&JOY2_n(1)&JOY2_n(0)) and not (porta_dir_out)) or (porta_dir_out and porta_out);
+PORTA_IN <= ((JOY2_n(3)&JOY2_n(2)&JOY2_n(1)&JOY2_n(0)&JOY1_n(3)&JOY1_n(2)&JOY1_n(1)&JOY1_n(0)) and not (porta_dir_out)) or (porta_dir_out and porta_out);
 PORTB_IN <= PORTB_OUT;
 
+-- ANTIC lightpen
+ANTIC_LIGHTPEN <= JOY2_n(4) and JOY1_n(4);
+
 -- GTIA triggers
-GTIA_TRIG <= CART_RD5&"1"&JOY1_n(4)&JOY2_n(4);
+GTIA_TRIG <= CART_RD5&"1"&JOY2_n(4)&JOY1_n(4);
 
 -- Cartridge not inserted
 CART_RD4 <= '0';
@@ -240,12 +246,15 @@
 		PORTA_DIR_OUT => PORTA_DIR_OUT,
 		PORTA_OUT => PORTA_OUT,
 		PORTB_IN => PORTB_IN,
-		PORTB_DIR_OUT => PORTB_DIR_OUT,
+		PORTB_DIR_OUT => open,--PORTB_DIR_OUT,
 		PORTB_OUT => PORTB_OUT,
 
 		KEYBOARD_RESPONSE => KEYBOARD_RESPONSE,
 		KEYBOARD_SCAN => KEYBOARD_SCAN,
 
+		POT_IN => "00000000",
+      POT_RESET => open,
+		
 		-- PBI
 		PBI_ADDR => open,
 		PBI_WRITE_ENABLE => open,
@@ -272,6 +281,8 @@
 		CONSOL_SELECT => CONSOL_SELECT,
 		CONSOL_START=> CONSOL_START,
 		GTIA_TRIG => GTIA_TRIG,
+		
+		ANTIC_LIGHTPEN => ANTIC_LIGHTPEN,
 
 		SDRAM_REQUEST => SDRAM_REQUEST,
 		SDRAM_REQUEST_COMPLETE => SDRAM_REQUEST_COMPLETE,
@@ -302,8 +313,8 @@
 		DMA_WRITE_DATA => DMA_WRITE_DATA,
 		MEMORY_READY_DMA => MEMORY_READY_DMA,
 
-   		RAM_SELECT => RAM_SELECT,
-    		ROM_SELECT => ROM_SELECT,
+   	RAM_SELECT => RAM_SELECT,
+    	ROM_SELECT => ROM_SELECT,
 		CART_EMULATION_SELECT => "0000000",
 		CART_EMULATION_ACTIVATE => '0',
 		PAL => PAL,
