diff -Naur spediv_v0.2d/README spediv_v0.3/README
--- spediv_v0.2d/README	2005-06-16 20:06:55.000000000 +0200
+++ spediv_v0.3/README	2009-08-08 18:14:42.000000000 +0200
@@ -9,5 +9,5 @@
 
 Spectemu-divIDE can be optained from:
 
-    http://www.dusky.sk/zxs/spediv_beta.tgz
+    http://www.dusky.sk/zxs/spediv.tgz
 
diff -Naur spediv_v0.2d/divide.c spediv_v0.3/divide.c
--- spediv_v0.2d/divide.c	2007-07-28 16:08:23.000000000 +0200
+++ spediv_v0.3/divide.c	2009-08-08 18:27:52.000000000 +0200
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2005 Dusan Gallo
+ * Copyright (C) 2005-2009 Dusan Gallo
  * Email: dusky@hq.alert.sk
  *
  * This program is free software; you can redistribute it and/or modify
@@ -23,6 +23,9 @@
  *
  * I would like to thank to Zilog, baze, nairam for their useful 
  * comments/informations. dusky
+ *
+ * $Rev: 12 $
+ *
  */
 
 #include <stdio.h>
@@ -85,22 +88,31 @@
 
 // mapped original ROM or divide memory?
 int divide_memstate=0;
+int divide_int_port=0;
+int divide_int_state=0;
 
-// forced memory mapping
-int divide_conmem=0;
-
-// RAM page 3 mapped RO in 0K-8K range
-int divide_mapram=0;
+int divide_mb02_write_enable=0;
 
 // flash write jumper
 int divide_jp2=1;
 
-// which memry page memory in 8k-16k
-int divide_bank=0;
+// was memory page changed? (8k layout)
 int divide_bank_changed=0;
 
 // if should be done automapping
 int divide_automap=0;
+//CONMEM MAPRAM X X X X RAM_BANK1 RAM_BANK0
+// forced memory mapping
+#define DIVIDE_CONMEM(x) (x&0x80)
+// EEPROM or RAM#3 mapped RO in 0K-8K range?
+#define DIVIDE_MAPRAM(x) (x&0x40)
+// which 8kbank is on 8K-16K ?
+#define DIVIDE_BANK(x) (x&0x03)
+
+//RETURN WRITEENABLE X X X X X BANK0
+#define DIVIDE_RETURN(x) (x&0x80)
+#define DIVIDE_WRITEENABLE(x) (x&0x40)
+#define DIVIDE_MB02_BANK(x) (x&0x01)
 
 #define DIVIDE_MAX_SEC_NR 96 // 96*512 = 48K .. in 48K mode spectrum this should be enough
 
