OSDN Git Service

VRAM /CS direction is fixed
authornaruko <naruko@24ea1065-a21e-4ca1-99c9-f5125deb0858>
Sat, 26 Dec 2009 20:14:04 +0000 (20:14 +0000)
committernaruko <naruko@24ea1065-a21e-4ca1-99c9-f5125deb0858>
Sat, 26 Dec 2009 20:14:04 +0000 (20:14 +0000)
git-svn-id: svn+ssh://svn.osdn.net/svnroot/unagi@338 24ea1065-a21e-4ca1-99c9-f5125deb0858

kazzo/trunk/firmware/bus_access.c

index 675a503..21d3083 100644 (file)
@@ -20,7 +20,9 @@ enum databus_dir{
        DATABUS_DIR_OUT = 0xff,
        DATABUS_DIR_IN = 0
 };
-/*PCx: output ADDRESS_HIGH_LATCH connect HC574 clock pin, bus control signal*/
+/*PCx: output ADDRESS_HIGH_LATCH connect HC574 clock pin, bus control signal
+VRAM_CS is input port this is design mistake!
+*/
 #define BUS_CONTROL_DIR IO_DIRECTION(C)
 #define BUS_CONTROL_OUT IO_OUT(C)
 enum iobit_bus_control{
@@ -40,12 +42,18 @@ enum iobit_usb_misc{
        USB_DPLUS = 2, CPU_IRQ, 
        USB_DMINUS, VRAM_A10
 };
+static inline uint8_t bit_get_negative(enum iobit_bus_control bit)
+{
+       uint8_t ret = (1 << bit);
+       return ~ret;
+}
+
 void bus_init(void)
 {
        ADDRESSBUS_A0_A7_DIR = 0xff;
        ADDRESSBUS_A0_A7_OUT = 0;
        DATABUS_DIR = DATABUS_DIR_OUT;
-       BUS_CONTROL_DIR = 0xff;
+       BUS_CONTROL_DIR = bit_get_negative(VRAM_CS); //VRAM_CS is input port
        BUS_CONTROL_OUT = BUS_CLOSE;
        USB_MISC_DIR = (0b1100 << 4) | 0b0011; //empty pin use OUT
        USB_MISC_PULLUP = (1 << CPU_IRQ) | (1 << VRAM_A10);
@@ -64,12 +72,6 @@ void phi2_init(void)
        }
 }
 
-static inline uint8_t bit_get_negative(enum iobit_bus_control bit)
-{
-       uint8_t ret = (1 << bit);
-       return ~ret;
-}
-
 //for RAM adapter DRAM refresh
 void phi2_update(void)
 {