]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/z180-serv.c
Additional Codes for HOME and END key.
[z180-stamp.git] / avr / z180-serv.c
index f55b7a8c681858e2610aacce0431c8ab04857285..9cf59f89314190bfe139bc51e98271b7c8a53847 100644 (file)
@@ -263,7 +263,7 @@ int drv_detach(uint8_t unit)
                        p->flags &= ~DRV_FLG_DIRTY;
                        p->img_name = NULL;
 
-                       uint32_t scb = getenv_ulong(ENV_CPM3_SCB, 16, 0);
+                       uint32_t scb = getenv_ulong(PSTR(ENV_CPM3_SCB), 16, 0);
                        if (scb && (z80_bus_cmd(Request) & ZST_ACQUIRED)) {
                                z80_write(scb + 0xf0, 0xff);
                                z80_write(p->dph + 11, 0xff);
@@ -399,6 +399,7 @@ static const FLASH char * const FLASH rc_messages[] = {
                        FSTR("Access byond disk size"),                         /* 04 */
                        FSTR("Write protect"),                                          /* 05 */
                        FSTR("No media"),                                                       /* 06 */
+                       FSTR("R/W address == 0 !!!!"),                          /* 07 */
                };
 
 void msg_cpm_result(uint8_t subf, uint8_t rc, int res)
@@ -530,6 +531,10 @@ void do_msg_cpm_rw(uint8_t subf, int len, uint8_t * msg)
        drv_debug(MIDDLE, PSTR(" T:%4d, S:%2d, cnt:%2d, lba: %.8lx, addr: %.5lx"),
                                track, sec, secs, pos, addr);
 
+       if (addr == 0) {
+               return msg_cpm_result(subf, 0x07, res);
+       }
+
        if (dowrite && dp->opt & DRV_OPT_RO) {
                return msg_cpm_result(subf, 0x05, res);
        }