trunk/src/mame/drivers/aleck64.c
| r243014 | r243015 | |
| 30 | 30 | Seta E92 Mother PCB |
| 31 | 31 | |---------------------------------------------| |
| 32 | 32 | --| VOL_POT | |
| 33 | | |R|TA8139S | |
| 33 | |R|TA8139S |- |
| 34 | 34 | RCA --| TA8201 BU9480 | |
| 35 | 35 | AUDIO | | |
| 36 | 36 | PLUGS --| AMP-NUS | |
| r243014 | r243015 | |
| 178 | 178 | public: |
| 179 | 179 | aleck64_state(const machine_config &mconfig, device_type type, const char *tag) |
| 180 | 180 | : n64_state(mconfig, type, tag), |
| 181 | m_e90_vram(*this,"e90vram"), |
| 181 | 182 | m_dip_read_offset(0) { } |
| 182 | 183 | |
| 184 | optional_shared_ptr<UINT32> m_e90_vram; |
| 183 | 185 | DECLARE_DRIVER_INIT(aleck64); |
| 184 | 186 | DECLARE_WRITE32_MEMBER(aleck_dips_w); |
| 185 | 187 | DECLARE_READ32_MEMBER(aleck_dips_r); |
| 186 | 188 | DECLARE_READ16_MEMBER(e90_prot_r); |
| 187 | 189 | DECLARE_WRITE16_MEMBER(e90_prot_w); |
| 190 | UINT32 screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 188 | 191 | private: |
| 189 | 192 | UINT32 m_dip_read_offset; |
| 190 | 193 | }; |
| r243014 | r243015 | |
| 349 | 352 | |
| 350 | 353 | static ADDRESS_MAP_START( e90_map, AS_PROGRAM, 32, aleck64_state ) |
| 351 | 354 | 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 |
| 353 | 356 | AM_RANGE(0xd0010000, 0xd0010fff) AM_RAM // RGB555 palette |
| 354 | 357 | AM_RANGE(0xd0030000, 0xd003001f) AM_READWRITE16(e90_prot_r, e90_prot_w,0xffffffff) |
| 355 | 358 | ADDRESS_MAP_END |
| r243014 | r243015 | |
| 873 | 876 | MCFG_N64_PERIPHS_ADD("rcp"); |
| 874 | 877 | MACHINE_CONFIG_END |
| 875 | 878 | |
| 879 | UINT32 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 | |
| 876 | 921 | static MACHINE_CONFIG_DERIVED( a64_e90, aleck64 ) |
| 877 | 922 | MCFG_CPU_MODIFY("maincpu") |
| 878 | 923 | MCFG_CPU_PROGRAM_MAP(e90_map) |
| 924 | |
| 925 | MCFG_SCREEN_MODIFY("screen") |
| 926 | MCFG_SCREEN_UPDATE_DRIVER(aleck64_state, screen_update_e90) |
| 879 | 927 | MACHINE_CONFIG_END |
| 880 | 928 | |
| 881 | 929 | DRIVER_INIT_MEMBER(aleck64_state,aleck64) |