Previous 15994 Revisions Next

r3726 Sunday 30th November, 2008 at 16:23:03 UTC by Nathan Woods
More deprecat.h removal
[src/mess/drivers]mbee.c vtech1.c

src/mess/drivers/mbee.c
r3725r3726
5555#include "devices/cassette.h"
5656#include "devices/z80bin.h"
5757#include "sound/speaker.h"
58#include "deprecat.h"
5958
6059static const device_config *cassette_device_image(running_machine *machine)
6160{
r3725r3726
545544
546545static Z80BIN_EXECUTE( mbee )
547546{
548   memory_write_word_16le(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xa6, execute_address);         /* fix the EXEC command */
547   const device_config *cpu = cputag_get_cpu(machine, "main");
548   const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
549549
550   memory_write_word_16le(space, 0xa6, execute_address);         /* fix the EXEC command */
551
550552   if (autorun)
551553   {
552      memory_write_word_16le(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xa2, execute_address);      /* fix warm-start vector to get around some copy-protections */
553      cpu_set_reg(cputag_get_cpu(Machine, "main"), REG_PC, execute_address);
554      memory_write_word_16le(space, 0xa2, execute_address);      /* fix warm-start vector to get around some copy-protections */
555      cpu_set_reg(cpu, REG_PC, execute_address);
554556   }
555557   else
556558   {
557      memory_write_word_16le(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xa2, 0x8517);
559      memory_write_word_16le(space, 0xa2, 0x8517);
558560   }
559561}
560562
561563static QUICKLOAD_LOAD( mbee )
562564{
565   const device_config *cpu = cputag_get_cpu(image->machine, "main");
566   const address_space *space = cputag_get_address_space(image->machine, "main", ADDRESS_SPACE_PROGRAM);
563567   UINT16 i, j;
564568   UINT8 data, sw = input_port_read(image->machine, "CONFIG") & 1;   /* reading the dipswitch: 1 = autorun */
565569
r3725r3726
573577         if (image_fread(image, &data, 1) != 1) return INIT_FAIL;
574578
575579         if ((j < mbee_size) || (j > 0xefff))
576            memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), j, data);
580            memory_write_byte(space, j, data);
577581         else
578582            return INIT_FAIL;
579583      }
580584
581585      if (sw)
582586      {
583         memory_write_word_16le(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xa2,0x801e);   /* fix warm-start vector to get around some copy-protections */
584         cpu_set_reg(cputag_get_cpu(Machine, "main"), REG_PC, 0x801e);
587         memory_write_word_16le(space, 0xa2,0x801e);   /* fix warm-start vector to get around some copy-protections */
588         cpu_set_reg(cpu, REG_PC, 0x801e);
585589      }
586590      else
587         memory_write_word_16le(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0xa2,0x8517);
591         memory_write_word_16le(space, 0xa2,0x8517);
588592   }
589593   else if (!mame_stricmp(image_filetype(image), "com"))
590594   {
r3725r3726
596600         if (image_fread(image, &data, 1) != 1) return INIT_FAIL;
597601
598602         if ((j < mbee_size) || (j > 0xefff))
599            memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), j, data);
603            memory_write_byte(space, j, data);
600604         else
601605            return INIT_FAIL;
602606      }
603607
604      if (sw) cpu_set_reg(cputag_get_cpu(Machine, "main"), REG_PC, 0x100);
608      if (sw) cpu_set_reg(cpu, REG_PC, 0x100);
605609   }
606610
607611   return INIT_PASS;
src/mess/drivers/vtech1.c
r3725r3726
113113#include "devices/printer.h"
114114#include "devices/z80bin.h"
115115#include "formats/vt_cas.h"
116#include "deprecat.h"
117116
118117static Z80BIN_EXECUTE(vtech1);
119118
r3725r3726
423422
424423static Z80BIN_EXECUTE( vtech1 )
425424{
425   const device_config *cpu = cputag_get_cpu(machine, "main");
426   const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
427
426428   /* A Microsoft Basic program needs some manipulation before it can be run.
427429   1. A start address of 7ae9 indicates a basic program which needs its pointers fixed up.
428430   2. If autorun is turned off, the pointers still need fixing, but then display READY.
r3725r3726
430432      7ae9 = start (load) address of a conventional basic program
431433      791e = custom routine to fix basic pointers */
432434
433   memory_write_word_16le(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0x791c, end_address + 1);
434   memory_write_word_16le(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0x781e, execute_address);
435   memory_write_word_16le(space, 0x791c, end_address + 1);
436   memory_write_word_16le(space, 0x781e, execute_address);
435437
436438   if (start_address == 0x7ae9)
437439   {
r3725r3726
445447         0xc3, 0xcf, 0x36,};   // JP 36CF   ;enter bios at autorun point
446448
447449      for (i = 0; i < ARRAY_LENGTH(data); i++)
448         memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0x791e + i, data[i]);
450         memory_write_byte(space, 0x791e + i, data[i]);
449451
450452      if (!autorun)
451         memory_write_byte(cputag_get_address_space(Machine,"main",ADDRESS_SPACE_PROGRAM), 0x7929, 0xb6);   /* turn off autorun */
453         memory_write_byte(space, 0x7929, 0xb6);   /* turn off autorun */
452454
453      cpu_set_reg(cputag_get_cpu(Machine, "main"), REG_PC, 0x791e);
455      cpu_set_reg(cpu, REG_PC, 0x791e);
454456   }
455457   else
456458   {
457459      if (autorun)
458         cpu_set_reg(cputag_get_cpu(Machine, "main"), REG_PC, execute_address);
460         cpu_set_reg(cpu, REG_PC, execute_address);
459461   }
460462}
461463

Previous 15994 Revisions Next


© 1998-2018 The MESS Team