Debugging ... (yeah, already somehow playable)

This commit is contained in:
Angelo Salese 2015-01-20 00:32:43 +01:00
parent 1774358f2b
commit 206c44a0e9

View File

@ -30,7 +30,7 @@ PCB Layout
Seta E92 Mother PCB
|---------------------------------------------|
--| VOL_POT |
|R|TA8139S |
|R|TA8139S |-
RCA --| TA8201 BU9480 |
AUDIO | |
PLUGS --| AMP-NUS |
@ -178,13 +178,16 @@ class aleck64_state : public n64_state
public:
aleck64_state(const machine_config &mconfig, device_type type, const char *tag)
: n64_state(mconfig, type, tag),
m_e90_vram(*this,"e90vram"),
m_dip_read_offset(0) { }
optional_shared_ptr<UINT32> m_e90_vram;
DECLARE_DRIVER_INIT(aleck64);
DECLARE_WRITE32_MEMBER(aleck_dips_w);
DECLARE_READ32_MEMBER(aleck_dips_r);
DECLARE_READ16_MEMBER(e90_prot_r);
DECLARE_WRITE16_MEMBER(e90_prot_w);
UINT32 screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
private:
UINT32 m_dip_read_offset;
};
@ -349,7 +352,7 @@ WRITE16_MEMBER(aleck64_state::e90_prot_w)
static ADDRESS_MAP_START( e90_map, AS_PROGRAM, 32, aleck64_state )
AM_IMPORT_FROM( n64_map )
AM_RANGE(0xd0000000, 0xd0000fff) AM_RAM // x/y offsets
AM_RANGE(0xd0000000, 0xd0000fff) AM_RAM AM_SHARE("e90vram")// x/y offsets
AM_RANGE(0xd0010000, 0xd0010fff) AM_RAM // RGB555 palette
AM_RANGE(0xd0030000, 0xd003001f) AM_READWRITE16(e90_prot_r, e90_prot_w,0xffffffff)
ADDRESS_MAP_END
@ -873,9 +876,54 @@ static MACHINE_CONFIG_START( aleck64, aleck64_state )
MCFG_N64_PERIPHS_ADD("rcp");
MACHINE_CONFIG_END
UINT32 aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
static int testx,testy;
bitmap.fill(0, cliprect);
screen_update_n64(screen,bitmap,cliprect);
if(machine().input().code_pressed(KEYCODE_Z))
testx++;
if(machine().input().code_pressed(KEYCODE_X))
testx--;
if(machine().input().code_pressed_once(KEYCODE_A))
testy++;
if(machine().input().code_pressed_once(KEYCODE_S))
testy--;
popmessage("%d %d",testx,testy);
for(int offs=0;offs<0x1000/4;offs+=2)
{
int xi,yi;
//UINT16 tile = m_e90_vram[offs] >> 16;
UINT16 pal = m_e90_vram[offs] & 0x7f; // guess: 0x1000 entries / word / 4bpp = 0x7f
INT16 x = m_e90_vram[offs+1] >> 16;
INT16 y = m_e90_vram[offs+1] & 0xffff;
x>>=1;
for(yi=0;yi<8;yi++)
for(xi=0;xi<8;xi++)
{
int res_x,res_y;
res_x = x+xi + 4;
res_y = y+yi + 7;
if(cliprect.contains(res_x, res_y))
bitmap.pix32(res_y, res_x) = pal << 16;
}
}
return 0;
}
static MACHINE_CONFIG_DERIVED( a64_e90, aleck64 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(e90_map)
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_UPDATE_DRIVER(aleck64_state, screen_update_e90)
MACHINE_CONFIG_END
DRIVER_INIT_MEMBER(aleck64_state,aleck64)