@@ -474,13 +486,11 @@
   switch (portl) {
   case 0xE3: // divide_control_register
     // this port contains CONMEM, MAPRAM, x, x, x, x, RAM_BANK (2 bits)
-    divide_conmem = (data >> 7) & 1;
+
+    divide_bank_changed = (DIVIDE_BANK(divide_int_port) != DIVIDE_BANK(data));
     // MAPRAM cannot be cleared (1->0)
-    if ((data & 64)) {
-      divide_mapram = 1;
-    }
-    divide_bank_changed = (divide_bank != (data & 0x03));
-    divide_bank = (data & 0x03);
+    divide_int_port = data | DIVIDE_MAPRAM(divide_int_port);
+    divide_mb02_write_enable = (data & 0x40);
     break;
   case 0xBB: // drive/head register
     divide_active_drive = ((data >> 4) & 1);
@@ -757,10 +767,10 @@
   
 void divide_mapper() {
   // if CONMEM is set, connect EEPROM (read only if JP2 is closed) and selected RAM bank (read/write)
-  if (divide_conmem) { // map eeprom+ram
+  if (DIVIDE_CONMEM(divide_int_port)) { // map eeprom+ram
     if ((divide_memstate != 1) || divide_bank_changed) {
       memcpy(PRNM(proc).mem, divide_eeprom, 0x2000);
-      memcpy(PRNM(proc).mem + 0x2000, divide_ram[divide_bank], 0x2000);
+      memcpy(PRNM(proc).mem + 0x2000, divide_ram[DIVIDE_BANK(divide_int_port)], 0x2000);
     }
     divide_memstate = 1;
     divide_bank_changed = 0;
@@ -770,11 +780,23 @@
   // if CONMEM isn't set and MAPRAM is set and:
   //   1) if we reached "connecting" entry point, connect RAM #3 bank (read only) and selected RAM bank (if it is 3 it is too read only, else it is writable)
   //   2) if we reached "disconnecting" entry point, connect original ZX Speccy ROM
-  if (divide_mapram) {
+  if (DIVIDE_MAPRAM(divide_int_port)) {
+    
+    // check for mb02 layout
+    if (!divide_jp2 && (DIVIDE_BANK(divide_int_port) > 1 || divide_memstate == 3)) {
+      
+      if ((divide_memstate != 3) || divide_bank_changed) {
+        memcpy(PRNM(proc).mem, divide_ram[DIVIDE_MB02_BANK(divide_int_port)*2], 0x2000);
+        memcpy(PRNM(proc).mem + 0x2000, divide_ram[DIVIDE_MB02_BANK(divide_int_port)*2+1], 0x2000);
+      }
+      divide_memstate = 3;
+      divide_bank_changed = 0;
+      return;
+    }
     if (divide_automap) { // map ram3+ram
       if ((divide_memstate != 2) || divide_bank_changed) {
         memcpy(PRNM(proc).mem, divide_ram[3], 0x2000);
-        memcpy(PRNM(proc).mem + 0x2000, divide_ram[divide_bank], 0x2000);
+        memcpy(PRNM(proc).mem + 0x2000, divide_ram[DIVIDE_BANK(divide_int_port)], 0x2000);
       }
       divide_memstate = 2;
       divide_bank_changed = 0;
@@ -795,7 +817,7 @@
     if (divide_automap) { // map eeprom+ram
       if ((divide_memstate != 1) || divide_bank_changed) {
         memcpy(PRNM(proc).mem, divide_eeprom, 0x2000);
-        memcpy(PRNM(proc).mem + 0x2000, divide_ram[divide_bank], 0x2000);
+        memcpy(PRNM(proc).mem + 0x2000, divide_ram[DIVIDE_BANK(divide_int_port)], 0x2000);
       }
       divide_memstate = 1;
       divide_bank_changed = 0;
@@ -835,18 +857,25 @@
       }
       *ptr=val;
       // we have to make this change in divide memory too (not really mapped, only copied)
-      divide_ram[divide_bank][addr-0x2000]=val;
+      divide_ram[DIVIDE_BANK(divide_int_port)][addr-0x2000]=val;
       break;
     case 2:
       // RAM #3 bank + selected RAM bank
       // if it is 0k-8k page, write is disabled
       // if it is 8k-16k page, write is disabled if is selected RAM #3 bank
-      if (addr<0x2000 || divide_bank==3) break;
+      if (addr<0x2000 || DIVIDE_BANK(divide_int_port)==3) break;
       *ptr=val;
       // we have to make this change in divide memory too (not really mapped, only copied)
-      divide_ram[divide_bank][addr-0x2000]=val;
+      divide_ram[DIVIDE_BANK(divide_int_port)][addr-0x2000]=val;
+      break;
+    case 3:
+      if (!divide_mb02_write_enable) break;
+      *ptr=val;   
+      if (addr<0x2000)
+        divide_ram[DIVIDE_MB02_BANK(divide_int_port)*2][addr]=val;
+      else
+        divide_ram[DIVIDE_MB02_BANK(divide_int_port)*2+1][addr-0x2000]=val;
       break;
-    
     default:
 //      printf("unknown divide state %d\n", divide_memstate);
       ;
diff -Naur spediv_v0.2d/divide.h spediv_v0.3/divide.h
--- spediv_v0.2d/divide.h	2007-07-28 10:25:32.000000000 +0200
+++ spediv_v0.3/divide.h	2009-08-08 18:27:52.000000000 +0200
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2005 Dusan Gallo
+ * Copyright (C) 2005-2009 Dusan Gallo
  * Email: dusky@hq.alert.sk
  *
  * This program is free software; you can redistribute it and/or modify
@@ -16,12 +16,14 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
+ * $Rev: 12 $
+ *
  */
 
 #ifndef DIVIDE_H
 #define DIVIDE_H
 
-#define DIVIDE_VERSION "v0.2d"
+#define DIVIDE_VERSION "v0.3 ($Rev: 12 $)"
 
 void divide_init();
 void divide_exit();
diff -Naur spediv_v0.2d/sp_def.h spediv_v0.3/sp_def.h
--- spediv_v0.2d/sp_def.h	2005-06-16 20:14:02.000000000 +0200
+++ spediv_v0.3/sp_def.h	2009-08-08 17:04:35.000000000 +0200
@@ -83,7 +83,7 @@
      DANM(ula_outport) = (source);                               \
      DANM(tc) -= 1;                                              \
   } else                                                         \
-      if ((portl)==227 || ((portl)&0xA3)==0xA3)                  \
+      if ((portl)==0xE3 || ((portl)&0xA3)==0xA3)                 \
         divide_port_out((portl), (source));                      \
   PORT(outports)[portl] = (source);                              \
 }
diff -Naur spediv_v0.2d/spmain.c spediv_v0.3/spmain.c
--- spediv_v0.2d/spmain.c	2005-07-12 13:13:14.000000000 +0200
+++ spediv_v0.3/spmain.c	2009-08-08 18:19:35.000000000 +0200
@@ -246,7 +246,10 @@
 	  SPECTEMU_VERSION, SPECTEMU_TYPE);
   put_msg(msgbuf);
 #ifdef HAVE_DIVIDE
-  put_msg("\033[47m  \033[40;37mdiv\033[1;41;37mIDE\033[0;47;30m extension (c) 2005 dusky (dusky@hq.alert.sk)              \033[0m");
+  sprintf(msgbuf,
+          "\033[47m  \033[40;37mdiv\033[1;41;37mIDE\033[0;47;30m extension %s (c) Dusan Gallo 2005-2009     \033[0m",
+          DIVIDE_VERSION);
+  put_msg(msgbuf);
 #endif
   put_msg("\033[47m                                                                   \033[0m");
 
