src/mess/drivers/vboy.c
| r15926 | r15927 | |
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | |
| 697 | | static UINT8 display_world(vboy_state *state, int num, bitmap_ind16 &bitmap, bool right) |
| 697 | static UINT8 display_world(vboy_state *state, int num, bitmap_ind16 &bitmap, bool right, int &cur_spt) |
| 698 | 698 | { |
| 699 | 699 | num <<= 4; |
| 700 | 700 | UINT16 def = state->m_world[num]; |
| 701 | UINT8 lon = (def >> 15) & 1; |
| 702 | //UINT8 ron = (def >> 14) & 1; |
| 701 | 703 | INT16 gx = state->m_world[num+1]; |
| 702 | 704 | INT16 gp = state->m_world[num+2]; |
| 703 | 705 | INT16 gy = state->m_world[num+3]; |
| r15926 | r15927 | |
| 774 | 776 | else |
| 775 | 777 | if (mode==3) |
| 776 | 778 | { |
| 777 | | int cur_spt; |
| 779 | int start_offs, end_offs; |
| 778 | 780 | |
| 779 | | for(cur_spt = 3; cur_spt >= 0;cur_spt--) |
| 781 | if(cur_spt == -1) |
| 780 | 782 | { |
| 781 | | int start_offs, end_offs; |
| 783 | popmessage("Cur spt used with -1 pointer!"); |
| 784 | return 0; |
| 785 | } |
| 782 | 786 | |
| 783 | | start_offs = state->m_vip_regs.SPT[cur_spt]; |
| 787 | start_offs = state->m_vip_regs.SPT[cur_spt]; |
| 784 | 788 | |
| 785 | | end_offs = 0x3ff; |
| 786 | | if(cur_spt != 0) |
| 787 | | end_offs = state->m_vip_regs.SPT[cur_spt-1]; |
| 789 | end_offs = 0x3ff; |
| 790 | if(cur_spt != 0) |
| 791 | end_offs = state->m_vip_regs.SPT[cur_spt-1]; |
| 788 | 792 | |
| 789 | | i = start_offs; |
| 793 | i = start_offs; |
| 794 | do |
| 795 | { |
| 796 | UINT16 start_ndx = i * 4; |
| 797 | INT16 jx = state->m_objects[start_ndx+0]; |
| 798 | INT16 jp = state->m_objects[start_ndx+1] & 0x3fff; |
| 799 | INT16 jy = state->m_objects[start_ndx+2] & 0x1ff; |
| 800 | UINT16 val = state->m_objects[start_ndx+3]; |
| 801 | UINT8 jlon = (state->m_objects[start_ndx+1] & 0x8000) >> 15; |
| 802 | UINT8 jron = (state->m_objects[start_ndx+1] & 0x4000) >> 14; |
| 790 | 803 | |
| 791 | | do |
| 792 | | { |
| 793 | | UINT16 start_ndx = i * 4; |
| 794 | | INT16 jx = state->m_objects[start_ndx+0]; |
| 795 | | INT16 jp = state->m_objects[start_ndx+1] & 0x3fff; |
| 796 | | INT16 jy = state->m_objects[start_ndx+2] & 0x1ff; |
| 797 | | UINT16 val = state->m_objects[start_ndx+3]; |
| 798 | | UINT8 jlon = (state->m_objects[start_ndx+1] & 0x8000) >> 15; |
| 799 | | UINT8 jron = (state->m_objects[start_ndx+1] & 0x4000) >> 14; |
| 804 | if (!right && jlon) |
| 805 | put_char(state, bitmap, (jx-jp) & 0x1ff, jy, val & 0x7ff, BIT(val,13), BIT(val,12), true, state->m_vip_regs.JPLT[(val>>14) & 3]); |
| 800 | 806 | |
| 801 | | if (!right && jlon) |
| 802 | | put_char(state, bitmap, (jx-jp) & 0x1ff, jy, val & 0x7ff, BIT(val,13), BIT(val,12), true, state->m_vip_regs.JPLT[(val>>14) & 3]); |
| 807 | if(right && jron) |
| 808 | put_char(state, bitmap, (jx+jp) & 0x1ff, jy, val & 0x7ff, BIT(val,13), BIT(val,12), true, state->m_vip_regs.JPLT[(val>>14) & 3]); |
| 803 | 809 | |
| 804 | | if(right && jron) |
| 805 | | put_char(state, bitmap, (jx+jp) & 0x1ff, jy, val & 0x7ff, BIT(val,13), BIT(val,12), true, state->m_vip_regs.JPLT[(val>>14) & 3]); |
| 810 | i --; |
| 811 | i &= 0x3ff; |
| 812 | }while(i != end_offs); |
| 806 | 813 | |
| 807 | | i --; |
| 808 | | i &= 0x3ff; |
| 809 | | }while(i != end_offs); |
| 810 | | } |
| 814 | if((lon && !right) /*|| (ron && right)*/) |
| 815 | cur_spt --; |
| 811 | 816 | } |
| 812 | 817 | |
| 813 | 818 | return 0; |
| r15926 | r15927 | |
| 817 | 822 | { |
| 818 | 823 | vboy_state *state = screen.machine().driver_data<vboy_state>(); |
| 819 | 824 | state->m_screen_output.fill(state->m_vip_regs.BKCOL, cliprect); |
| 825 | int cur_spt; |
| 820 | 826 | |
| 827 | cur_spt = 3; |
| 821 | 828 | for(int i=31; i>=0; i--) |
| 822 | | if (display_world(state, i, state->m_screen_output, 0)) break; |
| 829 | if (display_world(state, i, state->m_screen_output, 0,cur_spt)) break; |
| 823 | 830 | |
| 824 | 831 | copybitmap(bitmap, state->m_screen_output, 0, 0, 0, 0, cliprect); |
| 825 | 832 | return 0; |
| r15926 | r15927 | |
| 829 | 836 | { |
| 830 | 837 | vboy_state *state = screen.machine().driver_data<vboy_state>(); |
| 831 | 838 | state->m_screen_output.fill(state->m_vip_regs.BKCOL, cliprect); |
| 839 | int cur_spt; |
| 832 | 840 | |
| 841 | cur_spt = 3; |
| 833 | 842 | for(int i=31; i>=0; i--) |
| 834 | | if (display_world(state, i, state->m_screen_output, 1)) break; |
| 843 | if (display_world(state, i, state->m_screen_output, 1,cur_spt)) break; |
| 835 | 844 | |
| 836 | 845 | copybitmap(bitmap, state->m_screen_output, 0, 0, 0, 0, cliprect); |
| 837 | 846 | return 0; |