Previous 15994 Revisions Next

r8314 Friday 25th June, 2010 at 08:53:04 UTC by Fabio Priuli
[VG5K] Improved emulation (fixing some games like Mission Omega & Helicopter) and added support for .k7 VG5k tapes to castool [Sandro Ronco]
[src/mess/drivers]vg5k.c
[src/mess/formats]vg5k_cas.c
[src/mess/tools/castool]castool.mak main.c
[src/mess/video]ef9345.c

src/mess/tools/castool/main.c
r8313r8314
4444#include "formats/trs_cas.h"
4545#include "formats/tzx_cas.h"
4646#include "formats/uef_cas.h"
47#include "formats/vg5k_cas.h"
4748#include "formats/vt_cas.h"
4849#include "formats/zx81_p.h"
4950
r8313r8314
8788   {"tzx", tzx_cassette_formats               ,"ZX Spectrum"},
8889   {"cdt", cdt_cassette_formats               ,"Amstrad CPC"},
8990   {"uef", uef_cassette_formats               ,"Acorn Electron"},
91   {"vg5k", vg5k_cassette_formats             ,"VG 5000 k7"},
9092   {"vtech1", vtech1_cassette_formats         ,"Video Technology Laser 110-310"},
9193   {"vtech2", vtech2_cassette_formats         ,"Video Technology Laser 350-700"},
9294   {"zx81_p", zx81_p_format                   ,"Sinclair ZX81"},
src/mess/tools/castool/castool.mak
r8313r8314
5959   $(MESS_FORMATS)/trs_cas.o           \
6060   $(MESS_FORMATS)/tzx_cas.o           \
6161   $(MESS_FORMATS)/uef_cas.o           \
62   $(MESS_FORMATS)/vg5k_cas.o          \
6263   $(MESS_FORMATS)/vt_cas.o            \
6364   $(MESS_FORMATS)/zx81_p.o          \
6465   $(MESS_FORMATS)/ioprocs.o         \
src/mess/video/ef9345.c
r8313r8314
829829{
830830   ef9345_t *ef9345 = get_safe_token(device);
831831
832   if(offset & 8)
833      ef9345_exec(ef9345, ef9345->registers[0] & 0xff);
834
835832   if(offset & 7)
836833      return ef9345->registers[offset & 7];
837834
src/mess/formats/vg5k_cas.c
r8313r8314
125125      /* Identify type of block */
126126      if (casdata[data_pos] == 0xd3)
127127      {
128         /* head block have fixed size of 20 byte */
128         /* head block have fixed size of 32 byte */
129129         block_size = 0x20;
130130
131131         /* 1 sec of silence before the head block */
132132         sample_count += vg5k_cas_silence(buffer, sample_count, 44100);
133133
134         /* head block starts with 15000 samples of synchro */
135         sample_count += vg5k_k7_synchro( buffer, sample_count, 15000 );
134         /* head block starts with 30000 samples of synchro */
135         sample_count += vg5k_k7_synchro( buffer, sample_count, 30000 );
136136      }
137137      else if (casdata[data_pos] == 0xd6)
138138      {
r8313r8314
142142         /* 10000 samples of silence before the data block */
143143         sample_count += vg5k_cas_silence(buffer, sample_count, 10000);
144144
145         /* data block starts with 3600 samples of synchro */
146         sample_count += vg5k_k7_synchro( buffer, sample_count, 3600);
145         /* data block starts with 7200 samples of synchro */
146         sample_count += vg5k_k7_synchro( buffer, sample_count, 7200);
147147      }
148148      else
149149         return -1;
src/mess/drivers/vg5k.c
r8313r8314
121121{
122122   vg5k_state *vg5k = (vg5k_state *)space->machine->driver_data;
123123
124   dac_signed_data_w(vg5k->dac, data <<2);
124   dac_data_w(vg5k->dac, data <<2);
125
126   if (data == 0x03)
127      cassette_output(vg5k->cassette, +1);
128   else if (data == 0x02)
129      cassette_output(vg5k->cassette, -1);
130   else
131      cassette_output(vg5k->cassette, 0);
125132}
126133
127134
r8313r8314
268275INPUT_PORTS_END
269276
270277
278static TIMER_CALLBACK( z80_irq_clear )
279{
280   cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
281}
282
283
271284static TIMER_CALLBACK( z80_irq )
272285{
273   cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
286   cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
287
288   timer_set(machine, ATTOTIME_IN_USEC(100), NULL, 0, z80_irq_clear);
274289}
275290
276291static TIMER_DEVICE_CALLBACK( vg5k_scanline )
r8313r8314
363378   300               /* screen height */
364379};
365380
366static const struct CassetteOptions vg5kr_cassette_options =
381static const struct CassetteOptions vg5k_cassette_options =
367382{
368383   1,      /* channels */
369384   16,      /* bits per sample */
r8313r8314
373388static const cassette_config vg5k_cassette_config =
374389{
375390   vg5k_cassette_formats,
376   &vg5kr_cassette_options,
391   &vg5k_cassette_options,
377392   (cassette_state)(CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER)
378393};
379394

Previous 15994 Revisions Next


© 1998-2018 The MESS Team