src/mess/audio/dave.c
| r3615 | r3616 | |
| 7 | 7 | |
| 8 | 8 | - pure tone |
| 9 | 9 | - sampled sounds |
| 10 | | - 1khz, 50hz and 1hz ints |
| 10 | - 1kHz, 50Hz and 1Hz ints |
| 11 | 11 | - external ints (int1 and int2) - not correct speed yet |
| 12 | 12 | |
| 13 | 13 | */ |
| r3615 | r3616 | |
| 57 | 57 | |
| 58 | 58 | static void dave_refresh_selectable_int(void) |
| 59 | 59 | { |
| 60 | | /* update 1khz/50hz/tg latch and int input */ |
| 60 | /* update 1kHz/50Hz/tg latch and int input */ |
| 61 | 61 | switch ((dave.Regs[7]>>5) & 0x03) |
| 62 | 62 | { |
| 63 | | /* 1khz */ |
| 63 | /* 1kHz */ |
| 64 | 64 | case 0: |
| 65 | 65 | { |
| 66 | 66 | dave.int_latch &=~(1<<1); |
| r3615 | r3616 | |
| 72 | 72 | } |
| 73 | 73 | break; |
| 74 | 74 | |
| 75 | | /* 50hz */ |
| 75 | /* 50Hz */ |
| 76 | 76 | case 1: |
| 77 | 77 | { |
| 78 | 78 | dave.int_latch &=~(1<<1); |
| r3615 | r3616 | |
| 94 | 94 | |
| 95 | 95 | static TIMER_CALLBACK(dave_1khz_callback) |
| 96 | 96 | { |
| 97 | | // logerror("1khz int\n"); |
| 97 | // logerror("1kHz int\n"); |
| 98 | 98 | |
| 99 | 99 | /* time over - want int */ |
| 100 | 100 | dave.one_khz_state^=0x0ffffffff; |
| r3615 | r3616 | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | | /* update fifty hz counter */ |
| 109 | /* update fifty Hz counter */ |
| 110 | 110 | dave.fifty_hz_count--; |
| 111 | 111 | |
| 112 | 112 | if (dave.fifty_hz_count==0) |
| r3615 | r3616 | |
| 159 | 159 | /* temp! */ |
| 160 | 160 | nick_virq = 0; |
| 161 | 161 | |
| 162 | | /* initialise 1khz timer */ |
| 162 | /* initialise 1kHz timer */ |
| 163 | 163 | dave.int_latch = 0; |
| 164 | 164 | dave.int_input = 0; |
| 165 | 165 | dave.int_enable = 0; |
| r3615 | r3616 | |
| 298 | 298 | int count = 0; |
| 299 | 299 | int channel_index = offset>>1; |
| 300 | 300 | |
| 301 | | /* Fout = 125,000 / (n+1) hz */ |
| 301 | /* Fout = 125,000 / (n+1) Hz */ |
| 302 | 302 | |
| 303 | 303 | /* sample rate/clock */ |
| 304 | 304 | |
| r3615 | r3616 | |
| 366 | 366 | { |
| 367 | 367 | case 0: |
| 368 | 368 | { |
| 369 | | logerror("1khz\n"); |
| 369 | logerror("1kHz\n"); |
| 370 | 370 | } |
| 371 | 371 | break; |
| 372 | 372 | |
| 373 | 373 | case 1: |
| 374 | 374 | { |
| 375 | | logerror("50hz\n"); |
| 375 | logerror("50Hz\n"); |
| 376 | 376 | } |
| 377 | 377 | break; |
| 378 | 378 | |
| r3615 | r3616 | |
| 503 | 503 | /* clear latches */ |
| 504 | 504 | dave.int_latch &=~(data & 0x0aa); |
| 505 | 505 | |
| 506 | | /* reset 1khz, 50hz latch */ |
| 506 | /* reset 1kHz, 50Hz latch */ |
| 507 | 507 | if (data & (1<<1)) |
| 508 | 508 | { |
| 509 | 509 | dave.int_irq = 0; |
| r3615 | r3616 | |
| 667 | 667 | b5 = 1: INT1 latch set |
| 668 | 668 | b4 = INT1 input pin |
| 669 | 669 | b3 = 1: 1Hz latch set |
| 670 | | b2 = 1hz input pin |
| 671 | | b1 = 1: 1khz/50hz/TG latch set |
| 672 | | b0 = 1khz/50hz/TG input |
| 670 | b2 = 1Hz input pin |
| 671 | b1 = 1: 1kHz/50Hz/TG latch set |
| 672 | b0 = 1kHz/50Hz/TG input |
| 673 | 673 | |
| 674 | 674 | Reg 4 WRITE: |
| 675 | 675 | |
| r3615 | r3616 | |
| 677 | 677 | b6 = 1: Enable INT2 |
| 678 | 678 | b5 = 1: Reset INT1 latch |
| 679 | 679 | b4 = 1: Enable INT1 |
| 680 | | b3 = 1: Reset 1hz interrupt latch |
| 681 | | b2 = 1: Enable 1hz interrupt |
| 682 | | b1 = 1: Reset 1khz/50hz/TG latch |
| 683 | | b0 = 1: Enable 1khz/50Hz/TG latch |
| 680 | b3 = 1: Reset 1Hz interrupt latch |
| 681 | b2 = 1: Enable 1Hz interrupt |
| 682 | b1 = 1: Reset 1kHz/50hz/TG latch |
| 683 | b0 = 1: Enable 1kHz/50Hz/TG latch |
| 684 | 684 | */ |
| 685 | 685 | |
| 686 | 686 | #if 0 |
src/mess/audio/dave.h
| r3615 | r3616 | |
| 30 | 30 | unsigned char Regs[32]; |
| 31 | 31 | |
| 32 | 32 | |
| 33 | | /* int latches (used by 1hz, int1 and int2) */ |
| 33 | /* int latches (used by 1Hz, int1 and int2) */ |
| 34 | 34 | unsigned long int_latch; |
| 35 | 35 | /* int enables */ |
| 36 | 36 | unsigned long int_enable; |
| r3615 | r3616 | |
| 42 | 42 | /* INTERRUPTS */ |
| 43 | 43 | |
| 44 | 44 | /* internal timer */ |
| 45 | | /* bit 2: 1khz timer irq */ |
| 46 | | /* bit 1: 50khz timer irq */ |
| 45 | /* bit 2: 1kHz timer irq */ |
| 46 | /* bit 1: 50kHz timer irq */ |
| 47 | 47 | int timer_irq; |
| 48 | | /* 1khz timer - divided into 1khz, 50hz and 1hz timer */ |
| 48 | /* 1khz timer - divided into 1kHz, 50Hz and 1Hz timer */ |
| 49 | 49 | void *int_timer; |
| 50 | | /* state of 1khz timer */ |
| 50 | /* state of 1kHz timer */ |
| 51 | 51 | unsigned long one_khz_state; |
| 52 | | /* state of 50hz timer */ |
| 52 | /* state of 50Hz timer */ |
| 53 | 53 | unsigned long fifty_hz_state; |
| 54 | 54 | |
| 55 | | /* counter used to trigger 50hz from 1khz timer */ |
| 55 | /* counter used to trigger 50Hz from 1kHz timer */ |
| 56 | 56 | unsigned long fifty_hz_count; |
| 57 | | /* counter used to trigger 1hz from 1khz timer */ |
| 57 | /* counter used to trigger 1Hz from 1kHz timer */ |
| 58 | 58 | unsigned long one_hz_count; |
| 59 | 59 | |
| 60 | 60 | |
src/mess/video/saa505x.c
| r3615 | r3616 | |
| 1 | | |
| 2 | | |
| 3 | 1 | /************************************************************************ |
| 4 | 2 | SAA505X Teletext |
| 5 | 3 | |
| r3615 | r3616 | |
| 47 | 45 | Timing Generator/Flash Counter |
| 48 | 46 | ------------------------------ |
| 49 | 47 | 13 DEW in data entry window |
| 50 | | 19 TR6 in 6Mhz input |
| 51 | | 20 F1 in 1Mhz input |
| 48 | 19 TR6 in 6MHz input |
| 49 | 20 F1 in 1MHz input |
| 52 | 50 | 26 LOSE in load output shift register enable |
| 53 | 51 | |
| 54 | 52 | Character Rounding |
| r3615 | r3616 | |
| 73 | 71 | |
| 74 | 72 | 20 F1 |
| 75 | 73 | ----- |
| 76 | | This input is a 1Mhz equal mark/space ration signal. It is used to latch the 7-bit parallel character data into the input latches. |
| 74 | This input is a 1MHz equal mark/space ration signal. It is used to latch the 7-bit parallel character data into the input latches. |
| 77 | 75 | |
| 78 | 76 | 26 LOSE Load output shift register enable |
| 79 | 77 | ----------------------------------------- |
src/mess/video/electron.c
| r3615 | r3616 | |
| 15 | 15 | |
| 16 | 16 | Timing is somewhat of a thorny issue on the Electron. It is almost certain the Electron could have been a much faster machine if BBC Micro OS level compatibility had not been not a design requirement. |
| 17 | 17 | |
| 18 | | When accessing the ROM regions, the CPU always runs at 2Mhz. When accessing the FC (1 Mhz bus) or FD (JIM) pages, the CPU always runs at 1Mhz. |
| 18 | When accessing the ROM regions, the CPU always runs at 2MHz. When accessing the FC (1 MHz bus) or FD (JIM) pages, the CPU always runs at 1MHz. |
| 19 | 19 | |
| 20 | | The timing for RAM accesses varies depending on the graphics mode, and how many bytes are required to be read by the video circuits per scanline. When accessing RAM in modes 4-6, the CPU is simply moved to a 1Mhz clock. This occurs for any RAM access at any point during the frame. |
| 20 | The timing for RAM accesses varies depending on the graphics mode, and how many bytes are required to be read by the video circuits per scanline. When accessing RAM in modes 4-6, the CPU is simply moved to a 1MHz clock. This occurs for any RAM access at any point during the frame. |
| 21 | 21 | |
| 22 | 22 | In modes 0-3, if the CPU tries to access RAM at any time during which the video circuits are fetching bytes, it is halted by means of receiving a stopped clock until the video circuits next stop fetching bytes. |
| 23 | 23 | |
| 24 | 24 | Each scanline is drawn in exactly 64us, and of that the video circuits fetch bytes for 40us. In modes 0, 1 and 2, 256 scanlines have pixels on, whereas in mode 3 only 250 scanlines are affected as mode 3 is a 'spaced' mode. |
| 25 | 25 | |
| 26 | | As opposed to one clock generator which changes pace, the 1Mhz and 2Mhz clocks are always available, so the ULA acts to simply change which clock is piped to the CPU. This means in half of all cases, a further 2Mhz cycle is lost waiting for the 2Mhz and 1Mhz clocks to synchronise during a 2Mhz to 1Mhz step. |
| 26 | As opposed to one clock generator which changes pace, the 1MHz and 2MHz clocks are always available, so the ULA acts to simply change which clock is piped to the CPU. This means in half of all cases, a further 2MHz cycle is lost waiting for the 2MHz and 1MHz clocks to synchronise during a 2MHz to 1MHz step. |
| 27 | 27 | |
| 28 | | The video circuits run from a constant 2Mhz clock, and generate 312 scanlines a frame, one scanline every 128 cycles. This actually gives means the Electron is running at 50.08 frames a second. |
| 28 | The video circuits run from a constant 2MHz clock, and generate 312 scanlines a frame, one scanline every 128 cycles. This actually gives means the Electron is running at 50.08 frames a second. |
| 29 | 29 | |
| 30 | 30 | Creating a scanline numbering scheme where the first scanline with pixels is scanline 0, in all modes the end of display interrupt is generated at the end of scanline 255, and the RTC interrupt is generated upon the end of scanline 99. |
| 31 | 31 | |
src/mess/video/kc.c
| r3615 | r3616 | |
| 208 | 208 | - The vertical states comprise top border, main display, bottom border and vertical retrace timing. |
| 209 | 209 | |
| 210 | 210 | |
| 211 | | - if frame rate is 50hz, and there are 312 lines, then the line rate is 15600hz. |
| 211 | - if frame rate is 50Hz, and there are 312 lines, then the line rate is 15600Hz. |
| 212 | 212 | - Each frame takes 0.02 seconds, and each line takes 0.0000064 seconds - approx 64microseconds per line |
| 213 | 213 | |
| 214 | 214 | - the event list is based on cpu time |
| r3615 | r3616 | |
| 491 | 491 | |
| 492 | 492 | |
| 493 | 493 | /* the kc85 screen is 320 pixels wide and 256 pixels tall */ |
| 494 | | /* if we assume a 50hz display, there are 312 lines for the complete frame, leaving 56 lines not visible */ |
| 494 | /* if we assume a 50Hz display, there are 312 lines for the complete frame, leaving 56 lines not visible */ |
| 495 | 495 | static void kc85_common_process_frame(running_machine *machine, bitmap_t *bitmap, void (*pixel_grab_callback)(struct grab_info *,int x,int y,unsigned char *, unsigned char *),struct grab_info *grab_data) |
| 496 | 496 | { |
| 497 | 497 | int cycles_remaining_in_frame = KC85_CYCLES_PER_FRAME; |
src/mess/messdriv.c
| r3615 | r3616 | |
| 48 | 48 | //128u4 DRIVER( a2600 ) /* Atari 2600 */ |
| 49 | 49 | //128u4 DRIVER( a2600p ) /* Atari 2600 PAL */ |
| 50 | 50 | //128u4 DRIVER( a5200 ) /* Atari 5200 */ |
| 51 | | //128u4 DRIVER( a5200a ) /* Atari 5200 alt */ |
| 51 | //128u4 DRIVER( a5200a ) /* Atari 5200 alt */ |
| 52 | 52 | //128u4 DRIVER( a7800 ) /* Atari 7800 NTSC */ |
| 53 | 53 | //128u4 DRIVER( a7800p ) /* Atari 7800 PAL */ |
| 54 | 54 | //128u4 DRIVER( lynx ) /* Atari Lynx Handheld */ |
| r3615 | r3616 | |
| 442 | 442 | //128u4 DRIVER( xtvga ) /* 198? PC-XT (VGA, MF2 Keyboard) */ |
| 443 | 443 | |
| 444 | 444 | /* at */ |
| 445 | | //128u4 DRIVER( ibm5170 ) /* 1984 IBM PC/AT 5170, original 6 Mhz model */ |
| 446 | | //128u4 DRIVER( ibm5170a ) /* 1985 IBM PC/AT 5170, enhanced 8 Mhz model */ |
| 445 | //128u4 DRIVER( ibm5170 ) /* 1984 IBM PC/AT 5170, original 6 MHz model */ |
| 446 | //128u4 DRIVER( ibm5170a ) /* 1985 IBM PC/AT 5170, enhanced 8 MHz model */ |
| 447 | 447 | //128u4 DRIVER( i8530286 ) /* 1988 IBM PS2 Model 30 286 (VGA) */ |
| 448 | 448 | //128u4 DRIVER( at ) /* 1987 AMI Bios and Diagnostics */ |
| 449 | 449 | //128u4 DRIVER( atvga ) /* 19?? AT VGA */ |
| r3615 | r3616 | |
| 1050 | 1050 | |
| 1051 | 1051 | DRIVER( mistrum ) /* 1988 Mistrum */ |
| 1052 | 1052 | |
| 1053 | | /* Russian clones */ |
| 1054 | | |
| 1053 | /* Russian clones */ |
| 1055 | 1054 | DRIVER( blitz ) /* 1990 Blic */ |
| 1056 | 1055 | DRIVER( byte ) /* 1990 Byte */ |
| 1057 | 1056 | DRIVER( orizon ) /* 199? Orizon-Micro */ |
src/mess/formats/oric_tap.c
| r3615 | r3616 | |
| 8 | 8 | #define ORIC_SYNC_BYTE 0x016 |
| 9 | 9 | |
| 10 | 10 | /* frequency of wave */ |
| 11 | | /* tapes use 1200hz and 2400hz samples */ |
| 11 | /* tapes use 1200Hz and 2400Hz samples */ |
| 12 | 12 | #define ORIC_WAV_FREQUENCY 4800 |
| 13 | 13 | |
| 14 | 14 | /* 13 bits define a byte on the cassette */ |
| r3615 | r3616 | |
| 32 | 32 | #define WAVEENTRY_NULL 0 |
| 33 | 33 | |
| 34 | 34 | /* to write a bit to the tape, the rom routines output either 4 periods at 1200 Hz for a 0 or 8 periods at 2400 Hz for a 1 */ |
| 35 | | /* 4800 is twice 2400hz */ |
| 35 | /* 4800 is twice 2400Hz */ |
| 36 | 36 | |
| 37 | | /* 8 periods at 2400hz */ |
| 37 | /* 8 periods at 2400Hz */ |
| 38 | 38 | /* hi,lo, hi,lo, hi,lo, hi,lo */ |
| 39 | 39 | |
| 40 | 40 | static INT16 wave_state = WAVEENTRY_HIGH; |
| r3615 | r3616 | |
| 52 | 52 | return p; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | | /* 4 periods at 1200hz */ |
| 55 | /* 4 periods at 1200Hz */ |
| 56 | 56 | static INT16* oric_output_bit(INT16 *p, UINT8 b) |
| 57 | 57 | { |
| 58 | 58 | p = oric_emit_level(p,1); |