| Previous | 15994 Revisions | Next |
| r1682 Thursday 14th February, 2008 at 15:33:19 UTC by Dirk Best |
|---|
| Replaced legacy timer_adjust by timer_adjust_oneshot and timer_adjust_periodic. Updated all drivers. |
| [src/mess] | mslegacy.c mslegacy.h |
| [src/mess/audio] | t6721.c |
| [src/mess/devices] | flopdrv.c thomflop.c |
| [src/mess/drivers] | a2600.c a310.c abc80.c abc80x.c atarist.c exidy.c nc.c ql.c tm990189.c tutor.c x68k.c |
| [src/mess/machine] | 6551.c 68901mfp.c 99_dsk.c amigacd.c amigafdc.c amigakbd.c apple2gs.c applefdc.c at29040.c bbc.c centroni.c coco.c compis.c corvushd.c electron.c europc.c gamecom.c gb.c hd63450.c i8271.c ibmpc.c kc.c kim1.c lisa.c lynx.c mac.c matsucd.c mc6843.c mm58274c.c mz700.c nec765.c nes_mmc.c osborne1.c pc_hdc.c pc_mouse.c pce.c pcf8593.c pdp1.c pmd85.c pokemini.c rp5c15.c rriot.c serial.c sgi.c sms.c sym1.c thomson.c tms5501.c tms9901.c tms9902.c tx0.c vc1541.c vc20tape.c vectrex.c wd17xx.c z80dart.c zx.c |
| [src/mess/video] | 911_vdt.c abc80.c aim65.c atarist.c cdp1861.c cdp1864.c coco3.c gb.c m6847.c smsvdp.c ted7360.c thomson.c vectrex.c x68k.c zx8301.c |
| r1681 | r1682 | |
|---|---|---|
| 16 | 16 | */ |
| 17 | 17 | |
| 18 | 18 | #include "driver.h" |
| 19 | #include "mslegacy.h" | |
| 20 | 19 | #include "flopdrv.h" |
| 21 | 20 | |
| 22 | 21 | |
| r1681 | r1682 | |
| 76 | 75 | if (pDrive->index) |
| 77 | 76 | { |
| 78 | 77 | pDrive->index = 0; |
| 79 | timer_adjust(pDrive->index_timer, double_to_attotime(ms*19/20/1000.0), 0 | |
| 78 | timer_adjust_oneshot(pDrive->index_timer, double_to_attotime(ms*19/20/1000.0), 0 | |
| 80 | 79 | } |
| 81 | 80 | else |
| 82 | 81 | { |
| 83 | 82 | pDrive->index = 1; |
| 84 | timer_adjust(pDrive->index_timer, double_to_attotime(ms/20/1000.0), 0 | |
| 83 | timer_adjust_oneshot(pDrive->index_timer, double_to_attotime(ms/20/1000.0), 0 | |
| 85 | 84 | } |
| 86 | 85 | |
| 87 | 86 | if (pDrive->index_pulse_callback) |
| r1681 | r1682 | |
| 224 | 223 | else |
| 225 | 224 | { |
| 226 | 225 | /* on->off */ |
| 227 | timer_adjust(pDrive->index_timer, attotime_zero, 0 | |
| 226 | timer_adjust_oneshot(pDrive->index_timer, attotime_zero, 0 | |
| 228 | 227 | } |
| 229 | 228 | } |
| 230 | 229 | } |
| r1681 | r1682 | |
|---|---|---|
| 7 | 7 | **********************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | #include "mslegacy.h" | |
| 11 | 10 | #include "includes/thomson.h" |
| 12 | 11 | #include "machine/wd17xx.h" |
| 13 | 12 | #include "devices/flopdrv.h" |
| r1681 | r1682 | |
| 1042 | 1041 | thmfc1->stat0 |= THMFC1_STAT0_FINISHED; |
| 1043 | 1042 | thmfc1->data_idx = 0; |
| 1044 | 1043 | thmfc1->data_size = 0; |
| 1045 | timer_adjust( | |
| 1044 | timer_adjust_oneshot( | |
| 1046 | 1045 | } |
| 1047 | 1046 | |
| 1048 | 1047 | |
| r1681 | r1682 | |
| 1342 | 1341 | |
| 1343 | 1342 | /* abort previous command, if any */ |
| 1344 | 1343 | thmfc1->op = THMFC1_OP_RESET; |
| 1345 | timer_adjust( | |
| 1344 | timer_adjust_oneshot( | |
| 1346 | 1345 | |
| 1347 | 1346 | switch ( data & 3 ) |
| 1348 | 1347 | { |
| r1681 | r1682 | |
| 1361 | 1360 | thmfc1->data_finish = thmfc1->sector_size + 3; |
| 1362 | 1361 | thmfc1->stat0 |= THMFC1_STAT0_BYTE_READY_OP; |
| 1363 | 1362 | thmfc1->op = THMFC1_OP_WRITE_SECT; |
| 1364 | timer_adjust( | |
| 1363 | timer_adjust_oneshot( | |
| 1365 | 1364 | } |
| 1366 | 1365 | break; |
| 1367 | 1366 | |
| r1681 | r1682 | |
| 1377 | 1376 | thmfc1->data_idx = 1; |
| 1378 | 1377 | thmfc1->stat0 |= THMFC1_STAT0_BYTE_READY_OP; |
| 1379 | 1378 | thmfc1->op = THMFC1_OP_READ_ADDR; |
| 1380 | timer_adjust( | |
| 1379 | timer_adjust_oneshot( | |
| 1381 | 1380 | } |
| 1382 | 1381 | break; |
| 1383 | 1382 | |
| r1681 | r1682 | |
| 1393 | 1392 | thmfc1->data_idx = 1; |
| 1394 | 1393 | thmfc1->stat0 |= THMFC1_STAT0_BYTE_READY_OP; |
| 1395 | 1394 | thmfc1->op = THMFC1_OP_READ_SECT; |
| 1396 | timer_adjust( | |
| 1395 | timer_adjust_oneshot( | |
| 1397 | 1396 | } |
| 1398 | 1397 | break; |
| 1399 | 1398 | } |
| r1681 | r1682 | |
| 1550 | 1549 | thmfc1->data_raw_size = 0; |
| 1551 | 1550 | thmfc1->data_crc = 0; |
| 1552 | 1551 | thmfc1->wsync = 0; |
| 1553 | timer_adjust( | |
| 1552 | timer_adjust_oneshot( | |
| 1554 | 1553 | } |
| 1555 | 1554 | |
| 1556 | 1555 |
| r1681 | r1682 | |
|---|---|---|
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | /*************************************************************************** |
| 108 | TIMER | |
| 109 | ***************************************************************************/ | |
| 110 | ||
| 111 | void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period) | |
| 112 | { | |
| 113 | if (attotime_compare(period, attotime_zero) == 0) | |
| 114 | timer_adjust_oneshot(which, duration, param); | |
| 115 | else | |
| 116 | timer_adjust_periodic(which, duration, param, period); | |
| 117 | } | |
| 118 | ||
| 119 | ||
| 120 | ||
| 121 | /*************************************************************************** | |
| 122 | 108 | MC6845 |
| 123 | 109 | ***************************************************************************/ |
| 124 | 110 |
| r1681 | r1682 | |
|---|---|---|
| 84 | 84 | const char * ui_getstring (int string_num); |
| 85 | 85 | |
| 86 | 86 | |
| 87 | /* timer */ | |
| 88 | void timer_adjust(emu_timer *which, attotime duration, INT32 param, attotime period); | |
| 89 | ||
| 90 | ||
| 91 | 87 | /* mc6845 */ |
| 92 | 88 | struct _mc6845_t; |
| 93 | 89 | struct _mc6845_interface; |
| r1681 | r1682 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | #include <ctype.h> |
| 17 | 17 | #include "driver.h" |
| 18 | #include "mslegacy.h" | |
| 19 | 18 | #include "cpu/m6502/m6502.h" |
| 20 | 19 | |
| 21 | 20 | #define VERBOSE_DBG 1 |
| r1681 | r1682 | |
| 118 | 117 | speech.playing=FALSE; |
| 119 | 118 | break; |
| 120 | 119 | case 1: /* start */ |
| 121 | timer_adjust(speech.timer, attotime_zero, 0, ATTOTIME_IN_HZ(8000)); | |
| 120 | timer_adjust_periodic(speech.timer, attotime_zero, 0, ATTOTIME_IN_HZ(8000)); | |
| 122 | 121 | speech.playing=TRUE; |
| 123 | 122 | speech.endOfSample=FALSE; |
| 124 | 123 | speech.sampleindex=0; |
| r1681 | r1682 | |
|---|---|---|
| 15 | 15 | #include "911_chr.h" |
| 16 | 16 | #include "911_key.h" |
| 17 | 17 | #include "sound/beep.h" |
| 18 | #include "mslegacy.h" | |
| 19 | 18 | #include "deprecat.h" |
| 20 | 19 | |
| 21 | 20 | |
| r1681 | r1682 | |
| 443 | 442 | /* beep enable strobe - not tested */ |
| 444 | 443 | beep_set_state(unit, 1); |
| 445 | 444 | |
| 446 | timer_adjust(vdt[unit].beep_timer, ATTOTIME_IN_USEC(300), unit | |
| 445 | timer_adjust_oneshot(vdt[unit].beep_timer, ATTOTIME_IN_USEC(300), unit | |
| 447 | 446 | break; |
| 448 | 447 | |
| 449 | 448 | case 0xf: |
| r1681 | r1682 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | 15 | #include "deprecat.h" |
| 16 | #include "mslegacy.h" | |
| 17 | 16 | #include "includes/gb.h" |
| 18 | 17 | #include "cpu/z80gb/z80gb.h" |
| 19 | 18 | #include "profiler.h" |
| 20 | 19 | |
| 20 | ||
| 21 | 21 | #define LCDCONT gb_vid_regs[0x00] /* LCD control register */ |
| 22 | 22 | #define LCDSTAT gb_vid_regs[0x01] /* LCD status register */ |
| 23 | 23 | #define SCROLLY gb_vid_regs[0x02] /* Starting Y position of the background */ |
| r1681 | r1682 | |
| 1191 | 1191 | switch( mode ) { |
| 1192 | 1192 | case GB_VIDEO_DMG: |
| 1193 | 1193 | gb_lcd.lcd_timer = timer_alloc( gb_lcd_timer_proc , NULL); |
| 1194 | timer_adjust( | |
| 1194 | timer_adjust_oneshot( | |
| 1195 | 1195 | |
| 1196 | 1196 | /* set the scanline update function */ |
| 1197 | 1197 | update_scanline = gb_update_scanline; |
| r1681 | r1682 | |
| 1226 | 1226 | CURLINE = gb_lcd.current_line = 0; |
| 1227 | 1227 | LCDSTAT = ( LCDSTAT & 0xF8 ) | 0x05; |
| 1228 | 1228 | gb_lcd.mode = 1; |
| 1229 | timer_adjust( | |
| 1229 | timer_adjust_oneshot( | |
| 1230 | 1230 | |
| 1231 | 1231 | break; |
| 1232 | 1232 | case GB_VIDEO_SGB: |
| r1681 | r1682 | |
| 1254 | 1254 | CURLINE = gb_lcd.current_line = 0; |
| 1255 | 1255 | LCDSTAT = ( LCDSTAT & 0xF8 ) | 0x05; |
| 1256 | 1256 | gb_lcd.mode = 1; |
| 1257 | timer_adjust( | |
| 1257 | timer_adjust_oneshot( | |
| 1258 | 1258 | |
| 1259 | 1259 | break; |
| 1260 | 1260 | case GB_VIDEO_CGB: |
| r1681 | r1682 | |
| 1286 | 1286 | CURLINE = gb_lcd.current_line = 0x90; |
| 1287 | 1287 | LCDSTAT = ( LCDSTAT & 0xF8 ) | 0x01; |
| 1288 | 1288 | gb_lcd.mode = 1; |
| 1289 | timer_adjust( | |
| 1289 | timer_adjust_oneshot( | |
| 1290 | 1290 | gb_lcd.oam_locked = UNLOCKED; |
| 1291 | 1291 | gb_lcd.vram_locked = UNLOCKED; |
| 1292 | 1292 | gb_lcd.pal_locked = UNLOCKED; |
| r1681 | r1682 | |
| 1345 | 1345 | gb_lcd.mode_irq = 0; |
| 1346 | 1346 | } |
| 1347 | 1347 | } |
| 1348 | timer_adjust( | |
| 1348 | timer_adjust_oneshot( | |
| 1349 | 1349 | break; |
| 1350 | 1350 | case GB_LCD_STATE_LYXX_M0: /* Switch to mode 0 */ |
| 1351 | 1351 | /* update current scanline */ |
| r1681 | r1682 | |
| 1368 | 1368 | */ |
| 1369 | 1369 | if ( ( SCROLLX & 0x03 ) == 0x03 ) { |
| 1370 | 1370 | gb_lcd.scrollx_adjust += 4; |
| 1371 | timer_adjust( | |
| 1371 | timer_adjust_oneshot( | |
| 1372 | 1372 | break; |
| 1373 | 1373 | } |
| 1374 | 1374 | case GB_LCD_STATE_LYXX_M0_SCX3: |
| r1681 | r1682 | |
| 1377 | 1377 | ( ( ! gb_lcd.line_irq && gb_lcd.delayed_line_irq ) || ! ( LCDSTAT & 0x40 ) ) ) { |
| 1378 | 1378 | cpunum_set_input_line( machine, 0, LCD_INT, HOLD_LINE ); |
| 1379 | 1379 | } |
| 1380 | timer_adjust( | |
| 1380 | timer_adjust_oneshot( | |
| 1381 | 1381 | break; |
| 1382 | 1382 | case GB_LCD_STATE_LYXX_M0_PRE_INC: /* Just before incrementing the line counter go to mode 2 internally */ |
| 1383 | 1383 | if ( CURLINE < 143 ) { |
| r1681 | r1682 | |
| 1394 | 1394 | } |
| 1395 | 1395 | } |
| 1396 | 1396 | } |
| 1397 | timer_adjust( | |
| 1397 | timer_adjust_oneshot( | |
| 1398 | 1398 | break; |
| 1399 | 1399 | case GB_LCD_STATE_LYXX_M0_INC: /* Increment LY, stay in M0 for 4 more cycles */ |
| 1400 | 1400 | gb_increment_scanline(); |
| r1681 | r1682 | |
| 1409 | 1409 | LCDSTAT &= 0xFB; |
| 1410 | 1410 | /* Check if we're going into VBlank next */ |
| 1411 | 1411 | if ( CURLINE == 144 ) { |
| 1412 | timer_adjust( | |
| 1412 | timer_adjust_oneshot( | |
| 1413 | 1413 | } else { |
| 1414 | 1414 | /* Internally switch to mode 2 */ |
| 1415 | 1415 | gb_lcd.mode = 2; |
| r1681 | r1682 | |
| 1419 | 1419 | gb_lcd.mode_irq = 1; |
| 1420 | 1420 | cpunum_set_input_line( machine, 0, LCD_INT, HOLD_LINE ); |
| 1421 | 1421 | } |
| 1422 | timer_adjust( | |
| 1422 | timer_adjust_oneshot( | |
| 1423 | 1423 | } |
| 1424 | 1424 | break; |
| 1425 | 1425 | case GB_LCD_STATE_LY00_M2: /* Switch to mode 2 on line #0 */ |
| r1681 | r1682 | |
| 1434 | 1434 | /* Check for regular compensation of x-scroll register */ |
| 1435 | 1435 | gb_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0; |
| 1436 | 1436 | /* Mode 2 lasts approximately 80 clock cycles */ |
| 1437 | timer_adjust( | |
| 1437 | timer_adjust_oneshot( | |
| 1438 | 1438 | break; |
| 1439 | 1439 | case GB_LCD_STATE_LYXX_M2: /* Switch to mode 2 */ |
| 1440 | 1440 | /* Update STAT register to the correct state */ |
| r1681 | r1682 | |
| 1454 | 1454 | /* Check for regular compensation of x-scroll register */ |
| 1455 | 1455 | gb_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0; |
| 1456 | 1456 | /* Mode 2 last for approximately 80 clock cycles */ |
| 1457 | timer_adjust( | |
| 1457 | timer_adjust_oneshot( | |
| 1458 | 1458 | break; |
| 1459 | 1459 | case GB_LCD_STATE_LYXX_M3: /* Switch to mode 3 */ |
| 1460 | 1460 | gb_select_sprites(); |
| r1681 | r1682 | |
| 1465 | 1465 | gb_lcd.vram_locked = LOCKED; |
| 1466 | 1466 | /* Check for compensations of x-scroll register */ |
| 1467 | 1467 | /* Mode 3 lasts for approximately 172+cycles needed to handle sprites clock cycles */ |
| 1468 | timer_adjust( | |
| 1468 | timer_adjust_oneshot( | |
| 1469 | 1469 | gb_lcd.start_x = -1; |
| 1470 | 1470 | break; |
| 1471 | 1471 | case GB_LCD_STATE_LY9X_M1: /* Switch to or stay in mode 1 */ |
| r1681 | r1682 | |
| 1487 | 1487 | if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1488 | 1488 | cpunum_set_input_line( machine, 0, LCD_INT, HOLD_LINE ); |
| 1489 | 1489 | } |
| 1490 | timer_adjust( | |
| 1490 | timer_adjust_oneshot( | |
| 1491 | 1491 | break; |
| 1492 | 1492 | case GB_LCD_STATE_LY9X_M1_INC: /* Increment scanline counter */ |
| 1493 | 1493 | gb_increment_scanline(); |
| r1681 | r1682 | |
| 1501 | 1501 | /* Reset LY==LYC STAT bit */ |
| 1502 | 1502 | LCDSTAT &= 0xFB; |
| 1503 | 1503 | if ( gb_lcd.current_line == 153 ) { |
| 1504 | timer_adjust( | |
| 1504 | timer_adjust_oneshot( | |
| 1505 | 1505 | } else { |
| 1506 | timer_adjust( | |
| 1506 | timer_adjust_oneshot( | |
| 1507 | 1507 | } |
| 1508 | 1508 | break; |
| 1509 | 1509 | case GB_LCD_STATE_LY00_M1: /* we stay in VBlank but current line counter should already be incremented */ |
| r1681 | r1682 | |
| 1521 | 1521 | gb_lcd.triggering_line_irq = ( ( CMPLINE == CURLINE ) && ( LCDSTAT & 0x40 ) ) ? 1 : 0; |
| 1522 | 1522 | gb_lcd.line_irq = 0; |
| 1523 | 1523 | LCDSTAT &= 0xFB; |
| 1524 | timer_adjust( | |
| 1524 | timer_adjust_oneshot( | |
| 1525 | 1525 | break; |
| 1526 | 1526 | case GB_LCD_STATE_LY00_M1_1: |
| 1527 | 1527 | if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1528 | 1528 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1529 | 1529 | cpunum_set_input_line( machine, 0, LCD_INT, HOLD_LINE ); |
| 1530 | 1530 | } |
| 1531 | timer_adjust( | |
| 1531 | timer_adjust_oneshot( | |
| 1532 | 1532 | break; |
| 1533 | 1533 | case GB_LCD_STATE_LY00_M1_2: /* Rest of line #0 during VBlank */ |
| 1534 | 1534 | if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| r1681 | r1682 | |
| 1538 | 1538 | if ( CURLINE == CMPLINE ) { |
| 1539 | 1539 | LCDSTAT |= 0x04; |
| 1540 | 1540 | } |
| 1541 | timer_adjust( | |
| 1541 | timer_adjust_oneshot( | |
| 1542 | 1542 | break; |
| 1543 | 1543 | case GB_LCD_STATE_LY00_M0: /* The STAT register seems to go to 0 for about 4 cycles */ |
| 1544 | 1544 | /* Set Mode 0 lcdstat */ |
| 1545 | 1545 | gb_lcd.mode = 0; |
| 1546 | 1546 | LCDSTAT = ( LCDSTAT & 0xFC ); |
| 1547 | timer_adjust( | |
| 1547 | timer_adjust_oneshot( | |
| 1548 | 1548 | break; |
| 1549 | 1549 | } |
| 1550 | 1550 | } else { |
| r1681 | r1682 | |
| 1552 | 1552 | if ( gb_lcd.current_line < 144 ) { |
| 1553 | 1553 | update_scanline(); |
| 1554 | 1554 | } |
| 1555 | timer_adjust( | |
| 1555 | timer_adjust_oneshot( | |
| 1556 | 1556 | } |
| 1557 | 1557 | } |
| 1558 | 1558 | |
| r1681 | r1682 | |
| 1576 | 1576 | gb_lcd.mode_irq = 0; |
| 1577 | 1577 | } |
| 1578 | 1578 | } |
| 1579 | timer_adjust( | |
| 1579 | timer_adjust_oneshot( | |
| 1580 | 1580 | break; |
| 1581 | 1581 | case GB_LCD_STATE_LYXX_M0: /* Switch to mode 0 */ |
| 1582 | 1582 | /* update current scanline */ |
| r1681 | r1682 | |
| 1600 | 1600 | gb_lcd.triggering_mode_irq = ( LCDSTAT & 0x08 ) ? 1 : 0; |
| 1601 | 1601 | if ( ( SCROLLX & 0x03 ) == 0x03 ) { |
| 1602 | 1602 | gb_lcd.scrollx_adjust += 4; |
| 1603 | timer_adjust( | |
| 1603 | timer_adjust_oneshot( | |
| 1604 | 1604 | break; |
| 1605 | 1605 | } |
| 1606 | 1606 | case GB_LCD_STATE_LYXX_M0_SCX3: |
| r1681 | r1682 | |
| 1613 | 1613 | if ( ( SCROLLX & 0x03 ) == 0x03 ) { |
| 1614 | 1614 | gb_lcd.pal_locked = UNLOCKED; |
| 1615 | 1615 | } |
| 1616 | timer_adjust( | |
| 1616 | timer_adjust_oneshot( | |
| 1617 | 1617 | break; |
| 1618 | 1618 | case GB_LCD_STATE_LYXX_M0_GBC_PAL: |
| 1619 | 1619 | gb_lcd.pal_locked = UNLOCKED; |
| r1681 | r1682 | |
| 1624 | 1624 | } else { |
| 1625 | 1625 | gb_lcd.hdma_possible = 1; |
| 1626 | 1626 | } |
| 1627 | timer_adjust( | |
| 1627 | timer_adjust_oneshot( | |
| 1628 | 1628 | break; |
| 1629 | 1629 | case GB_LCD_STATE_LYXX_M0_PRE_INC: /* Just before incrementing the line counter go to mode 2 internally */ |
| 1630 | 1630 | gb_lcd.cmp_line = CMPLINE; |
| r1681 | r1682 | |
| 1641 | 1641 | } |
| 1642 | 1642 | } |
| 1643 | 1643 | } |
| 1644 | timer_adjust( | |
| 1644 | timer_adjust_oneshot( | |
| 1645 | 1645 | break; |
| 1646 | 1646 | case GB_LCD_STATE_LYXX_M0_INC: /* Increment LY, stay in M0 for 4 more cycles */ |
| 1647 | 1647 | gb_increment_scanline(); |
| r1681 | r1682 | |
| 1655 | 1655 | gb_lcd.hdma_possible = 0; |
| 1656 | 1656 | /* Check if we're going into VBlank next */ |
| 1657 | 1657 | if ( CURLINE == 144 ) { |
| 1658 | timer_adjust( | |
| 1658 | timer_adjust_oneshot( | |
| 1659 | 1659 | } else { |
| 1660 | 1660 | /* Internally switch to mode 2 */ |
| 1661 | 1661 | gb_lcd.mode = 2; |
| r1681 | r1682 | |
| 1665 | 1665 | gb_lcd.mode_irq = 1; |
| 1666 | 1666 | cpunum_set_input_line( machine, 0, LCD_INT, HOLD_LINE ); |
| 1667 | 1667 | } |
| 1668 | timer_adjust( | |
| 1668 | timer_adjust_oneshot( | |
| 1669 | 1669 | } |
| 1670 | 1670 | break; |
| 1671 | 1671 | case GB_LCD_STATE_LY00_M2: /* Switch to mode 2 on line #0 */ |
| r1681 | r1682 | |
| 1680 | 1680 | /* Check for regular compensation of x-scroll register */ |
| 1681 | 1681 | gb_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0; |
| 1682 | 1682 | /* Mode 2 lasts approximately 80 clock cycles */ |
| 1683 | timer_adjust( | |
| 1683 | timer_adjust_oneshot( | |
| 1684 | 1684 | break; |
| 1685 | 1685 | case GB_LCD_STATE_LYXX_M2: /* Switch to mode 2 */ |
| 1686 | 1686 | /* Update STAT register to the correct state */ |
| r1681 | r1682 | |
| 1701 | 1701 | /* Check for regular compensation of x-scroll register */ |
| 1702 | 1702 | gb_lcd.scrollx_adjust = ( SCROLLX & 0x04 ) ? 4 : 0; |
| 1703 | 1703 | /* Mode 2 last for approximately 80 clock cycles */ |
| 1704 | timer_adjust( | |
| 1704 | timer_adjust_oneshot( | |
| 1705 | 1705 | break; |
| 1706 | 1706 | case GB_LCD_STATE_LYXX_M3: /* Switch to mode 3 */ |
| 1707 | 1707 | gb_select_sprites(); |
| r1681 | r1682 | |
| 1713 | 1713 | gb_lcd.pal_locked = LOCKED; |
| 1714 | 1714 | /* Check for compensations of x-scroll register */ |
| 1715 | 1715 | /* Mode 3 lasts for approximately 172+cycles needed to handle sprites clock cycles */ |
| 1716 | timer_adjust( | |
| 1716 | timer_adjust_oneshot( | |
| 1717 | 1717 | gb_lcd.start_x = -1; |
| 1718 | 1718 | break; |
| 1719 | 1719 | case GB_LCD_STATE_LY9X_M1: /* Switch to or stay in mode 1 */ |
| r1681 | r1682 | |
| 1737 | 1737 | if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1738 | 1738 | cpunum_set_input_line( machine, 0, LCD_INT, HOLD_LINE ); |
| 1739 | 1739 | } |
| 1740 | timer_adjust( | |
| 1740 | timer_adjust_oneshot( | |
| 1741 | 1741 | break; |
| 1742 | 1742 | case GB_LCD_STATE_LY9X_M1_INC: /* Increment scanline counter */ |
| 1743 | 1743 | gb_increment_scanline(); |
| r1681 | r1682 | |
| 1749 | 1749 | cpunum_set_input_line( machine, 0, LCD_INT, HOLD_LINE ); |
| 1750 | 1750 | } |
| 1751 | 1751 | if ( gb_lcd.current_line == 153 ) { |
| 1752 | timer_adjust( | |
| 1752 | timer_adjust_oneshot( | |
| 1753 | 1753 | } else { |
| 1754 | timer_adjust( | |
| 1754 | timer_adjust_oneshot( | |
| 1755 | 1755 | } |
| 1756 | 1756 | break; |
| 1757 | 1757 | case GB_LCD_STATE_LY00_M1: /* we stay in VBlank but current line counter should already be incremented */ |
| r1681 | r1682 | |
| 1771 | 1771 | gb_lcd.triggering_line_irq = ( ( CMPLINE == CURLINE ) && ( LCDSTAT & 0x40 ) ) ? 1 : 0; |
| 1772 | 1772 | gb_lcd.line_irq = 0; |
| 1773 | 1773 | LCDSTAT &= 0xFB; |
| 1774 | timer_adjust( | |
| 1774 | timer_adjust_oneshot( | |
| 1775 | 1775 | break; |
| 1776 | 1776 | case GB_LCD_STATE_LY00_M1_1: |
| 1777 | 1777 | if ( ! gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| 1778 | 1778 | gb_lcd.line_irq = gb_lcd.triggering_line_irq; |
| 1779 | 1779 | cpunum_set_input_line( machine, 0, LCD_INT, HOLD_LINE ); |
| 1780 | 1780 | } |
| 1781 | timer_adjust( | |
| 1781 | timer_adjust_oneshot( | |
| 1782 | 1782 | break; |
| 1783 | 1783 | case GB_LCD_STATE_LY00_M1_2: /* Rest of line #0 during VBlank */ |
| 1784 | 1784 | if ( gb_lcd.delayed_line_irq && gb_lcd.triggering_line_irq ) { |
| r1681 | r1682 | |
| 1790 | 1790 | } else { |
| 1791 | 1791 | LCDSTAT &= ~0x04; |
| 1792 | 1792 | } |
| 1793 | timer_adjust( | |
| 1793 | timer_adjust_oneshot( | |
| 1794 | 1794 | break; |
| 1795 | 1795 | case GB_LCD_STATE_LY00_M0: /* The STAT register seems to go to 0 for about 4 cycles */ |
| 1796 | 1796 | /* Set Mode 0 lcdstat */ |
| 1797 | 1797 | gb_lcd.mode = 0; |
| 1798 | timer_adjust( | |
| 1798 | timer_adjust_oneshot( | |
| 1799 | 1799 | break; |
| 1800 | 1800 | } |
| 1801 | 1801 | } else { |
| r1681 | r1682 | |
| 1803 | 1803 | if ( gb_lcd.current_line < 144 ) { |
| 1804 | 1804 | update_scanline(); |
| 1805 | 1805 | } |
| 1806 | timer_adjust( | |
| 1806 | timer_adjust_oneshot( | |
| 1807 | 1807 | } |
| 1808 | 1808 | } |
| 1809 | 1809 | |
| r1681 | r1682 | |
| 1824 | 1824 | } |
| 1825 | 1825 | } |
| 1826 | 1826 | gb_lcd.state = GB_LCD_STATE_LY00_M2; |
| 1827 | timer_adjust( | |
| 1827 | timer_adjust_oneshot( | |
| 1828 | 1828 | } |
| 1829 | 1829 | |
| 1830 | 1830 | READ8_HANDLER( gb_video_r ) { |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | #include <math.h> |
| 2 | 2 | #include "driver.h" |
| 3 | 3 | #include "deprecat.h" |
| 4 | #include "mslegacy.h" | |
| 5 | 4 | #include "includes/vectrex.h" |
| 6 | 5 | #include "video/vector.h" |
| 7 | 6 | #include "machine/6522via.h" |
| r1681 | r1682 | |
| 275 | 274 | imager_freq = 1; |
| 276 | 275 | |
| 277 | 276 | imager_timer = timer_alloc(vectrex_imager_right_eye, NULL); |
| 278 | timer_adjust(imager_timer, ATTOTIME_IN_HZ(imager_freq), 2, ATTOTIME_IN_HZ(imager_freq)); | |
| 277 | timer_adjust_periodic(imager_timer, ATTOTIME_IN_HZ(imager_freq), 2, ATTOTIME_IN_HZ(imager_freq)); | |
| 279 | 278 | |
| 280 | 279 | lp_t = timer_alloc(lightpen_trigger_callback, NULL); |
| 281 | 280 | |
| r1681 | r1682 | |
| 334 | 333 | +(double)(pen_y-y_int)*(pen_y-y_int); |
| 335 | 334 | d2=b2-ab*ab/a2; |
| 336 | 335 | if (d2<2e10 && analog_sig[ASIG_Z]*blank>0) |
| 337 | timer_adjust(lp_t, double_to_attotime(ab/a2/(VECTREX_CLOCK*INT_PER_CLOCK)),0 | |
| 336 | timer_adjust_oneshot(lp_t, double_to_attotime(ab/a2/(VECTREX_CLOCK*INT_PER_CLOCK)), 0 | |
| 338 | 337 | } |
| 339 | 338 | } |
| 340 | 339 | } |
| r1681 | r1682 | |
| 357 | 356 | vectrex_solid_line(attotime_to_double(timer_get_time())-start_time+RAMP_DELAY, blank); |
| 358 | 357 | /* Cancel running timer, line already finished */ |
| 359 | 358 | if (lightpen_down) |
| 360 | timer_adjust(lp_t,attotime_never,0 | |
| 359 | timer_adjust_oneshot(lp_t, attotime_never, 0 | |
| 361 | 360 | } |
| 362 | 361 | } |
| 363 | 362 |
| r1681 | r1682 | |
|---|---|---|
| 6 | 6 | ******************************************************************************/ |
| 7 | 7 | |
| 8 | 8 | #include "driver.h" |
| 9 | #include "mslegacy.h" | |
| 10 | 9 | |
| 11 | 10 | #include "includes/aim65.h" |
| 12 | 11 | #include "machine/6522via.h" |
| 13 | 12 | |
| 13 | ||
| 14 | 14 | static int printer_x; |
| 15 | 15 | static int printer_y; |
| 16 | 16 | static int printer_dir; |
| r1681 | r1682 | |
| 96 | 96 | if (!data) |
| 97 | 97 | { |
| 98 | 98 | aim65_printer_cr(); |
| 99 | timer_adjust(print_timer, attotime_zero, 0, ATTOTIME_IN_USEC(10)); | |
| 99 | timer_adjust_periodic(print_timer, attotime_zero, 0, ATTOTIME_IN_USEC(10)); | |
| 100 | 100 | via_0_cb1_w(0, 0); |
| 101 | 101 | printer_level = 1; |
| 102 | 102 | } |
| r1681 | r1682 | |
|---|---|---|
| 66 | 66 | #include "driver.h" |
| 67 | 67 | #include "m6847.h" |
| 68 | 68 | #include "deprecat.h" |
| 69 | #include "mslegacy.h" | |
| 70 | 69 | |
| 71 | 70 | #ifdef ENABLE_DEBUGGER |
| 72 | 71 | #include "debug/debugcpu.h" |
| 73 | 72 | #include "debug/debugcon.h" |
| 74 | 73 | #endif |
| 75 | 74 | |
| 75 | ||
| 76 | 76 | #define LOG_FS 0 |
| 77 | 77 | #define LOG_HS 0 |
| 78 | 78 | #define LOG_STATS 0 |
| r1681 | r1682 | |
| 1633 | 1633 | if (LOG_HS) |
| 1634 | 1634 | logerror("hs_rise(): time=%s\n", attotime_string(timer_get_time(), ATTOTIME_STRING_PRECISION)); |
| 1635 | 1635 | |
| 1636 | timer_adjust(m6847->hs_rise_timer, | |
| 1637 | attotime_make(0, m6847->scanline_period), | |
| 1638 | 0, attotime_never); | |
| 1639 | timer_adjust(m6847->hs_fall_timer, | |
| 1640 | attotime_make(0, m6847->horizontal_sync_period), | |
| 1641 | 0, attotime_never); | |
| 1636 | timer_adjust_oneshot(m6847->hs_rise_timer, | |
| 1637 | attotime_make(0, m6847->scanline_period), 0); | |
| 1638 | timer_adjust_oneshot(m6847->hs_fall_timer, | |
| 1639 | attotime_make(0, m6847->horizontal_sync_period), 0); | |
| 1642 | 1640 | |
| 1643 | 1641 | set_horizontal_sync(); |
| 1644 | 1642 | prepare_scanline(0); |
| r1681 | r1682 | |
| 1658 | 1656 | logerror("fs_rise(): time=%s scanline=%d\n", attotime_string(timer_get_time(), ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1659 | 1657 | |
| 1660 | 1658 | /* adjust field sync falling edge timer */ |
| 1661 | timer_adjust(m6847->fs_fall_timer, | |
| 1662 | attotime_make(0, m6847->field_sync_period), | |
| 1663 | 0, attotime_never); | |
| 1659 | timer_adjust_oneshot(m6847->fs_fall_timer, | |
| 1660 | attotime_make(0, m6847->field_sync_period), 0); | |
| 1664 | 1661 | |
| 1665 | 1662 | /* adjust horizontal sync rising timer */ |
| 1666 | timer_adjust(m6847->hs_rise_timer, attotime_zero, 0 | |
| 1663 | timer_adjust_oneshot(m6847->hs_rise_timer, attotime_zero, 0 | |
| 1667 | 1664 | |
| 1668 | 1665 | /* this is a hook for the CoCo 3 code to extend this stuff */ |
| 1669 | 1666 | if (m6847->new_frame_callback) |
| r1681 | r1682 | |
| 1892 | 1889 | /* setup timing */ |
| 1893 | 1890 | frame_period = period * |
| 1894 | 1891 | (UINT32) (v->clocks_per_scanline * total_scanlines * GROSS_FACTOR); |
| 1895 | timer_adjust(m6847->fs_rise_timer, attotime_zero, 0, attotime_make(0, frame_period)); | |
| 1892 | timer_adjust_periodic(m6847->fs_rise_timer, attotime_zero, 0, attotime_make(0, frame_period)); | |
| 1896 | 1893 | |
| 1897 | 1894 | /* setup save states */ |
| 1898 | 1895 | state_save_register_func_postload(set_field_sync); |
| r1681 | r1682 | |
|---|---|---|
| 9 | 9 | #include <math.h> |
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "deprecat.h" |
| 12 | #include "mslegacy.h" | |
| 13 | 12 | #include "includes/thomson.h" |
| 14 | 13 | #include "cpu/m6809/m6809.h" |
| 15 | 14 | #include "machine/6821pia.h" |
| r1681 | r1682 | |
| 220 | 219 | thom_lightpen_cb( step ); |
| 221 | 220 | |
| 222 | 221 | if ( step < thom_lightpen_nb ) |
| 223 | timer_adjust( | |
| 222 | timer_adjust_oneshot( | |
| 224 | 223 | } |
| 225 | 224 | |
| 226 | 225 | |
| r1681 | r1682 | |
| 820 | 819 | |
| 821 | 820 | /* prepare for next scanline */ |
| 822 | 821 | if ( y == 199 ) |
| 823 | timer_adjust( | |
| 822 | timer_adjust_oneshot( | |
| 824 | 823 | else |
| 825 | 824 | { |
| 826 | 825 | |
| r1681 | r1682 | |
| 845 | 844 | thom_pal_changed = 0; |
| 846 | 845 | } |
| 847 | 846 | |
| 848 | timer_adjust( | |
| 847 | timer_adjust_oneshot( | |
| 849 | 848 | } |
| 850 | 849 | } |
| 851 | 850 | |
| r1681 | r1682 | |
| 1028 | 1027 | if ( thom_init_cb ) |
| 1029 | 1028 | thom_init_cb( init ); |
| 1030 | 1029 | if ( ! init ) |
| 1031 | timer_adjust( | |
| 1030 | timer_adjust_oneshot( | |
| 1032 | 1031 | } |
| 1033 | 1032 | |
| 1034 | 1033 | /* call this at the very begining of each new frame */ |
| r1681 | r1682 | |
| 1066 | 1065 | thom_vstate_dirty = 0; |
| 1067 | 1066 | |
| 1068 | 1067 | /* schedule first init signal */ |
| 1069 | timer_adjust( | |
| 1068 | timer_adjust_oneshot( | |
| 1070 | 1069 | |
| 1071 | 1070 | /* schedule first lightpen signal */ |
| 1072 | 1071 | l.line &= ~1; /* hack (avoid lock in MO6 palette selection) */ |
| 1073 | timer_adjust( thom_lightpen_timer, | |
| 1074 | ATTOTIME_IN_USEC( 64 * ( THOM_BORDER_HEIGHT + l.line - 2 ) + 16 ), | |
| 1075 | 0, attotime_zero ); | |
| 1072 | timer_adjust_oneshot(thom_lightpen_timer, | |
| 1073 | ATTOTIME_IN_USEC( 64 * ( THOM_BORDER_HEIGHT + l.line - 2 ) + 16 ), 0); | |
| 1076 | 1074 | |
| 1077 | 1075 | /* schedule first active-area scanline call-back */ |
| 1078 | timer_adjust( thom_scanline_timer, ATTOTIME_IN_USEC( 64 * THOM_BORDER_HEIGHT + 7), | |
| 1079 | -1, attotime_zero ); | |
| 1076 | timer_adjust_oneshot(thom_scanline_timer, ATTOTIME_IN_USEC( 64 * THOM_BORDER_HEIGHT + 7), -1); | |
| 1080 | 1077 | |
| 1081 | 1078 | /* reset video frame time */ |
| 1082 | timer_adjust( | |
| 1079 | timer_adjust_oneshot( | |
| 1083 | 1080 | |
| 1084 | 1081 | /* update screen size according to user options */ |
| 1085 | 1082 | if ( thom_update_screen_size() ) |
| r1681 | r1682 | |
|---|---|---|
| 5 | 5 | ****************************************************************************/ |
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | #include "mslegacy.h" | |
| 9 | 8 | #include "includes/abc80.h" |
| 10 | 9 | |
| 11 | 10 | |
| r1681 | r1682 | |
| 71 | 70 | VIDEO_START( abc80 ) |
| 72 | 71 | { |
| 73 | 72 | abc80_blink_timer = timer_alloc(abc80_blink_tick, NULL); |
| 74 | timer_adjust(abc80_blink_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC80_XTAL/2/6/64/312/16)); | |
| 73 | timer_adjust_periodic(abc80_blink_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC80_XTAL/2/6/64/312/16)); | |
| 75 | 74 | |
| 76 | 75 | tx_tilemap = tilemap_create(abc80_get_tile_info, abc80_tilemap_scan, |
| 77 | 76 | 6, 10, 40, 24); |
| r1681 | r1682 | |
|---|---|---|
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | 28 | #include "driver.h" |
| 29 | #include "mslegacy.h" | |
| 30 | 29 | #include "includes/x68k.h" |
| 31 | 30 | #include "machine/68901mfp.h" |
| 32 | 31 | |
| 32 | ||
| 33 | 33 | extern struct x68k_system sys; |
| 34 | 34 | |
| 35 | 35 | extern emu_timer* scanline_timer; |
| r1681 | r1682 | |
| 232 | 232 | if(sys.crtc.reg[4] != 0) |
| 233 | 233 | { |
| 234 | 234 | // scantime = ATTOTIME_IN_HZ(55.45) / sys.crtc.reg[4]; |
| 235 | // timer_adjust(scanline_timer,attotime_zero,0,scantime); | |
| 235 | // timer_adjust_periodic(scanline_timer, attotime_zero, 0, scantime); | |
| 236 | 236 | }*/ |
| 237 | 237 | } |
| 238 | 238 | |
| r1681 | r1682 | |
| 248 | 248 | if(scan > sys.crtc.vend) |
| 249 | 249 | scan = 0; |
| 250 | 250 | hsync_time = video_screen_get_time_until_pos(0,scan+1,sys.crtc.hsync_end); |
| 251 | timer_adjust(scanline_timer,hsync_time,0 | |
| 251 | timer_adjust_oneshot(scanline_timer, hsync_time, 0 | |
| 252 | 252 | } |
| 253 | 253 | if(state == 0) |
| 254 | 254 | { |
| 255 | 255 | hsync_time = video_screen_get_time_until_pos(0,video_screen_get_vpos(0),sys.crtc.hend); |
| 256 | timer_adjust(scanline_timer,hsync_time,1 | |
| 256 | timer_adjust_oneshot(scanline_timer, hsync_time, 1 | |
| 257 | 257 | // if(!(sys.mfp.gpio & 0x40)) // if GPIP6 is active, clear it |
| 258 | 258 | // sys.mfp.gpio |= 0x40; |
| 259 | 259 | } |
| r1681 | r1682 | |
| 272 | 272 | |
| 273 | 273 | if(scan > sys.crtc.vtotal) |
| 274 | 274 | { |
| 275 | timer_adjust(raster_irq,attotime_zero,0 | |
| 275 | timer_adjust_oneshot(raster_irq, attotime_zero, 0 | |
| 276 | 276 | return; |
| 277 | 277 | } |
| 278 | 278 | sys.mfp.gpio &= ~0x40; // GPIP6 |
| r1681 | r1682 | |
| 284 | 284 | irq_time = video_screen_get_time_until_pos(0,scan,2); |
| 285 | 285 | // end of HBlank period clears GPIP6 also? |
| 286 | 286 | end_time = video_screen_get_time_until_pos(0,scan,sys.crtc.hbegin); |
| 287 | timer_adjust(raster_irq,irq_time,scan | |
| 287 | timer_adjust_oneshot(raster_irq, irq_time, scan | |
| 288 | 288 | timer_set(end_time,NULL,0,x68k_crtc_raster_end); |
| 289 | 289 | logerror("GPIP6: Raster triggered at line %i (%i)\n",scan,video_screen_get_vpos(0)); |
| 290 | 290 | } |
| r1681 | r1682 | |
| 302 | 302 | if(vblank_line > sys.crtc.vtotal) |
| 303 | 303 | vblank_line = sys.crtc.vtotal; |
| 304 | 304 | irq_time = video_screen_get_time_until_pos(0,vblank_line,2); |
| 305 | timer_adjust(vblank_irq,irq_time,0 | |
| 305 | timer_adjust_oneshot(vblank_irq, irq_time, 0 | |
| 306 | 306 | logerror("CRTC: VBlank on\n"); |
| 307 | 307 | } |
| 308 | 308 | if(val == 0) // VBlank off |
| r1681 | r1682 | |
| 310 | 310 | sys.crtc.vblank = 0; |
| 311 | 311 | vblank_line = sys.crtc.vbegin; |
| 312 | 312 | irq_time = video_screen_get_time_until_pos(0,vblank_line,2); |
| 313 | timer_adjust(vblank_irq,irq_time,1 | |
| 313 | timer_adjust_oneshot(vblank_irq, irq_time, 1 | |
| 314 | 314 | logerror("CRTC: VBlank off\n"); |
| 315 | 315 | } |
| 316 | 316 | } |
| r1681 | r1682 | |
| 388 | 388 | irq_time = video_screen_get_time_until_pos(0,(data - 1) / sys.crtc.vmultiple,2); |
| 389 | 389 | |
| 390 | 390 | if(attotime_to_double(irq_time) > 0) |
| 391 | timer_adjust(raster_irq,irq_time,(data - 1) / sys.crtc.vmultiple | |
| 391 | timer_adjust_oneshot(raster_irq, irq_time, (data - 1) / sys.crtc.vmultiple | |
| 392 | 392 | logerror("CRTC: Time until next raster IRQ = %f\n",attotime_to_double(irq_time)); |
| 393 | 393 | } |
| 394 | 394 | } |
| 395 | 395 | else |
| 396 | 396 | { |
| 397 | timer_adjust(raster_irq,attotime_zero,0 | |
| 397 | timer_adjust_oneshot(raster_irq, attotime_zero, 0 | |
| 398 | 398 | } |
| 399 | 399 | logerror("CRTC: Write to raster IRQ register - %i\n",data); |
| 400 | 400 | break; |
| r1681 | r1682 | |
| 977 | 977 | tilemap_set_transparent_pen(x68k_bg0_16,0); |
| 978 | 978 | tilemap_set_transparent_pen(x68k_bg1_16,0); |
| 979 | 979 | |
| 980 | // timer_adjust(scanline_timer,attotime_zero,0,ATTOTIME_IN_HZ(55.45)/568); | |
| 980 | // timer_adjust_periodic(scanline_timer, attotime_zero, 0, ATTOTIME_IN_HZ(55.45)/568); | |
| 981 | 981 | } |
| 982 | 982 | |
| 983 | 983 | VIDEO_UPDATE( x68000 ) |
| r1681 | r1682 | |
|---|---|---|
| 15 | 15 | #include "cpu/m68000/m68000.h" |
| 16 | 16 | #include "machine/68901mfp.h" |
| 17 | 17 | #include "video/atarist.h" |
| 18 | #include "mslegacy.h" | |
| 19 | 18 | |
| 19 | ||
| 20 | 20 | static struct SHIFTER |
| 21 | 21 | { |
| 22 | 22 | UINT32 base; |
| r1681 | r1682 | |
| 721 | 721 | atarist_shifter_timer = timer_alloc(atarist_shifter_tick, NULL); |
| 722 | 722 | atarist_glue_timer = timer_alloc(atarist_glue_tick, NULL); |
| 723 | 723 | |
| 724 | timer_adjust(atarist_shifter_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/4)); // 125 ns | |
| 725 | timer_adjust(atarist_glue_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/16)); // 500 ns | |
| 724 | timer_adjust_periodic(atarist_shifter_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/4)); // 125 ns | |
| 725 | timer_adjust_periodic(atarist_glue_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/16)); // 500 ns | |
| 726 | 726 | |
| 727 | 727 | memset(&shifter, 0, sizeof(shifter)); |
| 728 | 728 |
| r1681 | r1682 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | 8 | #include "deprecat.h" |
| 9 | #include "mslegacy.h" | |
| 10 | 9 | #include "zx8301.h" |
| 11 | 10 | |
| 12 | 11 | |
| r1681 | r1682 | |
| 121 | 120 | VIDEO_START( zx8301 ) |
| 122 | 121 | { |
| 123 | 122 | zx8301_flash_timer = timer_alloc(zx8301_flash_tick, NULL); |
| 124 | timer_adjust(zx8301_flash_timer, ATTOTIME_IN_HZ(2), 0, ATTOTIME_IN_HZ(2)); | |
| 123 | timer_adjust_periodic(zx8301_flash_timer, ATTOTIME_IN_HZ(2), 0, ATTOTIME_IN_HZ(2)); | |
| 125 | 124 | |
| 126 | 125 | state_save_register_global(zx8301.dispoff); |
| 127 | 126 | state_save_register_global(zx8301.mode8); |
| r1681 | r1682 | |
|---|---|---|
| 32 | 32 | #include "machine/6883sam.h" |
| 33 | 33 | #include "video/m6847.h" |
| 34 | 34 | #include "includes/coco.h" |
| 35 | #include "mslegacy.h" | |
| 36 | 35 | |
| 37 | 36 | |
| 38 | 37 | #if defined(__GNUC__) && (__GNUC__ >= 3) |
| r1681 | r1682 | |
| 511 | 510 | } |
| 512 | 511 | |
| 513 | 512 | /* set up GIME field sync */ |
| 514 | timer_adjust(video->gime_fs_timer, | |
| 515 | m6847_scanline_time(gime_field_sync), | |
| 516 | 0, | |
| 517 | attotime_never); | |
| 513 | timer_adjust_oneshot(video->gime_fs_timer, | |
| 514 | m6847_scanline_time(gime_field_sync), 0); | |
| 518 | 515 | |
| 519 | 516 | return video->legacy_video; |
| 520 | 517 | } |
| r1681 | r1682 | |
|---|---|---|
| 38 | 38 | |
| 39 | 39 | #include "driver.h" |
| 40 | 40 | #include "deprecat.h" |
| 41 | #include "mslegacy.h" | |
| 42 | 41 | #include "video/smsvdp.h" |
| 43 | 42 | #include "includes/sms.h" |
| 44 | 43 | |
| 44 | ||
| 45 | 45 | #define IS_SMS1_VDP ( smsvdp.features & MODEL_315_5124 ) |
| 46 | 46 | #define IS_SMS2_VDP ( smsvdp.features & MODEL_315_5246 ) |
| 47 | 47 | #define IS_GAMEGEAR_VDP ( smsvdp.features & MODEL_315_5378 ) |
| r1681 | r1682 | |
| 211 | 211 | set_display_settings(); |
| 212 | 212 | |
| 213 | 213 | smsvdp.smsvdp_display_timer = timer_alloc( smsvdp_display_callback , NULL); |
| 214 | timer_adjust( | |
| 214 | timer_adjust_periodic( | |
| 215 | 215 | return 0; |
| 216 | 216 | } |
| 217 | 217 |
| r1681 | r1682 | |
|---|---|---|
| 3 | 3 | #include "cpu/cdp1802/cdp1802.h" |
| 4 | 4 | #include "sound/beep.h" |
| 5 | 5 | #include "video/cdp1864.h" |
| 6 | #include "mslegacy.h" | |
| 7 | 6 | |
| 7 | ||
| 8 | 8 | static mame_bitmap *cdptmpbitmap; |
| 9 | 9 | |
| 10 | 10 | static emu_timer *cdp1864_int_timer; |
| r1681 | r1682 | |
| 40 | 40 | cdp1864.dmaptr = 0; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | timer_adjust(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_END, 0), 0 | |
| 43 | timer_adjust_oneshot(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_END, 0), 0 | |
| 44 | 44 | } |
| 45 | 45 | else |
| 46 | 46 | { |
| r1681 | r1682 | |
| 49 | 49 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | timer_adjust(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_START, 0), 0 | |
| 52 | timer_adjust_oneshot(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_START, 0), 0 | |
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | |
| r1681 | r1682 | |
| 61 | 61 | { |
| 62 | 62 | case CDP1864_SCANLINE_EFX_TOP_START: |
| 63 | 63 | cdp1864_efx = ASSERT_LINE; |
| 64 | timer_adjust(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_TOP_END, 0), 0 | |
| 64 | timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_TOP_END, 0), 0 | |
| 65 | 65 | break; |
| 66 | 66 | |
| 67 | 67 | case CDP1864_SCANLINE_EFX_TOP_END: |
| 68 | 68 | cdp1864_efx = CLEAR_LINE; |
| 69 | timer_adjust(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_BOTTOM_START, 0), 0 | |
| 69 | timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_BOTTOM_START, 0), 0 | |
| 70 | 70 | break; |
| 71 | 71 | |
| 72 | 72 | case CDP1864_SCANLINE_EFX_BOTTOM_START: |
| 73 | 73 | cdp1864_efx = ASSERT_LINE; |
| 74 | timer_adjust(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_BOTTOM_END, 0), 0 | |
| 74 | timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_BOTTOM_END, 0), 0 | |
| 75 | 75 | break; |
| 76 | 76 | |
| 77 | 77 | case CDP1864_SCANLINE_EFX_BOTTOM_END: |
| 78 | 78 | cdp1864_efx = CLEAR_LINE; |
| 79 | timer_adjust(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_TOP_START, 0), 0 | |
| 79 | timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_TOP_START, 0), 0 | |
| 80 | 80 | break; |
| 81 | 81 | } |
| 82 | 82 | } |
| r1681 | r1682 | |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | timer_adjust(cdp1864_dma_timer, ATTOTIME_IN_CYCLES(CDP1864_CYCLES_DMA_WAIT, 0), 0 | |
| 98 | timer_adjust_oneshot(cdp1864_dma_timer, ATTOTIME_IN_CYCLES(CDP1864_CYCLES_DMA_WAIT, 0), 0 | |
| 99 | 99 | |
| 100 | 100 | cdp1864.dmaout = 0; |
| 101 | 101 | } |
| r1681 | r1682 | |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | timer_adjust(cdp1864_dma_timer, ATTOTIME_IN_CYCLES(CDP1864_CYCLES_DMA_ACTIVE, 0), 0 | |
| 112 | timer_adjust_oneshot(cdp1864_dma_timer, ATTOTIME_IN_CYCLES(CDP1864_CYCLES_DMA_ACTIVE, 0), 0 | |
| 113 | 113 | |
| 114 | 114 | cdp1864.dmaout = 1; |
| 115 | 115 | } |
| r1681 | r1682 | |
| 180 | 180 | |
| 181 | 181 | MACHINE_RESET( cdp1864 ) |
| 182 | 182 | { |
| 183 | timer_adjust(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_START, 0), 0, attotime_zero); | |
| 184 | timer_adjust(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_TOP_START, 0), 0, attotime_zero); | |
| 185 | timer_adjust(cdp1864_dma_timer, ATTOTIME_IN_CYCLES(CDP1864_CYCLES_DMA_START, 0), 0, attotime_zero); | |
| 183 | timer_adjust_oneshot(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_START, 0), 0); | |
| 184 | timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_TOP_START, 0), 0); | |
| 185 | timer_adjust_oneshot(cdp1864_dma_timer, ATTOTIME_IN_CYCLES(CDP1864_CYCLES_DMA_START, 0), 0); | |
| 186 | 186 | |
| 187 | 187 | cdp1864.disp = 0; |
| 188 | 188 | cdp1864.dmaout = 0; |
| r1681 | r1682 | |
|---|---|---|
| 356 | 356 | #include <stdio.h> |
| 357 | 357 | #include "driver.h" |
| 358 | 358 | #include "deprecat.h" |
| 359 | #include "mslegacy.h" | |
| 360 | 359 | #include "utils.h" |
| 361 | 360 | #include "sound/custom.h" |
| 362 | 361 | |
| r1681 | r1682 | |
| 590 | 589 | { |
| 591 | 590 | case 1: |
| 592 | 591 | // prooved by digisound of several intros like eoroidpro |
| 593 | timer_adjust(timer1, TEDTIME_IN_CYCLES (TIMER1), 1 | |
| 592 | timer_adjust_oneshot(timer1, TEDTIME_IN_CYCLES (TIMER1), 1 | |
| 594 | 593 | timer1_active = 1; |
| 595 | 594 | ted7360_set_interrupt (8); |
| 596 | 595 | break; |
| 597 | 596 | case 2: |
| 598 | timer_adjust(timer2, TEDTIME_IN_CYCLES (0x10000), 2 | |
| 597 | timer_adjust_oneshot(timer2, TEDTIME_IN_CYCLES (0x10000), 2 | |
| 599 | 598 | timer2_active = 1; |
| 600 | 599 | ted7360_set_interrupt (0x10); |
| 601 | 600 | break; |
| 602 | 601 | case 3: |
| 603 | timer_adjust(timer3, TEDTIME_IN_CYCLES (0x10000), 3 | |
| 602 | timer_adjust_oneshot(timer3, TEDTIME_IN_CYCLES (0x10000), 3 | |
| 604 | 603 | timer3_active = 1; |
| 605 | 604 | ted7360_set_interrupt (0x40); |
| 606 | 605 | break; |
| r1681 | r1682 | |
| 653 | 652 | break; |
| 654 | 653 | case 1: /* start timer 1 */ |
| 655 | 654 | ted7360[offset] = data; |
| 656 | timer_adjust(timer1, TEDTIME_IN_CYCLES (TIMER1), 1 | |
| 655 | timer_adjust_oneshot(timer1, TEDTIME_IN_CYCLES (TIMER1), 1 | |
| 657 | 656 | timer1_active = 1; |
| 658 | 657 | break; |
| 659 | 658 | case 2: /* stop timer 2 */ |
| r1681 | r1682 | |
| 667 | 666 | break; |
| 668 | 667 | case 3: /* start timer 2 */ |
| 669 | 668 | ted7360[offset] = data; |
| 670 | timer_adjust(timer2, TEDTIME_IN_CYCLES (TIMER2), 2 | |
| 669 | timer_adjust_oneshot(timer2, TEDTIME_IN_CYCLES (TIMER2), 2 | |
| 671 | 670 | timer2_active = 1; |
| 672 | 671 | break; |
| 673 | 672 | case 4: /* stop timer 3 */ |
| r1681 | r1682 | |
| 681 | 680 | break; |
| 682 | 681 | case 5: /* start timer 3 */ |
| 683 | 682 | ted7360[offset] = data; |
| 684 | timer_adjust(timer3, TEDTIME_IN_CYCLES (TIMER3), 3 | |
| 683 | timer_adjust_oneshot(timer3, TEDTIME_IN_CYCLES (TIMER3), 3 | |
| 685 | 684 | timer3_active = 1; |
| 686 | 685 | break; |
| 687 | 686 | case 6: |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | 2 | #include "deprecat.h" |
| 3 | #include "mslegacy.h" | |
| 4 | 3 | #include "cpu/cdp1802/cdp1802.h" |
| 5 | 4 | #include "video/cdp1861.h" |
| 6 | 5 | |
| r1681 | r1682 | |
| 31 | 30 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, HOLD_LINE); |
| 32 | 31 | } |
| 33 | 32 | |
| 34 | timer_adjust(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_END, 0), 0 | |
| 33 | timer_adjust_oneshot(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_END, 0), 0 | |
| 35 | 34 | } |
| 36 | 35 | else |
| 37 | 36 | { |
| r1681 | r1682 | |
| 40 | 39 | cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE); |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | timer_adjust(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_START, 0), 0 | |
| 42 | timer_adjust_oneshot(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_START, 0), 0 | |
| 44 | 43 | } |
| 45 | 44 | } |
| 46 | 45 | |
| r1681 | r1682 | |
| 52 | 51 | { |
| 53 | 52 | case CDP1861_SCANLINE_EFX_TOP_START: |
| 54 | 53 | cdp1861_efx = ASSERT_LINE; |
| 55 | timer_adjust(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_TOP_END, 0), 0 | |
| 54 | timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_TOP_END, 0), 0 | |
| 56 | 55 | break; |
| 57 | 56 | |
| 58 | 57 | case CDP1861_SCANLINE_EFX_TOP_END: |
| 59 | 58 | cdp1861_efx = CLEAR_LINE; |
| 60 | timer_adjust(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_BOTTOM_START, 0), 0 | |
| 59 | timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_BOTTOM_START, 0), 0 | |
| 61 | 60 | break; |
| 62 | 61 | |
| 63 | 62 | case CDP1861_SCANLINE_EFX_BOTTOM_START: |
| 64 | 63 | cdp1861_efx = ASSERT_LINE; |
| 65 | timer_adjust(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_BOTTOM_END, 0), 0 | |
| 64 | timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_BOTTOM_END, 0), 0 | |
| 66 | 65 | break; |
| 67 | 66 | |
| 68 | 67 | case CDP1861_SCANLINE_EFX_BOTTOM_END: |
| 69 | 68 | cdp1861_efx = CLEAR_LINE; |
| 70 | timer_adjust(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_TOP_START, 0), 0 | |
| 69 | timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_TOP_START, 0), 0 | |
| 71 | 70 | break; |
| 72 | 71 | } |
| 73 | 72 | } |
| r1681 | r1682 | |
| 86 | 85 | } |
| 87 | 86 | } |
| 88 | 87 | |
| 89 | timer_adjust(cdp1861_dma_timer, ATTOTIME_IN_CYCLES(CDP1861_CYCLES_DMA_WAIT, 0), 0 | |
| 88 | timer_adjust_oneshot(cdp1861_dma_timer, ATTOTIME_IN_CYCLES(CDP1861_CYCLES_DMA_WAIT, 0), 0 | |
| 90 | 89 | |
| 91 | 90 | cdp1861.dmaout = 0; |
| 92 | 91 | } |
| r1681 | r1682 | |
| 100 | 99 | } |
| 101 | 100 | } |
| 102 | 101 | |
| 103 | timer_adjust(cdp1861_dma_timer, ATTOTIME_IN_CYCLES(CDP1861_CYCLES_DMA_ACTIVE, 0), 0 | |
| 102 | timer_adjust_oneshot(cdp1861_dma_timer, ATTOTIME_IN_CYCLES(CDP1861_CYCLES_DMA_ACTIVE, 0), 0 | |
| 104 | 103 | |
| 105 | 104 | cdp1861.dmaout = 1; |
| 106 | 105 | } |
| r1681 | r1682 | |
| 122 | 121 | |
| 123 | 122 | MACHINE_RESET( cdp1861 ) |
| 124 | 123 | { |
| 125 | timer_adjust(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_START, 0), 0, attotime_zero); | |
| 126 | timer_adjust(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_TOP_START, 0), 0, attotime_zero); | |
| 127 | timer_adjust(cdp1861_dma_timer, ATTOTIME_IN_CYCLES(CDP1861_CYCLES_DMA_START, 0), 0, attotime_zero); | |
| 124 | timer_adjust_oneshot(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_START, 0), 0); | |
| 125 | timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_TOP_START, 0), 0); | |
| 126 | timer_adjust_oneshot(cdp1861_dma_timer, ATTOTIME_IN_CYCLES(CDP1861_CYCLES_DMA_START, 0), 0); | |
| 128 | 127 | |
| 129 | 128 | cdp1861.disp = 0; |
| 130 | 129 | cdp1861.dmaout = 0; |
| r1681 | r1682 | |
|---|---|---|
| 11 | 11 | #include "cpu/z80/z80.h" |
| 12 | 12 | #include "includes/zx.h" |
| 13 | 13 | #include "devices/cassette.h" |
| 14 | #include "mslegacy.h" | |
| 15 | 14 | |
| 15 | ||
| 16 | 16 | #define DEBUG_ZX81_PORTS 1 |
| 17 | 17 | #define DEBUG_ZX81_VSYNC 1 |
| 18 | 18 | |
| r1681 | r1682 | |
| 79 | 79 | } |
| 80 | 80 | else if ((offset & 1) == 0) |
| 81 | 81 | { |
| 82 | timer_adjust(ula_nmi, attotime_zero, 0, ATTOTIME_IN_CYCLES(207, 0)); | |
| 82 | timer_adjust_periodic(ula_nmi, attotime_zero, 0, ATTOTIME_IN_CYCLES(207, 0)); | |
| 83 | 83 | |
| 84 | 84 | LOG_ZX81_IOW("ULA NMIs on"); |
| 85 | 85 |
| r1681 | r1682 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | #include "driver.h" |
| 15 | 15 | #include "deprecat.h" |
| 16 | #include "mslegacy.h" | |
| 17 | 16 | |
| 18 | 17 | #include "cpu/pdp1/pdp1.h" |
| 19 | 18 | #include "includes/pdp1.h" |
| r1681 | r1682 | |
| 407 | 406 | if (tape_reader.motor_on && tape_reader.rcl) |
| 408 | 407 | { |
| 409 | 408 | /* delay is approximately 1/400s */ |
| 410 | timer_adjust(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 409 | timer_adjust_oneshot(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 411 | 410 | } |
| 412 | 411 | else |
| 413 | 412 | { |
| r1681 | r1682 | |
| 489 | 488 | if (tape_reader.motor_on && tape_reader.rcl) |
| 490 | 489 | { |
| 491 | 490 | /* delay is approximately 1/400s */ |
| 492 | timer_adjust(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 491 | timer_adjust_oneshot(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 493 | 492 | } |
| 494 | 493 | else |
| 495 | 494 | { |
| r1681 | r1682 | |
| 542 | 541 | |
| 543 | 542 | if (tape_reader.motor_on && tape_reader.rcl) |
| 544 | 543 | /* delay is approximately 1/400s */ |
| 545 | timer_adjust(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 544 | timer_adjust_oneshot(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 546 | 545 | else |
| 547 | 546 | timer_enable(tape_reader.timer, 0); |
| 548 | 547 | } |
| r1681 | r1682 | |
| 680 | 679 | logerror("Error: overlapped PPA/PPB instructions: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 681 | 680 | } |
| 682 | 681 | |
| 683 | timer_adjust(tape_puncher.timer, ATTOTIME_IN_USEC(15800), nac | |
| 682 | timer_adjust_oneshot(tape_puncher.timer, ATTOTIME_IN_USEC(15800), nac | |
| 684 | 683 | } |
| 685 | 684 | |
| 686 | 685 | /* |
| r1681 | r1682 | |
| 707 | 706 | if (timer_enable(tape_puncher.timer, 0)) |
| 708 | 707 | logerror("Error: overlapped PPA/PPB instructions: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 709 | 708 | } |
| 710 | timer_adjust(tape_puncher.timer, ATTOTIME_IN_USEC(15800), nac | |
| 709 | timer_adjust_oneshot(tape_puncher.timer, ATTOTIME_IN_USEC(15800), nac | |
| 711 | 710 | } |
| 712 | 711 | |
| 713 | 712 | |
| r1681 | r1682 | |
| 896 | 895 | logerror("Error: overlapped TYO instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 897 | 896 | } |
| 898 | 897 | |
| 899 | timer_adjust(typewriter.tyo_timer, ATTOTIME_IN_MSEC(delay), nac | |
| 898 | timer_adjust_oneshot(typewriter.tyo_timer, ATTOTIME_IN_MSEC(delay), nac | |
| 900 | 899 | } |
| 901 | 900 | |
| 902 | 901 | /* |
| r1681 | r1682 | |
| 1008 | 1007 | if (timer_enable(dpy_timer, 0)) |
| 1009 | 1008 | logerror("Error: overlapped DPY instruction: mb=0%06o, pc=0%06o\n", (unsigned) mb, (unsigned) cpunum_get_reg(0, PDP1_PC)); |
| 1010 | 1009 | } |
| 1011 | timer_adjust(dpy_timer, ATTOTIME_IN_USEC(50), 0 | |
| 1010 | timer_adjust_oneshot(dpy_timer, ATTOTIME_IN_USEC(50), 0 | |
| 1012 | 1011 | } |
| 1013 | 1012 | } |
| 1014 | 1013 | |
| r1681 | r1682 | |
| 1027 | 1026 | il_phase = attotime_sub(attotime_mul(PARALLEL_DRUM_WORD_TIME, il), timer_timeelapsed(parallel_drum.rotation_timer)); |
| 1028 | 1027 | if (attotime_compare(il_phase, attotime_zero) < 0) |
| 1029 | 1028 | il_phase = attotime_add(il_phase, PARALLEL_DRUM_ROTATION_TIME); |
| 1030 | timer_adjust(parallel_drum.il_timer, il_phase, 0, PARALLEL_DRUM_ROTATION_TIME); | |
| 1029 | timer_adjust_periodic(parallel_drum.il_timer, il_phase, 0, PARALLEL_DRUM_ROTATION_TIME); | |
| 1031 | 1030 | } |
| 1032 | 1031 | |
| 1033 | 1032 | #ifdef UNUSED_FUNCTION |
| r1681 | r1682 | |
| 1043 | 1042 | static void parallel_drum_init(void) |
| 1044 | 1043 | { |
| 1045 | 1044 | parallel_drum.rotation_timer = timer_alloc(NULL, NULL); |
| 1046 | timer_adjust(parallel_drum.rotation_timer, PARALLEL_DRUM_ROTATION_TIME, 0, PARALLEL_DRUM_ROTATION_TIME); | |
| 1045 | timer_adjust_periodic(parallel_drum.rotation_timer, PARALLEL_DRUM_ROTATION_TIME, 0, PARALLEL_DRUM_ROTATION_TIME); | |
| 1047 | 1046 | |
| 1048 | 1047 | parallel_drum.il_timer = timer_alloc(il_timer_callback, NULL); |
| 1049 | 1048 | parallel_drum_set_il(0); |
| r1681 | r1682 | |
|---|---|---|
| 21 | 21 | ***************************************************************************/ |
| 22 | 22 | |
| 23 | 23 | #include "driver.h" |
| 24 | #include "mslegacy.h" | |
| 25 | 24 | #include "machine/nec765.h" |
| 26 | 25 | |
| 26 | ||
| 27 | 27 | typedef enum |
| 28 | 28 | { |
| 29 | 29 | NEC765_COMMAND_PHASE_FIRST_BYTE, |
| r1681 | r1682 | |
| 402 | 402 | |
| 403 | 403 | if (!(fdc.nec765_flags & NEC765_DMA_MODE)) |
| 404 | 404 | { |
| 405 | timer_adjust(fdc.timer, duration, 0 | |
| 405 | timer_adjust_oneshot(fdc.timer, duration, 0 | |
| 406 | 406 | } |
| 407 | 407 | else |
| 408 | 408 | { |
| r1681 | r1682 | |
| 429 | 429 | static void nec765_setup_timed_int(int signed_tracks) |
| 430 | 430 | { |
| 431 | 431 | /* setup timer to signal after seek time is complete */ |
| 432 | timer_adjust(fdc.seek_timer, attotime_zero, 0, double_to_attotime(fdc.srt_in_ms*abs(signed_tracks)*0.001)); | |
| 432 | timer_adjust_periodic(fdc.seek_timer, attotime_zero, 0, double_to_attotime(fdc.srt_in_ms*abs(signed_tracks)*0.001)); | |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | static void nec765_seek_setup(int is_recalibrate) |
| r1681 | r1682 | |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | #ifdef NO_END_OF_CYLINDER |
| 735 | timer_adjust(fdc.command_timer, attotime_zero, 0 | |
| 735 | timer_adjust_oneshot(fdc.command_timer, attotime_zero, 0 | |
| 736 | 736 | #else |
| 737 | 737 | nec765_update_state(); |
| 738 | 738 | #endif |
| r1681 | r1682 | |
| 1605 | 1605 | |
| 1606 | 1606 | if ((fdc.nec765_transfer_bytes_remaining==0) || (fdc.nec765_flags & NEC765_TC)) |
| 1607 | 1607 | { |
| 1608 | timer_adjust(fdc.command_timer, attotime_zero, 0 | |
| 1608 | timer_adjust_oneshot(fdc.command_timer, attotime_zero, 0 | |
| 1609 | 1609 | } |
| 1610 | 1610 | else |
| 1611 | 1611 | { |
| r1681 | r1682 | |
| 1673 | 1673 | |
| 1674 | 1674 | if ((fdc.nec765_transfer_bytes_remaining == 0) || (fdc.nec765_flags & NEC765_TC)) |
| 1675 | 1675 | { |
| 1676 | timer_adjust(fdc.command_timer, attotime_zero, 0 | |
| 1676 | timer_adjust_oneshot(fdc.command_timer, attotime_zero, 0 | |
| 1677 | 1677 | } |
| 1678 | 1678 | else |
| 1679 | 1679 | { |
| r1681 | r1682 | |
|---|---|---|
| 107 | 107 | #include <assert.h> |
| 108 | 108 | #include "driver.h" |
| 109 | 109 | #include "deprecat.h" |
| 110 | #include "mslegacy.h" | |
| 111 | 110 | |
| 112 | 111 | #include "includes/apple2gs.h" |
| 113 | 112 | #include "includes/apple2.h" |
| r1681 | r1682 | |
| 837 | 836 | apple2_interrupt(machine, 0); |
| 838 | 837 | } |
| 839 | 838 | |
| 840 | timer_adjust(apple2gs_scanline_timer, video_screen_get_time_until_pos(0, (scanline+1)%262, 0), 0 | |
| 839 | timer_adjust_oneshot(apple2gs_scanline_timer, video_screen_get_time_until_pos(0, (scanline+1)%262, 0), 0 | |
| 841 | 840 | |
| 842 | 841 | cpuintrf_pop_context(); |
| 843 | 842 | } |
| r1681 | r1682 | |
| 1725 | 1724 | MACHINE_RESET( apple2gs ) |
| 1726 | 1725 | { |
| 1727 | 1726 | apple2gs_clock_timer = timer_alloc(apple2gs_clock_tick, NULL); |
| 1728 | timer_adjust(apple2gs_clock_timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1)); | |
| 1727 | timer_adjust_periodic(apple2gs_clock_timer, ATTOTIME_IN_SEC(1), 0, ATTOTIME_IN_SEC(1)); | |
| 1729 | 1728 | |
| 1730 | 1729 | apple2gs_qsecond_timer = timer_alloc(apple2gs_qsecond_tick, NULL); |
| 1731 | timer_adjust(apple2gs_qsecond_timer, ATTOTIME_IN_USEC(266700), 0, ATTOTIME_IN_USEC(266700)); | |
| 1730 | timer_adjust_periodic(apple2gs_qsecond_timer, ATTOTIME_IN_USEC(266700), 0, ATTOTIME_IN_USEC(266700)); | |
| 1732 | 1731 | |
| 1733 | 1732 | apple2gs_scanline_timer = timer_alloc(apple2gs_scanline_tick, NULL); |
| 1734 | timer_adjust(apple2gs_scanline_timer, attotime_never, 0 | |
| 1733 | timer_adjust_oneshot(apple2gs_scanline_timer, attotime_never, 0 | |
| 1735 | 1734 | |
| 1736 | 1735 | // fire on scanline zero |
| 1737 | timer_adjust(apple2gs_scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0 | |
| 1736 | timer_adjust_oneshot(apple2gs_scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0 | |
| 1738 | 1737 | } |
| 1739 | 1738 | |
| 1740 | 1739 | MACHINE_START( apple2gs ) |
| r1681 | r1682 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | #include "applefdc.h" |
| 39 | 39 | #include "deprecat.h" |
| 40 | #include "mslegacy.h" | |
| 41 | 40 | |
| 41 | ||
| 42 | 42 | /* logging */ |
| 43 | 43 | #define LOG_IWM 0 |
| 44 | 44 | #define LOG_IWM_EXTRA 0 |
| r1681 | r1682 | |
| 310 | 310 | { |
| 311 | 311 | case 0x08: |
| 312 | 312 | /* Turn off motor */ |
| 313 | timer_adjust(motor_timer, | |
| 314 | (iwm_mode & IWM_MODE_MOTOROFFDELAY) ? attotime_zero : ATTOTIME_IN_SEC(1), | |
| 315 | 0, | |
| 316 | attotime_zero); | |
| 313 | timer_adjust_oneshot(motor_timer, | |
| 314 | (iwm_mode & IWM_MODE_MOTOROFFDELAY) ? attotime_zero : ATTOTIME_IN_SEC(1), 0); | |
| 317 | 315 | break; |
| 318 | 316 | |
| 319 | 317 | case 0x09: |
| 320 | 318 | /* Turn on motor */ |
| 321 | timer_adjust(motor_timer, attotime_zero, 1 | |
| 319 | timer_adjust_oneshot(motor_timer, attotime_zero, 1 | |
| 322 | 320 | break; |
| 323 | 321 | |
| 324 | 322 | case 0x0A: |
| r1681 | r1682 | |
|---|---|---|
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | 41 | #include "deprecat.h" |
| 42 | #include "mslegacy.h" | |
| 43 | 42 | #include "machine/6522via.h" |
| 44 | 43 | #include "machine/8530scc.h" |
| 45 | 44 | #include "cpu/m68000/m68000.h" |
| r1681 | r1682 | |
| 48 | 47 | #include "machine/ncr5380.h" |
| 49 | 48 | #include "includes/mac.h" |
| 50 | 49 | |
| 50 | ||
| 51 | 51 | #ifdef MAME_DEBUG |
| 52 | 52 | #define LOG_VIA 0 |
| 53 | 53 | #define LOG_RTC 0 |
| r1681 | r1682 | |
| 491 | 491 | if (keyboard_reply == 0x7B) |
| 492 | 492 | { |
| 493 | 493 | /* if NULL, wait until key pressed or timeout */ |
| 494 | timer_adjust(inquiry_timeout, | |
| 495 | attotime_make(0, DOUBLE_TO_ATTOSECONDS(0.25)), | |
| 496 | 0, attotime_zero); | |
| 494 | timer_adjust_oneshot(inquiry_timeout, | |
| 495 | attotime_make(0, DOUBLE_TO_ATTOSECONDS(0.25)), 0); | |
| 497 | 496 | } |
| 498 | 497 | break; |
| 499 | 498 | |
| r1681 | r1682 | |
| 1330 | 1329 | timer_set(attotime_zero, NULL, 0, set_memory_overlay_callback); |
| 1331 | 1330 | |
| 1332 | 1331 | mac_scanline_timer = timer_alloc(mac_scanline_tick, NULL); |
| 1333 | timer_adjust(mac_scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0 | |
| 1332 | timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0 | |
| 1334 | 1333 | } |
| 1335 | 1334 | |
| 1336 | 1335 | |
| r1681 | r1682 | |
| 1474 | 1473 | if (!(scanline % 10)) |
| 1475 | 1474 | mouse_callback(); |
| 1476 | 1475 | |
| 1477 | timer_adjust(mac_scanline_timer, video_screen_get_time_until_pos(0, (scanline+1) % MAC_V_TOTAL, 0), 0 | |
| 1476 | timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(0, (scanline+1) % MAC_V_TOTAL, 0), 0 | |
| 1478 | 1477 | |
| 1479 | 1478 | cpuintrf_pop_context(); |
| 1480 | 1479 | } |
| r1681 | r1682 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "pcf8593.h" |
| 10 | 10 | #include "deprecat.h" |
| 11 | #include "mslegacy.h" | |
| 12 | 11 | |
| 13 | 12 | #include <time.h> |
| 14 | 13 | |
| r1681 | r1682 | |
| 59 | 58 | rtc.size = 16; |
| 60 | 59 | rtc.data = malloc_or_die( rtc.size); |
| 61 | 60 | rtc.timer = timer_alloc( pcf8593_timer_callback , NULL); |
| 62 | timer_adjust( | |
| 61 | timer_adjust_periodic( | |
| 63 | 62 | pcf8593_reset(); |
| 64 | 63 | } |
| 65 | 64 |
| r1681 | r1682 | |
|---|---|---|
| 15 | 15 | #include "driver.h" |
| 16 | 16 | #include "i8271.h" |
| 17 | 17 | #include "devices/flopdrv.h" |
| 18 | #include "mslegacy.h" | |
| 19 | 18 | |
| 20 | 19 | |
| 21 | 20 | I8271_STATE_t I8271_STATE; |
| r1681 | r1682 | |
| 150 | 149 | |
| 151 | 150 | /* set timers */ |
| 152 | 151 | timer_reset(i8271.command_complete_timer, attotime_never); |
| 153 | timer_adjust(i8271.data_timer, ATTOTIME_IN_USEC(usecs), 0 | |
| 152 | timer_adjust_oneshot(i8271.data_timer, ATTOTIME_IN_USEC(usecs), 0 | |
| 154 | 153 | } |
| 155 | 154 | |
| 156 | 155 | |
| r1681 | r1682 | |
| 174 | 173 | |
| 175 | 174 | /* set timers */ |
| 176 | 175 | timer_reset(i8271.data_timer, attotime_never); |
| 177 | timer_adjust(i8271.command_complete_timer, ATTOTIME_IN_USEC(usecs), 0 | |
| 176 | timer_adjust_oneshot(i8271.command_complete_timer, ATTOTIME_IN_USEC(usecs), 0 | |
| 178 | 177 | } |
| 179 | 178 | |
| 180 | 179 | void i8271_reset() |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | #include "mslegacy.h" | |
| 3 | 2 | #include "includes/pokemini.h" |
| 4 | 3 | #include "cpu/minx/minx.h" |
| 5 | 4 | |
| 5 | ||
| 6 | 6 | struct VDP { |
| 7 | 7 | UINT8 colors_inverted; |
| 8 | 8 | UINT8 background_enabled; |
| r1681 | r1682 | |
| 126 | 126 | */ |
| 127 | 127 | if ( data & 0x01 ) { /* enable timer */ |
| 128 | 128 | if ( ! timers.seconds_running ) { |
| 129 | timer_adjust( | |
| 129 | timer_adjust_oneshot( | |
| 130 | 130 | timers.seconds_running = 1; |
| 131 | 131 | } |
| 132 | 132 | } else { /* pause timer */ |
| r1681 | r1682 | |
| 172 | 172 | Bit 4-7 R/W Unused |
| 173 | 173 | */ |
| 174 | 174 | if ( ( data & 0x07 ) != ( pokemini_hwreg[0x18] & 0x07 ) ) { |
| 175 | timer_adjust( | |
| 175 | timer_adjust_periodic( | |
| 176 | 176 | } |
| 177 | 177 | if ( ( data & 0x08 ) && timers.timers_enabled ) { |
| 178 | 178 | timer_enable( timers.timer1_timer, 1 ); |
| r1681 | r1682 | |
| 217 | 217 | Bit 4-7 Unused |
| 218 | 218 | */ |
| 219 | 219 | if ( ( data & 0x07 ) != ( pokemini_hwreg[0x1A] & 0x07 ) ) { |
| 220 | timer_adjust( | |
| 220 | timer_adjust_periodic( | |
| 221 | 221 | } |
| 222 | 222 | if ( ( data & 0x08 ) && timers.timers_enabled ) { |
| 223 | 223 | timer_enable( timers.timer2_timer, 1 ); |
| r1681 | r1682 | |
| 238 | 238 | Bit 4-7 Unused |
| 239 | 239 | */ |
| 240 | 240 | if ( ( data & 0x07 ) != ( pokemini_hwreg[0x1C] & 0x07 ) ) { |
| 241 | timer_adjust( | |
| 241 | timer_adjust_periodic( | |
| 242 | 242 | } |
| 243 | 243 | if ( ( data & 0x08 ) && timers.timers_enabled ) { |
| 244 | 244 | timer_enable( timers.timer3_timer, 1 ); |
| r1681 | r1682 | |
| 415 | 415 | */ |
| 416 | 416 | if ( data & 0x01 ) { /* enable timer */ |
| 417 | 417 | if ( ! timers.hz256_running ) { |
| 418 | timer_adjust( | |
| 418 | timer_adjust_oneshot( | |
| 419 | 419 | timers.hz256_running = 1; |
| 420 | 420 | } |
| 421 | 421 | } else { /* pause timer */ |
| r1681 | r1682 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | #include "rp5c15.h" |
| 71 | 71 | #include "deprecat.h" |
| 72 | #include "mslegacy.h" | |
| 73 | 72 | |
| 73 | ||
| 74 | 74 | static struct rp5c15 rtc; |
| 75 | 75 | |
| 76 | 76 | static emu_timer* rtc_timer; |
| r1681 | r1682 | |
| 138 | 138 | rtc.pulse_count = 0; |
| 139 | 139 | |
| 140 | 140 | rtc_timer = timer_alloc(rtc_alarm_pulse, NULL); |
| 141 | timer_adjust(rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(32)); | |
| 141 | timer_adjust_periodic(rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(32)); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | static int rp5c15_read(int offset, UINT16 mem_mask) |
| r1681 | r1682 | |
|---|---|---|
| 98 | 98 | #include "sound/dac.h" |
| 99 | 99 | #include "sound/ay8910.h" |
| 100 | 100 | #include "devices/cococart.h" |
| 101 | #include "mslegacy.h" | |
| 102 | 101 | |
| 102 | ||
| 103 | 103 | /*common vars/calls */ |
| 104 | 104 | static UINT8 *coco_rom; |
| 105 | 105 | static int dclg_state, dclg_output_h, dclg_output_v, dclg_timer; |
| r1681 | r1682 | |
| 1188 | 1188 | |
| 1189 | 1189 | static WRITE8_HANDLER ( d_pia0_ca2_w ) |
| 1190 | 1190 | { |
| 1191 | timer_adjust(mux_sel1_timer, ATTOTIME_IN_USEC(16), data | |
| 1191 | timer_adjust_oneshot(mux_sel1_timer, ATTOTIME_IN_USEC(16), data | |
| 1192 | 1192 | } |
| 1193 | 1193 | |
| 1194 | 1194 | static TIMER_CALLBACK(coco_update_sel1_timerproc) |
| r1681 | r1682 | |
| 1200 | 1200 | |
| 1201 | 1201 | static WRITE8_HANDLER ( d_pia0_cb2_w ) |
| 1202 | 1202 | { |
| 1203 | timer_adjust(mux_sel2_timer, ATTOTIME_IN_USEC(16), data | |
| 1203 | timer_adjust_oneshot(mux_sel2_timer, ATTOTIME_IN_USEC(16), data | |
| 1204 | 1204 | } |
| 1205 | 1205 | |
| 1206 | 1206 | static TIMER_CALLBACK(coco_update_sel2_timerproc) |
| r1681 | r1682 | |
| 2035 | 2035 | logerror("coco3_reset_timer(): target_time=%g\n", attotime_to_double(target_time)); |
| 2036 | 2036 | |
| 2037 | 2037 | /* and adjust the timer */ |
| 2038 | timer_adjust(coco3_gime_timer, target_time, 0 | |
| 2038 | timer_adjust_oneshot(coco3_gime_timer, target_time, 0 | |
| 2039 | 2039 | } |
| 2040 | 2040 | else |
| 2041 | 2041 | { |
| r1681 | r1682 | |
| 2572 | 2572 | |
| 2573 | 2573 | /* special code for Q state */ |
| 2574 | 2574 | if ((data == 0x02) || (data == 0x03) || (data == 0x04)) |
| 2575 | timer_adjust(cart_timer, ATTOTIME_IN_USEC(0), data + 1 | |
| 2575 | timer_adjust_oneshot(cart_timer, ATTOTIME_IN_USEC(0), data + 1 | |
| 2576 | 2576 | } |
| 2577 | 2577 | |
| 2578 | 2578 | |
| r1681 | r1682 | |
| 2637 | 2637 | switch(line) |
| 2638 | 2638 | { |
| 2639 | 2639 | case COCOCART_LINE_CART: |
| 2640 | timer_adjust(cart_timer, ATTOTIME_IN_USEC(0), (int) value | |
| 2640 | timer_adjust_oneshot(cart_timer, ATTOTIME_IN_USEC(0), (int) value | |
| 2641 | 2641 | break; |
| 2642 | 2642 | |
| 2643 | 2643 | case COCOCART_LINE_NMI: |
| 2644 | timer_adjust(nmi_timer, ATTOTIME_IN_USEC(0), (int) value | |
| 2644 | timer_adjust_oneshot(nmi_timer, ATTOTIME_IN_USEC(0), (int) value | |
| 2645 | 2645 | break; |
| 2646 | 2646 | |
| 2647 | 2647 | case COCOCART_LINE_HALT: |
| 2648 | timer_adjust(halt_timer, ATTOTIME_IN_CYCLES(7,0), (int) value | |
| 2648 | timer_adjust_oneshot(halt_timer, ATTOTIME_IN_CYCLES(7,0), (int) value | |
| 2649 | 2649 | break; |
| 2650 | 2650 | } |
| 2651 | 2651 | } |
| r1681 | r1682 | |
| 2706 | 2706 | { |
| 2707 | 2707 | /* if the cartridge CART line is set to Q, trigger another round of pulses */ |
| 2708 | 2708 | if ((coco_cart != NULL) && (cococart_get_line(coco_cart, COCOCART_LINE_CART) == COCOCART_LINE_VALUE_Q)) |
| 2709 | timer_adjust(cart_timer, ATTOTIME_IN_USEC(0), 0x02 | |
| 2709 | timer_adjust_oneshot(cart_timer, ATTOTIME_IN_USEC(0), 0x02 | |
| 2710 | 2710 | } |
| 2711 | 2711 | |
| 2712 | 2712 |
| r1681 | r1682 | |
|---|---|---|
| 16 | 16 | #include "machine/wd33c93.h" |
| 17 | 17 | #include "machine/tpi6525.h" |
| 18 | 18 | #include "matsucd.h" |
| 19 | #include "mslegacy.h" | |
| 20 | 19 | |
| 21 | 20 | |
| 22 | 21 | #define VERBOSE_DMAC 0 |
| r1681 | r1682 | |
| 112 | 111 | if ( dmac_data.wtc > 0 ) |
| 113 | 112 | { |
| 114 | 113 | matsucd_read_next_block(); |
| 115 | timer_adjust( | |
| 114 | timer_adjust_oneshot( | |
| 116 | 115 | } |
| 117 | 116 | else |
| 118 | 117 | { |
| r1681 | r1682 | |
| 221 | 220 | case 0x70: /* DMA start strobe */ |
| 222 | 221 | { |
| 223 | 222 | LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", activecpu_get_pc() )); |
| 224 | timer_adjust( | |
| 223 | timer_adjust_oneshot( | |
| 225 | 224 | } |
| 226 | 225 | break; |
| 227 | 226 | |
| r1681 | r1682 | |
| 347 | 346 | case 0x70: /* DMA start strobe */ |
| 348 | 347 | { |
| 349 | 348 | LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", activecpu_get_pc() )); |
| 350 | timer_adjust( | |
| 349 | timer_adjust_oneshot( | |
| 351 | 350 | } |
| 352 | 351 | break; |
| 353 | 352 | |
| r1681 | r1682 | |
| 456 | 455 | } |
| 457 | 456 | else |
| 458 | 457 | { |
| 459 | timer_adjust( | |
| 458 | timer_adjust_oneshot( | |
| 460 | 459 | } |
| 461 | 460 | } |
| 462 | 461 | |
| r1681 | r1682 | |
| 473 | 472 | else |
| 474 | 473 | { |
| 475 | 474 | /* we *have to* deliver the irq, so if we can't, delay it and try again later */ |
| 476 | timer_adjust( | |
| 475 | timer_adjust_oneshot( | |
| 477 | 476 | } |
| 478 | 477 | } |
| 479 | 478 | } |
| r1681 | r1682 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | #include "driver.h" |
| 39 | 39 | #include "deprecat.h" |
| 40 | #include "mslegacy.h" | |
| 41 | 40 | #include "includes/gb.h" |
| 42 | 41 | #include "cpu/z80gb/z80gb.h" |
| 43 | 42 | #include "image.h" |
| r1681 | r1682 | |
| 720 | 719 | case 0x81: /* enabled & internal clock */ |
| 721 | 720 | SIODATA = 0xFF; |
| 722 | 721 | SIOCount = 8; |
| 723 | timer_adjust( | |
| 722 | timer_adjust_periodic( | |
| 724 | 723 | timer_enable( gb_serial_timer, 1 ); |
| 725 | 724 | break; |
| 726 | 725 | } |
| r1681 | r1682 | |
|---|---|---|
| 8 | 8 | ******************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "mslegacy.h" | |
| 12 | 11 | #include "cpu/m6502/m6502.h" |
| 13 | 12 | #include "includes/kim1.h" |
| 14 | 13 | #include "sound/dac.h" |
| r1681 | r1682 | |
| 598 | 597 | |
| 599 | 598 | static void set_chip_clock(int chip, int data) |
| 600 | 599 | { |
| 601 | timer_adjust(m6530[chip].timer, attotime_zero, chip, ATTOTIME_IN_HZ((data + 1) * m6530[chip].clock / 256 / 256)); | |
| 600 | timer_adjust_periodic(m6530[chip].timer, attotime_zero, chip, ATTOTIME_IN_HZ((data + 1) * m6530[chip].clock / 256 / 256)); | |
| 602 | 601 | } |
| 603 | 602 | |
| 604 | 603 | MACHINE_RESET( kim1 ) |
| r1681 | r1682 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | #include "driver.h" |
| 27 | 27 | #include "deprecat.h" |
| 28 | #include "mslegacy.h" | |
| 29 | 28 | #include "machine/wd17xx.h" |
| 30 | 29 | #include "smc92x4.h" |
| 31 | 30 | #include "ti99_4x.h" |
| r1681 | r1682 | |
| 35 | 34 | #include "formats/basicdsk.h" |
| 36 | 35 | #include "devices/mflopimg.h" |
| 37 | 36 | |
| 37 | ||
| 38 | 38 | #define MAX_FLOPPIES 4 |
| 39 | 39 | #define TI99DSK_TAG "ti99dsktag" |
| 40 | 40 | |
| 41 | ||
| 41 | 42 | static int use_80_track_drives; |
| 42 | 43 | |
| 43 | 44 | /* defines for DRQ_IRQ_status */ |
| r1681 | r1682 | |
| 507 | 508 | { /* on rising edge, set DVENA for 4.23s */ |
| 508 | 509 | DVENA = 1; |
| 509 | 510 | fdc_handle_hold(); |
| 510 | timer_adjust(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0 | |
| 511 | timer_adjust_oneshot(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0 | |
| 511 | 512 | } |
| 512 | 513 | motor_on = data; |
| 513 | 514 | break; |
| r1681 | r1682 | |
| 711 | 712 | { /* on rising edge, set DVENA for 4.23s */ |
| 712 | 713 | DVENA = 1; |
| 713 | 714 | fdc_handle_hold(); |
| 714 | timer_adjust(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0 | |
| 715 | timer_adjust_oneshot(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0 | |
| 715 | 716 | } |
| 716 | 717 | motor_on = data; |
| 717 | 718 | break; |
| r1681 | r1682 | |
| 925 | 926 | { /* on rising edge, set DVENA for 4.23s */ |
| 926 | 927 | DVENA = 1; |
| 927 | 928 | fdc_handle_hold(); |
| 928 | timer_adjust(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0 | |
| 929 | timer_adjust_oneshot(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0 | |
| 929 | 930 | } |
| 930 | 931 | motor_on = data; |
| 931 | 932 | break; |
| r1681 | r1682 | |
| 1317 | 1318 | { |
| 1318 | 1319 | DVENA = 1; |
| 1319 | 1320 | fdc_handle_hold(); |
| 1320 | timer_adjust(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0 | |
| 1321 | timer_adjust_oneshot(motor_on_timer, ATTOTIME_IN_MSEC(4230), 0 | |
| 1321 | 1322 | } |
| 1322 | 1323 | motor_on = data; |
| 1323 | 1324 | break; |
| r1681 | r1682 | |
|---|---|---|
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | #include "driver.h" |
| 13 | #include "mslegacy.h" | |
| 14 | 13 | #include "at29040.h" |
| 15 | 14 | |
| 15 | ||
| 16 | 16 | #define MAX_AT29C040A 4 |
| 17 | 17 | |
| 18 | 18 | #define FEEPROM_SIZE 0x80000 |
| r1681 | r1682 | |
| 91 | 91 | /* programming cycle start */ |
| 92 | 92 | at29c040a[id].s_pgm = s_pgm_3; |
| 93 | 93 | /* max delay 10ms, typical delay 5 to 7 ms */ |
| 94 | timer_adjust(at29c040a[id].programming_timer, ATTOTIME_IN_MSEC(5), id | |
| 94 | timer_adjust_oneshot(at29c040a[id].programming_timer, ATTOTIME_IN_MSEC(5), id | |
| 95 | 95 | break; |
| 96 | 96 | |
| 97 | 97 | case s_pgm_3: |
| r1681 | r1682 | |
| 216 | 216 | at29c040a[id].s_pgm = s_pgm_0; |
| 217 | 217 | at29c040a[id].s_enabling_sdb = FALSE; |
| 218 | 218 | at29c040a[id].s_disabling_sdb = FALSE; |
| 219 | timer_adjust(at29c040a[id].programming_timer, attotime_never, id | |
| 219 | timer_adjust_oneshot(at29c040a[id].programming_timer, attotime_never, id | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | |
| r1681 | r1682 | |
| 251 | 251 | { /* data polling starts the programming cycle (right???) */ |
| 252 | 252 | at29c040a[id].s_pgm = s_pgm_3; |
| 253 | 253 | /* max delay 10ms, typical delay 5 to 7 ms */ |
| 254 | timer_adjust(at29c040a[id].programming_timer, ATTOTIME_IN_MSEC(5), id | |
| 254 | timer_adjust_oneshot(at29c040a[id].programming_timer, ATTOTIME_IN_MSEC(5), id | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | reply = at29c040a[id].toggle_bit; |
| r1681 | r1682 | |
| 319 | 319 | at29c040a[id].s_pgm = s_pgm_0; |
| 320 | 320 | at29c040a[id].s_enabling_sdb = FALSE; |
| 321 | 321 | at29c040a[id].s_disabling_sdb = FALSE; |
| 322 | timer_adjust(at29c040a[id].programming_timer, attotime_never, id | |
| 322 | timer_adjust_oneshot(at29c040a[id].programming_timer, attotime_never, id | |
| 323 | 323 | |
| 324 | 324 | /* process command */ |
| 325 | 325 | switch (data) |
| r1681 | r1682 | |
| 345 | 345 | at29c040a[id].s_pgm = s_pgm_1; |
| 346 | 346 | at29c040a[id].s_disabling_sdb = TRUE; |
| 347 | 347 | /* set command timeout (right???) */ |
| 348 | //timer_adjust(at29c040a[id].programming_timer, ATTOTIME_IN_USEC(150), id, 0.); | |
| 348 | //timer_adjust_periodic(at29c040a[id].programming_timer, ATTOTIME_IN_USEC(150), id, 0.); | |
| 349 | 349 | } |
| 350 | 350 | break; |
| 351 | 351 | |
| r1681 | r1682 | |
| 365 | 365 | at29c040a[id].s_pgm = s_pgm_1; |
| 366 | 366 | at29c040a[id].s_enabling_sdb = TRUE; |
| 367 | 367 | /* set command timeout (right???) */ |
| 368 | //timer_adjust(at29c040a[id].programming_timer, ATTOTIME_IN_USEC(150), id, 0.); | |
| 368 | //timer_adjust_periodic(at29c040a[id].programming_timer, ATTOTIME_IN_USEC(150), id, 0.); | |
| 369 | 369 | break; |
| 370 | 370 | |
| 371 | 371 | case 0xf0: |
| r1681 | r1682 | |
| 394 | 394 | at29c040a[id].s_pgm = s_pgm_0; |
| 395 | 395 | at29c040a[id].s_enabling_sdb = FALSE; |
| 396 | 396 | at29c040a[id].s_disabling_sdb = FALSE; |
| 397 | timer_adjust(at29c040a[id].programming_timer, attotime_never, id | |
| 397 | timer_adjust_oneshot(at29c040a[id].programming_timer, attotime_never, id | |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | if (((at29c040a[id].s_pgm == s_pgm_0) && ! at29c040a[id].s_sdp) |
| r1681 | r1682 | |
| 420 | 420 | /* write data to programming buffer */ |
| 421 | 421 | at29c040a[id].programming_buffer[offset & 0xff] = data; |
| 422 | 422 | at29c040a[id].programming_last_offset = offset; |
| 423 | timer_adjust(at29c040a[id].programming_timer, ATTOTIME_IN_USEC(150), id | |
| 423 | timer_adjust_oneshot(at29c040a[id].programming_timer, ATTOTIME_IN_USEC(150), id | |
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | #include "driver.h" |
| 3 | 3 | #include "deprecat.h" |
| 4 | #include "mslegacy.h" | |
| 5 | 4 | #include "includes/gamecom.h" |
| 6 | 5 | #include "cpu/sm8500/sm8500.h" |
| 7 | 6 | #include "image.h" |
| r1681 | r1682 | |
| 328 | 327 | /* timer run */ |
| 329 | 328 | if ( data & 0x40 ) { |
| 330 | 329 | /* timer resolution 1 minute */ |
| 331 | timer_adjust( | |
| 330 | timer_adjust_periodic( | |
| 332 | 331 | } else { |
| 333 | 332 | /* TImer resolution 1 second */ |
| 334 | timer_adjust( | |
| 333 | timer_adjust_periodic( | |
| 335 | 334 | } |
| 336 | 335 | } else { |
| 337 | 336 | /* disable timer reset */ |
| r1681 | r1682 | |
|---|---|---|
| 13 | 13 | #include "driver.h" |
| 14 | 14 | #include "deprecat.h" |
| 15 | 15 | #include "includes/mz700.h" |
| 16 | #include "mslegacy.h" | |
| 17 | 16 | |
| 18 | 17 | /* Components */ |
| 19 | 18 | #include "cpu/z80/z80.h" |
| r1681 | r1682 | |
| 98 | 97 | MACHINE_RESET( mz700 ) |
| 99 | 98 | { |
| 100 | 99 | ne556_timer[0] = timer_alloc(ne556_callback, NULL); |
| 101 | timer_adjust(ne556_timer[0], ATTOTIME_IN_HZ(1.5), 0, ATTOTIME_IN_HZ(1.5)); | |
| 100 | timer_adjust_periodic(ne556_timer[0], ATTOTIME_IN_HZ(1.5), 0, ATTOTIME_IN_HZ(1.5)); | |
| 102 | 101 | /*timer_pulse(ATTOTIME_IN_HZ(1.5), NULL, 0, ne556_callback)*/ |
| 103 | 102 | ne556_timer[1] = timer_alloc(ne556_callback, NULL); |
| 104 | timer_adjust(ne556_timer[1], ATTOTIME_IN_HZ(34.5), 1, ATTOTIME_IN_HZ(34.5)); | |
| 103 | timer_adjust_periodic(ne556_timer[1], ATTOTIME_IN_HZ(34.5), 1, ATTOTIME_IN_HZ(34.5)); | |
| 105 | 104 | /*timer_pulse(ATTOTIME_IN_HZ(34.5), NULL, 1, ne556_callback)*/ |
| 106 | 105 | } |
| 107 | 106 |
| r1681 | r1682 | |
|---|---|---|
| 30 | 30 | */ |
| 31 | 31 | |
| 32 | 32 | #include "driver.h" |
| 33 | #include "mslegacy.h" | |
| 34 | 33 | #include "includes/serial.h" |
| 35 | 34 | |
| 35 | ||
| 36 | 36 | #define VERBOSE 0 |
| 37 | 37 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) |
| 38 | 38 | |
| r1681 | r1682 | |
| 209 | 209 | if (state) |
| 210 | 210 | { |
| 211 | 211 | /* start timer */ |
| 212 | timer_adjust(serial_devices[id].timer, attotime_zero, id, ATTOTIME_IN_HZ(serial_devices[id].BaudRate)); | |
| 212 | timer_adjust_periodic(serial_devices[id].timer, attotime_zero, id, ATTOTIME_IN_HZ(serial_devices[id].BaudRate)); | |
| 213 | 213 | } |
| 214 | 214 | else |
| 215 | 215 | { |
| r1681 | r1682 | |
|---|---|---|
| 6 | 6 | #include "cpu/m6809/m6809.h" |
| 7 | 7 | #include "sound/ay8910.h" |
| 8 | 8 | #include "image.h" |
| 9 | #include "mslegacy.h" | |
| 10 | 9 | |
| 11 | 10 | #include "includes/vectrex.h" |
| 12 | 11 | |
| 12 | ||
| 13 | 13 | #define VC_RED MAKE_RGB(0xff, 0x00, 0x00) |
| 14 | 14 | #define VC_GREEN MAKE_RGB(0x00, 0xff, 0x00) |
| 15 | 15 | #define VC_BLUE MAKE_RGB(0x00, 0x00, 0xff) |
| r1681 | r1682 | |
| 290 | 290 | |
| 291 | 291 | if (imager_freq > 1) |
| 292 | 292 | { |
| 293 | timer_adjust | |
| 293 | timer_adjust_periodic(imager_timer, | |
| 294 | 294 | double_to_attotime(MIN(1.0/imager_freq, attotime_to_double(timer_timeleft(imager_timer)))), |
| 295 | 295 | 2, |
| 296 | 296 | ATTOTIME_IN_HZ(imager_freq)); |
| r1681 | r1682 | |
|---|---|---|
| 30 | 30 | #include "osdepend.h" |
| 31 | 31 | #include "deprecat.h" |
| 32 | 32 | #include "driver.h" |
| 33 | #include "mslegacy.h" | |
| 34 | 33 | #include "includes/nes.h" |
| 35 | 34 | #include "nes_mmc.h" |
| 36 | 35 | #include "sound/nes_apu.h" |
| r1681 | r1682 | |
| 102 | 101 | static TIMER_CALLBACK(nes_irq_callback) |
| 103 | 102 | { |
| 104 | 103 | cpunum_set_input_line(machine, 0, M6502_IRQ_LINE, HOLD_LINE); |
| 105 | timer_adjust(nes_irq_timer, attotime_never, 0 | |
| 104 | timer_adjust_oneshot(nes_irq_timer, attotime_never, 0 | |
| 106 | 105 | } |
| 107 | 106 | |
| 108 | 107 | WRITE8_HANDLER( nes_low_mapper_w ) |
| r1681 | r1682 | |
| 635 | 634 | { |
| 636 | 635 | logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(0), video_screen_get_hpos(0)); |
| 637 | 636 | cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE); |
| 638 | // timer_adjust(nes_irq_timer, ATTOTIME_IN_CYCLES(4, 0), 0 | |
| 637 | // timer_adjust_oneshot(nes_irq_timer, ATTOTIME_IN_CYCLES(4, 0), 0 | |
| 639 | 638 | } |
| 640 | 639 | } |
| 641 | 640 | } |
| r1681 | r1682 | |
| 2874 | 2873 | /* Check if IRQ is being enabled */ |
| 2875 | 2874 | if ( ! IRQ_enable && ( data & 0x02 ) ) { |
| 2876 | 2875 | IRQ_enable = 1; |
| 2877 | timer_adjust(nes_irq_timer, ATTOTIME_IN_CYCLES(24576, 0), 0 | |
| 2876 | timer_adjust_oneshot(nes_irq_timer, ATTOTIME_IN_CYCLES(24576, 0), 0 | |
| 2878 | 2877 | } |
| 2879 | 2878 | if ( ! ( data & 0x02 ) ) { |
| 2880 | 2879 | IRQ_enable = 0; |
| 2881 | timer_adjust(nes_irq_timer, attotime_never, 0 | |
| 2880 | timer_adjust_oneshot(nes_irq_timer, attotime_never, 0 | |
| 2882 | 2881 | } |
| 2883 | 2882 | break; |
| 2884 | 2883 | } |
| r1681 | r1682 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | #include "driver.h" |
| 104 | 104 | #include "deprecat.h" |
| 105 | #include "mslegacy.h" | |
| 106 | 105 | #include "image.h" |
| 107 | 106 | #include "cpu/m6502/m6502.h" |
| 108 | 107 | #include "machine/6522via.h" |
| r1681 | r1682 | |
| 572 | 571 | if (attotime_to_double(timer_timeelapsed(vc1541->timer)) > 1.0e29) |
| 573 | 572 | timer_reset(vc1541->timer, attotime_never); |
| 574 | 573 | else |
| 575 | timer_adjust(vc1541->timer, attotime_zero, 0, double_to_attotime(tme)); | |
| 574 | timer_adjust_periodic(vc1541->timer, attotime_zero, 0, double_to_attotime(tme)); | |
| 576 | 575 | } |
| 577 | 576 | else |
| 578 | 577 | { |
| r1681 | r1682 | |
| 866 | 865 | if (attotime_to_double(timer_timeelapsed(vc1541->timer)) > 1.0e29) |
| 867 | 866 | timer_reset(vc1541->timer, attotime_never); |
| 868 | 867 | else |
| 869 | timer_adjust(vc1541->timer, attotime_zero, 0, double_to_attotime(tme)); | |
| 868 | timer_adjust_periodic(vc1541->timer, attotime_zero, 0, double_to_attotime(tme)); | |
| 870 | 869 | } |
| 871 | 870 | else |
| 872 | 871 | { |
| r1681 | r1682 | |
| 947 | 946 | /* time should be small enough to allow quitting of the irq |
| 948 | 947 | line before the next interrupt is triggered */ |
| 949 | 948 | vc1541->drive.c1551.timer = timer_alloc(c1551_timer, NULL); |
| 950 | timer_adjust(vc1541->drive.c1551.timer, attotime_zero, 0, ATTOTIME_IN_HZ(60)); | |
| 949 | timer_adjust_periodic(vc1541->drive.c1551.timer, attotime_zero, 0, ATTOTIME_IN_HZ(60)); | |
| 951 | 950 | return 0; |
| 952 | 951 | } |
| 953 | 952 |
| r1681 | r1682 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "deprecat.h" |
| 11 | #include "mslegacy.h" | |
| 12 | 11 | #include "includes/thomson.h" |
| 13 | 12 | #include "cpu/m6809/m6809.h" |
| 14 | 13 | #include "machine/6821pia.h" |
| r1681 | r1682 | |
| 976 | 975 | LOG (( "to7_game_init called\n" )); |
| 977 | 976 | pia_config( THOM_PIA_GAME, &to7_game ); |
| 978 | 977 | to7_game_timer = timer_alloc( to7_game_update_cb , NULL); |
| 979 | timer_adjust( | |
| 978 | timer_adjust_periodic( | |
| 980 | 979 | state_save_register_global( to7_game_sound ); |
| 981 | 980 | state_save_register_global( to7_game_mute ); |
| 982 | 981 | } |
| r1681 | r1682 | |
| 1599 | 1598 | static void mo5_init_timer(void) |
| 1600 | 1599 | { |
| 1601 | 1600 | /* time is a faster than 50 Hz to match video framerate */ |
| 1602 | timer_adjust( | |
| 1601 | timer_adjust_periodic( | |
| 1603 | 1602 | } |
| 1604 | 1603 | |
| 1605 | 1604 | |
| r1681 | r1682 | |
| 2624 | 2623 | } |
| 2625 | 2624 | |
| 2626 | 2625 | to9_kbd_byte_count = ( to9_kbd_byte_count + 1 ) & 3; |
| 2627 | timer_adjust( | |
| 2626 | timer_adjust_oneshot( | |
| 2628 | 2627 | } |
| 2629 | 2628 | else |
| 2630 | 2629 | { |
| r1681 | r1682 | |
| 2632 | 2631 | /* keyboard mode: send a byte only if a key is down */ |
| 2633 | 2632 | if ( key ) |
| 2634 | 2633 | to9_kbd_send( key, 0 ); |
| 2635 | timer_adjust( | |
| 2634 | timer_adjust_oneshot( | |
| 2636 | 2635 | } |
| 2637 | 2636 | } |
| 2638 | 2637 | |
| r1681 | r1682 | |
| 2652 | 2651 | to9_kbd_key_count = 0; |
| 2653 | 2652 | to9_kbd_last_key = 0xff; |
| 2654 | 2653 | to9_kbd_update_irq(); |
| 2655 | timer_adjust( | |
| 2654 | timer_adjust_oneshot( | |
| 2656 | 2655 | } |
| 2657 | 2656 | |
| 2658 | 2657 | |
| r1681 | r1682 | |
| 3065 | 3064 | d = ATTOTIME_IN_USEC( bit ? 56 : 38 ); |
| 3066 | 3065 | to8_kbd_step++; |
| 3067 | 3066 | } |
| 3068 | timer_adjust( | |
| 3067 | timer_adjust_oneshot( | |
| 3069 | 3068 | } |
| 3070 | 3069 | |
| 3071 | 3070 | |
| r1681 | r1682 | |
| 3100 | 3099 | /* send back signal: TODO returned codes ? */ |
| 3101 | 3100 | to8_kbd_data = 0; |
| 3102 | 3101 | to8_kbd_step = 0; |
| 3103 | timer_adjust( | |
| 3102 | timer_adjust_oneshot( | |
| 3104 | 3103 | } |
| 3105 | 3104 | else |
| 3106 | 3105 | { |
| 3107 | 3106 | to8_kbd_step = 0; |
| 3108 | timer_adjust( | |
| 3107 | timer_adjust_oneshot( | |
| 3109 | 3108 | if ( len >= 1.2 && len <= 1.4 ) |
| 3110 | 3109 | { |
| 3111 | 3110 | LOG (( "%f to8_kbd_set_ack: CAPS on signal\n", attotime_to_double(timer_get_time()) )); |
| r1681 | r1682 | |
| 3123 | 3122 | { |
| 3124 | 3123 | /* end key transmission */ |
| 3125 | 3124 | to8_kbd_step = 0; |
| 3126 | timer_adjust( | |
| 3125 | timer_adjust_oneshot( | |
| 3127 | 3126 | } |
| 3128 | 3127 | } |
| 3129 | 3128 | |
| r1681 | r1682 | |
| 3133 | 3132 | { |
| 3134 | 3133 | /* CPU accepts key */ |
| 3135 | 3134 | to8_kbd_step = 99; |
| 3136 | timer_adjust( | |
| 3135 | timer_adjust_oneshot( | |
| 3137 | 3136 | } |
| 3138 | 3137 | else |
| 3139 | 3138 | { |
| 3140 | 3139 | /* start signal from CPU */ |
| 3141 | 3140 | to8_kbd_data = 0xfff; |
| 3142 | 3141 | to8_kbd_step = 91; |
| 3143 | timer_adjust( to8_kbd_timer, ATTOTIME_IN_USEC( 400 ), 0, attotime_never ); | |
| 3144 | timer_adjust( to8_kbd_signal, attotime_never, 0, attotime_never ); | |
| 3142 | timer_adjust_oneshot(to8_kbd_timer, ATTOTIME_IN_USEC( 400 ), 0); | |
| 3143 | timer_adjust_oneshot(to8_kbd_signal, attotime_never, 0); | |
| 3145 | 3144 | } |
| 3146 | 3145 | LOG_KBD(( "%f to8_kbd_set_ack: CPU ack, data=$%03X\n", attotime_to_double(timer_get_time()), to8_kbd_data )); |
| 3147 | 3146 | } |
| r1681 | r1682 | |
| 4163 | 4162 | LOG (( "mo6_game_init called\n" )); |
| 4164 | 4163 | pia_config( THOM_PIA_GAME, &mo6_game ); |
| 4165 | 4164 | to7_game_timer = timer_alloc( mo6_game_update_cb , NULL); |
| 4166 | timer_adjust( | |
| 4165 | timer_adjust_periodic( | |
| 4167 | 4166 | state_save_register_global( to7_game_sound ); |
| 4168 | 4167 | state_save_register_global( to7_game_mute ); |
| 4169 | 4168 | } |
| r1681 | r1682 | |
| 4671 | 4670 | LOG (( "mo5nr_game_init called\n" )); |
| 4672 | 4671 | pia_config( THOM_PIA_GAME, &mo5nr_game ); |
| 4673 | 4672 | to7_game_timer = timer_alloc( mo6_game_update_cb , NULL); |
| 4674 | timer_adjust( | |
| 4673 | timer_adjust_periodic( | |
| 4675 | 4674 | state_save_register_global( to7_game_sound ); |
| 4676 | 4675 | state_save_register_global( to7_game_mute ); |
| 4677 | 4676 | } |
| r1681 | r1682 | |
|---|---|---|
| 38 | 38 | |
| 39 | 39 | #include "driver.h" |
| 40 | 40 | #include "deprecat.h" |
| 41 | #include "mslegacy.h" | |
| 42 | 41 | #include "includes/lisa.h" |
| 43 | 42 | #include "machine/6522via.h" |
| 44 | 43 | #include "machine/applefdc.h" |
| r1681 | r1682 | |
| 646 | 645 | |
| 647 | 646 | case 0x7: /* send mouse command */ |
| 648 | 647 | if (immediate & 0x8) |
| 649 | timer_adjust(mouse_timer, attotime_zero, 0, ATTOTIME_IN_MSEC((immediate & 0x7)*4)); /* enable mouse */ | |
| 648 | timer_adjust_periodic(mouse_timer, attotime_zero, 0, ATTOTIME_IN_MSEC((immediate & 0x7)*4)); /* enable mouse */ | |
| 650 | 649 | else |
| 651 | 650 | timer_reset(mouse_timer, attotime_never); |
| 652 | 651 | break; |
| r1681 | r1682 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "deprecat.h" |
| 12 | #include "mslegacy.h" | |
| 13 | 12 | #include "includes/sym1.h" |
| 14 | 13 | |
| 15 | 14 | /* M6502 CPU */ |
| r1681 | r1682 | |
| 37 | 36 | |
| 38 | 37 | static void sym1_74145_output_0_w(int state) |
| 39 | 38 | { |
| 40 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 0 | |
| 39 | if (state) timer_adjust_oneshot(led_update, LED_REFRESH_DELAY, 0 | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | |
| 44 | 43 | static void sym1_74145_output_1_w(int state) |
| 45 | 44 | { |
| 46 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 1 | |
| 45 | if (state) timer_adjust_oneshot(led_update, LED_REFRESH_DELAY, 1 | |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | |
| 50 | 49 | static void sym1_74145_output_2_w(int state) |
| 51 | 50 | { |
| 52 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 2 | |
| 51 | if (state) timer_adjust_oneshot(led_update, LED_REFRESH_DELAY, 2 | |
| 53 | 52 | } |
| 54 | 53 | |
| 55 | 54 | |
| 56 | 55 | static void sym1_74145_output_3_w(int state) |
| 57 | 56 | { |
| 58 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 3 | |
| 57 | if (state) timer_adjust_oneshot(led_update, LED_REFRESH_DELAY, 3 | |
| 59 | 58 | } |
| 60 | 59 | |
| 61 | 60 | |
| 62 | 61 | static void sym1_74145_output_4_w(int state) |
| 63 | 62 | { |
| 64 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 4 | |
| 63 | if (state) timer_adjust_oneshot(led_update, LED_REFRESH_DELAY, 4 | |
| 65 | 64 | } |
| 66 | 65 | |
| 67 | 66 | |
| 68 | 67 | static void sym1_74145_output_5_w(int state) |
| 69 | 68 | { |
| 70 | if (state) timer_adjust(led_update, LED_REFRESH_DELAY, 5 | |
| 69 | if (state) timer_adjust_oneshot(led_update, LED_REFRESH_DELAY, 5 | |
| 71 | 70 | } |
| 72 | 71 | |
| 73 | 72 |
| r1681 | r1682 | |
|---|---|---|
| 5 | 5 | #include "driver.h" |
| 6 | 6 | #include "includes/lynx.h" |
| 7 | 7 | #include "deprecat.h" |
| 8 | #include "mslegacy.h" | |
| 9 | ||
| 10 | 8 | #include "cpu/m6502/m6502.h" |
| 11 | 9 | |
| 12 | 10 | |
| r1681 | r1682 | |
| 948 | 946 | { |
| 949 | 947 | attotime t = attotime_mul(ATTOTIME_IN_HZ( lynx_time_factor( lynx_timer[which].cntrl1 & 7 ) ), lynx_timer[which].bakup + 1 ); |
| 950 | 948 | if ( lynx_timer[which].cntrl1 & 0x10 ) |
| 951 | timer_adjust( | |
| 949 | timer_adjust_periodic( | |
| 952 | 950 | else |
| 953 | timer_adjust( | |
| 951 | timer_adjust_oneshot( | |
| 954 | 952 | lynx_timer[which].timer_active = 1; |
| 955 | 953 | } |
| 956 | 954 | } |
| r1681 | r1682 | |
|---|---|---|
| 12 | 12 | #include <stdarg.h> |
| 13 | 13 | #include "driver.h" |
| 14 | 14 | #include "deprecat.h" |
| 15 | #include "mslegacy.h" | |
| 16 | 15 | #include "devices/cassette.h" |
| 17 | 16 | #include "cpu/i8085/i8085.h" |
| 18 | 17 | #include "includes/pmd85.h" |
| r1681 | r1682 | |
| 787 | 786 | msm8251_init(&pmd85_msm8251_interface); |
| 788 | 787 | |
| 789 | 788 | pmd85_cassette_timer = timer_alloc(pmd85_cassette_timer_callback, NULL); |
| 790 | timer_adjust(pmd85_cassette_timer, attotime_zero, 0, ATTOTIME_IN_HZ(2400)); | |
| 789 | timer_adjust_periodic(pmd85_cassette_timer, attotime_zero, 0, ATTOTIME_IN_HZ(2400)); | |
| 791 | 790 | |
| 792 | 791 | serial_connection_init(&pmd85_cassette_serial_connection); |
| 793 | 792 | serial_connection_set_in_callback(&pmd85_cassette_serial_connection, pmd85_cassette_write); |
| r1681 | r1682 | |
|---|---|---|
| 10 | 10 | * used in chess champion mk2 |
| 11 | 11 | * rockwell aim65 ? |
| 12 | 12 | **********************************************************************/ |
| 13 | ||
| 13 | 14 | #include "driver.h" |
| 14 | 15 | #include "rriot.h" |
| 15 | #include "mslegacy.h" | |
| 16 | 16 | |
| 17 | ||
| 17 | 18 | #define VERBOSE 0 |
| 18 | 19 | |
| 19 | 20 | #define LOG(a) do { if (VERBOSE) logerror a; } while (0) |
| r1681 | r1682 | |
| 220 | 221 | switch (offset&3) { |
| 221 | 222 | case 0: /* Timer 1 start */ |
| 222 | 223 | LOG(("rriot(%d) TMR1 write: $%02x%s\n", chip, data, (char*)((offset & 8) ? " (IRQ)":" "))); |
| 223 | timer_adjust(rriot[chip].timer, attotime_mul(ATTOTIME_IN_HZ(rriot[chip].config->baseclock), (data+1) ), chip | |
| 224 | timer_adjust_oneshot(rriot[chip].timer, attotime_mul(ATTOTIME_IN_HZ(rriot[chip].config->baseclock), (data+1) ), chip | |
| 224 | 225 | rriot[chip].state=Delay1; |
| 225 | 226 | break; |
| 226 | 227 | case 1: /* Timer 8 start */ |
| 227 | 228 | LOG(("rriot(%d) TMR8 write: $%02x%s\n", chip, data, (char*)((offset & 8) ? " (IRQ)":" "))); |
| 228 | timer_adjust(rriot[chip].timer, attotime_mul(ATTOTIME_IN_HZ(rriot[chip].config->baseclock), (data+1) * 8 ), chip | |
| 229 | timer_adjust_oneshot(rriot[chip].timer, attotime_mul(ATTOTIME_IN_HZ(rriot[chip].config->baseclock), (data+1) * 8 ), chip | |
| 229 | 230 | rriot[chip].state=Delay8; |
| 230 | 231 | break; |
| 231 | 232 | case 2: /* Timer 64 start */ |
| 232 | 233 | LOG(("rriot(%d) TMR64 write: $%02x%s\n", chip, data, (char*)((offset & 8) ? " (IRQ)":" "))); |
| 233 | 234 | // LOG(("rriot(%d) TMR64 write: time is $%f\n", chip, (double)(64.0 * (data + 1) / rriot[chip].clock))); |
| 234 | timer_adjust(rriot[chip].timer, attotime_mul(ATTOTIME_IN_HZ(rriot[chip].config->baseclock), (data+1) * 64 ), chip | |
| 235 | timer_adjust_oneshot(rriot[chip].timer, attotime_mul(ATTOTIME_IN_HZ(rriot[chip].config->baseclock), (data+1) * 64 ), chip | |
| 235 | 236 | rriot[chip].state=Delay64; |
| 236 | 237 | break; |
| 237 | 238 | case 3: /* Timer 1024 start */ |
| 238 | 239 | LOG(("rriot(%d) TMR1K write: $%02x%s\n", chip, data, (char*)((offset & 8) ? " (IRQ)":" "))); |
| 239 | timer_adjust(rriot[chip].timer, attotime_mul(ATTOTIME_IN_HZ(rriot[chip].config->baseclock), (data+1) * 1024 ), chip | |
| 240 | timer_adjust_oneshot(rriot[chip].timer, attotime_mul(ATTOTIME_IN_HZ(rriot[chip].config->baseclock), (data+1) * 1024 ), chip | |
| 240 | 241 | rriot[chip].state=Delay1024; |
| 241 | 242 | break; |
| 242 | 243 | } |
| r1681 | r1682 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | #include "cpu/pdp1/tx0.h" |
| 10 | 10 | #include "includes/tx0.h" |
| 11 | #include "mslegacy.h" | |
| 12 | 11 | #include "video/crt.h" |
| 13 | 12 | |
| 14 | 13 | |
| r1681 | r1682 | |
| 232 | 231 | if (tape_reader.motor_on && tape_reader.rcl) |
| 233 | 232 | { |
| 234 | 233 | /* delay is approximately 1/400s */ |
| 235 | timer_adjust(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 234 | timer_adjust_oneshot(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 236 | 235 | } |
| 237 | 236 | else |
| 238 | 237 | { |
| r1681 | r1682 | |
| 306 | 305 | if (tape_reader.motor_on && tape_reader.rcl) |
| 307 | 306 | { |
| 308 | 307 | /* delay is approximately 1/400s */ |
| 309 | timer_adjust(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 308 | timer_adjust_oneshot(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 310 | 309 | } |
| 311 | 310 | else |
| 312 | 311 | { |
| r1681 | r1682 | |
| 357 | 356 | |
| 358 | 357 | if (tape_reader.motor_on && tape_reader.rcl) |
| 359 | 358 | /* delay is approximately 1/400s */ |
| 360 | timer_adjust(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 359 | timer_adjust_oneshot(tape_reader.timer, ATTOTIME_IN_USEC(2500), 0 | |
| 361 | 360 | else |
| 362 | 361 | timer_enable(tape_reader.timer, 0); |
| 363 | 362 | } |
| r1681 | r1682 | |
| 398 | 397 | /* shuffle and punch 6-bit word */ |
| 399 | 398 | tape_write(((ac & 0100000) >> 15) | ((ac & 0010000) >> 11) | ((ac & 0001000) >> 7) | ((ac & 0000100) >> 3) | ((ac & 0000010) << 1) | ((ac & 0000001) << 5)); |
| 400 | 399 | |
| 401 | timer_adjust(tape_puncher.timer, ATTOTIME_IN_USEC(15800), 0 | |
| 400 | timer_adjust_oneshot(tape_puncher.timer, ATTOTIME_IN_USEC(15800), 0 | |
| 402 | 401 | } |
| 403 | 402 | |
| 404 | 403 | /* |
| r1681 | r1682 | |
| 413 | 412 | /* shuffle and punch 6-bit word */ |
| 414 | 413 | tape_write(((ac & 0100000) >> 15) | ((ac & 0010000) >> 11) | ((ac & 0001000) >> 7) | ((ac & 0000100) >> 3) | ((ac & 0000010) << 1) | ((ac & 0000001) << 5) | 0100); |
| 415 | 414 | |
| 416 | timer_adjust(tape_puncher.timer, ATTOTIME_IN_USEC(15800), 0 | |
| 415 | timer_adjust_oneshot(tape_puncher.timer, ATTOTIME_IN_USEC(15800), 0 | |
| 417 | 416 | } |
| 418 | 417 | |
| 419 | 418 | |
| r1681 | r1682 | |
| 472 | 471 | ch = ((ac & 0100000) >> 15) | ((ac & 0010000) >> 11) | ((ac & 0001000) >> 7) | ((ac & 0000100) >> 3) | ((ac & 0000010) << 1) | ((ac & 0000001) << 5); |
| 473 | 472 | typewriter_out(ch); |
| 474 | 473 | |
| 475 | timer_adjust(typewriter.prt_timer, ATTOTIME_IN_MSEC(100), 0 | |
| 474 | timer_adjust_oneshot(typewriter.prt_timer, ATTOTIME_IN_MSEC(100), 0 | |
| 476 | 475 | } |
| 477 | 476 | |
| 478 | 477 | |
| r1681 | r1682 | |
| 498 | 497 | y = ac & 0777; |
| 499 | 498 | tx0_plot(x, y); |
| 500 | 499 | |
| 501 | timer_adjust(dis_timer, ATTOTIME_IN_USEC(50), 0 | |
| 500 | timer_adjust_oneshot(dis_timer, ATTOTIME_IN_USEC(50), 0 | |
| 502 | 501 | } |
| 503 | 502 | |
| 504 | 503 | |
| r1681 | r1682 | |
| 531 | 530 | delay = ATTOTIME_IN_USEC(4600); |
| 532 | 531 | break; |
| 533 | 532 | } |
| 534 | timer_adjust(magtape.timer, delay, 0 | |
| 533 | timer_adjust_oneshot(magtape.timer, delay, 0 | |
| 535 | 534 | } |
| 536 | 535 | |
| 537 | 536 | static void schedule_unselect(void) |
| r1681 | r1682 | |
| 553 | 552 | delay = ATTOTIME_IN_USEC(5750); |
| 554 | 553 | break; |
| 555 | 554 | } |
| 556 | timer_adjust(magtape.timer, delay, 0 | |
| 555 | timer_adjust_oneshot(magtape.timer, delay, 0 | |
| 557 | 556 | } |
| 558 | 557 | |
| 559 | 558 | DEVICE_INIT( tx0_magtape ) |
| r1681 | r1682 | |
| 783 | 782 | break; |
| 784 | 783 | } |
| 785 | 784 | if (magtape.state != MTS_UNSELECTING) |
| 786 | timer_adjust(magtape.timer, ATTOTIME_IN_USEC(66), 0 | |
| 785 | timer_adjust_oneshot(magtape.timer, ATTOTIME_IN_USEC(66), 0 | |
| 787 | 786 | } |
| 788 | 787 | break; |
| 789 | 788 | |
| r1681 | r1682 | |
| 942 | 941 | break; |
| 943 | 942 | } |
| 944 | 943 | if (magtape.state != MTS_UNSELECTING) |
| 945 | timer_adjust(magtape.timer, ATTOTIME_IN_USEC(66), 0 | |
| 944 | timer_adjust_oneshot(magtape.timer, ATTOTIME_IN_USEC(66), 0 | |
| 946 | 945 | } |
| 947 | 946 | break; |
| 948 | 947 | |
| 949 | 948 | case 2: /* rewind */ |
| 950 | 949 | magtape.state = MTS_UNSELECTING; |
| 951 | 950 | /* we rewind at 10*read speed (I don't know the real value) */ |
| 952 | timer_adjust(magtape.timer, attotime_mul(ATTOTIME_IN_NSEC(6600), image_ftell(magtape.img)), 0 | |
| 951 | timer_adjust_oneshot(magtape.timer, attotime_mul(ATTOTIME_IN_NSEC(6600), image_ftell(magtape.img)), 0 | |
| 953 | 952 | //schedule_unselect(); |
| 954 | 953 | image_fseek(magtape.img, 0, SEEK_END); |
| 955 | 954 | magtape.irg_pos = MTIRGP_END; |
| r1681 | r1682 | |
| 1037 | 1036 | image_unload(magtape.img); |
| 1038 | 1037 | } |
| 1039 | 1038 | else |
| 1040 | timer_adjust(magtape.timer, ATTOTIME_IN_USEC(66), 0 | |
| 1039 | timer_adjust_oneshot(magtape.timer, ATTOTIME_IN_USEC(66), 0 | |
| 1041 | 1040 | } |
| 1042 | 1041 | break; |
| 1043 | 1042 | } |
| r1681 | r1682 | |
| 1053 | 1052 | { |
| 1054 | 1053 | if (0) |
| 1055 | 1054 | magtape_callback(0); |
| 1056 | timer_adjust(magtape.timer, attotime_zero, 0 | |
| 1055 | timer_adjust_oneshot(magtape.timer, attotime_zero, 0 | |
| 1057 | 1056 | } |
| 1058 | 1057 | } |
| 1059 | 1058 |
| r1681 | r1682 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include <math.h> |
| 8 | 8 | #include "driver.h" |
| 9 | #include "mslegacy.h" | |
| 10 | 9 | |
| 11 | 10 | #include "tms9901.h" |
| 12 | 11 | |
| r1681 | r1682 | |
| 329 | 328 | { |
| 330 | 329 | if (tms9901[which].clockinvl) |
| 331 | 330 | { /* reset clock interval */ |
| 332 | timer_adjust(tms9901[which].timer, double_to_attotime((double) tms9901[which].clockinvl / (tms9901[which].clock_rate / 64.)), which, double_to_attotime((double) tms9901[which].clockinvl / (tms9901[which].clock_rate / 64.))); | |
| 331 | timer_adjust_periodic(tms9901[which].timer, double_to_attotime((double) tms9901[which].clockinvl / (tms9901[which].clock_rate / 64.)), which, double_to_attotime((double) tms9901[which].clockinvl / (tms9901[which].clock_rate / 64.))); | |
| 333 | 332 | } |
| 334 | 333 | else |
| 335 | 334 | { /* clock interval == 0 -> no timer */ |
| r1681 | r1682 | |
|---|---|---|
| 5 | 5 | #include "video/pc_aga.h" |
| 6 | 6 | #include "audio/pc.h" |
| 7 | 7 | #include "deprecat.h" |
| 8 | #include "mslegacy.h" | |
| 9 | 8 | |
| 9 | ||
| 10 | 10 | /* |
| 11 | 11 | |
| 12 | 12 | */ |
| r1681 | r1682 | |
| 279 | 279 | europc_rtc.data[0xf]=1; |
| 280 | 280 | |
| 281 | 281 | europc_rtc.timer = timer_alloc(europc_rtc_timer, NULL); |
| 282 | timer_adjust(europc_rtc.timer, attotime_zero, 0, attotime_make(1, 0)); | |
| 282 | timer_adjust_periodic(europc_rtc.timer, attotime_zero, 0, attotime_make(1, 0)); | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | READ8_HANDLER( europc_rtc_r ) |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | 2 | #include "6551.h" |
| 3 | 3 | #include "includes/serial.h" |
| 4 | #include "mslegacy.h" | |
| 5 | 4 | |
| 5 | ||
| 6 | 6 | static void acia_6551_receive_char(unsigned char ch); |
| 7 | 7 | static void acia_6551_refresh_ints(void); |
| 8 | 8 | |
| r1681 | r1682 | |
| 467 | 467 | break; |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | timer_adjust(acia.timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud_rate)); | |
| 470 | timer_adjust_periodic(acia.timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud_rate)); | |
| 471 | 471 | } |
| 472 | 472 | } |
| 473 | 473 |
| r1681 | r1682 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "deprecat.h" |
| 12 | #include "mslegacy.h" | |
| 13 | 12 | #include "includes/electron.h" |
| 14 | 13 | #include "sound/beep.h" |
| 15 | 14 | #include "devices/cassette.h" |
| r1681 | r1682 | |
| 30 | 29 | ula.high_tone_set = 0; |
| 31 | 30 | ula.bit_count = 0; |
| 32 | 31 | ula.tape_running = 1; |
| 33 | timer_adjust( | |
| 32 | timer_adjust_periodic( | |
| 34 | 33 | } |
| 35 | 34 | |
| 36 | 35 | static void electron_tape_stop( void ) { |
| r1681 | r1682 | |
|---|---|---|
| 24 | 24 | #include "machine/8237dma.h" |
| 25 | 25 | #include "devices/harddriv.h" |
| 26 | 26 | #include "memconv.h" |
| 27 | #include "mslegacy.h" | |
| 28 | 27 | |
| 29 | 28 | |
| 30 | 29 | #define LOG_HDC_STATUS 0 |
| r1681 | r1682 | |
| 635 | 634 | status[n] |= STA_INPUT; |
| 636 | 635 | |
| 637 | 636 | assert(timer[n]); |
| 638 | timer_adjust(timer[n], ATTOTIME_IN_MSEC(1), n | |
| 637 | timer_adjust_oneshot(timer[n], ATTOTIME_IN_MSEC(1), n | |
| 639 | 638 | } |
| 640 | 639 | } |
| 641 | 640 | } |
| r1681 | r1682 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "driver.h" |
| 8 | 8 | #include "centroni.h" |
| 9 | #include "mslegacy.h" | |
| 10 | 9 | #include "devices/printer.h" |
| 11 | 10 | |
| 12 | 11 | typedef struct { |
| r1681 | r1682 | |
| 75 | 74 | { |
| 76 | 75 | This->new_control_mask = CENTRONICS_ACKNOWLEDGE; |
| 77 | 76 | This->new_control_data = 0; |
| 78 | timer_adjust(This->timer, ATTOTIME_IN_USEC(2), nr | |
| 77 | timer_adjust_oneshot(This->timer, ATTOTIME_IN_USEC(2), nr | |
| 79 | 78 | } |
| 80 | 79 | /* phase 3: end */ |
| 81 | 80 | else if ( This->control & CENTRONICS_NOT_BUSY ) |
| 82 | 81 | { |
| 83 | timer_adjust(This->timer, attotime_never, nr | |
| 82 | timer_adjust_oneshot(This->timer, attotime_never, nr | |
| 84 | 83 | } |
| 85 | 84 | /* phase 1: schedule not busy & ack */ |
| 86 | 85 | else |
| 87 | 86 | { |
| 88 | 87 | This->new_control_mask = CENTRONICS_NOT_BUSY | CENTRONICS_ACKNOWLEDGE; |
| 89 | 88 | This->new_control_data = CENTRONICS_NOT_BUSY | CENTRONICS_ACKNOWLEDGE; |
| 90 | timer_adjust(This->timer, ATTOTIME_IN_USEC(15), nr | |
| 89 | timer_adjust_oneshot(This->timer, ATTOTIME_IN_USEC(15), nr | |
| 91 | 90 | } |
| 92 | 91 | } |
| 93 | 92 | |
| r1681 | r1682 | |
| 105 | 104 | /* schedule busy */ |
| 106 | 105 | This->new_control_mask = CENTRONICS_NOT_BUSY; |
| 107 | 106 | This->new_control_data = 0; |
| 108 | timer_adjust(This->timer, ATTOTIME_IN_USEC(5), nr | |
| 107 | timer_adjust_oneshot(This->timer, ATTOTIME_IN_USEC(5), nr | |
| 109 | 108 | |
| 110 | 109 | /* output */ |
| 111 | 110 | printer_output(image_from_devtype_and_index(IO_PRINTER, nr), This->data); |
| r1681 | r1682 | |
|---|---|---|
| 33 | 33 | #include "driver.h" |
| 34 | 34 | #include "mc6843.h" |
| 35 | 35 | #include "devices/flopdrv.h" |
| 36 | #include "mslegacy.h" | |
| 37 | 36 | |
| 38 | 37 | |
| 39 | 38 | /******************* parameters ******************/ |
| r1681 | r1682 | |
| 376 | 375 | |
| 377 | 376 | LOG(( "%f mc6843_cont: timer called for cmd=%s(%i)\n", attotime_to_double(timer_get_time()), mc6843_cmd[cmd], cmd )); |
| 378 | 377 | |
| 379 | timer_adjust( | |
| 378 | timer_adjust_oneshot( | |
| 380 | 379 | |
| 381 | 380 | switch ( cmd ) |
| 382 | 381 | { |
| r1681 | r1682 | |
| 444 | 443 | } |
| 445 | 444 | else |
| 446 | 445 | { |
| 447 | timer_adjust( | |
| 446 | timer_adjust_oneshot( | |
| 448 | 447 | } |
| 449 | 448 | } |
| 450 | 449 | else |
| r1681 | r1682 | |
| 589 | 588 | } |
| 590 | 589 | else |
| 591 | 590 | { |
| 592 | timer_adjust( | |
| 591 | timer_adjust_oneshot( | |
| 593 | 592 | } |
| 594 | 593 | } |
| 595 | 594 | else |
| r1681 | r1682 | |
| 690 | 689 | mc6843->STRA |= 0x80; /* set Busy */ |
| 691 | 690 | mc6843->STRA &= ~0x22; /* clear Track Not Equal & Delete Data Mark Detected */ |
| 692 | 691 | mc6843->STRB &= ~0x04; /* clear Data Mark Undetected */ |
| 693 | timer_adjust( | |
| 692 | timer_adjust_oneshot( | |
| 694 | 693 | break; |
| 695 | 694 | case CMD_STZ: |
| 696 | 695 | case CMD_SEK: |
| 697 | 696 | mc6843->STRA |= 0x80; /* set Busy */ |
| 698 | timer_adjust( | |
| 697 | timer_adjust_oneshot( | |
| 699 | 698 | break; |
| 700 | 699 | case CMD_FFW: |
| 701 | 700 | case CMD_FFR: |
| r1681 | r1682 | |
| 778 | 777 | |
| 779 | 778 | mc6843->data_size = 0; |
| 780 | 779 | mc6843->data_idx = 0; |
| 781 | timer_adjust( | |
| 780 | timer_adjust_oneshot( | |
| 782 | 781 | } |
| 783 | 782 | |
| 784 | 783 |
| r1681 | r1682 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | #include "driver.h" |
| 22 | 22 | #include "deprecat.h" |
| 23 | #include "mslegacy.h" | |
| 24 | 23 | #include "mm58274c.h" |
| 25 | 24 | |
| 26 | 25 | |
| r1681 | r1682 | |
| 249 | 248 | /* interrupt run */ |
| 250 | 249 | attotime period = interrupt_period_table(rtc[which].int_ctl & int_ctl_dly); |
| 251 | 250 | |
| 252 | timer_adjust(rtc[which].interrupt_timer, period, which, rtc[which].int_ctl & int_ctl_rpt ? period : attotime_zero); | |
| 251 | timer_adjust_periodic(rtc[which].interrupt_timer, period, which, rtc[which].int_ctl & int_ctl_rpt ? period : attotime_zero); | |
| 253 | 252 | } |
| 254 | 253 | if (data & ctl_clkstop) |
| 255 | 254 | /* stopping the clock clears the tenth counter */ |
| r1681 | r1682 | |
| 322 | 321 | /* interrupt run */ |
| 323 | 322 | attotime period = interrupt_period_table(rtc[which].int_ctl & int_ctl_dly); |
| 324 | 323 | |
| 325 | timer_adjust(rtc[which].interrupt_timer, period, which, rtc[which].int_ctl & int_ctl_rpt ? period : attotime_zero); | |
| 324 | timer_adjust_periodic(rtc[which].interrupt_timer, period, which, rtc[which].int_ctl & int_ctl_rpt ? period : attotime_zero); | |
| 326 | 325 | } |
| 327 | 326 | } |
| 328 | 327 | else |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | 2 | #include "memconv.h" |
| 3 | #include "mslegacy.h" | |
| 4 | 3 | #include "includes/ibmpc.h" |
| 5 | 4 | |
| 6 | 5 | #include "machine/pcshare.h" |
| r1681 | r1682 | |
| 221 | 220 | { |
| 222 | 221 | memset(&pc_rtc,0,sizeof(pc_rtc)); |
| 223 | 222 | pc_rtc.timer = timer_alloc(pc_rtc_timer, NULL); |
| 224 | timer_adjust(pc_rtc.timer, attotime_zero, 0, attotime_make(1, 0)); | |
| 223 | timer_adjust_periodic(pc_rtc.timer, attotime_zero, 0, attotime_make(1, 0)); | |
| 225 | 224 | } |
| 226 | 225 | |
| 227 | 226 | READ8_HANDLER( pc_rtc_r ) |
| r1681 | r1682 | |
|---|---|---|
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | 36 | #include "68901mfp.h" |
| 37 | #include "mslegacy.h" | |
| 38 | 37 | |
| 38 | ||
| 39 | 39 | typedef struct |
| 40 | 40 | { |
| 41 | 41 | const mfp68901_interface *intf; |
| r1681 | r1682 | |
| 657 | 657 | { |
| 658 | 658 | int divisor = PRESCALER[mfp_p->tacr & 0x07]; |
| 659 | 659 | logerror("MFP68901 #%u Timer A Delay Mode : %u Prescale\n", which, divisor); |
| 660 | timer_adjust(mfp_p->timer[MFP68901_TIMER_A], ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor), which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 660 | timer_adjust_periodic(mfp_p->timer[MFP68901_TIMER_A], ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor), which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 661 | 661 | } |
| 662 | 662 | break; |
| 663 | 663 | |
| r1681 | r1682 | |
| 676 | 676 | { |
| 677 | 677 | int divisor = PRESCALER[mfp_p->tacr & 0x07]; |
| 678 | 678 | logerror("MFP68901 #%u Timer A Pulse Width Mode : %u Prescale\n", which, divisor); |
| 679 | timer_adjust(mfp_p->timer[MFP68901_TIMER_A], attotime_never, which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 679 | timer_adjust_periodic(mfp_p->timer[MFP68901_TIMER_A], attotime_never, which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 680 | 680 | timer_enable(mfp_p->timer[MFP68901_TIMER_A], 0); |
| 681 | 681 | } |
| 682 | 682 | break; |
| r1681 | r1682 | |
| 715 | 715 | { |
| 716 | 716 | int divisor = PRESCALER[mfp_p->tbcr & 0x07]; |
| 717 | 717 | logerror("MFP68901 #%u Timer B Delay Mode : %u Prescale\n", which, divisor); |
| 718 | timer_adjust(mfp_p->timer[MFP68901_TIMER_B], ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor), which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 718 | timer_adjust_periodic(mfp_p->timer[MFP68901_TIMER_B], ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor), which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 719 | 719 | } |
| 720 | 720 | break; |
| 721 | 721 | |
| r1681 | r1682 | |
| 734 | 734 | { |
| 735 | 735 | int divisor = PRESCALER[mfp_p->tbcr & 0x07]; |
| 736 | 736 | logerror("MFP68901 #%u Timer B Pulse Width Mode : %u Prescale\n", which, DIVISOR); |
| 737 | timer_adjust(mfp_p->timer[MFP68901_TIMER_B], attotime_never, which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 737 | timer_adjust_periodic(mfp_p->timer[MFP68901_TIMER_B], attotime_never, which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 738 | 738 | timer_enable(mfp_p->timer[MFP68901_TIMER_B], 0); |
| 739 | 739 | } |
| 740 | 740 | break; |
| r1681 | r1682 | |
| 773 | 773 | { |
| 774 | 774 | int divisor = PRESCALER[mfp_p->tcdcr & 0x07]; |
| 775 | 775 | logerror("MFP68901 #%u Timer D Delay Mode : %u Prescale\n", which, divisor); |
| 776 | timer_adjust(mfp_p->timer[MFP68901_TIMER_D], ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor), which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 776 | timer_adjust_periodic(mfp_p->timer[MFP68901_TIMER_D], ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor), which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 777 | 777 | } |
| 778 | 778 | break; |
| 779 | 779 | } |
| r1681 | r1682 | |
| 795 | 795 | { |
| 796 | 796 | int divisor = PRESCALER[(mfp_p->tcdcr >> 4) & 0x07]; |
| 797 | 797 | logerror("MFP68901 #%u Timer C Delay Mode : %u Prescale\n", which, divisor); |
| 798 | timer_adjust(mfp_p->timer[MFP68901_TIMER_C], ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor), which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 798 | timer_adjust_periodic(mfp_p->timer[MFP68901_TIMER_C], ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor), which, ATTOTIME_IN_HZ(mfp_p->intf->timer_clock / divisor)); | |
| 799 | 799 | } |
| 800 | 800 | break; |
| 801 | 801 | } |
| r1681 | r1682 | |
|---|---|---|
| 15 | 15 | #include "amiga.h" |
| 16 | 16 | #include "amigafdc.h" |
| 17 | 17 | #include "machine/6526cia.h" |
| 18 | #include "mslegacy.h" | |
| 19 | 18 | |
| 20 | 19 | |
| 21 | 20 | #define MAX_TRACK_BYTES 12500 |
| r1681 | r1682 | |
| 277 | 276 | time = ONE_SECTOR_BYTES; |
| 278 | 277 | time *= ( CUSTOM_REG(REG_ADKCON) & 0x0100 ) ? 2 : 4; |
| 279 | 278 | time *= 8; |
| 280 | timer_adjust( | |
| 279 | timer_adjust_oneshot( | |
| 281 | 280 | return; |
| 282 | 281 | } |
| 283 | 282 | |
| r1681 | r1682 | |
| 354 | 353 | time = len_words * 2; |
| 355 | 354 | time *= ( CUSTOM_REG(REG_ADKCON) & 0x0100 ) ? 2 : 4; |
| 356 | 355 | time *= 8; |
| 357 | timer_adjust( | |
| 356 | timer_adjust_oneshot( | |
| 358 | 357 | return; |
| 359 | 358 | } |
| 360 | 359 | } |
| r1681 | r1682 | |
| 425 | 424 | time += len_words * 2; |
| 426 | 425 | time *= ( CUSTOM_REG(REG_ADKCON) & 0x0100 ) ? 2 : 4; |
| 427 | 426 | time *= 8; |
| 428 | timer_adjust( | |
| 427 | timer_adjust_oneshot( | |
| 429 | 428 | |
| 430 | 429 | return; |
| 431 | 430 | |
| r1681 | r1682 | |
| 601 | 600 | /* Issue a index pulse when a disk revolution completes */ |
| 602 | 601 | cia_issue_index(1); |
| 603 | 602 | |
| 604 | timer_adjust(fdc_status[drive].rev_timer, ATTOTIME_IN_MSEC( ONE_REV_TIME ), drive | |
| 603 | timer_adjust_oneshot(fdc_status[drive].rev_timer, ATTOTIME_IN_MSEC( ONE_REV_TIME ), drive | |
| 605 | 604 | fdc_status[drive].rev_timer_started = 1; |
| 606 | 605 | |
| 607 | 606 | if ( fdc_status[drive].is_ext_image == 0 ) |
| r1681 | r1682 | |
| 610 | 609 | time = GAP_TRACK_BYTES + 6; |
| 611 | 610 | time *= ( CUSTOM_REG(REG_ADKCON) & 0x0100 ) ? 2 : 4; |
| 612 | 611 | time *= 8; |
| 613 | timer_adjust( | |
| 612 | timer_adjust_oneshot( | |
| 614 | 613 | } |
| 615 | 614 | } |
| 616 | 615 | |
| r1681 | r1682 | |
| 622 | 621 | return; |
| 623 | 622 | } |
| 624 | 623 | |
| 625 | timer_adjust(fdc_status[drive].rev_timer, ATTOTIME_IN_MSEC( ONE_REV_TIME ), drive | |
| 624 | timer_adjust_oneshot(fdc_status[drive].rev_timer, ATTOTIME_IN_MSEC( ONE_REV_TIME ), drive | |
| 626 | 625 | fdc_status[drive].rev_timer_started = 1; |
| 627 | 626 | } |
| 628 | 627 |
| r1681 | r1682 | |
|---|---|---|
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "driver.h" |
| 11 | #include "mslegacy.h" | |
| 12 | 11 | #include "z80dart.h" |
| 13 | 12 | #include "cpu/z80/z80.h" |
| 14 | 13 | #include "cpu/z80/z80daisy.h" |
| r1681 | r1682 | |
| 309 | 308 | interrupt_check(dart); |
| 310 | 309 | |
| 311 | 310 | /* start the receive timer running */ |
| 312 | timer_adjust(chan->receive_timer, tpc, ((dart - darts) << 1) | ch, tpc); | |
| 311 | timer_adjust_periodic(chan->receive_timer, tpc, ((dart - darts) << 1) | ch, tpc); | |
| 313 | 312 | } |
| 314 | 313 | |
| 315 | 314 |
| r1681 | r1682 | |
|---|---|---|
| 9 | 9 | #include "amiga.h" |
| 10 | 10 | #include "amigakbd.h" |
| 11 | 11 | #include "machine/6526cia.h" |
| 12 | #include "mslegacy.h" | |
| 13 | 12 | |
| 14 | 13 | |
| 15 | 14 | #define KEYBOARD_BUFFER_SIZE 256 |
| r1681 | r1682 | |
| 51 | 50 | /* if we still have more data, schedule another update */ |
| 52 | 51 | if ( key_buf_pos != key_cur_pos ) |
| 53 | 52 | { |
| 54 | timer_adjust( | |
| 53 | timer_adjust_oneshot( | |
| 55 | 54 | } |
| 56 | 55 | } |
| 57 | 56 | |
| r1681 | r1682 | |
| 91 | 90 | /* if the buffer was empty and we have new data, start a timer to send the keystrokes */ |
| 92 | 91 | if ( key_buf_was_empty && ( key_buf_pos != key_cur_pos ) ) |
| 93 | 92 | { |
| 94 | timer_adjust( | |
| 93 | timer_adjust_oneshot( | |
| 95 | 94 | } |
| 96 | 95 | } |
| 97 | 96 | } |
| r1681 | r1682 | |
|---|---|---|
| 16 | 16 | #include "devices/chd_cd.h" |
| 17 | 17 | #include "sound/cdda.h" |
| 18 | 18 | #include "machine/matsucd.h" |
| 19 | #include "mslegacy.h" | |
| 20 | 19 | |
| 21 | 20 | |
| 22 | 21 | #define MATSU_STATUS_READY ( 1 << 0 ) /* driver ready */ |
| r1681 | r1682 | |
| 151 | 150 | if (cddanum != -1) |
| 152 | 151 | { |
| 153 | 152 | cdda_start_audio(cddanum, lba, num_blocks); |
| 154 | timer_adjust( | |
| 153 | timer_adjust_oneshot( | |
| 155 | 154 | } |
| 156 | 155 | } |
| 157 | 156 | |
| r1681 | r1682 | |
| 168 | 167 | } |
| 169 | 168 | else |
| 170 | 169 | { |
| 171 | timer_adjust( | |
| 170 | timer_adjust_oneshot( | |
| 172 | 171 | } |
| 173 | 172 | } |
| 174 | 173 | } |
| r1681 | r1682 | |
| 298 | 297 | |
| 299 | 298 | newstatus |= MATSU_STATUS_PLAYING; |
| 300 | 299 | |
| 301 | timer_adjust( | |
| 300 | timer_adjust_oneshot( | |
| 302 | 301 | } |
| 303 | 302 | else |
| 304 | 303 | { |
| r1681 | r1682 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include <math.h> |
| 8 | 8 | #include "driver.h" |
| 9 | #include "mslegacy.h" | |
| 10 | 9 | |
| 11 | 10 | #include "tms9902.h" |
| 12 | 11 | |
| r1681 | r1682 | |
| 281 | 280 | { |
| 282 | 281 | if (tms9902[which].TMR) |
| 283 | 282 | { /* reset clock interval */ |
| 284 | timer_adjust(tms9902[which].timer, | |
| 283 | timer_adjust_periodic(tms9902[which].timer, | |
| 285 | 284 | double_to_attotime((double) tms9902[which].TMR / (tms9902[which].clock_rate / ((tms9902[which].CLK4M) ? 4. : 3.) / 64.)), |
| 286 | 285 | which, |
| 287 | 286 | double_to_attotime((double) tms9902[which].TMR / (tms9902[which].clock_rate / ((tms9902[which].CLK4M) ? 4. : 3.) / 64.))); |
| r1681 | r1682 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | 18 | #include "deprecat.h" |
| 19 | #include "mslegacy.h" | |
| 20 | 19 | #include "cpu/z80/z80.h" |
| 21 | 20 | #include "machine/6821pia.h" |
| 22 | 21 | #include "machine/6850acia.h" |
| r1681 | r1682 | |
| 358 | 357 | beep_set_state( 0, 0 ); |
| 359 | 358 | } |
| 360 | 359 | |
| 361 | timer_adjust( | |
| 360 | timer_adjust_oneshot( | |
| 362 | 361 | } |
| 363 | 362 | |
| 364 | 363 | /* |
| r1681 | r1682 | |
| 435 | 434 | memset( mess_ram + 0x10000, 0xFF, 0x1000 ); |
| 436 | 435 | |
| 437 | 436 | osborne1.video_timer = timer_alloc( osborne1_video_callback , NULL); |
| 438 | timer_adjust( | |
| 437 | timer_adjust_oneshot( | |
| 439 | 438 | pia_1_ca1_w( 0, 0 ); |
| 440 | 439 | |
| 441 | 440 | timer_set( attotime_zero, NULL, 0, setup_beep ); |
| r1681 | r1682 | |
|---|---|---|
| 2 | 2 | #include "driver.h" |
| 3 | 3 | #include "image.h" |
| 4 | 4 | #include "deprecat.h" |
| 5 | #include "mslegacy.h" | |
| 6 | 5 | #include "includes/sms.h" |
| 7 | 6 | #include "video/smsvdp.h" |
| 8 | 7 | #include "sound/2413intf.h" |
| r1681 | r1682 | |
| 945 | 944 | rapid_fire_state_1 = 0; |
| 946 | 945 | rapid_fire_state_2 = 0; |
| 947 | 946 | rapid_fire_timer = timer_alloc( rapid_fire_callback , NULL); |
| 948 | timer_adjust( | |
| 947 | timer_adjust_periodic( | |
| 949 | 948 | |
| 950 | 949 | last_paddle_read_time = 0; |
| 951 | 950 | paddle_read_state = 0; |
| r1681 | r1682 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | #include "driver.h" |
| 39 | 39 | #include "deprecat.h" |
| 40 | #include "mslegacy.h" | |
| 41 | 40 | #include "machine/wd17xx.h" |
| 42 | 41 | #include "devices/flopdrv.h" |
| 43 | 42 | |
| r1681 | r1682 | |
| 314 | 313 | static void wd17xx_set_busy(wd17xx_info *w, attotime duration) |
| 315 | 314 | { |
| 316 | 315 | w->status |= STA_1_BUSY; |
| 317 | timer_adjust(busy_timer, duration, 0 | |
| 316 | timer_adjust_oneshot(busy_timer, duration, 0 | |
| 318 | 317 | } |
| 319 | 318 | |
| 320 | 319 | |
| r1681 | r1682 | |
| 832 | 831 | usecs *= delay; |
| 833 | 832 | |
| 834 | 833 | /* set new timer */ |
| 835 | timer_adjust(w->timer, ATTOTIME_IN_USEC(usecs), MISCCALLBACK_COMMAND | |
| 834 | timer_adjust_oneshot(w->timer, ATTOTIME_IN_USEC(usecs), MISCCALLBACK_COMMAND | |
| 836 | 835 | } |
| 837 | 836 | |
| 838 | 837 | |
| r1681 | r1682 | |
| 1014 | 1013 | usecs = floppy_drive_get_datarate_in_us(w->density); |
| 1015 | 1014 | |
| 1016 | 1015 | /* set new timer */ |
| 1017 | timer_adjust(w->timer, ATTOTIME_IN_USEC(usecs), MISCCALLBACK_DATA | |
| 1016 | timer_adjust_oneshot(w->timer, ATTOTIME_IN_USEC(usecs), MISCCALLBACK_DATA | |
| 1018 | 1017 | } |
| 1019 | 1018 | |
| 1020 | 1019 |
| r1681 | r1682 | |
|---|---|---|
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "machine/uart8250.h" |
| 11 | 11 | #include "includes/pc_mouse.h" |
| 12 | #include "mslegacy.h" | |
| 13 | 12 | |
| 14 | 13 | |
| 15 | 14 | static struct { |
| r1681 | r1682 | |
| 230 | 229 | } |
| 231 | 230 | |
| 232 | 231 | /* start a timer to scan the mouse input */ |
| 233 | timer_adjust(pc_mouse.timer, attotime_zero, pc_mouse.serial_port, ATTOTIME_IN_HZ(240)); | |
| 232 | timer_adjust_periodic(pc_mouse.timer, attotime_zero, pc_mouse.serial_port, ATTOTIME_IN_HZ(240)); | |
| 234 | 233 | } |
| 235 | 234 | else |
| 236 | 235 | { |
| 237 | 236 | /* CTS just went to 0 */ |
| 238 | timer_adjust(pc_mouse.timer, attotime_zero, pc_mouse.serial_port | |
| 237 | timer_adjust_oneshot(pc_mouse.timer, attotime_zero, pc_mouse.serial_port | |
| 239 | 238 | pc_mouse.head = pc_mouse.tail = 0; |
| 240 | 239 | } |
| 241 | 240 | } |
| r1681 | r1682 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | #include "machine/hd63450.h" |
| 8 | 8 | #include "deprecat.h" |
| 9 | #include "mslegacy.h" | |
| 10 | 9 | |
| 10 | ||
| 11 | 11 | static struct hd63450 dmac; |
| 12 | 12 | |
| 13 | 13 | static TIMER_CALLBACK(dma_transfer_timer); |
| r1681 | r1682 | |
| 207 | 207 | if((dmac.reg[channel].dcr & 0xc0) == 0x00) // Burst transfer |
| 208 | 208 | { |
| 209 | 209 | cpunum_set_input_line(Machine, dmac.intf->cpu,INPUT_LINE_HALT,ASSERT_LINE); |
| 210 | timer_adjust(dmac.timer[channel],attotime_zero,channel, dmac.intf->burst_clock[channel]); | |
| 210 | timer_adjust_periodic(dmac.timer[channel], attotime_zero, channel, dmac.intf->burst_clock[channel]); | |
| 211 | 211 | } |
| 212 | 212 | else |
| 213 | timer_adjust(dmac.timer[channel],ATTOTIME_IN_USEC(500),channel, dmac.intf->clock[channel]); | |
| 213 | timer_adjust_periodic(dmac.timer[channel], ATTOTIME_IN_USEC(500), channel, dmac.intf->clock[channel]); | |
| 214 | 214 | |
| 215 | 215 | |
| 216 | 216 | dmac.transfer_size[channel] = dmac.reg[channel].mtc; |
| r1681 | r1682 | |
| 226 | 226 | static void dma_transfer_abort(int channel) |
| 227 | 227 | { |
| 228 | 228 | logerror("DMA#%i: Transfer aborted\n",channel); |
| 229 | timer_adjust(dmac.timer[channel],attotime_zero,0 | |
| 229 | timer_adjust_oneshot(dmac.timer[channel], attotime_zero, 0 | |
| 230 | 230 | dmac.in_progress[channel] = 0; |
| 231 | 231 | dmac.reg[channel].mtc = dmac.transfer_size[channel]; |
| 232 | 232 | dmac.reg[channel].csr |= 0xe0; // channel operation complete, block transfer complete |
| r1681 | r1682 | |
| 236 | 236 | static void dma_transfer_halt(int channel) |
| 237 | 237 | { |
| 238 | 238 | dmac.halted[channel] = 1; |
| 239 | timer_adjust(dmac.timer[channel],attotime_zero,0 | |
| 239 | timer_adjust_oneshot(dmac.timer[channel], attotime_zero, 0 | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | static void dma_transfer_continue(int channel) |
| r1681 | r1682 | |
| 244 | 244 | if(dmac.halted[channel] != 0) |
| 245 | 245 | { |
| 246 | 246 | dmac.halted[channel] = 0; |
| 247 | timer_adjust(dmac.timer[channel],attotime_zero,channel, dmac.intf->clock[channel]); | |
| 247 | timer_adjust_periodic(dmac.timer[channel], attotime_zero, channel, dmac.intf->clock[channel]); | |
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
| r1681 | r1682 | |
| 363 | 363 | dmac.reg[x].mtc = program_read_word(dmac.reg[x].bar+4); |
| 364 | 364 | return; |
| 365 | 365 | } |
| 366 | timer_adjust(dmac.timer[x],attotime_zero,0 | |
| 366 | timer_adjust_oneshot(dmac.timer[x], attotime_zero, 0 | |
| 367 | 367 | dmac.in_progress[x] = 0; |
| 368 | 368 | dmac.reg[x].mtc = dmac.transfer_size[x]; |
| 369 | 369 | dmac.reg[x].csr |= 0xe0; // channel operation complete, block transfer complete |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | |
| 2 | 2 | #include "driver.h" |
| 3 | 3 | #include "deprecat.h" |
| 4 | #include "mslegacy.h" | |
| 5 | 4 | #include "video/vdc.h" |
| 6 | 5 | #include "cpu/h6280/h6280.h" |
| 7 | 6 | #include "includes/pce.h" |
| r1681 | r1682 | |
| 357 | 356 | if ( frame_count == 0 ) { |
| 358 | 357 | pce_cd_reply_status_byte( SCSI_STATUS_OK ); |
| 359 | 358 | } else { |
| 360 | timer_adjust( | |
| 359 | timer_adjust_periodic( | |
| 361 | 360 | } |
| 362 | 361 | } |
| 363 | 362 | |
| r1681 | r1682 | |
| 789 | 788 | /* We are done, disable the timer */ |
| 790 | 789 | logerror("Last frame read from CD\n"); |
| 791 | 790 | pce_cd.data_transferred = 1; |
| 792 | timer_adjust( | |
| 791 | timer_adjust_oneshot( | |
| 793 | 792 | } else { |
| 794 | 793 | pce_cd.data_transferred = 0; |
| 795 | 794 | } |
| r1681 | r1682 | |
| 834 | 833 | } |
| 835 | 834 | |
| 836 | 835 | pce_cd.data_timer = timer_alloc( pce_cd_data_timer_callback , NULL); |
| 837 | timer_adjust( | |
| 836 | timer_adjust_oneshot( | |
| 838 | 837 | pce_cd.adpcm_dma_timer = timer_alloc( pce_cd_adpcm_dma_timer_callback , NULL); |
| 839 | timer_adjust( | |
| 838 | timer_adjust_oneshot( | |
| 840 | 839 | } |
| 841 | 840 | |
| 842 | 841 | WRITE8_HANDLER( pce_cd_bram_w ) { |
| r1681 | r1682 | |
| 890 | 889 | case 0x0B: /* ADPCM DMA control */ |
| 891 | 890 | if ( ! ( pce_cd.regs[0x0B] & 0x02 ) && ( data & 0x02 ) ) { |
| 892 | 891 | /* Start CD to ADPCM transfer */ |
| 893 | timer_adjust( | |
| 892 | timer_adjust_periodic( | |
| 894 | 893 | } |
| 895 | 894 | if ( ( pce_cd.regs[0x0B] & 0x02 ) && ! ( data & 0x02 ) ) { |
| 896 | 895 | /* Stop CD to ADPCM transfer (?) */ |
| 897 | timer_adjust( | |
| 896 | timer_adjust_oneshot( | |
| 898 | 897 | } |
| 899 | 898 | break; |
| 900 | 899 | case 0x0C: /* ADPCM status */ |
| r1681 | r1682 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | #include "driver.h" |
| 18 | 18 | #include "tms5501.h" |
| 19 | #include "mslegacy.h" | |
| 20 | 19 | |
| 20 | ||
| 21 | 21 | #define DEBUG_TMS5501 0 |
| 22 | 22 | |
| 23 | 23 | #define LOG_TMS5501(n, message, data) do { if (DEBUG_TMS5501) logerror ("TMS5501 %d: %s %02x\n", n, message, data); } while (0) |
| r1681 | r1682 | |
| 212 | 212 | { |
| 213 | 213 | if (tms5501[which].timer_counter[timer]) |
| 214 | 214 | { /* reset clock interval */ |
| 215 | timer_adjust(tms5501[which].timer[timer], double_to_attotime((double) tms5501[which].timer_counter[0] / (tms5501[which].clock_rate / 128.)), which, double_to_attotime((double) tms5501[which].timer_counter[timer] / (tms5501[which].clock_rate / 128.))); | |
| 215 | timer_adjust_periodic(tms5501[which].timer[timer], double_to_attotime((double) tms5501[which].timer_counter[0] / (tms5501[which].clock_rate / 128.)), which, double_to_attotime((double) tms5501[which].timer_counter[timer] / (tms5501[which].clock_rate / 128.))); | |
| 216 | 216 | } |
| 217 | 217 | else |
| 218 | 218 | { /* clock interval == 0 -> no timer */ |
| r1681 | r1682 | |
|---|---|---|
| 9 | 9 | #include "driver.h" |
| 10 | 10 | #include "sgi.h" |
| 11 | 11 | #include "deprecat.h" |
| 12 | #include "mslegacy.h" | |
| 13 | 12 | |
| 13 | ||
| 14 | 14 | #define VERBOSE_LEVEL ( 1 ) |
| 15 | 15 | |
| 16 | 16 | INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... ) |
| r1681 | r1682 | |
| 576 | 576 | nMC_DMAMode = 0; |
| 577 | 577 | nMC_DMAZoomByteCnt = 0; |
| 578 | 578 | tMC_UpdateTimer = timer_alloc( mc_update_callback , NULL); |
| 579 | timer_adjust( | |
| 579 | timer_adjust_periodic( | |
| 580 | 580 | |
| 581 | 581 | // if Indigo2, ID appropriately |
| 582 | 582 | if (!strcmp(Machine->gamedrv->name, "ip244415")) |
| r1681 | r1682 | |
|---|---|---|
| 233 | 233 | if (tape.motor && tape.play) |
| 234 | 234 | { |
| 235 | 235 | wav.state = 3; |
| 236 | timer_adjust(wav.timer, 0, 0, 1.0 / wav.sample->smpfreq); | |
| 236 | timer_adjust_periodic(wav.timer, 0, 0, 1.0 / wav.sample->smpfreq); | |
| 237 | 237 | break; |
| 238 | 238 | } |
| 239 | 239 | if (tape.motor && tape.record) |
| r1681 | r1682 | |
|---|---|---|
| 11 | 11 | #include "ctype.h" |
| 12 | 12 | #include "driver.h" |
| 13 | 13 | #include "deprecat.h" |
| 14 | #include "mslegacy.h" | |
| 15 | 14 | #include "cpu/m6502/m6502.h" |
| 16 | 15 | #include "machine/6522via.h" |
| 17 | 16 | #include "machine/wd17xx.h" |
| r1681 | r1682 | |
| 1453 | 1452 | if (status) |
| 1454 | 1453 | { |
| 1455 | 1454 | cassette_change_state(image_from_devtype_and_index(IO_CASSETTE, 0),CASSETTE_MOTOR_ENABLED ,CASSETTE_MASK_MOTOR); |
| 1456 | timer_adjust(bbc_tape_timer, attotime_zero, 0, ATTOTIME_IN_HZ(44100)); | |
| 1455 | timer_adjust_periodic(bbc_tape_timer, attotime_zero, 0, ATTOTIME_IN_HZ(44100)); | |
| 1457 | 1456 | } else { |
| 1458 | 1457 | cassette_change_state(image_from_devtype_and_index(IO_CASSETTE, 0),CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR); |
| 1459 | 1458 | timer_reset(bbc_tape_timer, attotime_never); |
| r1681 | r1682 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | #include "driver.h" |
| 16 | 16 | #include "deprecat.h" |
| 17 | #include "mslegacy.h" | |
| 18 | 17 | #include "cpu/i86/i186intf.h" |
| 19 | 18 | #include "video/i82720.h" |
| 20 | 19 | #include "machine/8255ppi.h" |
| r1681 | r1682 | |
| 27 | 26 | #include "devices/basicdsk.h" |
| 28 | 27 | #include "devices/printer.h" |
| 29 | 28 | |
| 29 | ||
| 30 | 30 | /*-------------------------------------------------------------------------*/ |
| 31 | 31 | /* Defines, constants, and global variables */ |
| 32 | 32 | /*-------------------------------------------------------------------------*/ |
| r1681 | r1682 | |
| 778 | 778 | if (t->control & 0x0001) |
| 779 | 779 | { |
| 780 | 780 | int count = t->maxA ? t->maxA : 0x10000; |
| 781 | timer_adjust(t->int_timer, attotime_mul(ATTOTIME_IN_HZ(2000000), count), which | |
| 781 | timer_adjust_oneshot(t->int_timer, attotime_mul(ATTOTIME_IN_HZ(2000000), count), which | |
| 782 | 782 | if (LOG_TIMER) logerror(" Repriming interrupt\n"); |
| 783 | 783 | } |
| 784 | 784 | else |
| 785 | timer_adjust(t->int_timer, attotime_never, which | |
| 785 | timer_adjust_oneshot(t->int_timer, attotime_never, which | |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | |
| r1681 | r1682 | |
| 893 | 893 | internal_timer_sync(which); |
| 894 | 894 | |
| 895 | 895 | /* nuke the timer and force the interrupt timer to be recomputed */ |
| 896 | timer_adjust(t->time_timer, attotime_never, which | |
| 896 | timer_adjust_oneshot(t->time_timer, attotime_never, which | |
| 897 | 897 | t->time_timer_active = 0; |
| 898 | 898 | update_int_timer = 1; |
| 899 | 899 | } |
| r1681 | r1682 | |
| 902 | 902 | else if ((diff & 0x8000) && (new_control & 0x8000)) |
| 903 | 903 | { |
| 904 | 904 | /* start the timing */ |
| 905 | timer_adjust(t->time_timer, attotime_never, which | |
| 905 | timer_adjust_oneshot(t->time_timer, attotime_never, which | |
| 906 | 906 | t->time_timer_active = 1; |
| 907 | 907 | update_int_timer = 1; |
| 908 | 908 | } |
| r1681 | r1682 | |
| 927 | 927 | int diff = t->maxA - t->count; |
| 928 | 928 | if (diff <= 0) |
| 929 | 929 | diff += 0x10000; |
| 930 | timer_adjust(t->int_timer, attotime_mul(ATTOTIME_IN_HZ(2000000), diff), which | |
| 930 | timer_adjust_oneshot(t->int_timer, attotime_mul(ATTOTIME_IN_HZ(2000000), diff), which | |
| 931 | 931 | if (LOG_TIMER) logerror("Set interrupt timer for %d\n", which); |
| 932 | 932 | } |
| 933 | 933 | else |
| 934 | 934 | { |
| 935 | timer_adjust(t->int_timer, attotime_never, which | |
| 935 | timer_adjust_oneshot(t->int_timer, attotime_never, which | |
| 936 | 936 | } |
| 937 | 937 | } |
| 938 | 938 | } |
| r1681 | r1682 | |
| 1014 | 1014 | if (LOG_DMA) logerror("Initiated DMA %d - count = %04X, source = %04X, dest = %04X\n", which, d->count, d->source, d->dest); |
| 1015 | 1015 | |
| 1016 | 1016 | d->finished = 0; |
| 1017 | /* timer_adjust(d->finish_timer, | |
| 1018 | ATTOTIME_IN_HZ(dac[dacnum].frequency) * (double)count, which, 0);*/ | |
| 1017 | /* timer_adjust_oneshot(d->finish_timer, | |
| 1018 | ATTOTIME_IN_HZ(dac[dacnum].frequency) * (double)count, which);*/ | |
| 1019 | 1019 | } |
| 1020 | 1020 | } |
| 1021 | 1021 |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | /* Core includes */ |
| 2 | 2 | #include "driver.h" |
| 3 | 3 | #include "deprecat.h" |
| 4 | #include "mslegacy.h" | |
| 5 | 4 | #include "includes/kc.h" |
| 6 | 5 | |
| 7 | 6 | /* Components */ |
| r1681 | r1682 | |
| 434 | 433 | if (motor_state) |
| 435 | 434 | { |
| 436 | 435 | /* start timer */ |
| 437 | timer_adjust(kc_cassette_timer, attotime_zero, 0, KC_CASSETTE_TIMER_FREQUENCY); | |
| 436 | timer_adjust_periodic(kc_cassette_timer, attotime_zero, 0, KC_CASSETTE_TIMER_FREQUENCY); | |
| 438 | 437 | } |
| 439 | 438 | else |
| 440 | 439 | { |
| r1681 | r1682 | |
|---|---|---|
| 64 | 64 | // |
| 65 | 65 | |
| 66 | 66 | #include "driver.h" |
| 67 | #include "mslegacy.h" | |
| 68 | 67 | #include "devices/harddriv.h" |
| 69 | 68 | #include "includes/corvushd.h" |
| 70 | 69 | #include <ctype.h> |
| 71 | 70 | |
| 71 | ||
| 72 | 72 | #define VERBOSE 0 |
| 73 | 73 | #define VERBOSE_RESPONSES 0 |
| 74 | 74 | #define VERSION 1 |
| r1681 | r1682 | |
| 1455 | 1455 | c->recv_bytes = 0; // We aren't waiting on additional data from the host |
| 1456 | 1456 | |
| 1457 | 1457 | c->timeout_timer = timer_alloc(corvus_hdc_callback, NULL); // Set up a timer to handle the four-second host-to-controller timeout |
| 1458 | timer_adjust(c->timeout_timer, ATTOTIME_IN_SEC(4), CALLBACK_TIMEOUT | |
| 1458 | timer_adjust_oneshot(c->timeout_timer, ATTOTIME_IN_SEC(4), CALLBACK_TIMEOUT | |
| 1459 | 1459 | timer_enable(c->timeout_timer, 0); // Start this timer out disabled |
| 1460 | 1460 | |
| 1461 | 1461 | LOG(("corvus_hdc_init: Attached to drive image: H:%d, C:%d, S:%d\n", info->heads, info->cylinders, info->sectors)); |
| r1681 | r1682 | |
|---|---|---|
| 95 | 95 | |
| 96 | 96 | #include "driver.h" |
| 97 | 97 | #include "deprecat.h" |
| 98 | #include "mslegacy.h" | |
| 99 | 98 | #include "includes/nc.h" |
| 100 | 99 | #include "includes/serial.h" /* for serial data transfers */ |
| 101 | 100 | #include "machine/msm8251.h" /* for NC100 uart */ |
| r1681 | r1682 | |
| 593 | 592 | |
| 594 | 593 | /* keyboard timer */ |
| 595 | 594 | nc_keyboard_timer = timer_alloc(nc_keyboard_timer_callback, NULL); |
| 596 | timer_adjust(nc_keyboard_timer, ATTOTIME_IN_MSEC(10), 0 | |
| 595 | timer_adjust_oneshot(nc_keyboard_timer, ATTOTIME_IN_MSEC(10), 0 | |
| 597 | 596 | |
| 598 | 597 | /* dummy timer */ |
| 599 | 598 | timer_pulse(ATTOTIME_IN_HZ(50), NULL, 0, dummy_timer_callback); |
| r1681 | r1682 | |
| 798 | 797 | } |
| 799 | 798 | } |
| 800 | 799 | |
| 801 | timer_adjust(nc_serial_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud_rate_table[(data & 0x07)])); | |
| 800 | timer_adjust_periodic(nc_serial_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud_rate_table[(data & 0x07)])); | |
| 802 | 801 | |
| 803 | 802 | nc_uart_control = data; |
| 804 | 803 | } |
| r1681 | r1682 | |
|---|---|---|
| 38 | 38 | */ |
| 39 | 39 | |
| 40 | 40 | #include "driver.h" |
| 41 | #include "deprecat.h" | |
| 42 | #include "mslegacy.h" | |
| 41 | 43 | #include "cpu/tms9900/tms9900.h" |
| 42 | 44 | #include "machine/tms9901.h" |
| 43 | 45 | #include "machine/tms9902.h" |
| 44 | 46 | #include "video/tms9928a.h" |
| 45 | 47 | #include "devices/cassette.h" |
| 46 | 48 | #include "sound/speaker.h" |
| 47 | #include "mslegacy.h" | |
| 48 | #include "deprecat.h" | |
| 49 | 49 | |
| 50 | ||
| 50 | 51 | static int load_state; |
| 51 | 52 | static int ic_state; |
| 52 | 53 | |
| r1681 | r1682 | |
| 489 | 490 | |
| 490 | 491 | tms9902_set_dsr(id, 1); |
| 491 | 492 | rs232_input_timer = timer_alloc(rs232_input_callback, NULL); |
| 492 | timer_adjust(rs232_input_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(10)); | |
| 493 | timer_adjust_periodic(rs232_input_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(10)); | |
| 493 | 494 | |
| 494 | 495 | return INIT_PASS; |
| 495 | 496 | } |
| r1681 | r1682 | |
|---|---|---|
| 79 | 79 | #include "machine/z80pio.h" |
| 80 | 80 | #include "sound/sn76477.h" |
| 81 | 81 | #include "machine/abcbus.h" |
| 82 | #include "mslegacy.h" | |
| 83 | 82 | |
| 84 | 83 | /* Devices */ |
| 85 | 84 | #include "devices/basicdsk.h" |
| r1681 | r1682 | |
| 447 | 446 | state_save_register_global(keylatch); |
| 448 | 447 | |
| 449 | 448 | abc80_keyboard_timer = timer_alloc(abc80_keyboard_tick, NULL); |
| 450 | timer_adjust(abc80_keyboard_timer, attotime_zero, 0, ATTOTIME_IN_USEC(2500)); | |
| 449 | timer_adjust_periodic(abc80_keyboard_timer, attotime_zero, 0, ATTOTIME_IN_USEC(2500)); | |
| 451 | 450 | } |
| 452 | 451 | |
| 453 | 452 | /* Machine Drivers */ |
| r1681 | r1682 | |
|---|---|---|
| 127 | 127 | #include "driver.h" |
| 128 | 128 | #include "render.h" |
| 129 | 129 | #include "deprecat.h" |
| 130 | #include "mslegacy.h" | |
| 131 | 130 | #include "cpu/m68000/m68000.h" |
| 132 | 131 | #include "machine/68901mfp.h" |
| 133 | 132 | #include "machine/8255ppi.h" |
| r1681 | r1682 | |
| 140 | 139 | #include "devices/basicdsk.h" |
| 141 | 140 | #include "includes/x68k.h" |
| 142 | 141 | |
| 142 | ||
| 143 | 143 | struct x68k_system sys; |
| 144 | 144 | |
| 145 | 145 | extern UINT16* gvram; // Graphic VRAM |
| r1681 | r1682 | |
| 210 | 210 | mfp_timer[2] = timer_alloc(mfp_timer_c_callback, NULL); |
| 211 | 211 | mfp_timer[3] = timer_alloc(mfp_timer_d_callback, NULL); |
| 212 | 212 | mfp_irq = timer_alloc(mfp_update_irq, NULL); |
| 213 | timer_adjust(mfp_irq, attotime_zero, 0, ATTOTIME_IN_USEC(32)); | |
| 213 | timer_adjust_periodic(mfp_irq, attotime_zero, 0, ATTOTIME_IN_USEC(32)); | |
| 214 | 214 | */ |
| 215 | 215 | } |
| 216 | 216 | /* |
| r1681 | r1682 | |
| 331 | 331 | { |
| 332 | 332 | if((data & 0x07) == 0x0000) |
| 333 | 333 | { // Timer stop |
| 334 | timer_adjust(mfp_timer[timer],attotime_zero,0 | |
| 334 | timer_adjust_oneshot(mfp_timer[timer], attotime_zero, 0 | |
| 335 | 335 | logerror("MFP: Timer #%i stopped. \n",timer); |
| 336 | 336 | return; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | timer_adjust(mfp_timer[timer], attotime_zero, 0, prescale(data & 0x07)); | |
| 339 | timer_adjust_periodic(mfp_timer[timer], attotime_zero, 0, prescale(data & 0x07)); | |
| 340 | 340 | logerror("MFP: Timer #%i set to %2.1fus\n",timer, attotime_to_double(prescale(data & 0x07)) * 1000000); |
| 341 | 341 | |
| 342 | 342 | } |
| r1681 | r1682 | |
| 1896 | 1896 | // start VBlank timer |
| 1897 | 1897 | sys.crtc.vblank = 1; |
| 1898 | 1898 | irq_time = video_screen_get_time_until_pos(0,sys.crtc.reg[6],2); |
| 1899 | timer_adjust(vblank_irq,irq_time,0 | |
| 1899 | timer_adjust_oneshot(vblank_irq, irq_time, 0 | |
| 1900 | 1900 | |
| 1901 | 1901 | // start HBlank timer |
| 1902 | timer_adjust(scanline_timer,video_screen_get_scan_period(0),1 | |
| 1902 | timer_adjust_oneshot(scanline_timer, video_screen_get_scan_period(0), 1 | |
| 1903 | 1903 | |
| 1904 | 1904 | sys.mfp.gpio = 0xfb; |
| 1905 | 1905 | } |
| r1681 | r1682 | |
| 1922 | 1922 | memory_set_bankptr(4,generic_nvram16); // so that code in SRAM is executable, there is an option for booting from SRAM |
| 1923 | 1923 | |
| 1924 | 1924 | // start keyboard timer |
| 1925 | timer_adjust(kb_timer,attotime_zero,0,ATTOTIME_IN_MSEC(5)); // every 5ms | |
| 1925 | timer_adjust_periodic(kb_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(5)); // every 5ms | |
| 1926 | 1926 | |
| 1927 | 1927 | // start mouse timer |
| 1928 | timer_adjust(mouse_timer,attotime_zero,0,ATTOTIME_IN_MSEC(1)); // a guess for now | |
| 1928 | timer_adjust_periodic(mouse_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(1)); // a guess for now | |
| 1929 | 1929 | sys.mouse.inputtype = 0; |
| 1930 | 1930 | } |
| 1931 | 1931 |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | 2 | #include "deprecat.h" |
| 3 | #include "mslegacy.h" | |
| 4 | 3 | #include "video/atarist.h" |
| 5 | 4 | #include "cpu/m68000/m68k.h" |
| 6 | 5 | #include "cpu/m68000/m68000.h" |
| r1681 | r1682 | |
| 598 | 597 | if (!dmasound.active) |
| 599 | 598 | { |
| 600 | 599 | atariste_dmasound_set_state(1); |
| 601 | timer_adjust(dmasound_timer, attotime_zero, 0, ATTOTIME_IN_HZ(DMASOUND_RATE[dmasound.mode & 0x03])); | |
| 600 | timer_adjust_periodic(dmasound_timer, attotime_zero, 0, ATTOTIME_IN_HZ(DMASOUND_RATE[dmasound.mode & 0x03])); | |
| 602 | 601 | } |
| 603 | 602 | } |
| 604 | 603 | else |
| r1681 | r1682 | |
| 713 | 712 | if (!timer_enabled(microwire_timer)) |
| 714 | 713 | { |
| 715 | 714 | mwire.data = data; |
| 716 | timer_adjust(microwire_timer, attotime_zero, 0, ATTOTIME_IN_USEC(2)); | |
| 715 | timer_adjust_periodic(microwire_timer, attotime_zero, 0, ATTOTIME_IN_USEC(2)); | |
| 717 | 716 | } |
| 718 | 717 | } |
| 719 | 718 |
| r1681 | r1682 | |
|---|---|---|
| 94 | 94 | #include "devices/printer.h" |
| 95 | 95 | #include "devices/z80bin.h" |
| 96 | 96 | #include "sound/speaker.h" |
| 97 | #include "mslegacy.h" | |
| 98 | 97 | |
| 99 | 98 | |
| 100 | 99 | static int device_load_exidy_floppy(mess_image *image) |
| r1681 | r1682 | |
| 465 | 464 | /* both are now off */ |
| 466 | 465 | |
| 467 | 466 | /* stop timer */ |
| 468 | timer_adjust(cassette_timer, attotime_zero, 0 | |
| 467 | timer_adjust_oneshot(cassette_timer, attotime_zero, 0 | |
| 469 | 468 | } |
| 470 | 469 | else |
| 471 | 470 | { |
| r1681 | r1682 | |
| 477 | 476 | cassette_clock_state = 0; |
| 478 | 477 | /* start timer */ |
| 479 | 478 | /* the correct baud rate should be being used here (see bit 6 below) */ |
| 480 | timer_adjust(cassette_timer, attotime_zero, 0, ATTOTIME_IN_HZ(4800)); | |
| 479 | timer_adjust_periodic(cassette_timer, attotime_zero, 0, ATTOTIME_IN_HZ(4800)); | |
| 481 | 480 | } |
| 482 | 481 | } |
| 483 | 482 | } |
| r1681 | r1682 | |
| 514 | 513 | baud_rate = 1200; |
| 515 | 514 | } |
| 516 | 515 | |
| 517 | timer_adjust(serial_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud_rate)); | |
| 516 | timer_adjust_periodic(serial_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud_rate)); | |
| 518 | 517 | } |
| 519 | 518 | |
| 520 | 519 | exidy_fe = data; |
| r1681 | r1682 | |
|---|---|---|
| 13 | 13 | #include "formats/a26_cas.h" |
| 14 | 14 | #include "video/tia.h" |
| 15 | 15 | #include "deprecat.h" |
| 16 | #include "mslegacy.h" | |
| 17 | 16 | |
| 17 | ||
| 18 | 18 | #define CART memory_region(REGION_USER1) |
| 19 | 19 | |
| 20 | 20 | #define MASTER_CLOCK_NTSC 3579545 |
| r1681 | r1682 | |
| 1743 | 1743 | } |
| 1744 | 1744 | } |
| 1745 | 1745 | dpc.oscillator = timer_alloc( modeDPC_timer_callback , NULL); |
| 1746 | timer_adjust( | |
| 1746 | timer_adjust_periodic( | |
| 1747 | 1747 | break; |
| 1748 | 1748 | |
| 1749 | 1749 | case mode32in1: |
| r1681 | r1682 | |
|---|---|---|
| 1 | 1 | #include "driver.h" |
| 2 | 2 | #include "deprecat.h" |
| 3 | #include "mslegacy.h" | |
| 4 | 3 | #include "cpu/i8039/i8039.h" |
| 5 | 4 | #include "cpu/m68000/m68000.h" |
| 6 | 5 | #include "devices/cartslot.h" |
| r1681 | r1682 | |
| 212 | 211 | |
| 213 | 212 | zx8302.tcr = data; |
| 214 | 213 | |
| 215 | timer_adjust(zx8302_txd_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud)); | |
| 216 | timer_adjust(zx8302_ipc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baudx4)); | |
| 214 | timer_adjust_periodic(zx8302_txd_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud)); | |
| 215 | timer_adjust_periodic(zx8302_ipc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baudx4)); | |
| 217 | 216 | } |
| 218 | 217 | |
| 219 | 218 | static UINT8 zx8302_get_microdrive_status(void) |
| r1681 | r1682 | |
| 878 | 877 | zx8302_rtc_timer = timer_alloc(zx8302_rtc_tick, NULL); |
| 879 | 878 | zx8302_gap_timer = timer_alloc(zx8302_gap_tick, NULL); |
| 880 | 879 | |
| 881 | timer_adjust(zx8302_rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(X2/32768)); | |
| 882 | timer_adjust(zx8302_gap_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(31)); | |
| 880 | timer_adjust_periodic(zx8302_rtc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(X2/32768)); | |
| 881 | timer_adjust_periodic(zx8302_gap_timer, attotime_zero, 0, ATTOTIME_IN_MSEC(31)); | |
| 883 | 882 | |
| 884 | 883 | zx8302.ctr = time(NULL) + 283996800; |
| 885 | 884 |
| r1681 | r1682 | |
|---|---|---|
| 70 | 70 | |
| 71 | 71 | /* Core includes */ |
| 72 | 72 | #include "driver.h" |
| 73 | #include "mslegacy.h" | |
| 73 | 74 | #include "includes/abc80x.h" |
| 74 | #include "mslegacy.h" | |
| 75 | 75 | |
| 76 | 76 | /* Components */ |
| 77 | 77 | #include "cpu/z80/z80daisy.h" |
| r1681 | r1682 | |
| 658 | 658 | state_save_register_global(abc77_clock); |
| 659 | 659 | |
| 660 | 660 | abc800_ctc_timer = timer_alloc(abc800_ctc_tick, NULL); |
| 661 | timer_adjust(abc800_ctc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC800_X01/2/2/2)); | |
| 661 | timer_adjust_periodic(abc800_ctc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(ABC800_X01/2/2/2)); | |
| 662 | 662 | |
| 663 | 663 | z80ctc_init(0, &abc800_ctc_intf); |
| 664 | 664 | z80sio_init(0, &abc800_sio_intf); |
| r1681 | r1682 | |
|---|---|---|
| 35 | 35 | #include "cpu/arm/arm.h" |
| 36 | 36 | #include "sound/dac.h" |
| 37 | 37 | #include "deprecat.h" |
| 38 | #include "mslegacy.h" | |
| 39 | 38 | |
| 40 | 39 | |
| 41 | 40 | // interrupt register stuff |
| r1681 | r1682 | |
| 130 | 129 | a310_request_irq_a(A310_IRQA_VBL); |
| 131 | 130 | |
| 132 | 131 | // set up for next vbl |
| 133 | timer_adjust(vbl_timer, video_screen_get_time_until_pos(0, a310_vidregs[0xb4], 0), 0 | |
| 132 | timer_adjust_oneshot(vbl_timer, video_screen_get_time_until_pos(0, a310_vidregs[0xb4], 0), 0 | |
| 134 | 133 | } |
| 135 | 134 | |
| 136 | 135 | static void a310_set_timer(int tmr) |
| r1681 | r1682 | |
| 139 | 138 | |
| 140 | 139 | // logerror("IOC: starting timer %d, %d ticks, freq %f Hz\n", tmr, a310_timercnt[tmr], freq); |
| 141 | 140 | |
| 142 | timer_adjust(timer[tmr], ATTOTIME_IN_HZ(freq), tm | |
| 141 | timer_adjust_oneshot(timer[tmr], ATTOTIME_IN_HZ(freq), tm | |
| 143 | 142 | } |
| 144 | 143 | |
| 145 | 144 | // param |
| r1681 | r1682 | |
| 208 | 207 | wd17xx_init(WD_TYPE_1772, a310_wd177x_callback, NULL); |
| 209 | 208 | |
| 210 | 209 | vbl_timer = timer_alloc(a310_vblank, NULL); |
| 211 | timer_adjust(vbl_timer, attotime_never, 0 | |
| 210 | timer_adjust_oneshot(vbl_timer, attotime_never, 0 | |
| 212 | 211 | |
| 213 | 212 | timer[0] = timer_alloc(a310_timer, NULL); |
| 214 | 213 | timer[1] = timer_alloc(a310_timer, NULL); |
| 215 | 214 | timer[2] = timer_alloc(a310_timer, NULL); |
| 216 | 215 | timer[3] = timer_alloc(a310_timer, NULL); |
| 217 | timer_adjust(timer[0], attotime_never, 0, attotime_never); | |
| 218 | timer_adjust(timer[1], attotime_never, 0, attotime_never); | |
| 219 | timer_adjust(timer[2], attotime_never, 0, attotime_never); | |
| 220 | timer_adjust(timer[3], attotime_never, 0, attotime_never); | |
| 216 | timer_adjust_oneshot(timer[0], attotime_never, 0); | |
| 217 | timer_adjust_oneshot(timer[1], attotime_never, 0); | |
| 218 | timer_adjust_oneshot(timer[2], attotime_never, 0); | |
| 219 | timer_adjust_oneshot(timer[3], attotime_never, 0); | |
| 221 | 220 | |
| 222 | 221 | snd_timer = timer_alloc(a310_audio_tick, NULL); |
| 223 | timer_adjust(snd_timer, attotime_never, 0 | |
| 222 | timer_adjust_oneshot(snd_timer, attotime_never, 0 | |
| 224 | 223 | |
| 225 | 224 | // reset the DAC to centerline |
| 226 | 225 | DAC_signed_data_w(0, 0x80); |
| r1681 | r1682 | |
| 591 | 590 | video_screen_configure(0, a310_vidregs[0x80], a310_vidregs[0xa0], &visarea, Machine->screen[0].refresh); |
| 592 | 591 | |
| 593 | 592 | // slightly hacky: fire off a VBL right now. the BIOS doesn't wait long enough otherwise. |
| 594 | timer_adjust(vbl_timer, attotime_zero, 0 | |
| 593 | timer_adjust_oneshot(vbl_timer, attotime_zero, 0 | |
| 595 | 594 | } |
| 596 | 595 | |
| 597 | 596 | a310_vidregs[reg] = val>>12; |
| r1681 | r1682 | |
| 638 | 637 | |
| 639 | 638 | a310_sndcur = a310_sndstart; |
| 640 | 639 | |
| 641 | timer_adjust(snd_timer, ATTOTIME_IN_HZ(sndhz), 0, ATTOTIME_IN_HZ(sndhz)); | |
| 640 | timer_adjust_periodic(snd_timer, ATTOTIME_IN_HZ(sndhz), 0, ATTOTIME_IN_HZ(sndhz)); | |
| 642 | 641 | } |
| 643 | 642 | else |
| 644 | 643 | { |
| 645 | timer_adjust(snd_timer, attotime_never, 0 | |
| 644 | timer_adjust_oneshot(snd_timer, attotime_never, 0 | |
| 646 | 645 | DAC_signed_data_w(0, 0x80); |
| 647 | 646 | } |
| 648 | 647 | break; |
| r1681 | r1682 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | #include "driver.h" |
| 76 | 76 | #include "deprecat.h" |
| 77 | #include "mslegacy.h" | |
| 78 | 77 | #include "cpu/tms9900/tms9900.h" |
| 79 | 78 | #include "video/tms9928a.h" |
| 80 | 79 | #include "devices/cartslot.h" |
| r1681 | r1682 | |
| 291 | 290 | { |
| 292 | 291 | tape_interrupt_enable = ! data; |
| 293 | 292 | if (tape_interrupt_enable) |
| 294 | timer_adjust(tape_interrupt_timer, /*ATTOTIME_IN_HZ(44100)*/attotime_zero, 0, ATTOTIME_IN_HZ(44100)); | |
| 293 | timer_adjust_periodic(tape_interrupt_timer, /*ATTOTIME_IN_HZ(44100)*/attotime_zero, 0, ATTOTIME_IN_HZ(44100)); | |
| 295 | 294 | else |
| 296 | 295 | { |
| 297 | timer_adjust(tape_interrupt_timer, attotime_never, 0 | |
| 296 | timer_adjust_oneshot(tape_interrupt_timer, attotime_never, 0 | |
| 298 | 297 | cpunum_set_input_line(Machine, 0, 1, CLEAR_LINE); |
| 299 | 298 | } |
| 300 | 299 | } |
| Previous | 15994 Revisions | Next |