src/mess/machine/apple2gs.c
| r914 | r915 | |
| 148 | 148 | static mess_image *apple2gs_cur_slot6_image; |
| 149 | 149 | static mame_timer *apple2gs_scanline_timer; |
| 150 | 150 | |
| 151 | |
| 151 | 152 | /* ----------------------------------------------------------------------- |
| 152 | 153 | * Apple IIgs clock |
| 153 | 154 | * ----------------------------------------------------------------------- */ |
| r914 | r915 | |
| 772 | 773 | |
| 773 | 774 | // make sure we're in the 65816's context |
| 774 | 775 | cpuintrf_push_context(0); |
| 775 | | |
| 776 | |
| 776 | 777 | scanline = video_screen_get_vpos(0); |
| 777 | 778 | |
| 778 | 779 | video_screen_update_partial(0, scanline); |
| 779 | 780 | |
| 780 | 781 | /* scanline interrupt */ |
| 781 | | if ((apple2gs_newvideo & 0x80) && (apple2gs_vgcint & 0x02) && (scanline < 200)) |
| 782 | if ((apple2gs_newvideo & 0x80) && (apple2gs_vgcint & 0x02) && (scanline >= (BORDER_TOP-1)) && (scanline < (200+BORDER_TOP-1))) |
| 782 | 783 | { |
| 783 | 784 | UINT8 scb; |
| 784 | 785 | |
| 785 | | scb = apple2gs_slowmem[0x19D00 + scanline]; |
| 786 | scb = apple2gs_slowmem[0x19D00 + scanline - BORDER_TOP + 1]; |
| 786 | 787 | |
| 787 | 788 | if (scb & 0x40) |
| 788 | 789 | { |
| r914 | r915 | |
| 791 | 792 | } |
| 792 | 793 | } |
| 793 | 794 | |
| 794 | | if (scanline == 0) |
| 795 | if (scanline == BORDER_TOP) |
| 795 | 796 | { |
| 796 | 797 | current_frame = cpu_getcurrentframe(); |
| 797 | 798 | |
| r914 | r915 | |
| 809 | 810 | apple2gs_add_irq(IRQ_VGC_SECOND); |
| 810 | 811 | } |
| 811 | 812 | } |
| 812 | | else if (scanline == 192) |
| 813 | else if (scanline == (192+BORDER_TOP)) |
| 813 | 814 | { |
| 814 | 815 | /* VBL interrupt */ |
| 815 | 816 | if ((apple2gs_inten & 0x08) && !(apple2gs_intflag & 0x08)) |
| r914 | r915 | |
| 919 | 920 | } |
| 920 | 921 | } |
| 921 | 922 | |
| 922 | | |
| 923 | | |
| 924 | 923 | /* ----------------------------------------------------------------------- |
| 925 | 924 | * IO handlers |
| 926 | 925 | * ----------------------------------------------------------------------- */ |
| 927 | 926 | |
| 927 | // apple2gs_get_vpos - return the correct vertical counter value for the current scanline, |
| 928 | // keeping borders in mind. |
| 929 | |
| 930 | static int apple2gs_get_vpos(void) |
| 931 | { |
| 932 | int result, scan; |
| 933 | static UINT8 top_border_vert[BORDER_TOP] = |
| 934 | { |
| 935 | 0xfa, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfb, |
| 936 | 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe, 0xff, |
| 937 | |
| 938 | }; |
| 939 | |
| 940 | scan = video_screen_get_vpos(0); |
| 941 | |
| 942 | if (scan < BORDER_TOP) |
| 943 | { |
| 944 | result = top_border_vert[scan]; |
| 945 | } |
| 946 | else |
| 947 | { |
| 948 | result = scan - BORDER_TOP + 0x100 + 1; |
| 949 | } |
| 950 | |
| 951 | return result; |
| 952 | } |
| 953 | |
| 928 | 954 | static READ8_HANDLER( apple2gs_c0xx_r ) |
| 929 | 955 | { |
| 930 | 956 | UINT8 result; |
| r914 | r915 | |
| 934 | 960 | switch(offset) |
| 935 | 961 | { |
| 936 | 962 | case 0x19: /* C019 - RDVBLBAR */ |
| 937 | | result = (video_screen_get_vpos(0) >= 192) ? 0x80 : 0x00; |
| 963 | result = (video_screen_get_vpos(0) >= (192+BORDER_TOP)) ? 0x80 : 0x00; |
| 938 | 964 | break; |
| 939 | 965 | |
| 940 | 966 | case 0x22: /* C022 - TBCOLOR */ |
| r914 | r915 | |
| 975 | 1001 | break; |
| 976 | 1002 | |
| 977 | 1003 | case 0x2E: /* C02E - VERTCNT */ |
| 978 | | result = video_screen_get_vpos(0) + 55; |
| 1004 | result = apple2gs_get_vpos() >> 1; |
| 979 | 1005 | break; |
| 980 | 1006 | |
| 981 | 1007 | case 0x2F: /* C02F - HORIZCNT */ |
| r914 | r915 | |
| 985 | 1011 | result += 0x40; |
| 986 | 1012 | } |
| 987 | 1013 | |
| 988 | | result |= ((video_screen_get_vpos(0) & 0x01) << 7); |
| 1014 | if (apple2gs_get_vpos() & 1) |
| 1015 | { |
| 1016 | result |= 0x80; |
| 1017 | } |
| 989 | 1018 | break; |
| 990 | 1019 | |
| 991 | 1020 | case 0x31: /* C031 - DISKREG */ |
docs/messnew.txt
| r914 | r915 | |
| 18 | 18 | |
| 19 | 19 | - [AMSTRAD] Palette fix. [Barry Rodewald] |
| 20 | 20 | |
| 21 | - [APPLE2GS] Fixed raster interrupts and scanline counter registers to fire at the proper |
| 22 | times. Mouse pointer is no longer flickery in GUI apps and some border effects work in |
| 23 | the FTA XMAS DEMO. [R. Belmont] |
| 24 | |
| 21 | 25 | - [A2600] Added automatic input device selection. [Cowering & Wilbert Pol] |
| 22 | 26 | |
| 23 | 27 | - [C64] Added partial T64 tape image loading support. [Pugsy] |
| r914 | r915 | |
| 28 | 32 | |
| 29 | 33 | - [PCE] Fixed endian issues and regression from 0.106. (bug #1143) [Wilbert Pol] |
| 30 | 34 | |
| 35 | - [PC88] Fixed regression from 0.112. [R. Belmont] |
| 36 | |
| 31 | 37 | - [X68000] Supported more BIOSes, sprite fixes, made SRAM executable and added |
| 32 | 38 | an hsync timer. [Barry Rodewald] |
| 33 | 39 | |