02677: eprom, eprom2: missing graphical brightness effect, verified on real machine w/video

Note that the RGB output circuitry uses many transistors and I don't really understand it.
This commit is contained in:
Nicola Salmoria 2008-12-07 17:22:40 +00:00
parent 872ec20658
commit 3d114f0b25
3 changed files with 82 additions and 3 deletions

View File

@ -12,6 +12,10 @@
Known bugs: Known bugs:
* none at this time * none at this time
TODO:
* the RGB generator visible in the schematics is not properly modeled.
**************************************************************************** ****************************************************************************
Memory map (TBA) Memory map (TBA)
@ -106,13 +110,19 @@ static READ16_HANDLER( adc_r )
static WRITE16_HANDLER( eprom_latch_w ) static WRITE16_HANDLER( eprom_latch_w )
{ {
/* reset extra CPU */
if (ACCESSING_BITS_0_7) if (ACCESSING_BITS_0_7)
{ {
/* bit 0: reset extra CPU */
if (data & 1) if (data & 1)
cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE); cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE);
else else
cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE); cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE);
/* bits 1-4: screen intensity */
eprom_screen_intensity = (data & 0x1e) >> 1;
/* bit 5: video disable */
eprom_video_disable = (data & 0x20);
} }
} }
@ -164,7 +174,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w) AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
AM_RANGE(0x360020, 0x360021) AM_WRITE(atarigen_sound_reset_w) AM_RANGE(0x360020, 0x360021) AM_WRITE(atarigen_sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_WRITE(atarigen_sound_w) AM_RANGE(0x360030, 0x360031) AM_WRITE(atarigen_sound_w)
AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE(paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_BASE(&paletteram16)
AM_RANGE(0x3f0000, 0x3f1fff) AM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) AM_RANGE(0x3f0000, 0x3f1fff) AM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield)
AM_RANGE(0x3f2000, 0x3f3fff) AM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) AM_RANGE(0x3f2000, 0x3f3fff) AM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram)
AM_RANGE(0x3f4000, 0x3f4f7f) AM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha) AM_RANGE(0x3f4000, 0x3f4f7f) AM_WRITE(atarigen_alpha_w) AM_BASE(&atarigen_alpha)
@ -189,7 +199,7 @@ static ADDRESS_MAP_START( guts_map, ADDRESS_SPACE_PROGRAM, 16 )
// AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w) // AM_RANGE(0x360010, 0x360011) AM_WRITE(eprom_latch_w)
AM_RANGE(0x360020, 0x360021) AM_WRITE(atarigen_sound_reset_w) AM_RANGE(0x360020, 0x360021) AM_WRITE(atarigen_sound_reset_w)
AM_RANGE(0x360030, 0x360031) AM_WRITE(atarigen_sound_w) AM_RANGE(0x360030, 0x360031) AM_WRITE(atarigen_sound_w)
AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM_WRITE(paletteram16_IIIIRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16) AM_RANGE(0x3e0000, 0x3e0fff) AM_RAM AM_BASE(&paletteram16)
AM_RANGE(0xff0000, 0xff1fff) AM_WRITE(atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper) AM_RANGE(0xff0000, 0xff1fff) AM_WRITE(atarigen_playfield_upper_w) AM_BASE(&atarigen_playfield_upper)
AM_RANGE(0xff8000, 0xff9fff) AM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield) AM_RANGE(0xff8000, 0xff9fff) AM_WRITE(atarigen_playfield_w) AM_BASE(&atarigen_playfield)
AM_RANGE(0xffa000, 0xffbfff) AM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram) AM_RANGE(0xffa000, 0xffbfff) AM_WRITE(atarimo_0_spriteram_w) AM_BASE(&atarimo_0_spriteram)

View File

@ -13,3 +13,6 @@ VIDEO_START( guts );
VIDEO_UPDATE( guts ); VIDEO_UPDATE( guts );
void eprom_scanline_update(const device_config *screen, int scanline); void eprom_scanline_update(const device_config *screen, int scanline);
extern int eprom_screen_intensity;
extern int eprom_video_disable;

View File

@ -10,6 +10,44 @@
#include "thunderj.h" #include "thunderj.h"
int eprom_screen_intensity;
int eprom_video_disable;
/*************************************
*
* Palette
*
*************************************/
static void update_palette(running_machine *machine)
{
int color;
for (color = 0; color < 0x800; ++color)
{
int i, r, g, b;
UINT16 const data = paletteram16[color];
/* FIXME this is only a very crude approximation of the palette output.
* The circuit involves a dozen transistors and probably has an output
* which is quite different from this.
* This is, however, good enough to match the video and description
* of MAMETesters bug #02677.
*/
i = (((data >> 12) & 15) + 1) * (4 - eprom_screen_intensity);
if (i < 0)
i = 0;
r = ((data >> 8) & 15) * i / 4;
g = ((data >> 4) & 15) * i / 4;
b = ((data >> 0) & 15) * i / 4;
palette_set_color_rgb(machine, color, r, g, b);
}
}
/************************************* /*************************************
* *
@ -102,6 +140,12 @@ VIDEO_START( eprom )
/* initialize the alphanumerics */ /* initialize the alphanumerics */
atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32); atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
/* global brightess (not used by klax and guts) */
eprom_screen_intensity = 0;
/* video disabled (not used?) */
eprom_video_disable = 0;
} }
@ -153,6 +197,12 @@ VIDEO_START( guts )
/* initialize the alphanumerics */ /* initialize the alphanumerics */
atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32); atarigen_alpha_tilemap = tilemap_create(get_alpha_tile_info, tilemap_scan_rows, 8,8, 64,32);
tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0); tilemap_set_transparent_pen(atarigen_alpha_tilemap, 0);
/* global brightess (not used by guts) */
eprom_screen_intensity = 0;
/* video disable (not used by guts) */
eprom_video_disable = 0;
} }
@ -191,6 +241,14 @@ VIDEO_UPDATE( eprom )
bitmap_t *mobitmap; bitmap_t *mobitmap;
int x, y, r; int x, y, r;
if (eprom_video_disable)
{
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
return 0;
}
update_palette(screen->machine);
/* draw the playfield */ /* draw the playfield */
tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);
@ -337,6 +395,14 @@ VIDEO_UPDATE( guts )
bitmap_t *mobitmap; bitmap_t *mobitmap;
int x, y, r; int x, y, r;
if (eprom_video_disable)
{
bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
return 0;
}
update_palette(screen->machine);
/* draw the playfield */ /* draw the playfield */
tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0); tilemap_draw(bitmap, cliprect, atarigen_playfield_tilemap, 0, 0);