trunk/src/devices/bus/a2bus/a2themill.c
r249898 | r249899 | |
7 | 7 | Implementation of the Stellation Two The Mill 6809 card |
8 | 8 | |
9 | 9 | 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 |
14 | 15 | |
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) |
16 | 17 | |
17 | 18 | ProDOS "Stellation The Mill Disk.po" requires Mill in slot 2; boot |
18 | 19 | the disc and type "-DEMO1" and press Enter to launch the simple demo. |
19 | 20 | |
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. |
25 | 22 | |
26 | 23 | *********************************************************************/ |
27 | 24 | |
r249898 | r249899 | |
103 | 100 | { |
104 | 101 | m_bEnabled = false; |
105 | 102 | m_flipAddrSpace = false; |
106 | | m_6809Mode = false; |
| 103 | m_6809Mode = true; |
107 | 104 | m_status = 0xc0; // OS9 loader relies on this |
108 | 105 | m_6809->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
109 | 106 | m_6809->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
r249898 | r249899 | |
238 | 235 | |
239 | 236 | READ8_MEMBER( a2bus_themill_device::dma_r ) |
240 | 237 | { |
| 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 | |
241 | 244 | if (m_6809Mode) |
242 | 245 | { |
243 | | if (offset <= 0xafff) |
| 246 | if (offset <= 0x7fff) |
244 | 247 | { |
245 | 248 | return slot_dma_read(space, offset+0x1000); |
246 | 249 | } |
247 | | else if (offset <= 0xbfff) |
| 250 | else if (offset <= 0xafff) |
248 | 251 | { |
249 | | return slot_dma_read(space, (offset&0xfff) + 0xd000); |
| 252 | return slot_dma_read(space, (offset&0x3fff) + 0xd000); |
250 | 253 | } |
251 | | else if (offset <= 0xcfff) |
| 254 | else if (offset <= 0xbfff) |
252 | 255 | { |
253 | | return slot_dma_read(space, (offset&0xfff) + 0xe000); |
| 256 | return slot_dma_read(space, (offset&0xfff) + 0xc000); |
254 | 257 | } |
255 | | else if (offset <= 0xdfff) |
| 258 | else if (offset <= 0xcfff) // 6809 Cxxx -> 6502 ZP |
256 | 259 | { |
257 | | return slot_dma_read(space, (offset&0xfff) + 0xf000); |
| 260 | return slot_dma_read(space, (offset&0xfff)); |
258 | 261 | } |
259 | | else if (offset <= 0xefff) |
| 262 | else // 6809 Dxxx -> 6502 9000 |
260 | 263 | { |
261 | | return slot_dma_read(space, (offset&0xfff) + 0xc000); |
| 264 | return slot_dma_read(space, (offset-0xd000)+0x9000); |
262 | 265 | } |
263 | | else // 6809 Fxxx -> 6502 ZP |
264 | | { |
265 | | return slot_dma_read(space, offset&0xfff); |
266 | | } |
267 | 266 | } |
268 | 267 | else |
269 | 268 | { |
r249898 | r249899 | |
289 | 288 | { |
290 | 289 | if (m_6809Mode) |
291 | 290 | { |
292 | | if (offset <= 0xafff) |
| 291 | if (offset <= 0x7fff) |
293 | 292 | { |
294 | 293 | slot_dma_write(space, offset+0x1000, data); |
295 | 294 | } |
| 295 | else if (offset <= 0xafff) |
| 296 | { |
| 297 | slot_dma_write(space, (offset&0x3fff) + 0xd000, data); |
| 298 | } |
296 | 299 | else if (offset <= 0xbfff) |
297 | 300 | { |
298 | | slot_dma_write(space, (offset&0xfff) + 0xd000, data); |
| 301 | slot_dma_write(space, (offset&0xfff) + 0xc000, data); |
299 | 302 | } |
300 | 303 | else if (offset <= 0xcfff) |
301 | 304 | { |
302 | | slot_dma_write(space, (offset&0xfff) + 0xe000, data); |
| 305 | slot_dma_write(space, (offset&0xfff), data); |
303 | 306 | } |
304 | | else if (offset <= 0xdfff) |
| 307 | else // 6809 Dxxx -> 6502 9000 |
305 | 308 | { |
306 | | slot_dma_write(space, (offset&0xfff) + 0xf000, data); |
| 309 | slot_dma_write(space, (offset-0xd000)+0x9000, data); |
307 | 310 | } |
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 | | } |
316 | 311 | } |
317 | 312 | else |
318 | 313 | { |