IDE bugfix for dragon-nx32
authorBrett Gordon <beretta42@gmail.com>
Sat, 4 Jul 2015 14:52:05 +0000 (10:52 -0400)
committerAlan Cox <alan@linux.intel.com>
Sun, 5 Jul 2015 20:41:47 +0000 (21:41 +0100)
--94eb2c094236ea23be051a0dd016
Content-Type: text/plain; charset=UTF-8

Here's a bug fix that make IDE work for 6809 stuff.
* bugfix: removed spaces in operand to test the rawflag in blk_op (lwasm
treats as comments)
* bugfix: moved accesses to blk_ops around to before we switch to
userspace: blk_ops is in kernel space to it goes *poof* when we flip to
user-space

The good news is we can share ide.s directly, as these bug fixes make IDE
work for the coco3 platform too.

I haven't tried this on real hardware, but on fake hardware it works great!
:)

--
Brett M. Gordon,
beretta42@gmail.com

<div dir="ltr"><div>Here&#39;s a bug fix that make IDE work for 6809 stuff.  </div><div>* bugfix: removed spaces in operand to test the rawflag in blk_op (lwasm treats as comments)</div><div>* bugfix: moved accesses to blk_ops around to before we switch to userspace: blk_ops is in kernel space to it goes *poof* when we flip to user-space</div><div><br></div><div>The good news is we can share ide.s directly, as these bug fixes make IDE work for the coco3 platform too.</div><div><br></div><div>I haven&#39;t tried this on real hardware, but on fake hardware it works great! :)</div><div><br></div><div><br></div>-- <br><div class="gmail_signature">Brett M. Gordon,<br><a href="mailto:beretta42@gmail.com" target="_blank">beretta42@gmail.com</a></div>
</div>

Kernel/platform-dragon-nx32/ide.s

index f9fec54..ae6d657 100644 (file)
@@ -24,12 +24,12 @@ _devide_read_data:
        pshs y,dp
        lda #0xFF
        tfr a,dp
-       lda _blk_op + 2
-       beq rdk
-       jsr map_process_always
-rdk:   ldx _blk_op
+       ldx _blk_op
        leay 512,x
        sty endp
+       tst _blk_op+2
+       beq readword
+       jsr map_process_always
 readword:
        lda <IDEDATA
        ldb <IDEDATA_L          ; latched
@@ -43,12 +43,12 @@ _devide_write_data:
        pshs y,dp
        lda #0xFF
        tfr a,dp
-       lda _blk_op + 2
-       beq wdk
-       jsr map_process_always
-wdk:   ldx _blk_op
+       ldx _blk_op
        leay 512,x
        sty endp
+       tst _blk_op+2
+       beq writeword
+       jsr map_process_always
 writeword:
        ldd ,x++
        stb <IDEDATA_L