Previous 199869 Revisions Next

r41432 Wednesday 28th October, 2015 at 16:54:05 UTC by David Haywood
checkpoint (nw)
[src/lib/formats]tzx_cas.c
[src/mame/drivers]naomi.c

trunk/src/lib/formats/tzx_cas.c
r249943r249944
4343#include <assert.h>
4444
4545#include "tzx_cas.h"
46#include "formats/imageutl.h"
47#include "emu.h"
4648
47
4849#define TZX_WAV_FREQUENCY   44100
4950#define WAVE_LOW        -0x5a9e
5051#define WAVE_HIGH       0x5a9e
r249943r249944
334335}
335336
336337
338static int tzx_handle_symbol(INT16 **buffer, const UINT8 *symtable, UINT8 symbol, int maxp)
339{
340   int size = 0;
341   const UINT8 *cursymb = symtable + (2 * maxp + 1)*symbol;
342
343   UINT8 starttype = cursymb[0];
344
345   printf("start polarity %01x (max number of symbols is %d)\n", starttype, maxp);
346
347   switch (starttype)
348   {
349   case 0x00:
350      toggle_wave_data();
351      break;
352
353   case 0x01:
354      // don't change
355      break;
356
357   case 0x02:
358      // force low
359      wave_data = WAVE_LOW;
360      break;
361
362   case 0x03:
363      // force high
364      wave_data = WAVE_HIGH;
365      break;
366
367   default:
368      printf("SYMDEF invalid - bad starting polarity");
369   }
370
371   for (int i = 0; i < maxp; i++)
372   {
373      UINT16 pulse_length = cursymb[1 + (i*2)] | (cursymb[2 + (i*2)] << 8);
374   //   printf("pulse_length %04x\n", pulse_length);
375
376      // shorter lists can be terminated with a pulse_length of 0
377      if (pulse_length != 0)
378      {
379         int samples = tcycles_to_samplecount(pulse_length);
380         tzx_output_wave(buffer, samples);
381         size += samples;
382         toggle_wave_data();
383
384      }
385      else
386      {
387         toggle_wave_data(); // ?
388         i = maxp;
389         continue;
390      }
391   }
392
393
394   return size;
395}
396
397static int tzx_handle_generalized(INT16 **buffer, const UINT8 *bytes, int pause, int data_size, UINT32 totp, int npp, int asp, UINT32 totd, int npd, int asd )
398{
399   int size = 0;
400
401   if (totp > 0)
402   {
403   //   printf("pilot block table %04x\n", totp);
404
405      const UINT8 *symtable = bytes;
406      const UINT8 *table2 = symtable + (2 * npp + 1)*asp;
407
408      // the Pilot and sync data stream has an RLE encoding
409      for (int i = 0; i < totp; i+=3)
410      {
411         UINT8 symbol = table2[i + 0];
412         UINT16 repetitions = table2[i + 1] + (table2[i + 2] << 8);
413         //printf("symbol %02x repititions %04x\n", symbol, repetitions); // does 1 mean repeat once, or that it only occurs once?
414
415         for (int j = 0; j < repetitions; j++)
416         {
417            size += tzx_handle_symbol(buffer, symtable, symbol, npp);
418         }
419
420
421      }
422
423      // advance to after this data
424      bytes += ((2 * npp + 1)*asp) + totp * 3;
425   }
426   else
427   {
428      printf("no pilot block\n");
429   }
430
431   if (totd > 0)
432   {
433      printf("data block table %04x\n", totd);
434
435   //   const UINT8 *symtable = bytes;
436   //   const UINT8 *table2 = bytes + (2 * npd + 1)*asd;
437
438      int NB = ceil(compute_log2(asd)); // number of bits needed to represent each symbol
439      printf("NB is %d\n", NB);
440   }
441   else
442   {
443      printf("no data block\n");
444   }
445
446
447
448   /* pause */
449   if (pause > 0)
450   {
451      int start_pause_samples = millisec_to_samplecount(1);
452      int rest_pause_samples = millisec_to_samplecount(pause - 1);
453
454      tzx_output_wave(buffer, start_pause_samples);
455      size += start_pause_samples;
456      wave_data = WAVE_LOW;
457      tzx_output_wave(buffer, rest_pause_samples);
458      size += rest_pause_samples;
459   }
460   return size;
461}
462
463
464
337465static void ascii_block_common_log( const char *block_type_string, UINT8 block_type )
338466{
339467   LOG_FORMATS("%s (type %02x) encountered.\n", block_type_string, block_type);
r249943r249944
376504   while (current_block < block_count)
377505   {
378506      int pause_time;
379      int data_size, text_size, total_size, i;
507      UINT32 data_size;
508      int text_size, total_size, i;
380509      int pilot, pilot_length, sync1, sync2;
381510      int bit0, bit1, bits_in_last_byte;
382511      UINT8 *cur_block = blocks[current_block];
r249943r249944
571700         break;
572701
573702      case 0x19:  /* Generalized Data Block */
574         // having this missing is fatal
575         printf("Unsupported block type (0x19 - Generalized Data Block) encountered.\n");
576         current_block++;
703         {
704            // having this missing is fatal
705            // used crudely by batmanc in spectrum_cass list (which is just a redundant encoding of batmane ?)
706            printf("Unsupported block type (0x19 - Generalized Data Block) encountered.\n");
707
708            data_size = cur_block[1] + (cur_block[2] << 8) + (cur_block[3] << 16) + (cur_block[4] << 24);
709            pause_time= cur_block[5] + (cur_block[6] << 8);
710           
711            UINT32 totp = cur_block[7] + (cur_block[8] << 8) + (cur_block[9] << 16) + (cur_block[10] << 24);
712            int npp = cur_block[11];
713            int asp = cur_block[12];
714            if (asp == 0) asp = 256;
715           
716            UINT32 totd = cur_block[13] + (cur_block[14] << 8) + (cur_block[15] << 16) + (cur_block[16] << 24);
717            int npd = cur_block[17];
718            int asd = cur_block[18];
719            if (asd == 0) asd = 256;
720
721            size += tzx_handle_generalized(buffer, &cur_block[19], pause_time, data_size, totp, npp, asp, totd, npd, asd);
722
723            current_block++;
724         }
577725         break;
578726
579727      }
trunk/src/mame/drivers/naomi.c
r249943r249944
33/*
44
55  Sega Naomi / Naomi 2 / Atomiswave
6  Sega, 1998-2005
76
87  Driver by Samuele Zannoli, R. Belmont, ElSemi,
98            David Haywood, Angelo Salese and Olivier Galibert
r249943r249944
9493    (more will come up soon ...)
9594
9695---------------------------------------------------------------------------------------------------------------------------------------------------
97Guru's Readmes
98--------------
9996
100Sega NAOMI Mainboard PCB Layout
101-------------------------------
97Guru's Readme
98-------------
99
100Sega NAOMI Mainboard
101Sega, 1998-2005
102
103PCB Layout
104----------
102105837-13544-01
103106171-7772F
104107837-13707 (sticker)
r249943r249944
111114|ADM485  BIOS.IC27   5264165            5264165     |
112115|                    5264165  |-----|   5264165     |
113116|    CN2                      | SH4 |               |
114|                             |     | 33.3333MHz    |
115|CN26                         |-----|          27MHz|
117|                             |     | 33.3333MHZ    |
118|CN26                         |-----|          27MHZ|
116119|                                         CY2308SC-3|
117120|        KM416S4030      |------|     HY57V161610   |
118121|                        | POWER|     HY57V161610   |
119| C844         315-6232  | VR2  |             32MHz |
120|            33.8688MHz  |------|     HY57V161610   |
121|                         32.768MHz   HY57V161610   |
122| C844G        315-6232  | VR2  |             32MHZ |
123|            33.8688MHZ  |------|     HY57V161610   |
124|                         xMHz        HY57V161610   |
122125|      PCM1725    JP1                    62256      |
123126|                     HY57V161610                   |
124127|                          HY57V161610              |
125128|              315-6145                             |
126|CN25                CY2308SC-3          315-6146   |
129|CN25                CY2308SC-1          315-6146   |
127130|          LED1                              93C46  |
128|          LED2                     14.7456MHz      |
131|          LED2                     14.7456MHZ      |
129132|---------------------------------------------------|
130133Notes:
131            SH4 - Hitachi SH4 CPU (BGAxxx, with heatsink)
132       POWERVR2 - NEC POWERVR2 Video Generator IC (large BGAxxx, with heatsink and fan)
133EPF8452AQC160-3 - Altera FLEX EPF8452AQC160-3 FPGA (QFP160)
134          93C46 - 128 bytes serial EEPROM (SOIC8)
135      BIOS.IC27 - 27C160 EPROM (DIP42)
136        5264165 - Hitachi 5264165FTTA60 1M x 16-bit x 4-banks (64Mbit) SDRAM (TSOPII-54)
137    HY57V161610 - Hynix HY57V161610DTC-8 512k x 16-bit x 2-banks (16Mbit) SDRAM (TSOPII-50)
138     KM416S4030 - Samsung KM416S4030 1M x 16-bit x 4 Banks SDRAM (TSOPII-54)
139          62256 - 32k x8-bit SRAM (SOP28)
140       315-6145 - Sega Custom IC (QFP56)
141       315-6146 - Sega Custom IC (QFP176)
142       315-6188 - Altera EPC1064PC8 FPGA Configuration Device with sticker '315-6188' at IC31 (DIP8)
143       315-6232 - Sega Custom IC (QFP100)
144     CY2308SC-3 - Cypress CY2308SC-3 2-Bank 4-Output Tri-state PLL Programmable Clock Generator IC with 2X or 4X outputs and Zero Delay Buffer (SOIC16)
145           C844 - NEC uPC844 Quad Operational Amplifier (SOIC14)
146          A179B - TI SN75179B Differential Driver and Receiver Pair (DIP8)
147         ADM485 - Analog Devices ADM485 +5 V Low Power EIA RS-485 Transceiver (SOIC8)
148        PCM1725 - Burr-Brown PCM1725 Stereo Audio Digital to Analog Converter 16 Bits, 96kHz Sampling (SOIC14)
149            JP1 - set to 2-3. Alt setting is 1-2
150            JP4 - set to 2-3. Alt setting is 1-2
151        CN1/2/3 - Connectors for ROM cart or GDROM DIMM Unit
152        CN25/26 - Connectors for Filter Board
134      CN1/2/3         - Connectors for ROM cart
135      CN25/26         - Connectors for filter board
136      EPF8452AQC160-3 - Altera FLEX EPF8452AQC160-3 FPGA (QFP160)
137      315-6188.IC31   - Altera EPC1064 (DIP8)
138                        According to the datasheet, it's an FPGA Configuration
139                        Device which loads the Altera Flex EPF8452 with some info
140                        on power-up.
141      JP1             - set to 2-3. Alt setting is 1-2
142      JP4             - set to 2-3. Alt setting is 1-2
143      93C46           - 128 bytes serial EEPROM
144      A179B 96K       - TI SN75179B Differential driver and receiver pair (like RS485)
145      ADM485          - Analog Devices ADM485
146      BIOS.IC27       - 27C160 EPROM
147      5264165         - Hitachi 5264165FTTA60 (video RAM)
148      HY57V161610     - Hyundai 57V161610DTC-8 (main program RAM)
149      CY2308SC-3      - Clock generator IC
150      KM416S4030      - Samsung KM416S4030 16MBit SDRAM (sound related RAM?)
151      315-6232        - Sega Custom IC (QFP100)
152      315-6145        - Sega Custom IC (QFP56)
153      315-6146        - Sega Custom IC (QFP176)
154      C844G           - ? (SOIC14)
155      62256           - 32kx8 SRAM
156      PCM1725         - Burr-Brown PCM1725
157      xMHz            - Small round XTAL (possibly 32.768kHz for a clock?)
158      SH4             - Hitachi SH4 CPU (BGAxxx, with heatsink)
159      POWERVR2        - POWERVR2 video generator (BGAxxx, with heatsink and fan)
153160
154161
155Sega NAOMI 2 Mainboard PCB Layout
156---------------------------------
157837-14009-01
158171-8082C
159837-14123 (sticker)
160(C) SEGA 1999
161|---------------------------------------------------|
162|    CN1  32MHz   BATTERY          CN3              |
163|PC910   315-6146 S-CAP        62256   315-6188.IC31|
164|A179B  62256 *93C46      BIOS.IC27 EPF8452         |
165|   ADM485      14.7456MHz                     D4721|
166|     5264165 315-6232    315-6268  93C46           |
167|PCM1725       33.8688MHz      33.3333MHz           |
168|               32.768kHz                           |
169|    CN2          CY2308  |-----|                   |
170|                         | SH4 |                   |
171|CN26                     |     |                   |
172| C844          *CY2308   |-----|                   |
173| 315-6258             5264165  5264165             |
174|     315-6269        *5264165 *5264165 16M  16M    |
175| 315-6258                             *16M *16M    |
176|       16M|--------|    |--------|    |--------|   |
177|       16M|315-6267|    |315-6289|    |315-6267|16M|
178|      *16M|        |    |        |    |        |16M|
179|      *16M|        |    |        |    |        |*16M
180|MC33470   |--------|    |--------|    |--------|*16M
181|CN25       16M  16M      64M  64M                  |
182|*3771     *16M *16M     *64M *64M             3771 |
183|                                        27MHz 3771 |
184|                  LED2 LED1    *CY2308 CY2292  3773|
185|---------------------------------------------------|
186Notes: (* - these parts on other side of PCB)
187            SH4 - Hitachi SH4 CPU (BGAxxx, with heatsink)
188      BIOS.IC27 - 27C160 EPROM (DIP42)
189        EPF8452 - Altera FLEX EPF8452AQC160-3 FPGA (QFP160)
190          93C46 - 128 bytes serial EEPROM (SOIC8)
191        5264165 - Hitachi 5264165FTTA60 1M x 16-bit x 4-banks (64Mbit) SDRAM (TSOP-II 54)
192            16M - Hynix HY57V161610DTC-8 512k x 16-bit x 2-banks (16Mbit) SDRAM (TSOP-II 50)
193            64M - NEC D4564323 512k x 32-bit x 4-banks (64Mbit) SDRAM (TSOP-II 86)
194          62256 - 32k x8-bit SRAM (SOP28)
195       315-6146 - Sega Custom IC (QFP176)
196       315-6188 - Altera EPC1064PC8 FPGA Configuration Device with sticker '315-6188' at IC31 (DIP8)
197       315-6232 - Sega Custom IC (QFP100)
198       315-6258 - Sega Custom IC (QFP56)
199       315-6267 - NEC POWER-VR2 Video Generator IC (large BGAxxx, with heatsink and fan, x2)
200       315-6268 - Altera EPM7032AELC44-10 CPLD with sticker '315-6268' (PLCC44)
201       315-6269 - Altera MAX EPM7064AETC100-10 CPLD with sticker '315-6269' (TQFP100)
202       315-6289 - Sega custom IC (large BGAxxx, with heatsink)
203        MC33470 - ON Semiconductor MC33470 Synchronous Rectification DC/DC Converter Programmable Integrated Controller (SOIC20)
204         CY2308 - Cypress CY2308SC-3 2-Bank 4-Output Tri-state PLL Programmable Clock Generator IC with 2X or 4X outputs and Zero Delay Buffer (SOIC16)
205         CY2292 - Cypress CY2292SL Three-PLL General-Purpose EPROM Programmable Clock Generator IC (SOIC16)
206          A179B - TI SN75179B Differential Driver and Receiver Pair (SOIC8)
207         ADM485 - Analog Devices ADM485 +5 V Low Power EIA RS-485 Transceiver (SOIC8)
208          PC910 - Sharp PC910 Ultra-high Speed Response OPIC Photocoupler (DIP8)
209          D4721 - NEC uPD4721GS RS-232 Line Driver/Receiver at 3.3V / 5V (TSSOP20)
210           3771 - Fujitsu MB3771 Power Supply Monitor (i.e. reset) IC (SOIC8)
211           3773 - Fujitsu MB3773 Power Supply Monitor with Watch-Dog Timer (SOIC8)
212           C844 - NEC uPC844 Quad Operational Amplifier (SOIC14)
213        PCM1725 - Burr-Brown PCM1725 Stereo Audio Digital to Analog Converter 16 Bits, 96kHz Sampling (SOIC14)
214        BATTERY - 3v Coin Battery
215          S-CAP - 5.5v 0.1f Supercap
216    LED1 / LED2 - Red LED / Green LED
217        CN1/2/3 - Connectors for ROM cart or GDROM DIMM Unit
218        CN25/26 - Connectors for Filter Board
219
220
221162Filter Board
222163------------
223164839-1069
r249943r249944
232173|    CN7     CN6           CN4       CN3    CN2   CN1|
233174|----------------------------------------------------|
234175Notes:
235      CN1/CN2 - Power input
236          CN3 - HD15 (i.e. VGA connector) RGB Video Output @ 15kHz or 31.5kHz
237          CN4 - RCA Audio Output connectors
238          CN5 - USB connector (connection to I/O board)
239          CN6 - 10 pin connector labelled 'MAPLE 0-1'
240          CN7 - 11 pin connector labelled 'MAPLE 2-3'
241          CN8 - RS422 connector
242          CN9 - Midi connector
243    CNTX/CNRX - Network connectors
244    DIN1/DIN2 - Connectors joining to mainboard CN25/26
245          SW1 - Test Switch
246          SW2 - Service Switch
247        DIPSW - 4-position DIP switch block
248         CN10 - 12 volt output for internal case exhaust fan
249         CN11 - RGB connector (not populated)
250         CN12 - 5 volt output connector
176      CN1/CN2   - Power input
177      CN3       - HD15 (i.e. VGA connector) RGB Video Output @ 15kHz or 31.5kHz
178      CN4       - RCA Audio Output connectors
179      CN5       - USB connector (connection to I/O board)
180      CN6       - 10 pin connector labelled 'MAPLE 0-1'
181      CN7       - 11 pin connector labelled 'MAPLE 2-3'
182      CN8       - RS422 connector
183      CN9       - Midi connector
184      CNTX/CNRX - Network connectors
185      DIN1/DIN2 - Connectors joining to mainboard CN25/26
186      SW1       - Test Switch
187      SW2       - Service Switch
188      DIPSW     - 4-position DIP switch block
189      CN10      - 12 volt output for internal case exhaust fan
190      CN11      - RGB connector (not populated)
191      CN12      - 5 volt output connector
251192
252193
194
253195---------------------------------------------------------
254196Bios Version Information                                |
255197---------------------------------------------------------
r249943r249944
269211---------------------------------------------------------
270212
271213
214
272215NAOMI ROM cart usage
273216-------------------------
274217There are 6 known types of carts manufactured by Sega: 171-7885A, 171-7919A, 171-7930B, 171-7978B, 171-8132B, 171-8346C
r249943r249944
420363Zombie Revenge                                  840-0003C    21707   19 (64Mb)   ?           315-6213  317-0249-COM   joystick + 3 buttons
421364
422365
366
423367171-7930B (C) Sega 1998
424368|------------------------------------------------------------------|
425369|        JJJJJJ      SW2                        ----CN2----        -|
r249943r249944
469413Puyo Puyo Fever (prototype ver 0.01)  *        not present  22 (64Mb)   no cart, only development PCB
470414
471415
416
472417837-13801  171-7978B (C) Sega 1999
473418|---------------------------------------------------------|
474419|                                       ----CN2----       -|
r249943r249944
531476Virtua Tennis 2 / Power Smash 2 (Rev A)                      840-0084C    22327A  18 (64Mb)   present  317-0320-COM
532477
533478
479
534480837-14114-01  171-8132B (C) Sega 2000
535481|---------------------------------------------------------|
536482|      IC11  IC10  IC9                  ----CN2----       -|
r249943r249944
595541Zero Gunner 2                                   841-0020C  23689    5 (128Mb)  315-6319A  315-6213  317-5073-COM
596542
597543
544
598545171-8346C (C) Sega 2005
599546|---------------------------------------------------------|
600547|  IC12          IC8                    ----CN2----       -|
r249943r249944
649596Touch De Zunou (Rev A)                              840-0166C    not present  2 (512Mb)   present  317-0435-JPN  present  IC4# is marked "18", requires 837-14672 sensor board (SH4 based)
650597
651598
599
652600MASK B (C) Namco 2000
653601|-------------------------------------------------------------------------------------|
654602|                                                               ----CN2----            -|
r249943r249944
756704
757705(1) note: the number in the game code has the following meaning: 1 = Japan, 2 = Asia, 3 = US, 4 = World.
758706
707
708
759709      Note! Generally, games that require a special I/O board or controller will not boot at all with a
760710            standard NAOMI I/O board. Usually they display a message saying the I/O board is not acceptable
761711            or not connected properly.
762712
763713
714
764715Sega I/O boards
765716---------------
766717
767718These are used on NAOMI and all other Sega games from 1999 onwards.
768719Not all I/O boards are listed here. If you know of others, please let us know.
769720
721
770722838-13683
771723838-13683-91 (sticker)
772724838-13683-92 (sticker)
r249943r249944
12481200The bottom of the PCB contains nothing significant except some connectors. One for the game cart, one for special controls
12491201or I/O, one for a communication module, one for a cooling fan and one for the serial connection daughterboard.
12501202
1203---------------------------------------------------------------------------------------------------------------------------------
12511204
1205
1206
12521207Atomiswave cart PCB layout and game usage (revision 1.0 26/2/2011 5:59pm)
12531208-----------------------------------------
12541209
12551210Type 1 ROM Board:
12561211
1212
12571213AM3AGB-04
12581214MROM PCB
125912152002
r249943r249944
13361292
13371293Type 2 ROM Board:
13381294
1295
13391296AM3ALW-02
13401297MROM2 PCB
134112982005
r249943r249944
15451502      CN         - This connector plugs into the main board
15461503
15471504
1505
15481506Gun Sub Board
15491507-------------
15501508


Previous 199869 Revisions Next


© 1997-2024 The MAME Team