Previous 15994 Revisions Next

r915 Sunday 2nd September, 2007 at 04:39:17 UTC by R. Belmont
[APPLE2GS] Fixed scanline interrupts and vertical counter register to fire at the proper places. Some border effects work now in the FTA XMAS DEMO, and the mouse pointer no longer flickers like crazy in the GUI.
[docs]messnew.txt
[src/mess/drivers]apple2gs.c
[src/mess/includes]apple2gs.h
[src/mess/machine]apple2gs.c
[src/mess/video]apple2gs.c

src/mess/includes/apple2gs.h
r914r915
1414#define APPLE2GS_14M (APPLE2GS_28M/2)
1515#define APPLE2GS_7M (APPLE2GS_28M/4)
1616
17// screen dimensions
18#define BORDER_LEFT   (32)
19#define BORDER_RIGHT   (32)
20#define BORDER_TOP   (16)   // (plus bottom)
21
1722extern UINT8 *apple2gs_slowmem;
1823extern UINT8 apple2gs_newvideo;
1924extern UINT16 apple2gs_bordercolor;
src/mess/video/apple2gs.c
r914r915
1010#include "includes/apple2.h"
1111#include "includes/apple2gs.h"
1212
13#define BORDER_LEFT   (32)
14#define BORDER_RIGHT   (32)
15#define BORDER_TOP   (16)   // (plus bottom)
16
1713static mame_bitmap *apple2gs_legacy_gfx;
1814UINT16 apple2gs_bordercolor;
1915
src/mess/machine/apple2gs.c
r914r915
148148static mess_image *apple2gs_cur_slot6_image;
149149static mame_timer *apple2gs_scanline_timer;
150150
151
151152/* -----------------------------------------------------------------------
152153 * Apple IIgs clock
153154 * ----------------------------------------------------------------------- */
r914r915
772773
773774   // make sure we're in the 65816's context
774775   cpuintrf_push_context(0);
775
776                           
776777   scanline = video_screen_get_vpos(0);
777778
778779   video_screen_update_partial(0, scanline);
779780   
780781   /* 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)))
782783   {
783784      UINT8 scb;
784785
785      scb = apple2gs_slowmem[0x19D00 + scanline];
786      scb = apple2gs_slowmem[0x19D00 + scanline - BORDER_TOP + 1];
786787
787788      if (scb & 0x40)
788789      {
r914r915
791792      }
792793   }
793794
794   if (scanline == 0)
795   if (scanline == BORDER_TOP)
795796   {
796797      current_frame = cpu_getcurrentframe();
797798
r914r915
809810         apple2gs_add_irq(IRQ_VGC_SECOND);
810811      }
811812   }
812   else if (scanline == 192)
813   else if (scanline == (192+BORDER_TOP))
813814   {
814815      /* VBL interrupt */
815816      if ((apple2gs_inten & 0x08) && !(apple2gs_intflag & 0x08))
r914r915
919920   }
920921}
921922
922
923
924923/* -----------------------------------------------------------------------
925924 * IO handlers
926925 * ----------------------------------------------------------------------- */
927926
927// apple2gs_get_vpos - return the correct vertical counter value for the current scanline,
928// keeping borders in mind.
929
930static 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
928954static READ8_HANDLER( apple2gs_c0xx_r )
929955{
930956   UINT8 result;
r914r915
934960   switch(offset)
935961   {
936962      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;
938964         break;
939965         
940966      case 0x22:   /* C022 - TBCOLOR */
r914r915
9751001         break;
9761002
9771003      case 0x2E:   /* C02E - VERTCNT */
978         result = video_screen_get_vpos(0) + 55;
1004         result = apple2gs_get_vpos() >> 1;
9791005         break;
9801006
9811007      case 0x2F:   /* C02F - HORIZCNT */
r914r915
9851011            result += 0x40;
9861012         }
9871013
988         result |= ((video_screen_get_vpos(0) & 0x01) << 7);
1014         if (apple2gs_get_vpos() & 1)
1015         {
1016            result |= 0x80;
1017         }
9891018         break;
9901019
9911020      case 0x31:   /* C031 - DISKREG */
src/mess/drivers/apple2gs.c
r914r915
2727                |                                    |
2828                |                                    |
2929                |                                    |
30                |                                    |   0x1ba (first line of Vblank, c019 and heartbeat trigger here, only true VBL if in A2 classic modes)
30                |                                    |   0x1c0 (first line of Vblank, c019 and heartbeat trigger here, only true VBL if in A2 classic modes)
3131                |                                    |
3232                 ____________________________________    0x1c8 (actual start of vblank in IIgs modes)
3333   
docs/messnew.txt
r914r915
1818
1919- [AMSTRAD] Palette fix.  [Barry Rodewald]
2020
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
2125- [A2600] Added automatic input device selection.  [Cowering & Wilbert Pol]
2226
2327- [C64] Added partial T64 tape image loading support.  [Pugsy]
r914r915
2832
2933- [PCE] Fixed endian issues and regression from 0.106. (bug #1143)  [Wilbert Pol]
3034
35- [PC88] Fixed regression from 0.112.  [R. Belmont]
36
3137- [X68000] Supported more BIOSes, sprite fixes, made SRAM executable and added
3238  an hsync timer.  [Barry Rodewald]
3339

Previous 15994 Revisions Next


© 1998-2018 The MESS Team