Previous 199869 Revisions Next

r18721 Friday 26th October, 2012 at 14:49:25 UTC by Miodrag Milanović
added basic support for the loop flags in tzx [David Haywood]
[hash]spectrum_cass.xml
[src/lib/formats]tzx_cas.c

trunk/hash/spectrum_cass.xml
r18720r18721
1919     The MESS emulation at the time of writing isn't very good, the following emulators are used to determine how things should work
2020     
2121      Fuse (Free Unix Spectrum Emulator) - Free, High Compatibility can run some of the trickier images, Windows port available - http://fuse-emulator.sourceforge.net/
22      Spectaculator                      - Commercial, a bit more user friendly than above, similar compatibility               - http://www.spectaculator.com/
22      Spectaculator                      - Commercial, a bit more user friendly than above, similar compatibility               - http://www.spectaculator.com/     
2323     
2424     Note, even with those emulators you'll have to turn off some of the speed cheats on loading to get good compatibilty for example, in Fuse
2525      Use Tape Traps
r18720r18721
3030     MESS doesn't have any accelerated loading so some games which require the tricks to be disabled in other emulators work in MESS without trickery, eg Xanthius
3131     
3232     http://newton.sunderland.ac.uk/~specfreak/Schemes/schemes.html is a rather outdated guide mentioning some of the custom loaders, and showing disassemblies of them.
33 
34     legacy emulators including Real Spectrum ( http://zxm.speccy.cz/realspec/ ) appear to struggle with some of the more complex tape protections
35
36 
37     ToDo: Find an emulator which works with the 'Gremlin 2' protected tapes 'M.A.S.K' and 'Basil The Great Mouse Detective' all TZX images I've found fail in the
38     above emulators, although RealSpectrum does load some copies of MASK but fails loading the 2nd part of the game.
3339     
3440
35     legacy emulators including Real Spectrum ( http://zxm.speccy.cz/realspec/ ) appear to struggle with some of the more complex tape protections
3641
3742-->
3843
r18720r18721
344349      </part>
345350   </software>
346351
347   <!-- loader fails before title screen, works in other emus -->
348   <software name="batmana" cloneof="batman" supported="no">
352   <!-- OK -->
353   <software name="batmana" cloneof="batman" >
349354      <description>Batman (set 2)</description>
350355      <year>1986</year>
351356      <publisher>Ocean</publisher>
r18720r18721
356361      </part>
357362   </software>
358363
359   <!-- loader fails, doesn't boot after countdown completes, works in other emus -->
360   <software name="batmanb" cloneof="batman" supported="no">
364   <!-- OK -->
365  <!-- has load timer -->
366   <software name="batmanb" cloneof="batman" >
361367      <description>Batman (set 3)</description>
362368      <year>1986</year>
363369      <publisher>Ocean</publisher>
r18720r18721
368374      </part>
369375   </software>
370376
371   <!-- loader fails after first block is loaded, suspect image, doesn't even run in 'realspectrum' -->
377   <!-- Unsupported block type (0x19 - Generalized Data Block) encountered -->
372378   <software name="batmanc" cloneof="batman" supported ="no">
373379      <description>Batman (set 4)</description>
374380      <year>1986</year>
r18720r18721
381387   </software>
382388
383389   <!-- OK -->
390  <!-- colourful loader -->
384391   <software name="batmand" cloneof="batman">
385392      <description>Batman (set 5)</description>
386393      <year>1986</year>
r18720r18721
392399      </part>
393400   </software>
394401
395   <!-- loader fails after first block is loaded, works in other emus -->
396   <software name="batmane" cloneof="batman" supported="no">
402   <!-- OK -->
403   <software name="batmane" cloneof="batman">
397404      <description>Batman (set 6)</description>
398405      <year>1986</year>
399406      <publisher>Ocean</publisher>
r18720r18721
404411      </part>
405412   </software>
406413
407   <!-- loader fails before title screen -->
408   <software name="batmanf" cloneof="batman" supported="no">
414   <!-- OK -->
415   <software name="batmanf" cloneof="batman">
409416      <description>Batman (set 7)</description>
410417      <year>1986</year>
411418      <publisher>Ocean</publisher>
r18720r18721
416423      </part>
417424   </software>
418425
419   <!-- MESS doesn't see full length of tape?, suspect image-->
420   <software name="batmang" cloneof="batman">
426   <!-- Unsupported block type (0x19 - Generalized Data Block) encountered -->
427   <software name="batmang" cloneof="batman" supported="no">
421428      <description>Batman (set 8)</description>
422429      <year>1986</year>
423430      <publisher>Ocean</publisher>
trunk/src/lib/formats/tzx_cas.c
r18720r18721
8080{
8181   int pos = sizeof(TZX_HEADER) + 2;
8282   int max_block_count = INITIAL_MAX_BLOCK_COUNT;
83
83   int loopcount = 0, loopoffset = 0;
8484   blocks = (UINT8**)malloc(max_block_count * sizeof(UINT8*));
8585   memset(blocks,0,max_block_count);
8686   block_count = 0;
r18720r18721
134134         datasize = casdata[pos] + (casdata[pos + 1] << 8) + (casdata[pos + 2] << 16);
135135         pos += 3 + datasize;
136136         break;
137      case 0x20: case 0x23: case 0x24:
137      case 0x20: case 0x23:
138138         pos += 2;
139139         break;
140
141      case 0x24:
142         loopcount = casdata[pos] + (casdata[pos + 1] << 8);
143         pos +=2;
144         loopoffset = pos;
145         break;
146
140147      case 0x21: case 0x30:
141148         datasize = casdata[pos];
142149         pos += 1 + datasize;
143150         break;
144      case 0x22: case 0x25: case 0x27:
151      case 0x22: case 0x27:
145152         break;
153
154      case 0x25:
155         if (loopcount>0)
156         {
157            pos = loopoffset;
158            loopcount--;
159         }
160         break;
161
146162      case 0x26:
147163         datasize = casdata[pos] + (casdata[pos + 1] << 8);
148164         pos += 2 + 2 * datasize;
r18720r18721
313329
314330   wave_data = WAVE_LOW;
315331
332   int loopcount = 0, loopoffset = 0;
333
316334   while (current_block < block_count)
317335   {
318336      int   pause_time;
r18720r18721
322340      UINT8 *cur_block = blocks[current_block];
323341      UINT8 block_type = cur_block[0];
324342
343
325344   /* Uncomment this to include into error.log a list of the types each block */
326//      LOG_FORMATS("tzx_cas_fill_wave: block %d, block_type %02x\n", current_block, block_type);
345   LOG_FORMATS("tzx_cas_fill_wave: block %d, block_type %02x\n", current_block, block_type);
327346
328347      switch (block_type)
329348      {
r18720r18721
460479         LOG_FORMATS("Please use a .tzx handling utility to split the merged tape files.\n");
461480         current_block++;
462481         break;
463      case 0x15:   /* Direct Recording */
464      case 0x18:   /* CSW Recording */
465      case 0x19:   /* Generalized Data Block */
482      case 0x24:   /* Loop Start */
483         loopcount = cur_block[1] + (cur_block[2] << 8);
484         current_block++;
485         loopoffset = current_block;
486
487         LOG_FORMATS("loop start %d %d\n",  loopcount, current_block);
488         break;
489      case 0x25:   /* Loop End */
490         if (loopcount>0)
491         {
492            current_block = loopoffset;
493            loopcount--;
494            LOG_FORMATS("do loop\n");
495         }
496         else
497         {
498            current_block++;
499         }         
500         break;
501
466502      case 0x21:   /* Group Start */
467503      case 0x22:   /* Group End */
468504      case 0x23:   /* Jump To Block */
469      case 0x24:   /* Loop Start */
470      case 0x25:   /* Loop End */
471505      case 0x26:   /* Call Sequence */
472506      case 0x27:   /* Return From Sequence */
473507      case 0x28:   /* Select Block */
r18720r18721
477511         LOG_FORMATS("Unsupported block type (%02x) encountered.\n", block_type);
478512         current_block++;
479513         break;
514
515      case 0x15:   /* Direct Recording */
516         // having this missing is fatal
517         printf("Unsupported block type (0x15 - Direct Recording) encountered.\n");
518         current_block++;
519         break;
520
521      case 0x18:   /* CSW Recording */
522         // having this missing is fatal
523         printf("Unsupported block type (0x15 - CSW Recording) encountered.\n");
524         current_block++;
525         break;
526
527      case 0x19:   /* Generalized Data Block */
528         // having this missing is fatal
529         printf("Unsupported block type (0x19 - Generalized Data Block) encountered.\n");
530         current_block++;
531         break;
532
480533      }
481534   }
482535   return size;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team