Previous 199869 Revisions Next

r34503 Monday 19th January, 2015 at 23:32:43 UTC by Angelo Salese
Debugging ... (yeah, already somehow playable)
[src/mame/drivers]aleck64.c

trunk/src/mame/drivers/aleck64.c
r243014r243015
3030          Seta E92 Mother PCB
3131         |---------------------------------------------|
3232       --|     VOL_POT                                 |
33       |R|TA8139S                                      |
33       |R|TA8139S                                      |-
3434  RCA  --|  TA8201         BU9480                      |
3535 AUDIO   |                                             |
3636 PLUGS --|           AMP-NUS                           |
r243014r243015
178178public:
179179   aleck64_state(const machine_config &mconfig, device_type type, const char *tag)
180180      : n64_state(mconfig, type, tag),
181        m_e90_vram(*this,"e90vram"),
181182         m_dip_read_offset(0) { }
182183
184   optional_shared_ptr<UINT32> m_e90_vram;
183185   DECLARE_DRIVER_INIT(aleck64);
184186   DECLARE_WRITE32_MEMBER(aleck_dips_w);
185187   DECLARE_READ32_MEMBER(aleck_dips_r);
186188   DECLARE_READ16_MEMBER(e90_prot_r);
187189   DECLARE_WRITE16_MEMBER(e90_prot_w);
190   UINT32 screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
188191private:
189192   UINT32 m_dip_read_offset;
190193};
r243014r243015
349352
350353static ADDRESS_MAP_START( e90_map, AS_PROGRAM, 32, aleck64_state )
351354   AM_IMPORT_FROM( n64_map )
352   AM_RANGE(0xd0000000, 0xd0000fff) AM_RAM // x/y offsets
355   AM_RANGE(0xd0000000, 0xd0000fff) AM_RAM AM_SHARE("e90vram")// x/y offsets
353356   AM_RANGE(0xd0010000, 0xd0010fff) AM_RAM // RGB555 palette
354357   AM_RANGE(0xd0030000, 0xd003001f) AM_READWRITE16(e90_prot_r, e90_prot_w,0xffffffff)
355358ADDRESS_MAP_END
r243014r243015
873876   MCFG_N64_PERIPHS_ADD("rcp");
874877MACHINE_CONFIG_END
875878
879UINT32 aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
880{
881   static int testx,testy;
882   bitmap.fill(0, cliprect);
883   screen_update_n64(screen,bitmap,cliprect);
884   
885   if(machine().input().code_pressed(KEYCODE_Z))
886      testx++;
887
888   if(machine().input().code_pressed(KEYCODE_X))
889      testx--;
890
891   if(machine().input().code_pressed_once(KEYCODE_A))
892      testy++;
893
894   if(machine().input().code_pressed_once(KEYCODE_S))
895      testy--;
896     
897   popmessage("%d %d",testx,testy);
898   for(int offs=0;offs<0x1000/4;offs+=2)
899   {
900      int xi,yi;
901      //UINT16 tile = m_e90_vram[offs] >> 16;
902      UINT16 pal = m_e90_vram[offs] & 0x7f; // guess: 0x1000 entries / word / 4bpp = 0x7f
903      INT16 x = m_e90_vram[offs+1] >> 16;
904      INT16 y = m_e90_vram[offs+1] & 0xffff;
905      x>>=1;
906     
907      for(yi=0;yi<8;yi++)
908         for(xi=0;xi<8;xi++)
909         {
910            int res_x,res_y;
911            res_x = x+xi + 4;
912            res_y = y+yi + 7;
913           
914            if(cliprect.contains(res_x, res_y))
915               bitmap.pix32(res_y, res_x) = pal << 16;
916         }
917   }
918   return 0;
919}
920
876921static MACHINE_CONFIG_DERIVED( a64_e90, aleck64 )
877922   MCFG_CPU_MODIFY("maincpu")
878923   MCFG_CPU_PROGRAM_MAP(e90_map)
924
925   MCFG_SCREEN_MODIFY("screen")
926   MCFG_SCREEN_UPDATE_DRIVER(aleck64_state, screen_update_e90)   
879927MACHINE_CONFIG_END
880928
881929DRIVER_INIT_MEMBER(aleck64_state,aleck64)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team