Previous 15994 Revisions Next

r8762 Wednesday 11th August, 2010 at 23:28:03 UTC by Angelo Salese
[JR-200]: Some improvements
[src/mess/drivers]jr200.c

src/mess/drivers/jr200.c
r8761r8762
77    http://www.armchairarcade.com/neo/node/1598
88
99   TODO:
10   - Timings are basically screwed, it's too fast in idle mode, too slow
11     when the beeper fires for a syntax error;
10   - Timings are basically screwed, it takes too much to load the POST but
11     then the cursor blink is too fast
12   - keyboard MCU irq and data polling simulation should be inside a timer
13     callback
1214   - MN1544 4-bit CPU core and ROM dump
1315
1416****************************************************************************/
r8761r8762
2022static UINT8 *jr200_vram,*jr200_cram;
2123static UINT8 jr200_border_col;
2224
25/* TODO: double check this */
2326static const UINT8 jr200_keycodes[4][9][8] =
2427{
2528   /* unshifted */
r8761r8762
2932   { 0x37, 0x38, 0x39, 0x09, 0x71, 0x77, 0x65, 0x72 },
3033   { 0x74, 0x79, 0x75, 0x69, 0x6f, 0x70, 0x40, 0x5b },
3134   { 0x1b, 0x2b, 0x34, 0x35, 0x36, 0x61, 0x73, 0x64 },
32   { 0x66, 0x67, 0x68, 0x6a, 0x6b, 0x6c, 0x3b, 0x3a },
35   { 0x66, 0x67, 0x68, 0x6a, 0x6b, 0x6c, 0x3b, 0x27 },
3336   { 0x0d, 0x0a, 0x1e, 0x31, 0x32, 0x33, 0x7a, 0x78 },
3437   { 0x63, 0x76, 0x62, 0x6e, 0x6d, 0x2c, 0x2e, 0x2f },
3538   { 0x1d, 0x1f, 0x1c, 0x30, 0x2e, 0x20, 0x03, 0x00 }
r8761r8762
4245   { 0x37, 0x38, 0x39, 0x09, 0x51, 0x57, 0x45, 0x52 },
4346   { 0x54, 0x59, 0x55, 0x49, 0x4f, 0x50, 0x40, 0x7b },
4447   { 0x1b, 0x2b, 0x34, 0x35, 0x36, 0x41, 0x53, 0x44 },
45   { 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x2b, 0x2a },
48   { 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x3a, 0x22 },
4649   { 0x0d, 0x0a, 0x1e, 0x31, 0x32, 0x33, 0x5a, 0x58 },
4750   { 0x43, 0x56, 0x42, 0x4e, 0x4d, 0x3c, 0x3e, 0x3f },
4851   { 0x1d, 0x1f, 0x1c, 0x30, 0x2e, 0x20, 0x00, 0x00 }
r8761r8762
97100         {
98101            for(xi=0;xi<8;xi++)
99102            {
100               UINT8 *gfx_data; //= memory_region(screen->machine, "gfx_ram");
103               UINT8 *gfx_data;
101104
102105               if(attr & 0x80) //bitmap mode
103106               {
r8761r8762
105108                     this mode draws 4 x 4 dot blocks, by combining lower 6 bits of tile and attribute vram
106109
107110                     tile def
108                     --xx x--- up-right
109                     ---- -xxx up-left
111                     00xx x--- up-right
112                     00-- -xxx up-left
110113                     attr def
111                     --xx x--- down-right
112                     ---- -xxx down-left
114                     10xx x--- down-right
115                     10-- -xxx down-left
113116                  */
114117                  int step;
115118
r8761r8762
118121
119122                  pen = ((((attr & 0x3f) << 6) | (tile & 0x3f)) >> (step)) & 0x07;
120123               }
121               else
124               else // tile mode
122125               {
123126                  gfx_data = memory_region(screen->machine, attr & 0x40 ? "pcg" : "gfx_ram");
124127
r8761r8762
128131               *BITMAP_ADDR16(bitmap, y*8+yi+16, x*8+xi+16) = screen->machine->pens[pen];
129132            }
130133         }
131         //drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[(col & 0x40) >> 6], code, col & 0x3f, 0, 0, 16 + j * 8, 16 + (i >> 5) * 8);
132134      }
133         //}
134135   }
135136
136137   return 0;
r8761r8762
253254   return 1; // needs this to be high otherwise system refuses to boot
254255}
255256
257static READ8_HANDLER( jr200_tape_r )
258{
259   return mame_rand(space->machine);
260}
261
262static READ8_HANDLER( jr200_tape2_r )
263{
264   return mame_rand(space->machine);
265}
266
267
268static READ8_HANDLER( mcu_portd_r )
269{
270   /*
271   ---x ---- printer status ready (ACTIVE HIGH)
272   */
273
274   return 0x10;
275}
276
277
278static ADDRESS_MAP_START(jr200_mem, ADDRESS_SPACE_PROGRAM, 8)
256279/*
257280    0000-3fff RAM
258281    4000-4fff RAM ( 4k expansion)
259282    4000-7fff RAM (16k expansion)
260283    4000-bfff RAM (32k expansion)
261284*/
262
263static ADDRESS_MAP_START(jr200_mem, ADDRESS_SPACE_PROGRAM, 8)
264285   AM_RANGE(0x0000, 0x7fff) AM_RAM
265286
266287   AM_RANGE(0xa000, 0xbfff) AM_ROM
r8761r8762
272293
273294//   0xc800 - 0xcfff I / O area
274295   AM_RANGE(0xc801, 0xc801) AM_READ(mcu_keyb_r)
275   AM_RANGE(0xc803, 0xc803) AM_WRITENOP //used in IRQ routine (0x01 -> 0x43)
296   AM_RANGE(0xc803, 0xc803) AM_READ(mcu_portd_r) AM_WRITENOP //used in IRQ routine (0x01 -> 0x43)
297   AM_RANGE(0xc805, 0xc805) AM_WRITENOP //printer LPT port
276298//   AM_RANGE(0xc806, 0xc806) //writes 0x78 there
277//   AM_RANGE(0xc807, 0xc807) //bit 6 enables tape play
299   AM_RANGE(0xc807, 0xc807) AM_READ(jr200_tape_r) //W bit 6 enables tape play
300   AM_RANGE(0xc80e, 0xc80e) AM_READ(jr200_tape2_r)
278301   AM_RANGE(0xc819, 0xc819) AM_WRITE(jr200_beep_w)
279302   AM_RANGE(0xc81a, 0xc81b) AM_WRITE(jr200_beep_freq_w)
280303   AM_RANGE(0xc81c, 0xc81c) AM_READ(jr200_system_latch_1_r)
r8761r8762
445468
446469static MACHINE_DRIVER_START( jr200 )
447470   /* basic machine hardware */
448   MDRV_CPU_ADD("maincpu", M6802, 890000) /* MN1800A */
471   MDRV_CPU_ADD("maincpu", M6802, 4000000) /* MN1800A, ? Mhz */
449472   MDRV_CPU_PROGRAM_MAP(jr200_mem)
450473   MDRV_CPU_VBLANK_INT("screen", jr200_irq)
451474   MDRV_CPU_PERIODIC_INT(jr200_nmi,20)
r8761r8762
465488   MDRV_SCREEN_VISIBLE_AREA(0, 16 + 256 + 16 - 1, 0, 16 + 192 + 16 - 1)
466489
467490   MDRV_GFXDECODE(jr200)
468   MDRV_PALETTE_LENGTH(128)
491   MDRV_PALETTE_LENGTH(8)
469492   MDRV_PALETTE_INIT(jr200)
470493
471494   MDRV_VIDEO_START(jr200)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team