Previous 15994 Revisions Next

r2056 Saturday 22nd March, 2008 at 11:17:10 UTC by Miodrag Milanović
[UT88][MIKRO80][SPECIAL] Update of memory map, making soft reset works
[src/mess/drivers]mikro80.c special.c ut88.c
[src/mess/includes]mikro80.h special.h ut88.h
[src/mess/machine]mikro80.c special.c ut88.c
[src/mess/video]mikro80.c special.c ut88.c

src/mess/includes/special.h
r2055r2056
1919 
2020/*----------- defined in video/special.c -----------*/
2121 
22extern UINT8 *specialist_video_ram;
23 
2224extern VIDEO_START( special );
2325extern VIDEO_UPDATE( special );
2426 
src/mess/includes/mikro80.h
r2055r2056
1818extern WRITE8_HANDLER( mikro80_tape_w );
1919 
2020/*----------- defined in video/mikro80.c -----------*/
21extern UINT8 *mikro80_video_ram;
22extern UINT8 *mikro80_cursor_ram;
2123 
2224extern const gfx_layout mikro80_charlayout;
2325 
src/mess/includes/ut88.h
r2055r2056
99 
1010 
1111/*----------- defined in machine/ut88.c -----------*/
12 
1312extern DRIVER_INIT( ut88 );
1413extern MACHINE_RESET( ut88 );
1514extern READ8_HANDLER( ut88_keyboard_r );
r2055r2056
2423 
2524/*----------- defined in video/ut88.c -----------*/
2625 
26extern UINT8 *ut88_video_ram;
2727extern const gfx_layout ut88_charlayout;
2828 
2929extern VIDEO_START( ut88 );
src/mess/video/special.c
r2055r2056
99 
1010#include "driver.h"
1111   
12#define SPECIALIST_VIDEO_MEMORY      0x9000   
13     
12UINT8 *specialist_video_ram;
1413 
1514VIDEO_START( special )
1615{
r2055r2056
2524   {         
2625      for (y = 0; y < 256; y++)
2726      {
28         code = program_read_byte(SPECIALIST_VIDEO_MEMORY + y + x*256);
27         code = specialist_video_ram[y + x*256];
2928         for (b = 7; b >= 0; b--)
3029         {                         
3130            *BITMAP_ADDR16(bitmap, y, x*8+(7-b)) =  (code >> b) & 0x01;
src/mess/video/mikro80.c
r2055r2056
99 
1010#include "driver.h"
1111   
12#define MIKRO80_VIDEO_MEMORY      0xE800   
13#define MIKRO80_CURSOR_MEMORY      0xE000   
12UINT8 *mikro80_video_ram;
13UINT8 *mikro80_cursor_ram;
1414     
1515const gfx_layout mikro80_charlayout =
1616{
r2055r2056
3535   {
3636      for(x = 0; x < 64; x++ )
3737      {
38         int code = program_read_byte(MIKRO80_VIDEO_MEMORY + x + y*64);       
38         int code = mikro80_video_ram[x + y*64];       
3939         drawgfx(bitmap, screen->machine->gfx[0],  code , 0, 0,0, x*8,y*8,
4040            NULL, TRANSPARENCY_NONE, 0);
4141      }
r2055r2056
4545   {
4646      for(x = 0; x < 64; x++ )
4747      {
48         int code = program_read_byte(MIKRO80_CURSOR_MEMORY + x + y*64);       
48         int code = mikro80_cursor_ram[x + y*64];       
4949         if (code == 0x80 ) {
5050            drawgfx(bitmap, screen->machine->gfx[0],  0xff , 0, 0,0, x*8,y*8,
5151               NULL, TRANSPARENCY_NONE, 0);
src/mess/video/ut88.c
r2055r2056
99 
1010#include "driver.h"
1111   
12#define UT88_VIDEO_MEMORY      0xE800 
12UINT8 *ut88_video_ram;
1313     
1414const gfx_layout ut88_charlayout =
1515{
r2055r2056
3434   {
3535      for(x = 0; x < 64; x++ )
3636      {
37         int code = program_read_byte(UT88_VIDEO_MEMORY + x + y*64);       
37         int code = ut88_video_ram[ x + y*64 ];       
3838         drawgfx(bitmap, screen->machine->gfx[0],  code , 0, 0,0, x*8,y*8,
3939            NULL, TRANSPARENCY_NONE, 0);
4040      }
src/mess/machine/special.c
r2055r2056
2222/* Driver initialization */
2323DRIVER_INIT(special)
2424{
25 
25   /* set initialy ROM to be visible on first bank */
26   UINT8 *RAM = memory_region(REGION_CPU1);   
27   memset(RAM,0x0000,0x3000); // make frist page empty by default
28  memory_configure_bank(1, 1, 2, RAM, 0x0000);
29   memory_configure_bank(1, 0, 2, RAM, 0xc000);   
2630}
2731 
2832READ8_HANDLER (specialist_8255_porta_r )
r2055r2056
8690   specialist_8255_portb = data;
8791}
8892WRITE8_HANDLER (specialist_8255_portc_w )
89{   
93{      
9094   specialist_8255_portc = data;
95   
96   cassette_output(image_from_devtype_and_index(IO_CASSETTE, 0),data & 0x80 ? 1 : -1);   
97 
98   DAC_data_w(0,data & 0x20); //beeper
99   
91100}
92101 
93102static const ppi8255_interface specialist_ppi8255_interface =
r2055r2056
101110   {specialist_8255_portc_w}
102111};
103112 
113static TIMER_CALLBACK( special_reset )
114{
115   memory_set_bank(1, 0);
116}
117 
118 
104119MACHINE_RESET( special )
105120{
121   timer_set(ATTOTIME_IN_USEC(10), NULL, 0, special_reset);
122   memory_set_bank(1, 1);   
123 
106124   ppi8255_init(&specialist_ppi8255_interface);
107125}
108126 
src/mess/machine/mikro80.c
r2055r2056
1717/* Driver initialization */
1818DRIVER_INIT(mikro80)
1919{
20   /* set initialy ROM to be visible on first bank */
21   UINT8 *RAM = memory_region(REGION_CPU1);   
22   memset(RAM,0x0000,0x0800); // make frist page empty by default
23  memory_configure_bank(1, 1, 2, RAM, 0x0000);
24   memory_configure_bank(1, 0, 2, RAM, 0xf800);   
2025}
2126 
2227READ8_HANDLER (mikro80_8255_portb_r )
r2055r2056
5459   {NULL},
5560};
5661 
62static TIMER_CALLBACK( mikro80_reset )
63{
64   memory_set_bank(1, 0);
65}
66 
5767MACHINE_RESET( mikro80 )
5868{
69   timer_set(ATTOTIME_IN_USEC(10), NULL, 0, mikro80_reset);
70   memory_set_bank(1, 1);   
5971   ppi8255_init(&mikro80_ppi8255_interface);
6072   mikro80_keyboard_line = 0;
6173}
src/mess/machine/ut88.c
r2055r2056
1313#include "devices/cassette.h"
1414#include "machine/8255ppi.h"
1515 
16 
1716static int ut88_8255_porta;
1817 
19 
2018/* Driver initialization */
2119DRIVER_INIT(ut88)
2220{
23 
21   /* set initialy ROM to be visible on first bank */
22   UINT8 *RAM = memory_region(REGION_CPU1);   
23   memset(RAM,0x0000,0x0800); // make frist page empty by default
24  memory_configure_bank(1, 1, 2, RAM, 0x0000);
25   memory_configure_bank(1, 0, 2, RAM, 0xf800);
2426}
2527 
26 
2728READ8_HANDLER (ut88_8255_portb_r )
2829{
2930   switch (ut88_8255_porta ^ 0xff) {
r2055r2056
6061   {NULL},
6162};
6263 
64static TIMER_CALLBACK( ut88_reset )
65{
66   memory_set_bank(1, 0);
67}
68 
6369MACHINE_RESET( ut88 )
6470{
71   timer_set(ATTOTIME_IN_USEC(10), NULL, 0, ut88_reset);
72   memory_set_bank(1, 1);   
6573   ppi8255_init(&ut88_ppi8255_interface);
6674   ut88_8255_porta = 0;
6775}
r2055r2056
116124      }
117125}
118126 
119static int bcd_to_7seg[16] = 
127static int hex_to_7seg[16] = 
120128   {0x3F, 0x06, 0x5B, 0x4F, 
121129    0x66, 0x6D, 0x7D, 0x07, 
122130    0x7F, 0x6F, 0x77, 0x7c, 
r2055r2056
126134{   
127135   int i;
128136   for (i=0;i<6;i++) {
129      output_set_digit_value(i, bcd_to_7seg[lcd_digit[i]]);
137      output_set_digit_value(i, hex_to_7seg[lcd_digit[i]]);
130138   }         
131139}
132140 
src/mess/drivers/special.c
r2055r2056
1212#include "cpu/i8085/i8085.h"
1313#include "includes/special.h"
1414#include "machine/8255ppi.h"
15#include "sound/dac.h"
1516#include "devices/cassette.h"
1617#include "formats/rk_cas.h"
1718 
1819/* Address maps */
1920static ADDRESS_MAP_START(specialist_mem, ADDRESS_SPACE_PROGRAM, 8)
20    AM_RANGE( 0x0000, 0x8fff ) AM_RAM  // RAM
21    AM_RANGE( 0x9000, 0xbfff ) AM_RAM  // Video RAM
21     AM_RANGE( 0x0000, 0x2fff ) AM_RAMBANK(1) // First bank
22    AM_RANGE( 0x3000, 0x8fff ) AM_RAM  // RAM     
23    AM_RANGE( 0x9000, 0xbfff ) AM_RAM  AM_BASE(&specialist_video_ram) // Video RAM
2224    AM_RANGE( 0xc000, 0xf000 ) AM_ROM  // System ROM
2325    AM_RANGE( 0xf000, 0xf700 ) AM_NOP
2426    AM_RANGE( 0xf800, 0xffff ) AM_READWRITE(specialist_keyboard_r,specialist_keyboard_w) // 8255 for keyboard
r2055r2056
161163       
162164    MDRV_VIDEO_START(special)
163165    MDRV_VIDEO_UPDATE(special)
164    MACHINE_DRIVER_END
165166 
167    /* audio hardware */
168      MDRV_SPEAKER_STANDARD_MONO("mono")
169      MDRV_SOUND_ADD(DAC, 0)
170      MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)           
171      MDRV_SOUND_ADD(WAVE, 0)
172      MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)         
173MACHINE_DRIVER_END
174 
166175 
167176/* ROM definition */
168177ROM_START( special )
src/mess/drivers/mikro80.c
r2055r2056
2020   
2121/* Address maps */
2222static ADDRESS_MAP_START(mikro80_mem, ADDRESS_SPACE_PROGRAM, 8)
23    AM_RANGE( 0x0000, 0xf7ff ) AM_RAM  // RAM
23     AM_RANGE( 0x0000, 0x07ff ) AM_RAMBANK(1) // First bank
24    AM_RANGE( 0x0800, 0xdfff ) AM_RAM  // RAM
25    AM_RANGE( 0xe000, 0xe7ff ) AM_RAM  AM_BASE(&mikro80_cursor_ram)// Video RAM
26    AM_RANGE( 0xe800, 0xefff ) AM_RAM  AM_BASE(&mikro80_video_ram) // Video RAM
27    AM_RANGE( 0xd000, 0xf7ff ) AM_RAM  // RAM
2428    AM_RANGE( 0xf800, 0xffff ) AM_ROM  // System ROM
2529ADDRESS_MAP_END
2630 
src/mess/drivers/ut88.c
r2055r2056
2828    AM_RANGE( 0x9000, 0x9fff ) AM_WRITE(ut88mini_write_led) // 7seg LED     
2929ADDRESS_MAP_END
3030 
31static ADDRESS_MAP_START(ut88_mem, ADDRESS_SPACE_PROGRAM, 8)
32    AM_RANGE( 0x0000, 0xf7ff ) AM_RAM  // RAM
31static ADDRESS_MAP_START(ut88_mem, ADDRESS_SPACE_PROGRAM, 8)         
32     AM_RANGE( 0x0000, 0x07ff ) AM_RAMBANK(1) // First bank
33    AM_RANGE( 0x0800, 0xdfff ) AM_RAM  // RAM
34    AM_RANGE( 0xe000, 0xe7ff ) AM_RAM  // Video RAM (not used)
35    AM_RANGE( 0xe800, 0xefff ) AM_RAM  AM_BASE(&ut88_video_ram) // Video RAM
36    AM_RANGE( 0xf400, 0xf7ff ) AM_RAM  // System RAM
3337    AM_RANGE( 0xf800, 0xffff ) AM_ROM  // System ROM
3438ADDRESS_MAP_END
3539 

Previous 15994 Revisions Next


© 1998-2018 The MESS Team