Previous 15994 Revisions Next

r7976 Friday 7th May, 2010 at 04:12:24 UTC by Robbbert
Mbee - fix keyboard in Asteroids Plus, Scavenger Hunt and Edasm.
Pegasus - add back cartslots at c000 and d000, fix mistake in slot 3.
Some minor fixes.
[src/emu/cpu/tms57002]tms57002.c
[src/mess/drivers]mbee.c pegasus.c
[src/mess/machine]genesis.c
[src/mess/video]mbee.c

src/emu/cpu/tms57002/tms57002.c
r7975r7976
12801280   int initial_cycles = cycles;
12811281   int ipc = -1;
12821282
1283   while(cycles > 0 && !(s->sti & (S_IDLE | IN_PLOAD | IN_CLOAD))) {
1283   while((cycles > 0) && (!(s->sti & (S_IDLE | IN_PLOAD | IN_CLOAD)))) {
12841284      int iipc;
12851285
12861286      debugger_instruction_hook(device, s->pc);
src/mess/video/mbee.c
r7975r7976
44    video hardware
55    Juergen Buchmueller <pullmoll@t-online.de>, Dec 1999
66
7   Tests of keyboard. Start mbeeic.
8
9   1. Load ASTEROIDS PLUS, stay in attract mode, hold down spacebar,
10      it should only fire bullets. If it sometimes starts turning,
11      thrusting or using the shield, then there is a problem.
12
13   2. Load SCAVENGER and make sure it doesn't go to the next level
14      until you find the Exit.
15
16   3. At the Basic prompt, type in EDASM press enter. At the memory size
17      prompt press enter. Now, make sure the keyboard   works properly.
18
19
20   The keyboard can be accessed either by using the transparent-mode
21   registers, or by monitoring the lightpen registers, or by monitoring
22   the lightpen strobe bit in the status register.
23
24   Edasm is an example of the latter; it is therefore necessary to do a
25   keyboard scan whenever the status is read.
26
727****************************************************************************/
828
929#include "emu.h"
1030#include "includes/mbee.h"
1131
32#define MBEE_WAIT_TIME 5000
1233
1334typedef struct {       // CRTC 6545
1435   UINT8 horizontal_total;
r7975r7976
4364static UINT8 m6545_color_bank = 0;
4465static UINT8 m6545_video_bank = 0;
4566static UINT8 mbee_pcg_color_latch = 0;
67static int mbee_wait_time = 0;
4668
4769UINT8 *mbee_pcgram;
4870static UINT8 *colorram;
r7975r7976
85107static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
86108
87109/* The direction keys are used by the pc85 menu. Do not know what uses the "insert" key. */
88static int keyboard_matrix_r(running_machine *machine, int offs)
110static void keyboard_matrix_r(running_machine *machine, int offs)
89111{
90112   int port = (offs >> 7) & 7;
91113   int bit = (offs >> 4) & 7;
r7975r7976
125147      crt.lpen_lo = offs & 0xff;
126148      crt.lpen_hi = (offs >> 8) & 0x03;
127149      crt.lpen_strobe = 1;
128//      logerror("mbee keyboard_matrix_r $%03X (port:%d bit:%d) = %d\n", offs, port, bit, data);
129150   }
130   return data;
131151}
132152
133153READ8_HANDLER ( mbee_color_bank_r )
r7975r7976
187207
188208static void m6545_update_strobe(running_machine *machine, int param)
189209{
190   /*int data = */keyboard_matrix_r(machine, param);
210   keyboard_matrix_r(machine, param);
191211   crt.update_strobe = 1;
192//  if( data )
193//      logerror("6545 update_strobe_cb $%04X = $%02X\n", param, data);
194212}
195213
196214READ8_HANDLER ( m6545_status_r )
r7975r7976
199217   const rectangle *visarea = video_screen_get_visible_area(screen);
200218
201219   int data = 0, y = video_screen_get_vpos(space->machine->primary_screen);
220   int x = video_screen_get_hpos(space->machine->primary_screen);
202221
222   if (!mbee_wait_time)
223      m6545_update_strobe(space->machine, x+y*64);
224
203225   if( y < visarea->min_y ||
204226      y > visarea->max_y )
205227      data |= 0x20;   /* vertical blanking */
r7975r7976
207229      data |= 0x40;   /* lpen register full */
208230   if( crt.update_strobe )
209231      data |= 0x80;   /* update strobe has occured */
210//  logerror("6545 status_r $%02X\n", data);
232
211233   return data;
212234}
213235
r7975r7976
255277      data = crt.cursor_address_lo;
256278      break;
257279   case 16:
258//      logerror("6545 lpen_hi_r $%02X (lpen:%d upd:%d)\n", crt.lpen_hi, crt.lpen_strobe, crt.update_strobe);
259280      crt.lpen_strobe = 0;
260281      crt.update_strobe = 0;
261282      data = crt.lpen_hi;
262283      break;
263284   case 17:
264//      logerror("6545 lpen_lo_r $%02X (lpen:%d upd:%d)\n", crt.lpen_lo, crt.lpen_strobe, crt.update_strobe);
265285      crt.lpen_strobe = 0;
266286      crt.update_strobe = 0;
267287      data = crt.lpen_lo;
268288      break;
269289   case 18:
270//      logerror("6545 transp_hi_r $%02X\n", crt.transp_hi);
271290      data = crt.transp_hi;
272291      break;
273292   case 19:
274//      logerror("6545 transp_lo_r $%02X\n", crt.transp_lo);
275293      data = crt.transp_lo;
276294      break;
277295   case 31:
278296      /* shared memory latch */
279297      addr = (crt.transp_hi << 8) | crt.transp_lo;
280//      logerror("6545 transp_latch $%04X\n", addr);
281298      m6545_update_strobe(space->machine, addr);
282299      break;
283300   default:
r7975r7976
388405   case 18:
389406      data &= 63;
390407      crt.transp_hi = data;
391//      logerror("6545 transp_hi_w $%02X\n", data);
392408      break;
393409   case 19:
394410      crt.transp_lo = data;
395//      logerror("6545 transp_lo_w $%02X\n", data);
411      mbee_wait_time = MBEE_WAIT_TIME;
396412      break;
397413   case 31:
398414      /* shared memory latch */
399415      addr = (crt.transp_hi << 8) | crt.transp_lo;
400//      logerror("6545 transp_latch $%04X\n", addr);
401416      m6545_update_strobe(space->machine, addr);
402417      break;
403418   default:
r7975r7976
497512            UINT8 inv=0;
498513            mem = (x + screen_home) & 0x7ff;
499514            chr = screen->machine->generic.videoram.u8[mem];
500            if ((x & 15) == 0) keyboard_matrix_r(screen->machine, x);   // actually happens for every scanline of every character, but imposes too much unnecessary overhead */
515
516            if ((x & 15) == 0)
517            {
518               if (mbee_wait_time)
519                  mbee_wait_time--;
520               else
521                  m6545_update_strobe(screen->machine, x);
522            }
523
501524            /* process cursor */
502525            if ((((!flash) && (!speed)) ||               // (5,6)=(0,0) = cursor on always
503526               ((flash) && (speed) && (framecnt & 0x10)) ||      // (5,6)=(1,1) = cycle per 32 frames
r7975r7976
547570            mem = (x + screen_home) & 0x7ff;
548571            chr = screen->machine->generic.videoram.u8[mem];
549572            col = colorram[mem] | colourm;               // read a byte of colour
550            if ((x & 15) == 0) keyboard_matrix_r(screen->machine, x);   // actually happens for every scanline of every character, but imposes too much unnecessary overhead */
551573
574            if ((x & 15) == 0)
575            {
576               if (mbee_wait_time)
577                  mbee_wait_time--;
578               else
579                  m6545_update_strobe(screen->machine, x);
580            }
581
552582            /* process cursor */
553583            if ((((!flash) && (!speed)) ||               // (5,6)=(0,0) = cursor on always
554584               ((flash) && (speed) && (framecnt & 0x10)) ||      // (5,6)=(1,1) = cycle per 32 frames
src/mess/machine/genesis.c
r7975r7976
859859   {
860860      /* Info from DGen: If SRAM does not overlap main ROM, set it active by
861861        default since a few games can't manage to properly switch it on/off. */
862      if (genesis_last_loaded_image_length <= genesis_sram_start)
862      if (genesis_last_loaded_image_length < genesis_sram_start)
863863         genesis_sram_active = 1;
864864
865865      memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa130f0, 0xa130f1, 0, 0, genesis_sram_toggle);
src/mess/drivers/mbee.c
r7975r7976
5252        (by reading port 0A) to swap between the two halves.
5353
5454    EDASM - Jump to C000, usually the editor/Assembler package.
55        Currently this works properly only on the Standard model,
56        there appears to be some sort of core issue causing it to
57        freeze on the other models.
5855
5956    MENU - Do a rombank switch to bank 5 and jump to C000 to start the Shell
6057
r7975r7976
6663    - Printer is working, but with improper code. This needs to be fixed.
6764    - Other models to be added (64k, 128k, 256k, 512k, PPC85, Teleterm)
6865    - Roms for mbeepc to be checked (I think they are correct)
66    - Fix Paste (it loses most of the characters)
6967
7068    Notes about the printer:
7169    - When computer turned on, defaults to 1200 baud serial printer
src/mess/drivers/pegasus.c
r7975r7976
296296static DEVICE_IMAGE_LOAD( pegasus_cart_3 )
297297{
298298   image_fread(image, memory_region(image->machine, "maincpu") + 0x2000, 0x1000);
299   pegasus_decrypt_rom( image->machine, 0x2000 );
300
301   return INIT_PASS;
302}
303
304static DEVICE_IMAGE_LOAD( pegasus_cart_4 )
305{
306   image_fread(image, memory_region(image->machine, "maincpu") + 0xc000, 0x1000);
299307   pegasus_decrypt_rom( image->machine, 0xc000 );
300308
301309   return INIT_PASS;
302310}
303311
312static DEVICE_IMAGE_LOAD( pegasus_cart_5 )
313{
314   image_fread(image, memory_region(image->machine, "maincpu") + 0xd000, 0x1000);
315   pegasus_decrypt_rom( image->machine, 0xd000 );
316
317   return INIT_PASS;
318}
319
304320static MACHINE_START( pegasus )
305321{
306322   pegasus_cass = devtag_get_device(machine, "cassette");
r7975r7976
350366   MDRV_CARTSLOT_ADD("cart3")
351367   MDRV_CARTSLOT_EXTENSION_LIST("bin")
352368   MDRV_CARTSLOT_LOAD(pegasus_cart_3)
369   MDRV_CARTSLOT_ADD("cart4")
370   MDRV_CARTSLOT_EXTENSION_LIST("bin")
371   MDRV_CARTSLOT_LOAD(pegasus_cart_4)
372   MDRV_CARTSLOT_ADD("cart5")
373   MDRV_CARTSLOT_EXTENSION_LIST("bin")
374   MDRV_CARTSLOT_LOAD(pegasus_cart_5)
353375   MDRV_CASSETTE_ADD( "cassette", pegasus_cassette_config )
354376MACHINE_DRIVER_END
355377

Previous 15994 Revisions Next


© 1998-2018 The MESS Team