trunk/src/mess/drivers/amust.c
| r29631 | r29632 | |
| 36 | 36 | Having the PIT on ports 14-17 seems to make sense. It sets counters 1 and 2 |
| 37 | 37 | to mode 3, binary, initial count = 0x80. Counter 0 not used? |
| 38 | 38 | |
| 39 | |
| 39 | 40 | Floppy Parameters: |
| 41 | ------------------ |
| 40 | 42 | Double Density |
| 41 | 43 | Two Side |
| 42 | 44 | 80 track |
| r29631 | r29632 | |
| 48 | 50 | Skew 1,3,5,2,4 |
| 49 | 51 | |
| 50 | 52 | |
| 53 | Stuff that doesn't make sense: |
| 54 | ------------------------------ |
| 55 | 1. To access the screen, it waits for IRQ presumably from sync pulse. It sets INT |
| 56 | mode 0 which means a page-zero jump, but doesn't write anything to the zero-page ram. |
| 57 | That's why I added a RETI at 0008 and set the vector to there. A bit later it writes |
| 58 | a jump at 0000. Then it sets the interrupting device to the fdc (not sure how yet), |
| 59 | then proceeds to overwrite all of page-zero with the disk contents. This of course |
| 60 | kills the jump it just wrote, and my RETI. So it runs into the weeds at high speed. |
| 61 | What should happen is after loading the boot sector succesfully it will jump to 0000, |
| 62 | otherwise it will write BOOT NG to the screen and you're in the monitor. The bios |
| 63 | contains no RETI instructions. |
| 64 | 2. At F824 it copies itself to the same address which is presumably shadow ram. But |
| 65 | it never switches to it. The ram is physically in the machine. |
| 66 | |
| 67 | |
| 51 | 68 | Monitor Commands: |
| 69 | ----------------- |
| 52 | 70 | B = Boot from floppy |
| 53 | 71 | (YES! Most useless monitor ever) |
| 54 | 72 | |
| r29631 | r29632 | |
| 57 | 75 | - Everything |
| 58 | 76 | - Need software |
| 59 | 77 | - If booting straight to CP/M, the load message should be in the middle of the screen. |
| 60 | | - Beeper is a low pulse on bit 0 of port 0b |
| 61 | 78 | |
| 79 | |
| 62 | 80 | ****************************************************************************/ |
| 63 | 81 | |
| 64 | 82 | #include "emu.h" |
| r29631 | r29632 | |
| 69 | 87 | #include "machine/pit8253.h" |
| 70 | 88 | #include "machine/i8255.h" |
| 71 | 89 | #include "machine/i8251.h" |
| 90 | #include "sound/beep.h" |
| 72 | 91 | |
| 73 | 92 | |
| 74 | 93 | class amust_state : public driver_device |
| 75 | 94 | { |
| 76 | 95 | public: |
| 96 | enum |
| 97 | { |
| 98 | TIMER_BEEP_OFF |
| 99 | }; |
| 100 | |
| 77 | 101 | amust_state(const machine_config &mconfig, device_type type, const char *tag) |
| 78 | 102 | : driver_device(mconfig, type, tag) |
| 79 | 103 | , m_palette(*this, "palette") |
| 80 | 104 | , m_maincpu(*this, "maincpu") |
| 105 | , m_beep(*this, "beeper") |
| 81 | 106 | , m_fdc (*this, "fdc") |
| 82 | 107 | , m_floppy0(*this, "fdc:0") |
| 83 | 108 | , m_floppy1(*this, "fdc:1") |
| r29631 | r29632 | |
| 109 | 134 | UINT8 m_port08; |
| 110 | 135 | UINT8 m_port0a; |
| 111 | 136 | UINT8 m_term_data; |
| 137 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 112 | 138 | required_device<cpu_device> m_maincpu; |
| 139 | required_device<beep_device> m_beep; |
| 113 | 140 | required_device<upd765a_device> m_fdc; |
| 114 | 141 | required_device<floppy_connector> m_floppy0; |
| 115 | 142 | required_device<floppy_connector> m_floppy1; |
| 116 | 143 | }; |
| 117 | 144 | |
| 145 | void amust_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 146 | { |
| 147 | switch (id) |
| 148 | { |
| 149 | case TIMER_BEEP_OFF: |
| 150 | m_beep->set_state(0); |
| 151 | break; |
| 152 | default: |
| 153 | assert_always(FALSE, "Unknown id in amust_state::device_timer"); |
| 154 | } |
| 155 | } |
| 156 | |
| 118 | 157 | //WRITE8_MEMBER( amust_state::port00_w ) |
| 119 | 158 | //{ |
| 120 | 159 | // membank("bankr0")->set_entry(BIT(data, 6)); |
| r29631 | r29632 | |
| 196 | 235 | return m_port06; |
| 197 | 236 | } |
| 198 | 237 | |
| 238 | // BIT 5 low while writing to screen |
| 199 | 239 | WRITE8_MEMBER( amust_state::port06_w ) |
| 200 | 240 | { |
| 201 | 241 | m_port06 = data; |
| r29631 | r29632 | |
| 216 | 256 | return m_port08; |
| 217 | 257 | } |
| 218 | 258 | |
| 259 | // lower 8 bits of video address |
| 219 | 260 | WRITE8_MEMBER( amust_state::port08_w ) |
| 220 | 261 | { |
| 221 | 262 | m_port08 = data; |
| 222 | 263 | } |
| 223 | 264 | |
| 224 | | // bit 4: H = go to monitor; L = boot from disk |
| 265 | /* |
| 266 | d0 - something to do with type of disk |
| 267 | d1 - |
| 268 | d2 - |
| 269 | d3 - |
| 270 | d4 - H = go to monitor; L = boot from disk |
| 271 | d5 - status of disk-related; loops till NZ |
| 272 | d6 - |
| 273 | d7 - |
| 274 | */ |
| 225 | 275 | READ8_MEMBER( amust_state::port09_r ) |
| 226 | 276 | { |
| 277 | printf("%s\n",machine().describe_context()); |
| 227 | 278 | return 0xff; |
| 228 | 279 | } |
| 229 | 280 | |
| r29631 | r29632 | |
| 232 | 283 | return m_port0a; |
| 233 | 284 | } |
| 234 | 285 | |
| 286 | /* Bits 7,6,5,3 something to do |
| 287 | with selecting which device causes interrupt? |
| 288 | 50, 58 = video sync |
| 289 | 70 disk |
| 290 | D0 ? |
| 291 | Bit 4 low = beeper. |
| 292 | Lower 3 bits = upper part of video address */ |
| 235 | 293 | WRITE8_MEMBER( amust_state::port0a_w ) |
| 236 | 294 | { |
| 237 | 295 | m_port0a = data; |
| 296 | |
| 297 | if (!BIT(data, 4)) |
| 298 | { |
| 299 | m_beep->set_state(1); |
| 300 | timer_set(attotime::from_msec(150), TIMER_BEEP_OFF); |
| 301 | } |
| 238 | 302 | } |
| 239 | 303 | |
| 240 | 304 | static I8255_INTERFACE( ppi2_intf ) |
| r29631 | r29632 | |
| 327 | 391 | m_p_videoram = memregion("videoram")->base(); |
| 328 | 392 | membank("bankr0")->set_entry(0); // point at rom |
| 329 | 393 | membank("bankw0")->set_entry(0); // always write to ram |
| 394 | m_beep->set_frequency(800); |
| 330 | 395 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| 331 | | space.write_byte(8, 0xc9); |
| 396 | space.write_byte(8, 0xed); |
| 397 | space.write_byte(9, 0x4d); |
| 332 | 398 | m_port04 = 0; |
| 333 | 399 | m_port06 = 0; |
| 334 | 400 | m_port08 = 0; |
| r29631 | r29632 | |
| 363 | 429 | MCFG_PALETTE_ADD_MONOCHROME_GREEN("palette") |
| 364 | 430 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", amust) |
| 365 | 431 | |
| 432 | /* sound hardware */ |
| 433 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 434 | MCFG_SOUND_ADD("beeper", BEEP, 0) |
| 435 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 436 | |
| 366 | 437 | /* Devices */ |
| 367 | 438 | MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_14_31818MHz / 8, amust_crtc) |
| 368 | 439 | MCFG_DEVICE_ADD("keybd", GENERIC_KEYBOARD, 0) |
| r29631 | r29632 | |
| 408 | 479 | /* Driver */ |
| 409 | 480 | |
| 410 | 481 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ |
| 411 | | COMP( 1983, amust, 0, 0, amust, amust, amust_state, amust, "Amust", "Amust Executive 816", GAME_IS_SKELETON) |
| 482 | COMP( 1983, amust, 0, 0, amust, amust, amust_state, amust, "Amust", "Amust Executive 816", GAME_NOT_WORKING ) |