trunk/src/mame/drivers/aleck64.c
| r243015 | r243016 | |
| 179 | 179 | aleck64_state(const machine_config &mconfig, device_type type, const char *tag) |
| 180 | 180 | : n64_state(mconfig, type, tag), |
| 181 | 181 | m_e90_vram(*this,"e90vram"), |
| 182 | m_e90_pal(*this,"e90pal"), |
| 182 | 183 | m_dip_read_offset(0) { } |
| 183 | 184 | |
| 184 | 185 | optional_shared_ptr<UINT32> m_e90_vram; |
| 186 | optional_shared_ptr<UINT32> m_e90_pal; |
| 185 | 187 | DECLARE_DRIVER_INIT(aleck64); |
| 186 | 188 | DECLARE_WRITE32_MEMBER(aleck_dips_w); |
| 187 | 189 | DECLARE_READ32_MEMBER(aleck_dips_r); |
| r243015 | r243016 | |
| 353 | 355 | static ADDRESS_MAP_START( e90_map, AS_PROGRAM, 32, aleck64_state ) |
| 354 | 356 | AM_IMPORT_FROM( n64_map ) |
| 355 | 357 | AM_RANGE(0xd0000000, 0xd0000fff) AM_RAM AM_SHARE("e90vram")// x/y offsets |
| 356 | | AM_RANGE(0xd0010000, 0xd0010fff) AM_RAM // RGB555 palette |
| 358 | AM_RANGE(0xd0010000, 0xd0010fff) AM_RAM AM_SHARE("e90pal")// RGB555 palette |
| 357 | 359 | AM_RANGE(0xd0030000, 0xd003001f) AM_READWRITE16(e90_prot_r, e90_prot_w,0xffffffff) |
| 358 | 360 | ADDRESS_MAP_END |
| 359 | 361 | |
| r243015 | r243016 | |
| 878 | 880 | |
| 879 | 881 | UINT32 aleck64_state::screen_update_e90(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 880 | 882 | { |
| 881 | | static int testx,testy; |
| 882 | 883 | bitmap.fill(0, cliprect); |
| 883 | 884 | screen_update_n64(screen,bitmap,cliprect); |
| 884 | 885 | |
| 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 | 886 | for(int offs=0;offs<0x1000/4;offs+=2) |
| 899 | 887 | { |
| 900 | 888 | int xi,yi; |
| 889 | int r,g,b; |
| 890 | int pal_offs; |
| 891 | int pal_shift; |
| 901 | 892 | //UINT16 tile = m_e90_vram[offs] >> 16; |
| 902 | | UINT16 pal = m_e90_vram[offs] & 0x7f; // guess: 0x1000 entries / word / 4bpp = 0x7f |
| 893 | UINT16 pal = m_e90_vram[offs] & 0x3f; // guess: 0x1000 entries / word / 4bpp = 0x7f, bit 6 seems to have some special meaning tho ... |
| 903 | 894 | INT16 x = m_e90_vram[offs+1] >> 16; |
| 904 | 895 | INT16 y = m_e90_vram[offs+1] & 0xffff; |
| 905 | 896 | x>>=1; |
| 906 | | |
| 897 | pal_offs = (pal*0x20); |
| 898 | pal_offs+= 1; // edit this to get the other colors in the range |
| 899 | pal_shift = pal_offs & 1 ? 0 : 16; |
| 900 | r = m_e90_pal[pal_offs>>1] >> pal_shift; |
| 901 | g = (m_e90_pal[pal_offs>>1] >> (5+pal_shift)); |
| 902 | b = (m_e90_pal[pal_offs>>1] >> (10+pal_shift)); |
| 903 | r&=0x1f; |
| 904 | g&=0x1f; |
| 905 | b&=0x1f; |
| 906 | r = (r << 3) | (r >> 2); |
| 907 | g = (g << 3) | (g >> 2); |
| 908 | b = (b << 3) | (b >> 2); |
| 907 | 909 | for(yi=0;yi<8;yi++) |
| 908 | 910 | for(xi=0;xi<8;xi++) |
| 909 | 911 | { |
| r243015 | r243016 | |
| 912 | 914 | res_y = y+yi + 7; |
| 913 | 915 | |
| 914 | 916 | if(cliprect.contains(res_x, res_y)) |
| 915 | | bitmap.pix32(res_y, res_x) = pal << 16; |
| 917 | bitmap.pix32(res_y, res_x) = r << 16 | g << 8 | b; |
| 916 | 918 | } |
| 917 | 919 | } |
| 918 | 920 | return 0; |