Previous 15994 Revisions Next

r3616 Thursday 27th November, 2008 at 01:23:17 UTC by Hobie Troxell
updated a few comments to fix a pet peeve (changed hz to Hz). You must respect Heinrich.
[src/mess]messdriv.c
[src/mess/audio]dave.c dave.h t6721.c
[src/mess/formats]apf_apt.c oric_tap.c
[src/mess/includes]aim65.h
[src/mess/video]electron.c kc.c pc_ega.c saa505x.c ted7360.h vic6567.h

src/mess/audio/dave.c
r3615r3616
77
88   - pure tone
99   - sampled sounds
10   - 1khz, 50hz and 1hz ints
10   - 1kHz, 50Hz and 1Hz ints
1111   - external ints (int1 and int2) - not correct speed yet
1212
1313*/
r3615r3616
5757
5858static void dave_refresh_selectable_int(void)
5959{
60   /* update 1khz/50hz/tg latch and int input */
60   /* update 1kHz/50Hz/tg latch and int input */
6161   switch ((dave.Regs[7]>>5) & 0x03)
6262   {
63      /* 1khz */
63      /* 1kHz */
6464      case 0:
6565      {
6666         dave.int_latch &=~(1<<1);
r3615r3616
7272      }
7373      break;
7474
75      /* 50hz */
75      /* 50Hz */
7676      case 1:
7777      {
7878         dave.int_latch &=~(1<<1);
r3615r3616
9494
9595static TIMER_CALLBACK(dave_1khz_callback)
9696{
97//   logerror("1khz int\n");
97//   logerror("1kHz int\n");
9898
9999   /* time over - want int */
100100   dave.one_khz_state^=0x0ffffffff;
r3615r3616
106106   }
107107
108108
109   /* update fifty hz counter */
109   /* update fifty Hz counter */
110110   dave.fifty_hz_count--;
111111
112112   if (dave.fifty_hz_count==0)
r3615r3616
159159   /* temp! */
160160   nick_virq = 0;
161161
162   /* initialise 1khz timer */
162   /* initialise 1kHz timer */
163163   dave.int_latch = 0;
164164   dave.int_input = 0;
165165   dave.int_enable = 0;
r3615r3616
298298         int count = 0;
299299         int channel_index = offset>>1;
300300
301         /* Fout = 125,000 / (n+1) hz */
301         /* Fout = 125,000 / (n+1) Hz */
302302
303303         /* sample rate/clock */
304304
r3615r3616
366366         {
367367            case 0:
368368            {
369               logerror("1khz\n");
369               logerror("1kHz\n");
370370            }
371371            break;
372372
373373            case 1:
374374            {
375               logerror("50hz\n");
375               logerror("50Hz\n");
376376            }
377377            break;
378378
r3615r3616
503503         /* clear latches */
504504         dave.int_latch &=~(data & 0x0aa);
505505
506         /* reset 1khz, 50hz latch */
506         /* reset 1kHz, 50Hz latch */
507507         if (data & (1<<1))
508508         {
509509            dave.int_irq = 0;
r3615r3616
667667b5 = 1: INT1 latch set
668668b4 = INT1 input pin
669669b3 = 1: 1Hz latch set
670b2 = 1hz input pin
671b1 = 1: 1khz/50hz/TG latch set
672b0 = 1khz/50hz/TG input
670b2 = 1Hz input pin
671b1 = 1: 1kHz/50Hz/TG latch set
672b0 = 1kHz/50Hz/TG input
673673
674674Reg 4 WRITE:
675675
r3615r3616
677677b6 = 1: Enable INT2
678678b5 = 1: Reset INT1 latch
679679b4 = 1: Enable INT1
680b3 = 1: Reset 1hz interrupt latch
681b2 = 1: Enable 1hz interrupt
682b1 = 1: Reset 1khz/50hz/TG latch
683b0 = 1: Enable 1khz/50Hz/TG latch
680b3 = 1: Reset 1Hz interrupt latch
681b2 = 1: Enable 1Hz interrupt
682b1 = 1: Reset 1kHz/50hz/TG latch
683b0 = 1: Enable 1kHz/50Hz/TG latch
684684*/
685685
686686#if 0
src/mess/audio/t6721.c
r3615r3616
5858 2 0..7 sample data
5959
6060seems to be a toshiba t6721a build in
61(8 khz 9bit output)
61(8 kHz 9bit output)
6262generates output for 20ms (or 10ms) out of 6 byte voice data!
6363(P?ARCOR voice synthesizing and analyzing method
6464 Nippon Telegraph and Telephon Public Corporation)
src/mess/audio/dave.h
r3615r3616
3030   unsigned char Regs[32];
3131
3232
33   /* int latches (used by 1hz, int1 and int2) */
33   /* int latches (used by 1Hz, int1 and int2) */
3434   unsigned long int_latch;
3535   /* int enables */
3636   unsigned long int_enable;
r3615r3616
4242   /* INTERRUPTS */
4343
4444   /* 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 */
4747   int timer_irq;
48   /* 1khz timer - divided into 1khz, 50hz and 1hz timer */
48   /* 1khz timer - divided into 1kHz, 50Hz and 1Hz timer */
4949   void   *int_timer;
50   /* state of 1khz timer */
50   /* state of 1kHz timer */
5151   unsigned long one_khz_state;
52   /* state of 50hz timer */
52   /* state of 50Hz timer */
5353   unsigned long fifty_hz_state;
5454
55   /* counter used to trigger 50hz from 1khz timer */
55   /* counter used to trigger 50Hz from 1kHz timer */
5656   unsigned long fifty_hz_count;
57   /* counter used to trigger 1hz from 1khz timer */
57   /* counter used to trigger 1Hz from 1kHz timer */
5858   unsigned long one_hz_count;
5959
6060
src/mess/video/saa505x.c
r3615r3616
1
2
31/************************************************************************
42SAA505X Teletext
53
r3615r3616
4745Timing Generator/Flash Counter
4846------------------------------
494713   DEW      in      data entry window
5019   TR6      in      6Mhz input
5120   F1      in      1Mhz input
4819   TR6      in      6MHz input
4920   F1      in      1MHz input
525026   LOSE      in      load output shift register enable
5351
5452Character Rounding
r3615r3616
7371
747220 F1
7573-----
76This input is a 1Mhz equal mark/space ration signal. It is used to latch the 7-bit parallel character data into the input latches.
74This input is a 1MHz equal mark/space ration signal. It is used to latch the 7-bit parallel character data into the input latches.
7775
787626 LOSE Load output shift register enable
7977-----------------------------------------
src/mess/video/electron.c
r3615r3616
1515
1616Timing 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.
1717
18When 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.
18When 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.
1919
20The 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.
20The 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.
2121
2222In 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.
2323
2424Each 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.
2525
26As 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.
26As 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.
2727
28The 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.
28The 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.
2929
3030Creating 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.
3131
src/mess/video/pc_ega.c
r3615r3616
1818         | | | | | |           value in the Graphics Controllers.
1919         | | | | | +------ clock select bit 0
2020         | | | | +-------- clock select bit 1
21         | | | |           00 = 14Mhz from Processor I/O channel
21         | | | |           00 = 14MHz from Processor I/O channel
2222         | | | |           01 = 16MHz on-bord clock
2323         | | | |           10 = External clock from feature connector
2424         | | | |           11 = reserved/unused
src/mess/video/vic6567.h
r3615r3616
3333#define VIC6567_CLOCK   (1022725 /* (8181800/8) */ )
3434#define VIC6569_CLOCK   ( 985248 /* (7880000/8) */ )
3535
36/* pixel clock 8 mhz */
36/* pixel clock 8 MHz */
3737/* accesses to memory with 2 megahertz */
3838/* needs 2 memory accesses for 8 pixel */
3939/* + sprite + */
src/mess/video/ted7360.h
r3615r3616
4040/* video timing (these are used in c16/c116/plus4) */
4141#define TED7360NTSC_CLOCK   (14318180/4)
4242#define TED7360PAL_CLOCK   (17734470/5)
43/* pixel clock 8 mhz */
43/* pixel clock 8 MHz */
4444/* accesses to memory with 4 megahertz */
4545/* needs 3 memory accesses for 8 pixel */
4646/* but system clock 1 megahertz */
src/mess/video/kc.c
r3615r3616
208208   - The vertical states comprise top border, main display, bottom border and vertical retrace timing.
209209
210210
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.
212212   - Each frame takes 0.02 seconds, and each line takes 0.0000064 seconds - approx 64microseconds per line
213213
214214   - the event list is based on cpu time
r3615r3616
491491
492492
493493/* 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 */
495495static 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)
496496{
497497   int cycles_remaining_in_frame = KC85_CYCLES_PER_FRAME;
src/mess/includes/aim65.h
r3615r3616
1212
1313/** R6502 Clock.
1414 *
15 * The R6502 on AIM65 operates at 1 MHz. The frequency reference is a 4 Mhz
15 * The R6502 on AIM65 operates at 1 MHz. The frequency reference is a 4 MHz
1616 * crystal controlled oscillator. Dual D-type flip-flop Z10 divides the 4 MHz
1717 * signal by four to drive the R6502 phase 0 (O0) input with a 1 MHz clock.
1818 */
src/mess/messdriv.c
r3615r3616
4848//128u4   DRIVER( a2600 )      /* Atari 2600                              */
4949//128u4   DRIVER( a2600p )   /* Atari 2600 PAL                           */
5050//128u4   DRIVER( a5200 )      /* Atari 5200                              */
51//128u4 DRIVER( a5200a )   /* Atari 5200 alt                           */
51//128u4   DRIVER( a5200a )   /* Atari 5200 alt                           */
5252//128u4   DRIVER( a7800 )      /* Atari 7800 NTSC                           */
5353//128u4   DRIVER( a7800p )   /* Atari 7800 PAL                           */
5454//128u4   DRIVER( lynx )      /* Atari Lynx Handheld                        */
r3615r3616
442442//128u4   DRIVER( xtvga )      /* 198? PC-XT (VGA, MF2 Keyboard)               */
443443
444444   /* 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      */
447447//128u4   DRIVER( i8530286 )   /* 1988 IBM PS2 Model 30 286 (VGA)               */
448448//128u4   DRIVER( at )      /* 1987 AMI Bios and Diagnostics               */
449449//128u4   DRIVER( atvga )      /* 19?? AT VGA                              */
r3615r3616
10501050   
10511051   DRIVER( mistrum ) /* 1988 Mistrum                              */
10521052   
1053  /* Russian clones */
1054
1053   /* Russian clones */
10551054   DRIVER( blitz )     /* 1990 Blic                     */
10561055   DRIVER( byte )      /* 1990 Byte                     */
10571056   DRIVER( orizon )    /* 199? Orizon-Micro             */
src/mess/formats/apf_apt.c
r3615r3616
3131   return p;
3232}
3333
34/* 4 periods at 1200hz */
34/* 4 periods at 1200Hz */
3535static INT16* apf_output_bit(INT16 *p, UINT8 b)
3636{
3737   if (b)
src/mess/formats/oric_tap.c
r3615r3616
88#define ORIC_SYNC_BYTE   0x016
99
1010/* frequency of wave */
11/* tapes use 1200hz and 2400hz samples */
11/* tapes use 1200Hz and 2400Hz samples */
1212#define ORIC_WAV_FREQUENCY   4800
1313
1414/* 13 bits define a byte on the cassette */
r3615r3616
3232#define WAVEENTRY_NULL  0
3333
3434/* 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 */
3636
37/* 8 periods at 2400hz */
37/* 8 periods at 2400Hz */
3838/* hi,lo, hi,lo, hi,lo, hi,lo */
3939
4040static INT16 wave_state = WAVEENTRY_HIGH;
r3615r3616
5252   return p;
5353}
5454
55/* 4 periods at 1200hz */
55/* 4 periods at 1200Hz */
5656static INT16* oric_output_bit(INT16 *p, UINT8 b)
5757{
5858   p = oric_emit_level(p,1);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team