summaryrefslogtreecommitdiffstats
path: root/3rdparty/zlib/contrib/minizip/zip.h
blob: 7e4509d77bee5956e3e0c22e5a1119a53ef52aef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
/* zip.h -- IO on .zip files using zlib
   Version 1.1, February 14h, 2010
   part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )

         Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )

         Modifications for Zip64 support
         Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )

         For more info read MiniZip_info.txt

         ---------------------------------------------------------------------------

   Condition of use and distribution are the same than zlib :

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

        ---------------------------------------------------------------------------

        Changes

        See header of zip.h

*/

#ifndef _zip12_H
#define _zip12_H

#ifdef __cplusplus
extern "C" {
#endif

//#define HAVE_BZIP2

#ifndef _ZLIB_H
#include "zlib.h"
#endif

#ifndef _ZLIBIOAPI_H
#include "ioapi.h"
#endif

#ifdef HAVE_BZIP2
#include "bzlib.h"
#endif

#define Z_BZIP2ED 12

#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
/* like the STRICT of WIN32, we define a pointer that cannot be converted
    from (void*) without cast */
typedef struct TagzipFile__ { int unused; } zipFile__;
typedef zipFile__ *zipFile;
#else
typedef voidp zipFile;
#endif

#define ZIP_OK                          (0)
#define ZIP_EOF                         (0)
#define ZIP_ERRNO                       (Z_ERRNO)
#define ZIP_PARAMERROR                  (-102)
#define ZIP_BADZIPFILE                  (-103)
#define ZIP_INTERNALERROR               (-104)

#ifndef DEF_MEM_LEVEL
#  if MAX_MEM_LEVEL >= 8
#    define DEF_MEM_LEVEL 8
#  else
#    define DEF_MEM_LEVEL  MAX_MEM_LEVEL
#  endif
#endif
/* default memLevel */

/* tm_zip contain date/time info */
typedef struct tm_zip_s
{
    int tm_sec;             /* seconds after the minute - [0,59] */
    int tm_min;             /* minutes after the hour - [0,59] */
    int tm_hour;            /* hours since midnight - [0,23] */
    int tm_mday;            /* day of the month - [1,31] */
    int tm_mon;             /* months since January - [0,11] */
    int tm_year;            /* years - [1980..2044] */
} tm_zip;

typedef struct
{
    tm_zip      tmz_date;       /* date in understandable format           */
    uLong       dosDate;       /* if dos_date == 0, tmu_date is used      */
/*    uLong       flag;        */   /* general purpose bit flag        2 bytes */

    uLong       internal_fa;    /* internal file attributes        2 bytes */
    uLong       external_fa;    /* external file attributes        4 bytes */
} zip_fileinfo;

typedef const char* zipcharpc;


#define APPEND_STATUS_CREATE        (0)
#define APPEND_STATUS_CREATEAFTER   (1)
#define APPEND_STATUS_ADDINZIP      (2)

extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
/*
  Create a zipfile.
     pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
       an Unix computer "zlib/zlib113.zip".
     if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
       will be created at the end of the file.
         (useful if the file contain a self extractor code)
     if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will
       add files in existing zip (be sure you don't add file that doesn't exist)
     If the zipfile cannot be opened, the return value is NULL.
     Else, the return value is a zipFile Handle, usable with other function
       of this zip package.
*/

/* Note : there is no delete function into a zipfile.
   If you want delete file into a zipfile, you must open a zipfile, and create another
   Of couse, you can use RAW reading and writing to copy the file you did not want delte
*/

extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
                                   int append,
                                   zipcharpc* globalcomment,
                                   zlib_filefunc_def* pzlib_filefunc_def));

extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
                                   int append,
                                   zipcharpc* globalcomment,
                                   zlib_filefunc64_def* pzlib_filefunc_def));

extern zipFile ZEXPORT zipOpen3 OF((const void *pathname,
                                    int append,
                                    zipcharpc* globalcomment,
                                    zlib_filefunc64_32_def* pzlib_filefunc64_32_def));

extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
                       const char* filename,
                       const zip_fileinfo* zipfi,
                       const void* extrafield_local,
                       uInt size_extrafield_local,
                       const void* extrafield_global,
                       uInt size_extrafield_global,
                       const char* comment,
                       int method,
                       int level));

extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
                       const char* filename,
                       const zip_fileinfo* zipfi,
                       const void* extrafield_local,
                       uInt size_extrafield_local,
                       const void* extrafield_global,
                       uInt size_extrafield_global,
                       const char* comment,
                       int method,
                       int level,
                       int zip64));

/*
  Open a file in the ZIP for writing.
  filename : the filename in zip (if NULL, '-' without quote will be used
  *zipfi contain supplemental information
  if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
    contains the extrafield data the the local header
  if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
    contains the extrafield data the the local header
  if comment != NULL, comment contain the comment string
  method contain the compression method (0 for store, Z_DEFLATED for deflate)
  level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
  zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
                    this MUST be '1' if the uncompressed size is >= 0xffffffff.

*/


extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
                                            const char* filename,
                                            const zip_fileinfo* zipfi,
                                            const void* extrafield_local,
                                            uInt size_extrafield_local,
                                            const void* extrafield_global,
                                            uInt size_extrafield_global,
                                            const char* comment,
                                            int method,
                                            int level,
                                            int raw));


extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
                                            const char* filename,
                                            const zip_fileinfo* zipfi,
                                            const void* extrafield_local,
                                            uInt size_extrafield_local,
                                            const void* extrafield_global,
                                            uInt size_extrafield_global,
                                            const char* comment,
                                            int method,
                                            int level,
                                            int raw,
                                            int zip64));
/*
  Same than zipOpenNewFileInZip, except if raw=1, we write raw file
 */

extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
                                            const char* filename,
                                            const zip_fileinfo* zipfi,
                                            const void* extrafield_local,
                                            uInt size_extrafield_local,
                                            const void* extrafield_global,
                                            uInt size_extrafield_global,
                                            const char* comment,
                                            int method,
                                            int level,
                                            int raw,
                                            int windowBits,
                                            int memLevel,
                                            int strategy,
                                            const char* password,
                                            uLong crcForCrypting));

extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
                                            const char* filename,
                                            const zip_fileinfo* zipfi,
                                            const void* extrafield_local,
                                            uInt size_extrafield_local,
                                            const void* extrafield_global,
                                            uInt size_extrafield_global,
                                            const char* comment,
                                            int method,
                                            int level,
                                            int raw,
                                            int windowBits,
                                            int memLevel,
                                            int strategy,
                                            const char* password,
                                            uLong crcForCrypting,
                                            int zip64
                                            ));

/*
  Same than zipOpenNewFileInZip2, except
    windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
    password : crypting password (NULL for no crypting)
    crcForCrypting : crc of file to compress (needed for crypting)
 */

extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
                                            const char* filename,
                                            const zip_fileinfo* zipfi,
                                            const void* extrafield_local,
                                            uInt size_extrafield_local,
                                            const void* extrafield_global,
                                            uInt size_extrafield_global,
                                            const char* comment,
                                            int method,
                                            int level,
                                            int raw,
                                            int windowBits,
                                            int memLevel,
                                            int strategy,
                                            const char* password,
                                            uLong crcForCrypting,
                                            uLong versionMadeBy,
                                            uLong flagBase
                                            ));


extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
                                            const char* filename,
                                            const zip_fileinfo* zipfi,
                                            const void* extrafield_local,
                                            uInt size_extrafield_local,
                                            const void* extrafield_global,
                                            uInt size_extrafield_global,
                                            const char* comment,
                                            int method,
                                            int level,
                                            int raw,
                                            int windowBits,
                                            int memLevel,
                                            int strategy,
                                            const char* password,
                                            uLong crcForCrypting,
                                            uLong versionMadeBy,
                                            uLong flagBase,
                                            int zip64
                                            ));
/*
  Same than zipOpenNewFileInZip4, except
    versionMadeBy : value for Version made by field
    flag : value for flag field (compression level info will be added)
 */


extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
                       const void* buf,
                       unsigned len));
/*
  Write data in the zipfile
*/

extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
/*
  Close the current file in the zipfile
*/

extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
                                            uLong uncompressed_size,
                                            uLong crc32));

extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
                                            ZPOS64_T uncompressed_size,
                                            uLong crc32));

/*
  Close the current file in the zipfile, for file opened with
    parameter raw=1 in zipOpenNewFileInZip2
  uncompressed_size and crc32 are value for the uncompressed size
*/

extern int ZEXPORT zipClose OF((zipFile file,
                const char* global_comment));
/*
  Close the zipfile
*/


extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
/*
  zipRemoveExtraInfoBlock -  Added by Mathias Svensson

  Remove extra information block from a extra information data for the local file header or central directory header

  It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.

  0x0001 is the signature header for the ZIP64 extra information blocks

  usage.
                        Remove ZIP64 Extra information from a central director extra field data
              zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);

                        Remove ZIP64 Extra information from a Local File Header extra field data
        zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
*/

#ifdef __cplusplus
}
#endif

#endif /* _zip64_H */
>; if((sprite_list[mainlist_offset+5] & 0x700) == 0x700) { trans = TRANSPARENCY_ALPHA; alpha_set_level((sprite_list[mainlist_offset+5] & 0x1F) << 3); } else { trans = TRANSPARENCY_PEN; alpha_set_level(255); } // printf("%x %x \n",sprite_list[mainlist_offset+1],sublist_length); while(sublist_length) { sprite=sprite_sublist[0]&0x7fff; flip_x=sprite_sublist[1]>>8&1; flip_y=sprite_sublist[1]>>9&1; temp.b=sprite_sublist[2]; x=temp.a; temp.b=sprite_sublist[3]; y=temp.a; //x+=global_x; //y+=global_y; width=((sprite_sublist[1])&0x3); height=((sprite_sublist[1]>>2)&0x3); height = 1 << height; width = 1 << width; y-=height*8; tileno = sprite; //tileno += (sprite_list[4]&0xf)*0x4000; // this makes things worse in places (title screen for example) for(xw=0;xw<width;xw++) { for(yw=0;yw<height;yw++) { if(!flip_x) xb=x+xw*8+global_x; else xb=x+(width-xw-1)*8+global_x; if(!flip_y) yb=y+yw*8+global_y; else yb=y+(height-yw-1)*8+global_y; if (dirty_tileram[tileno]) { decodechar(machine->gfx[0], tileno, (UINT8*)tileram, &tiles8x8_layout); dirty_tileram[tileno] = 0; } drawgfx(bitmap,machine->gfx[0],tileno,global_pal,flip_x,flip_y,xb,yb,cliprect,trans,0); tileno++; } } sprite_sublist+=8; --sublist_length; } } mainlist_offset+=8; } memcpy(sprram_old, sprram, 0x80000); return 0; } /*************************************************************************** audio - VERY preliminary TODO: watch similarities with st0016 ***************************************************************************/ /* cpu #0 (PC=00011F7C): unmapped program memory word write to 004E0002 = 0000 & FFFF 0? cpu #0 (PC=00011F84): unmapped program memory word write to 004E0004 = 0D50 & FFFF lo word \ sample start cpu #0 (PC=00011F8A): unmapped program memory word write to 004E0006 = 0070 & FFFF hi word / address? cpu #0 (PC=00011FBA): unmapped program memory word write to 004E000A = 0000 & FFFF 0? cpu #0 (PC=00011FC2): unmapped program memory word write to 004E0018 = 866C & FFFF lo word \ sample stop cpu #0 (PC=00011FC8): unmapped program memory word write to 004E001A = 00AA & FFFF hi word / address? cpu #0 (PC=00011FD0): unmapped program memory word write to 004E000C = 0FFF & FFFF cpu #0 (PC=00011FD8): unmapped program memory word write to 004E001C = FFFF & FFFF cpu #0 (PC=00011FDC): unmapped program memory word write to 004E001E = FFFF & FFFF cpu #0 (PC=00026EFA): unmapped program memory word write to 004E0100 = 0001 & FFFF ctrl word r/w: bit 7-0 = voice 8-1 (1=play,0=stop) voice #1: $4E0000-$4E001F voice #2: $4E0020-$4E003F voice #3: $4E0040-$4E005F ... voice #8: $4E00E0-$4E00FF voice regs: offset description +00 +02 always 0? +04 lo-word \ sample +06 hi-word / counter ? +0A +18 \ +1A / +1C \ +1E / */ /*************************************************************************** Main CPU memory handlers ***************************************************************************/ static UINT16 srmp6_input_select = 0; static WRITE16_HANDLER( srmp6_input_select_w ) { srmp6_input_select = data & 0x0f; } static READ16_HANDLER( srmp6_inputs_r ) { if (offset == 0) // DSW return readinputport(4); switch(srmp6_input_select) // inputs { case 1<<0: return readinputport(0); case 1<<1: return readinputport(1); case 1<<2: return readinputport(2); case 1<<3: return readinputport(3); } return 0; } static UINT16 *video_regs; static WRITE16_HANDLER( video_regs_w ) { switch(offset) { case 0x5e/2: // bank switch, used by ROM check #if SRMP6_VERBOSE printf("%x\n",data); #endif memory_set_bankptr(1,(UINT16 *)(memory_region(REGION_USER2) + (data & 0x0f)*0x200000)); break; // set by IT4 case 0x5c/2: // either 0x40 explicitely in many places, or according $2083b0 (IT4) //Fade in/out (0x40(dark)-0x60(normal)-0x7e?(bright) reset by 0x00? data = (!data)?0x60:(data == 0x5e)?0x60:data; if(brightness != data) { brightness = data; update_palette(); } break; /* unknown registers - there are others */ // set by IT4 (jsr $b3c), according flip screen dsw case 0x48/2: // 0 / 0xb0 if flipscreen case 0x52/2: // 0 / 0x2ef if flipscreen case 0x54/2: // 0x152 / 0x15e if flipscreen // set by IT4 ($82e-$846) case 0x56/2: // written 8,9,8,9 successively default: logerror("video_regs_w (PC=%06X): %04x = %04x & %04x\n", activecpu_get_previouspc(), offset*2, data, mem_mask); break; } COMBINE_DATA(&video_regs[offset]); } static READ16_HANDLER( video_regs_r ) { logerror("video_regs_r (PC=%06X): %04x\n", activecpu_get_previouspc(), offset*2); return video_regs[offset]; } /* DMA RLE stuff - the same as CPS3 */ static unsigned short lastb; static unsigned short lastb2; static int destl; static UINT32 process(UINT8 b,UINT32 dst_offset) { int l=0; UINT8 *tram=(UINT8*)tileram; if(lastb==lastb2) //rle { int i; int rle=(b+1)&0xff; for(i=0;i<rle;++i) { tram[dst_offset+destl] = lastb; dirty_tileram[(dst_offset+destl)/0x40] = 1; dst_offset++; ++l; } lastb2=0xffff; return l; } else { lastb2=lastb; lastb=b; tram[dst_offset+destl] = b; dirty_tileram[(dst_offset+destl)/0x40] = 1; return 1; } } static WRITE16_HANDLER(srmp6_dma_w) { COMBINE_DATA(&dmaram[offset]); if(offset==13 && dmaram[offset]==0x40) { UINT32 srctab=2*((((UINT32)dmaram[5])<<16)|dmaram[4]); UINT32 srcdata=2*((((UINT32)dmaram[11])<<16)|dmaram[10]); UINT32 len=4*(((((UINT32)dmaram[7]&3)<<16)|dmaram[6])+1); //??? WRONG! int tempidx=0; /* show params */ #if SRMP6_VERBOSE printf("DMA! %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n", dmaram[0x00/2], dmaram[0x02/2], dmaram[0x04/2], dmaram[0x06/2], dmaram[0x08/2], dmaram[0x0a/2], dmaram[0x0c/2], dmaram[0x0e/2], dmaram[0x10/2], dmaram[0x12/2], dmaram[0x14/2], dmaram[0x16/2], dmaram[0x18/2], dmaram[0x1a/2]); #endif destl=dmaram[9]*0x40000; lastb=0xfffe; lastb2=0xffff; while(1) { int i; UINT8 ctrl=memory_region(REGION_USER2)[srcdata]; ++srcdata; for(i=0;i<8;++i) { UINT8 p=memory_region(REGION_USER2)[srcdata]; if(ctrl&0x80) { UINT8 real_byte; real_byte = memory_region(REGION_USER2)[srctab+p*2]; tempidx+=process(real_byte,tempidx); real_byte = memory_region(REGION_USER2)[srctab+p*2+1];//px[DMA_XOR((current_table_address+p*2+1))]; tempidx+=process(real_byte,tempidx); } else { tempidx+=process(p,tempidx); } ctrl<<=1; ++srcdata; if(tempidx>=len) { #if SRMP6_VERBOSE printf("%x\n",srcdata); #endif return; } } } } } /* if tileram is actually bigger than the mapped area, how do we access the rest? */ static READ16_HANDLER(tileram_r) { // return tileram[offset]; return 0x0000; } static WRITE16_HANDLER(tileram_w) { //UINT16 tmp; // COMBINE_DATA(&tileram[offset]); /* are the DMA registers enabled some other way, or always mapped here, over RAM? */ if (offset >= 0xfff00/2 && offset <= 0xfff1a/2 ) { offset &=0x1f; srmp6_dma_w(offset,data,mem_mask); } } static WRITE16_HANDLER(paletteram_w) { INT8 r, g, b; int brg = brightness - 0x60; paletteram16_xBBBBBGGGGGRRRRR_word_w(offset, data, mem_mask); if(brg) { r = data >> 0 & 0x1F; g = data >> 5 & 0x1F; b = data >> 10 & 0x1F; if(brg < 0) { r += (r * brg) >> 5; if(r < 0) r = 0; g += (g * brg) >> 5; if(g < 0) g = 0; b += (b * brg) >> 5; if(b < 0) b = 0; } else if(brg > 0) { r += ((0x1F - r) * brg) >> 5; if(r > 0x1F) r = 0x1F; g += ((0x1F - g) * brg) >> 5; if(g > 0x1F) g = 0x1F; b += ((0x1F - b) * brg) >> 5; if(b > 0x1F) b = 0x1F; } palette_set_color(Machine, offset, MAKE_RGB(r << 3, g << 3, b << 3)); } } static ADDRESS_MAP_START( srmp6, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x0fffff) AM_ROM AM_RANGE(0x200000, 0x23ffff) AM_RAM // work RAM AM_RANGE(0x600000, 0x7fffff) AM_READ(MRA16_BANK1) // banked ROM (used by ROM check) AM_RANGE(0x800000, 0x9fffff) AM_ROM AM_REGION(REGION_USER1, 0) AM_RANGE(0x300000, 0x300005) AM_READWRITE(srmp6_inputs_r, srmp6_input_select_w) // inputs AM_RANGE(0x480000, 0x480fff) AM_READWRITE(MRA16_RAM, paletteram_w) AM_BASE(&paletteram16) AM_RANGE(0x4d0000, 0x4d0001) AM_READWRITE(watchdog_reset16_r, watchdog_reset16_w) // watchdog // OBJ RAM: checked [$400000-$47dfff] AM_RANGE(0x400000, 0x47ffff) AM_RAM AM_BASE(&sprram) // CHR RAM: checked [$500000-$5fffff] AM_RANGE(0x500000, 0x5fffff) AM_READWRITE(tileram_r,tileram_w)//AM_RAM AM_BASE(&tileram) // AM_RANGE(0x5fff00, 0x5fffff) AM_WRITE(dma_w) AM_BASE(&dmaram) AM_RANGE(0x4c0000, 0x4c006f) AM_READWRITE(video_regs_r, video_regs_w) AM_BASE(&video_regs) // ? gfx regs ST-0026 NiLe // AM_RANGE(0x4e0000, 0x4e00ff) AM_READWRITE(sound_regs_r, sound_regs_w) AM_BASE(&sound_regs) // ? sound regs (data) ST-0026 NiLe // AM_RANGE(0x4e0100, 0x4e0101) AM_READWRITE(sndctrl_reg_r, sndctrl_reg_w) // ? sound reg (ctrl) ST-0026 NiLe // AM_RANGE(0x4e0110, 0x4e0111) AM_NOP // ? accessed once ($268dc, written $b.w) // AM_RANGE(0x5fff00, 0x5fff1f) AM_RAM // ? see routine $5ca8, video_regs related ??? // AM_RANGE(0xf00004, 0xf00005) AM_RAM // ? // AM_RANGE(0xf00006, 0xf00007) AM_RAM // ? ADDRESS_MAP_END /*************************************************************************** Port definitions ***************************************************************************/ static INPUT_PORTS_START( srmp6 ) PORT_START PORT_BIT ( 0xfe01, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded PORT_BIT ( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_BIT ( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_BIT ( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_BIT ( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_BIT ( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_BIT ( 0x0040, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT ( 0x0080, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) PORT_BIT ( 0x0100, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME(DEF_STR( Test )) PORT_CODE(KEYCODE_F2) PORT_START PORT_BIT ( 0xfe41, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded PORT_BIT ( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_BIT ( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_BIT ( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_BIT ( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_BIT ( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_BIT ( 0x0180, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START PORT_BIT ( 0xfe41, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded PORT_BIT ( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_BIT ( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_BIT ( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_BIT ( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_BIT ( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_BIT ( 0x0180, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START PORT_BIT ( 0xfe61, IP_ACTIVE_LOW, IPT_UNUSED ) // explicitely discarded PORT_BIT ( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_BIT ( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_BIT ( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_BIT ( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_BIT ( 0x0180, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START /* 16-bit DSW1+DSW2 */ PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) ) // DSW1 PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) ) PORT_DIPSETTING( 0x0001, DEF_STR( 4C_1C ) ) PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) ) PORT_DIPSETTING( 0x0003, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0006, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0005, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) ) PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unused ) ) PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0040, 0x0000, "Re-Clothe" ) PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0040, DEF_STR( On ) ) PORT_DIPNAME( 0x0080, 0x0080, "Nudity" ) PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0080, DEF_STR( On ) ) PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Difficulty ) ) // DSW2 PORT_DIPSETTING( 0x0000, "8" ) PORT_DIPSETTING( 0x0100, "7" ) PORT_DIPSETTING( 0x0200, "6" ) PORT_DIPSETTING( 0x0300, "5" ) PORT_DIPSETTING( 0x0400, "3" ) PORT_DIPSETTING( 0x0500, "2" ) PORT_DIPSETTING( 0x0600, "1" ) PORT_DIPSETTING( 0x0700, "4" ) PORT_DIPNAME( 0x0800, 0x0000, "Kuitan" ) PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0800, DEF_STR( On ) ) PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Continues ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Demo_Sounds ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x2000, DEF_STR( On ) ) PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Flip_Screen ) ) PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_SERVICE( 0x8000, IP_ACTIVE_LOW ) INPUT_PORTS_END /*************************************************************************** Machine driver ***************************************************************************/ static INTERRUPT_GEN(srmp6_interrupt) { if(!cpu_getiloops()) { cpunum_set_input_line(0,3,HOLD_LINE); } else { cpunum_set_input_line(0,4,HOLD_LINE); } } static MACHINE_DRIVER_START( srmp6 ) MDRV_CPU_ADD(M68000, 16000000) MDRV_CPU_PROGRAM_MAP(srmp6,0) MDRV_CPU_VBLANK_INT(srmp6_interrupt,2) MDRV_SCREEN_REFRESH_RATE(60) MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION) MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER) MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) MDRV_SCREEN_SIZE(64*8, 64*8) MDRV_SCREEN_VISIBLE_AREA(0*8, 42*8-1, 0*8, 30*8-1) MDRV_PALETTE_LENGTH(0x800) MDRV_VIDEO_START(srmp6) MDRV_VIDEO_UPDATE(srmp6) /* sound hardware */ MACHINE_DRIVER_END /*************************************************************************** ROM definition(s) ***************************************************************************/ /* CHR? sx011-05.18 '00':[23a640,300000[ sx011-04.19 sx011-03.20 sx011-02.21 sx011-01.22 '00':[266670,400000[ (end) most are 8 bits unsigned PCM 16/32KHz if stereo/mono some voices in 2nd rom have lower sample rate sx011-08.15 <- samples: instruments, musics, sound FXs, voices sx011-07.16 <- samples: voices (cont'd), sound FXs, music, theme music sx011-06.17 <- samples: theme music (cont'd) */ ROM_START( srmp6 ) ROM_REGION( 0x100000, REGION_CPU1, 0 ) /* 68000 Code */ ROM_LOAD16_BYTE( "sx011-10.4", 0x000001, 0x080000, CRC(8f4318a5) SHA1(44160968cca027b3d42805f2dd42662d11257ef6) ) ROM_LOAD16_BYTE( "sx011-11.5", 0x000000, 0x080000, CRC(7503d9cf) SHA1(03ab35f13b6166cb362aceeda18e6eda8d3abf50) ) ROM_REGION( 0x200000, REGION_USER1, 0 ) /* 68000 Data */ ROM_LOAD( "sx011-09.10", 0x000000, 0x200000, CRC(58f74438) SHA1(a256e39ca0406e513ab4dbd812fb0b559b4f61f2) ) /* these are accessed directly by the 68k, DMA device etc. NOT decoded */ ROM_REGION( 0x2000000, REGION_USER2, 0) /* Banked ROM */ ROM_LOAD16_WORD_SWAP( "sx011-08.15", 0x0000000, 0x0400000, CRC(01b3b1f0) SHA1(bbd60509c9ba78358edbcbb5953eafafd6e2eaf5) ) // CHR00 ROM_LOAD16_WORD_SWAP( "sx011-07.16", 0x0400000, 0x0400000, CRC(26e57dac) SHA1(91272268977c5fbff7e8fbe1147bf108bd2ed321) ) // CHR01 ROM_LOAD16_WORD_SWAP( "sx011-06.17", 0x0800000, 0x0400000, CRC(220ee32c) SHA1(77f39b54891c2381b967534b0f6d380962eadcae) ) // CHR02 ROM_LOAD16_WORD_SWAP( "sx011-05.18", 0x0c00000, 0x0400000, CRC(87e5fea9) SHA1(abd751b5744d6ac7e697774ea9a7f7455bf3ac7c) ) // CHR03 ROM_LOAD16_WORD_SWAP( "sx011-04.19", 0x1000000, 0x0400000, CRC(e90d331e) SHA1(d8afb1497cec8fe6de10d23d49427e11c4c57910) ) // CHR04 ROM_LOAD16_WORD_SWAP( "sx011-03.20", 0x1400000, 0x0400000, CRC(f1f24b35) SHA1(70d6848f77940331e1be8591a33d62ac22a3aee9) ) // CHR05 ROM_LOAD16_WORD_SWAP( "sx011-02.21", 0x1800000, 0x0400000, CRC(c56d7e50) SHA1(355c64b38e7b266f386b9c0b906c8581fc15374b) ) // CHR06 ROM_LOAD16_WORD_SWAP( "sx011-01.22", 0x1c00000, 0x0400000, CRC(785409d1) SHA1(3e31254452a30d929161a1ea3a3daa69de058364) ) // CHR07 ROM_END /*************************************************************************** Driver initialization ***************************************************************************/ static DRIVER_INIT( srmp6 ) { } /*************************************************************************** Game driver(s) ***************************************************************************/ /*GAME( YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS)*/ GAME( 1995, srmp6, 0, srmp6, srmp6, srmp6, ROT0, "Seta", "Super Real Mahjong P6 (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND)