Previous 199869 Revisions Next

r41387 Tuesday 27th October, 2015 at 12:49:18 UTC by R. Belmont
apple2: fixed OS-9 mapping mode for "The Mill" 6809 card; OS-9 boots now. (nw, will WNSS later)]
[src/devices/bus/a2bus]a2themill.c

trunk/src/devices/bus/a2bus/a2themill.c
r249898r249899
77    Implementation of the Stellation Two The Mill 6809 card
88
99    The OS9 add-on changes the address mapping as follows:
10    6809 0x0000-0xafff -> 6502 0x1000-0xbfff
11    6809 0xb000-0xdfff -> 6502 0xd000-0xffff
12    6809 0xe000-0xefff -> 6502 0xc000-0xcfff
13    6809 0xf000-0xffff -> 6502 0x0000-0x0fff
10    6809 0x0000-0x7fff -> 6502 0x1000-0x8fff
11    6809 0x8000-0xafff -> 6502 0xd000-0xffff
12    6809 0xb000-0xbfff -> 6502 0xc000-0xcfff
13    6809 0xc000-0xcfff -> 6502 0x0000-0x0fff
14    6809 0xd000-0xffff -> 6502 0x9000-0xbfff
1415
15    (reference: http://mirrors.apple2.org.za/ground.icaen.uiowa.edu/MiscInfo/Hardware/mill.6809 )
16    (reference: "6809.txt" on one of the disks for The Mill)
1617
1718    ProDOS "Stellation The Mill Disk.po" requires Mill in slot 2; boot
1819    the disc and type "-DEMO1" and press Enter to launch the simple demo.
1920
20    The OS9 disk image available around the internet seems to be bad - the
21    6809 boot vector is 0x4144 which maps to 6502 0x5144 and there's all
22    zeros from 6502 1000-8fff.  There is valid 6809 code from 9000-BFFF
23    at the point where it wants to boot the 6809, but I don't know what
24    is supposed to be the entry point.
21    TODO: Add DIP switch to select standard and OS-9 modes.
2522
2623*********************************************************************/
2724
r249898r249899
103100{
104101   m_bEnabled = false;
105102   m_flipAddrSpace = false;
106   m_6809Mode = false;
103   m_6809Mode = true;
107104   m_status = 0xc0;    // OS9 loader relies on this
108105   m_6809->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
109106   m_6809->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
r249898r249899
238235
239236READ8_MEMBER( a2bus_themill_device::dma_r )
240237{
238   // MAME startup ordering has the 6809 free-running at boot, which is undesirable
239   if (!m_bEnabled)
240   {
241      m_6809->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
242   }
243
241244   if (m_6809Mode)
242245   {
243      if (offset <= 0xafff)
246      if (offset <= 0x7fff)
244247      {
245248         return slot_dma_read(space, offset+0x1000);
246249      }
247      else if (offset <= 0xbfff)
250      else if (offset <= 0xafff)
248251      {
249         return slot_dma_read(space, (offset&0xfff) + 0xd000);
252         return slot_dma_read(space, (offset&0x3fff) + 0xd000);
250253      }
251      else if (offset <= 0xcfff)
254      else if (offset <= 0xbfff)
252255      {
253         return slot_dma_read(space, (offset&0xfff) + 0xe000);
256         return slot_dma_read(space, (offset&0xfff) + 0xc000);
254257      }
255      else if (offset <= 0xdfff)
258      else if (offset <= 0xcfff)   // 6809 Cxxx -> 6502 ZP
256259      {
257         return slot_dma_read(space, (offset&0xfff) + 0xf000);
260         return slot_dma_read(space, (offset&0xfff));
258261      }
259      else if (offset <= 0xefff)
262      else    // 6809 Dxxx -> 6502 9000
260263      {
261         return slot_dma_read(space, (offset&0xfff) + 0xc000);
264         return slot_dma_read(space, (offset-0xd000)+0x9000);
262265      }
263      else    // 6809 Fxxx -> 6502 ZP
264      {
265         return slot_dma_read(space, offset&0xfff);
266      }
267266   }
268267   else
269268   {
r249898r249899
289288{
290289   if (m_6809Mode)
291290   {
292      if (offset <= 0xafff)
291      if (offset <= 0x7fff)
293292      {
294293         slot_dma_write(space, offset+0x1000, data);
295294      }
295      else if (offset <= 0xafff)
296      {
297         slot_dma_write(space, (offset&0x3fff) + 0xd000, data);
298      }
296299      else if (offset <= 0xbfff)
297300      {
298         slot_dma_write(space, (offset&0xfff) + 0xd000, data);
301         slot_dma_write(space, (offset&0xfff) + 0xc000, data);
299302      }
300303      else if (offset <= 0xcfff)
301304      {
302         slot_dma_write(space, (offset&0xfff) + 0xe000, data);
305         slot_dma_write(space, (offset&0xfff), data);
303306      }
304      else if (offset <= 0xdfff)
307      else    // 6809 Dxxx -> 6502 9000
305308      {
306         slot_dma_write(space, (offset&0xfff) + 0xf000, data);
309         slot_dma_write(space, (offset-0xd000)+0x9000, data);
307310      }
308      else if (offset <= 0xefff)
309      {
310         slot_dma_write(space, (offset&0xfff) + 0xc000, data);
311      }
312      else    // 6809 Fxxx -> 6502 ZP
313      {
314         slot_dma_write(space, offset&0xfff, data);
315      }
316311   }
317312   else
318313   {


Previous 199869 Revisions Next


© 1997-2024 The MAME Team