Previous 15994 Revisions Next

r15066 Monday 30th April, 2012 at 02:09:42 UTC by R. Belmont
Apple II: Found and implemented the OS9 memory mapper for The Mill, but the available OS9 disk image appears to be damaged. Sigh. (nw)
[src/mess/machine]a2themill.c a2themill.h

src/mess/machine/a2themill.c
r15065r15066
44
55    Implementation of the Stellation Two The Mill 6809 card
66 
7    OS9 requires this add-on be implemented:
8    http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/CPU/Stellation%20Two%20The%20Mill%20-%206809/Photos/Stellation%20Two%20The%20Mill%20OS9%20ROM%20Interface%20Rev.%20A%20-%20Front.jpg
7    The OS9 add-on changes the address mapping as follows:
8    6809 0x0000-0xafff -> 6502 0x1000-0xbfff
9    6809 0xb000-0xdfff -> 6502 0xd000-0xffff
10    6809 0xe000-0xefff -> 6502 0xc000-0xcfff
11    6809 0xf000-0xffff -> 6502 0x0000-0x0fff
912 
10    but the chip numbers are unclear, and it may also require a ROM.
13    (reference: http://mirrors.apple2.org.za/ground.icaen.uiowa.edu/MiscInfo/Hardware/mill.6809 )
1114 
12    Excel Flex requires a ROM in the on-board socket which is not dumped :(
13
15    ProDOS "Stellation The Mill Disk.po" requires Mill in slot 2; boot
16    the disc and type "-DEMO1" and press Enter to launch the simple demo.
17 
18    The OS9 disk image available around the internet seems to be bad - the
19    6809 boot vector is 0x4144 which maps to 6502 0x5144 and there's all
20    zeros from 6502 1000-7fff.  There is valid 6809 code from 9000-BFFF
21    at the point where it wants to boot the 6809, but I don't know what
22    is supposed to be the entry point.
23     
1424*********************************************************************/
1525
1626#include "a2themill.h"
r15065r15066
8696   set_a2bus_device();
8797
8898   save_item(NAME(m_bEnabled));
89   save_item(NAME(m_FirstBoot));
9099   save_item(NAME(m_flipAddrSpace));
100   save_item(NAME(m_6809Mode));
91101   save_item(NAME(m_status));
92102}
93103
r15065r15066
95105{
96106    m_bEnabled = false;
97107    m_6502space = NULL;
98    m_FirstBoot = true;
99108    m_flipAddrSpace = false;
109    m_6809Mode = false;
100110    m_status = 0xc0;    // OS9 loader relies on this
101111    device_set_input_line(m_6809, INPUT_LINE_HALT, ASSERT_LINE);
102112    device_set_input_line(m_6809, INPUT_LINE_RESET, ASSERT_LINE);
r15065r15066
235245{
236246    if (m_6502space)
237247    {
238        if (m_flipAddrSpace)
248        if (m_6809Mode)
239249        {
240            return m_6502space->read_byte(offset^0x8000);
250            if (offset <= 0xafff)
251            {
252                return m_6502space->read_byte(offset+0x1000);
253            }
254            else if (offset <= 0xbfff)
255            {
256                return m_6502space->read_byte((offset&0xfff) + 0xd000);
257            }
258            else if (offset <= 0xcfff)
259            {
260                return m_6502space->read_byte((offset&0xfff) + 0xe000);
261            }
262            else if (offset <= 0xdfff)
263            {
264                return m_6502space->read_byte((offset&0xfff) + 0xf000);
265            }
266            else if (offset <= 0xefff)
267            {
268                return m_6502space->read_byte((offset&0xfff) + 0xc000);
269            }
270            else    // 6809 Fxxx -> 6502 ZP
271            {
272                return m_6502space->read_byte(offset&0xfff);
273            }
241274        }
242275        else
243276        {
244            return m_6502space->read_byte(offset);
277            if (m_flipAddrSpace)
278            {
279                return m_6502space->read_byte(offset^0x8000);
280            }
281            else
282            {
283                return m_6502space->read_byte(offset);
284            }
245285        }
246286    }
247287
r15065r15066
257297{
258298    if (m_6502space)
259299    {
260        if (m_flipAddrSpace)
300        if (m_6809Mode)
261301        {
262            m_6502space->write_byte(offset^0x8000, data);
302            if (offset <= 0xafff)
303            {
304                m_6502space->write_byte(offset+0x1000, data);
305            }
306            else if (offset <= 0xbfff)
307            {
308                m_6502space->write_byte((offset&0xfff) + 0xd000, data);
309            }
310            else if (offset <= 0xcfff)
311            {
312                m_6502space->write_byte((offset&0xfff) + 0xe000, data);
313            }
314            else if (offset <= 0xdfff)
315            {
316                m_6502space->write_byte((offset&0xfff) + 0xf000, data);
317            }
318            else if (offset <= 0xefff)
319            {
320                m_6502space->write_byte((offset&0xfff) + 0xc000, data);
321            }
322            else    // 6809 Fxxx -> 6502 ZP
323            {
324                m_6502space->write_byte(offset&0xfff, data);
325            }
263326        }
264327        else
265328        {
266            m_6502space->write_byte(offset, data);
329            if (m_flipAddrSpace)
330            {
331                m_6502space->write_byte(offset^0x8000, data);
332            }
333            else
334            {
335                m_6502space->write_byte(offset, data);
336            }
267337        }
268338    }
269339}
src/mess/machine/a2themill.h
r15065r15066
4444
4545private:
4646    bool m_bEnabled;
47    bool m_FirstBoot;
4847    bool m_flipAddrSpace;
48    bool m_6809Mode;
4949    address_space *m_6502space;
5050    UINT8 m_status;
5151};

Previous 15994 Revisions Next


© 1998-2018 The MESS Team