--- uae/src/custom.c 2018/04/24 16:44:56 1.1.1.6 +++ uae/src/custom.c 2018/04/24 16:47:31 1.1.1.7 @@ -74,8 +74,6 @@ static uae_u32 sprtaba[256],sprtabb[256] static void custom_wput_1 (int, uaecptr, uae_u32) REGPARAM; -static int fmode; - static uae_u16 cregs[256]; uae_u16 intena,intreq; @@ -83,6 +81,18 @@ uae_u16 dmacon; uae_u16 adkcon; /* used by audio code */ static uae_u32 cop1lc,cop2lc,copcon; + +int maxhpos = MAXHPOS_PAL; +int maxvpos = MAXVPOS_PAL; +int minfirstline = MINFIRSTLINE_PAL; +int vblank_endline = VBLANK_ENDLINE_PAL; +int vblank_hz = VBLANK_HZ_PAL; +unsigned long syncbase; +static int fmode; +static unsigned int beamcon0, new_beamcon0; +static int ntscmode = 0; + +#define MAX_SPRITES 32 /* This is but an educated guess. It seems to be correct, but this stuff * isn't documented well. */ @@ -92,6 +102,10 @@ static int spron[8]; static uaecptr sprpt[8]; static int sprxpos[8], sprvstart[8], sprvstop[8]; +static unsigned int sprdata[MAX_SPRITES], sprdatb[MAX_SPRITES], sprctl[MAX_SPRITES], sprpos[MAX_SPRITES]; +static int sprarmed[MAX_SPRITES], sprite_last_drawn_at[MAX_SPRITES]; +static int last_sprite_point, nr_armed; + static uae_u32 bpl1dat, bpl2dat, bpl3dat, bpl4dat, bpl5dat, bpl6dat, bpl7dat, bpl8dat; static uae_s16 bpl1mod, bpl2mod; @@ -108,9 +122,7 @@ static int nr_planes_from_bplcon0, corre static unsigned int diwstrt, diwstop, diwhigh; static int diwhigh_written; static unsigned int ddfstrt, ddfstop; -static unsigned int sprdata[8], sprdatb[8], sprctl[8], sprpos[8]; -static int sprarmed[8], sprite_last_drawn_at[8]; -static int last_sprite_point, nr_armed; + static uae_u32 dskpt; static uae_u16 dsklen, dsksync; static int dsklength; @@ -190,9 +202,9 @@ struct color_change color_changes[2][MAX struct delay_change delay_changes[MAX_REG_CHANGE]; #endif -struct decision line_decisions[2 * (maxvpos+1) + 1]; -struct draw_info line_drawinfo[2][2 * (maxvpos+1) + 1]; -struct color_entry color_tables[2][(maxvpos+1) * 2]; +struct decision line_decisions[2 * (MAXVPOS + 1) + 1]; +struct draw_info line_drawinfo[2][2 * (MAXVPOS + 1) + 1]; +struct color_entry color_tables[2][(MAXVPOS + 1) * 2]; struct sprite_draw *curr_sprite_positions, *prev_sprite_positions; struct color_change *curr_color_changes, *prev_color_changes; @@ -205,7 +217,7 @@ static int color_src_match, color_dest_m /* These few are only needed during/at the end of the scanline, and don't * have to be remembered. */ -static int decided_bpl1mod, decided_bpl2mod, decided_nr_planes, decided_hires; +static int decided_bpl1mod, decided_bpl2mod, decided_nr_planes, decided_res; static char thisline_changed; @@ -254,7 +266,7 @@ static __inline__ void prepare_copper (v void check_prefs_changed_custom (void) { - currprefs.framerate = changed_prefs.framerate; + currprefs.gfx_framerate = changed_prefs.gfx_framerate; /* Not really the right place... */ if (currprefs.jport0 != changed_prefs.jport0 || currprefs.jport1 != changed_prefs.jport1) { @@ -310,7 +322,7 @@ void notice_new_xcolors (void) docols(¤t_colors); /* docols(&colors_for_drawing);*/ - for (i = 0; i < (maxvpos+1)*2; i++) { + for (i = 0; i < (MAXVPOS + 1)*2; i++) { docols(color_tables[0]+i); docols(color_tables[1]+i); } @@ -452,9 +464,12 @@ static void adjust_broken_program (int h { int tmp1, tmp2; int i; - if (decided_hires) { + if (decided_res == RES_HIRES) { tmp1 = hpos & 3; tmp2 = hpos & ~3; + } else if (decided_res == RES_SUPERHIRES) { + tmp1 = hpos & 1; + tmp2 = hpos & ~1; } else { tmp1 = hpos & 7; tmp2 = hpos & ~7; @@ -462,7 +477,9 @@ static void adjust_broken_program (int h for (i = 0; i < decided_nr_planes; i++) { if (broken_plane_sub[i] != -1) continue; - if (decided_hires) { + /* FIXME: superhires, AGA playfields */ + /* Actually, I don't want to support this crap for AGA if we can avoid it. */ + if (decided_res == RES_HIRES) { broken_plane_sub[i] = (tmp2 - thisline_decision.plfstrt) / 4 * 2; switch (i) { case 3: broken_plane_sub[i] += 2; break; /* @@@ break was missing */ @@ -484,6 +501,15 @@ static void adjust_broken_program (int h } } +static __inline__ void set_decided_res (void) +{ + decided_res = RES_LORES; + if (bplcon0 & 0x8000) + decided_res = RES_HIRES; + if (bplcon0 & 0x40) + decided_res = RES_SUPERHIRES; +} + static __inline__ void post_decide_line (int hpos) { if (thisline_decision.which == 1 @@ -510,7 +536,7 @@ static __inline__ void post_decide_line && hpos > thisline_decision.plfstrt && decided_nr_planes < nr_planes_from_bplcon0) { - decided_hires = (bplcon0 & 0x8000) == 0x8000; + set_decided_res (); init_broken_program (); decided_nr_planes = nr_planes_from_bplcon0; thisline_decision.bplcon0 &= 0xFEF; @@ -569,21 +595,21 @@ static void decide_line_1 (int hpos) return; } - decided_hires = (bplcon0 & 0x8000) == 0x8000; + set_decided_res (); decided_nr_planes = nr_planes_from_bplcon0; #if 0 /* The blitter gets slower if there's high bitplane activity. * @@@ but the values must be different. FIXME */ if (bltstate != BLT_done - && ((decided_hires && decided_nr_planes > 2) - || (!decided_hires && decided_nr_planes > 4))) + && ((decided_res == RES_HIRES && decided_nr_planes > 2) + || (decided_res == RES_LORES && decided_nr_planes > 4))) { int pl = decided_nr_planes; unsigned int n = (eventtab[ev_blitter].evtime-cycles); if (n > plflinelen) n = plflinelen; n >>= 1; - if (decided_hires) + if (decided_res == RES_HIRES) pl <<= 1; if (pl == 8) eventtab[ev_blitter].evtime += plflinelen; @@ -711,13 +737,14 @@ static void decide_plane (int hpos) plane_decided = 1; - bytecount = plflinelen / (decided_hires ? 4 : 8) * 2; + bytecount = plflinelen / RES_SHIFT (decided_res) * 2; if (bytecount > MAX_WORDS_PER_LINE * 2) { /* Can't happen. */ static int warned = 0; if (!warned) write_log ("Mysterious bug in decide_plane(). Please report.\n"); + warned = 1; bytecount = 0; } if (!very_broken_program) { @@ -789,7 +816,7 @@ static void do_modulos (int hpos) if (decided_nr_planes != -1 && plane_decided && !modulos_added && hpos >= thisline_decision.plfstrt + thisline_decision.plflinelen) { - int bytecount = thisline_decision.plflinelen / (decided_hires ? 4 : 8) * 2; + int bytecount = thisline_decision.plflinelen / RES_SHIFT (decided_res) * 2; int add1 = bytecount + decided_bpl1mod; int add2 = bytecount + decided_bpl2mod; @@ -830,9 +857,6 @@ static __inline__ void record_sprite (in return; } #endif - data = sprdata[spr]; - datb = sprdatb[spr]; - /* XXX FIXME, this isn't very clever, but it might do */ for (;;) { if (pos == curr_drawinfo[next_lineno].first_sprite_draw) @@ -855,6 +879,8 @@ static __inline__ void record_sprite (in curr_sprite_positions[pos].linepos = sprxp; curr_sprite_positions[pos].num = spr; curr_sprite_positions[pos].ctl = sprctl[spr]; + data = sprdata[spr]; + datb = sprdatb[spr]; curr_sprite_positions[pos].datab = ((sprtaba[data & 0xFF] << 16) | sprtaba[data >> 8] | (sprtabb[datb & 0xFF] << 16) | sprtabb[datb >> 8]); next_sprite_draw++; @@ -862,7 +888,8 @@ static __inline__ void record_sprite (in static void decide_sprites (int hpos) { - int nrs[8], posns[8], count, i; + int nrs[MAX_SPRITES], posns[MAX_SPRITES]; + int count, i; int point = PIXEL_XPOS (hpos); if (framecnt != 0 || hpos < 0x14 || nr_armed == 0 || point == last_sprite_point) @@ -999,7 +1026,7 @@ static void reset_decisions (void) decided_bpl2mod = bpl2mod; decided_nr_planes = -1; - /* decided_hires shouldn't be touched before it's initialized by decide_line(). */ + /* decided_res shouldn't be touched before it's initialized by decide_line(). */ thisline_decision.diwfirstword = -1; thisline_decision.diwlastword = -2; if (hdiwstate == DIW_waiting_stop) { @@ -1032,10 +1059,40 @@ static void init_decisions (void) } } +/* set PAL or NTSC timing variables */ + +static void init_hz (void) +{ + int isntsc; + + beamcon0 = new_beamcon0; + init_decisions (); + + isntsc = beamcon0 & 0x20 ? 0 : 1; + if (!isntsc) { + maxvpos = MAXVPOS_PAL; + maxhpos = MAXHPOS_PAL; + minfirstline = MINFIRSTLINE_PAL; + vblank_endline = VBLANK_ENDLINE_PAL; + vblank_hz = VBLANK_HZ_PAL; + } else { + maxvpos = MAXVPOS_NTSC; + maxhpos = MAXHPOS_NTSC; + minfirstline = MINFIRSTLINE_NTSC; + vblank_endline = VBLANK_ENDLINE_NTSC; + vblank_hz = VBLANK_HZ_NTSC; + } + vsynctime = syncbase / vblank_hz; + + write_log ("Using %s timing\n", isntsc ? "NTSC" : "PAL"); +} + /* Calculate display window and data fetch values from the corresponding * hardware registers. */ static void calcdiw (void) { + int mask, add, mask2, add2, plfold; + int hstrt = diwstrt & 0xFF; int hstop = diwstop & 0xFF; int vstrt = diwstrt >> 8; @@ -1079,27 +1136,85 @@ static void calcdiw (void) plflastline = 313; } #endif + plfstrt = ddfstrt; plfstop = ddfstop; + /* @@@ Toni... these ones might be wrong for AGA? */ if (plfstrt < 0x18) plfstrt = 0x18; if (plfstop < 0x18) plfstop = 0x18; if (plfstop > 0xD8) plfstop = 0xD8; - if (plfstrt > plfstop) plfstrt = plfstop; /* ! If the masking operation is changed, the pfield_doline code could break * on some systems (alignment) */ /* This actually seems to be correct now, at least the non-AGA stuff... */ - plfstrt &= ~3; - plfstop &= ~3; - /* @@@ Start looking for AGA bugs here... (or maybe even in the above masking ops) */ - if ((fmode & 3) == 0) - plflinelen = (plfstop-plfstrt+15) & ~7; - else if ((fmode & 3) == 3) - plflinelen = (plfstop-plfstrt+63) & ~31; - else - plflinelen = (plfstop-plfstrt+31) & ~15; + + if ((fmode & 3) == 0) { + /* FMODE=0 */ + mask = ~7; + add = 15; + mask2 = ~3; + add2 = 0; + } else if ((fmode & 3) == 3) { + /* FMODE=3 */ + if(bplcon0 & 0x8000) { + mask = ~15; + add = 31; + mask2 = ~7; + add2 = 4; + } else { + mask = ~31; + add = 63; + mask2 = ~15; + add2 = 8; + } + } else { + /* FMODE=1/2 */ + if(bplcon0 & 0x8000) { + mask = ~15; + add = 31; + mask2 = ~15; + add2 = 4; + } else { + mask = ~15; + add = 31; + mask2 = ~15; + add2 = 8; + + } + } + /* ugh.. This works in every demo and game I have tested, but can't be correct, + * it looks too complex and stupid, does anybody know how this really works? (TW) + */ + plfold = plfstrt; + plfstrt &= mask2; + plfstrt += add2; + /* @@@ This one is different from the pre-AGA version. It shouldn't make + * a difference in OCS modes, though. */ + plfstop += plfstrt - plfold; + plfstop &= mask2; + plfstop += add2; + plflinelen = (plfstop-plfstrt+add) & mask; + + if (plfstrt > plfstop) + plfstrt = plfstop; + +#if 0 + if (plflinelen > 100 && (bplcon0 & 0x8000)) + write_log("vpos: %d fmode: %d, hires %d strt1 %d stop1 %d strt2 %d stop2 %d,plflinelen %d\n", + vpos,fmode&3,(bplcon0&0x8000)?1:0,ddfstrt,ddfstop,plfstrt,plfstop,plflinelen); +#endif } +/* + * lores,fmode=3 24 184 = 192 + * hires,fmode=3 40 200 = 176 + * hires,fmode=3 40 216 = 192 + * hires,fmode=1 56 200 = 160 + * hires,fmode=1 56 208 = 160 + * lores,fmode=1 48 200 = 176 + * lores,fmode=1 72 168 = 112 +*/ + /* Mousehack stuff */ #define defstepx (1<<16) @@ -1144,7 +1259,7 @@ static void mousehack_setfollow (void) mstepx = defstepx; mstepy = defstepy; } -uae_u32 mousehack_helper (void) +static uae_u32 mousehack_helper (void) { int mousexpos, mouseypos; @@ -1262,10 +1377,37 @@ static void do_mouse_hack (void) } } +static int timehack_alive = 0; + +static uae_u32 timehack_helper (void) +{ +#ifdef HAVE_GETTIMEOFDAY + struct timeval tv; + if (m68k_dreg (regs, 0) == 0) + return timehack_alive; + + timehack_alive = 10; + + gettimeofday (&tv, NULL); + put_long (m68k_areg (regs, 0), tv.tv_sec - (((365 * 8 + 2) * 24 - 2) * 60 * 60)); + put_long (m68k_areg (regs, 0) + 4, tv.tv_usec); + return 0; +#else + return 2; +#endif +} + /* * register functions */ - +static __inline__ uae_u16 DENISEID (void) +{ + if (currprefs.chipset_mask & CSMASK_AGA) + return 0xF8; + if (currprefs.chipset_mask & CSMASK_ECS_DENISE) + return 0xFC; + return 0xFFFF; +} static __inline__ uae_u16 DMACONR (void) { return (dmacon | (bltstate==BLT_done ? 0 : 0x4000) @@ -1285,13 +1427,10 @@ static __inline__ uae_u16 ADKCONR (void) } static __inline__ uae_u16 VPOSR (void) { -#if AGA_CHIPSET == 1 - return (vpos >> 8) | lof | 0x2300; -#elif defined (ECS_AGNUS) - return (vpos >> 8) | lof | 0x2000; -#else - return (vpos >> 8) | lof; -#endif + unsigned int csbit = ntscmode ? 0x1000 : 0; + csbit |= (currprefs.chipset_mask & CSMASK_AGA) ? 0x2300 : 0; + csbit |= (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? 0x2000 : 0; + return (vpos >> 8) | lof | csbit; } static void VPOSW (uae_u16 v) { @@ -1401,6 +1540,7 @@ static void DMACON (uae_u16 v) } else { if (cdp->state == 1 || cdp->state == 5) { cdp->state = 0; + cdp->last_sample = 0; cdp->current_sample = 0; } } @@ -1440,6 +1580,11 @@ static void ADKCON (uae_u16 v) audio_channel[3].adk_mask = (((t >> 3) & 1) - 1); } +static void BEAMCON0 (uae_u16 v) +{ + new_beamcon0 = v & 0x20; +} + static void BPLPTH (int hpos, uae_u16 v, int num) { decide_line (hpos); @@ -1457,28 +1602,29 @@ static void BPLPTL (int hpos, uae_u16 v, static void BPLCON0 (int hpos, uae_u16 v) { -#if AGA_CHIPSET == 0 - v &= 0xFF0E; - /* The Sanity WOC demo needs this at one place (at the end of the "Party Effect") - * Disable bitplane DMA if someone tries to do more than 4 Hires bitplanes. */ - if ((v & 0xF000) > 0xC000) - v &= 0xFFF; - /* Don't want 7 lores planes either. */ - if ((v & 0x8000) == 0 && (v & 0x7000) == 0x7000) - v &= 0xEFFF; -#endif + if (! (currprefs.chipset_mask & CSMASK_AGA)) { + v &= 0xFF0E; + /* The Sanity WOC demo needs this at one place (at the end of the "Party Effect") + * Disable bitplane DMA if someone tries to do more than 4 Hires bitplanes. */ + if ((v & 0xF000) > 0xC000) + v &= 0xFFF; + /* Don't want 7 lores planes either. */ + if ((v & 0x8000) == 0 && (v & 0x7000) == 0x7000) + v &= 0xEFFF; + } if (bplcon0 == v) return; decide_line (hpos); bplcon0 = v; nr_planes_from_bplcon0 = GET_PLANES (v); -#if AGA_CHIPSET != 0 - /* It's not clear how the copper timings are affected by the number - * of bitplanes on AGA machines */ - corrected_nr_planes_from_bplcon0 = 4; -#else - corrected_nr_planes_from_bplcon0 = nr_planes_from_bplcon0 << (bplcon0 & 0x8000 ? 1 : 0); -#endif + + if (currprefs.chipset_mask & CSMASK_AGA) + /* It's not clear how the copper timings are affected by the number + * of bitplanes on AGA machines */ + corrected_nr_planes_from_bplcon0 = 4; + else + corrected_nr_planes_from_bplcon0 = nr_planes_from_bplcon0 << (bplcon0 & 0x8000 ? 1 : 0); + post_decide_line (hpos); } static __inline__ void BPLCON1 (int hpos, uae_u16 v) @@ -1491,20 +1637,25 @@ static __inline__ void BPLCON1 (int hpos } static __inline__ void BPLCON2 (int hpos, uae_u16 v) { - if (bplcon2 != v) - decide_line (hpos); + if (bplcon2 == v) + return; + decide_line (hpos); bplcon2 = v; } static __inline__ void BPLCON3 (int hpos, uae_u16 v) { - if (bplcon3 != v) - decide_line (hpos); + if (bplcon3 == v) + return; + decide_line (hpos); bplcon3 = v; } static __inline__ void BPLCON4 (int hpos, uae_u16 v) { - if (bplcon4 != v) - decide_line (hpos); + if (! (currprefs.chipset_mask & CSMASK_AGA)) + return; + if (bplcon4 == v) + return; + decide_line (hpos); bplcon4 = v; } @@ -1558,6 +1709,8 @@ static void DIWSTOP (int hpos, uae_u16 v static void DIWHIGH (int hpos, uae_u16 v) { + if (! (currprefs.chipset_mask & CSMASK_ECS_DENISE)) + return; if (diwhigh_written && diwhigh == v) return; decide_line (hpos); @@ -1568,7 +1721,7 @@ static void DIWHIGH (int hpos, uae_u16 v static void DDFSTRT (int hpos, uae_u16 v) { - v &= AGA_CHIPSET ? 0x1FF : 0xFF; + v &= (currprefs.chipset_mask & CSMASK_AGA) ? 0x1FC : 0xFC; if (ddfstrt == v) return; decide_line (hpos); @@ -1577,7 +1730,7 @@ static void DDFSTRT (int hpos, uae_u16 v } static void DDFSTOP (int hpos, uae_u16 v) { - v &= AGA_CHIPSET ? 0x1FF : 0xFF; + v &= (currprefs.chipset_mask & CSMASK_AGA) ? 0x1FC : 0xFC; if (ddfstop == v) return; decide_line (hpos); @@ -1585,6 +1738,14 @@ static void DDFSTOP (int hpos, uae_u16 v calcdiw (); } +static void FMODE (uae_u16 v) +{ + if (! (currprefs.chipset_mask & CSMASK_AGA)) + return; + fmode = v; + calcdiw (); +} + static void BLTADAT (uae_u16 v) { maybe_blit(); @@ -1616,7 +1777,12 @@ static void BLTDMOD (uae_u16 v) { maybe_ static void BLTCON0 (uae_u16 v) { maybe_blit (); bltcon0 = v; blinea_shift = v >> 12; } /* The next category is "Most useless hardware register". * And the winner is... */ -static void BLTCON0L (uae_u16 v) { maybe_blit (); bltcon0 = (bltcon0 & 0xFF00) | (v & 0xFF); } +static void BLTCON0L (uae_u16 v) +{ + if (! (currprefs.chipset_mask & CSMASK_ECS_AGNUS)) + return; + maybe_blit (); bltcon0 = (bltcon0 & 0xFF00) | (v & 0xFF); +} static void BLTCON1 (uae_u16 v) { maybe_blit (); bltcon1 = v; } static void BLTAFWM (uae_u16 v) { maybe_blit (); blt_info.bltafwm = v; } @@ -1648,12 +1814,16 @@ static void BLTSIZE (uae_u16 v) static void BLTSIZV (uae_u16 v) { + if (! (currprefs.chipset_mask & CSMASK_ECS_AGNUS)) + return; maybe_blit (); oldvblts = v & 0x7FFF; } static void BLTSIZH (uae_u16 v) { + if (! (currprefs.chipset_mask & CSMASK_ECS_AGNUS)) + return; maybe_blit (); blt_info.hblitsize = v & 0x7FF; blt_info.vblitsize = oldvblts; @@ -1953,10 +2123,10 @@ static __inline__ int copper_cant_read ( if (hpos >= ((maxhpos - 2) & ~1)) return 1; -#if AGA_CHIPSET != 0 - /* FIXME */ - return 0; -#else + if (currprefs.chipset_mask & CSMASK_AGA) + /* FIXME */ + return 0; + if (! copper_in_playfield (diw, hpos)) return 0; @@ -1966,7 +2136,6 @@ static __inline__ int copper_cant_read ( abort (); #endif return t; -#endif } static void update_copper_1 (int until_hpos) @@ -2012,7 +2181,7 @@ static void update_copper_1 (int until_h if (cop_state.do_move) { cop_state.do_move = 0; - if (cop_state.i1 < (copcon & 2 ? (AGA_CHIPSET ? 0 : 0x40u) : 0x80u)) { + if (cop_state.i1 < (copcon & 2 ? ((currprefs.chipset_mask & CSMASK_AGA) ? 0 : 0x40u) : 0x80u)) { cop_state.state = COP_stop; break; } @@ -2204,7 +2373,7 @@ static void prepare_copper_1 (void) if (cst.do_move) { cst.do_move = 0; - if (cst.i1 < (copcon & 2 ? (AGA_CHIPSET ? 0 : 0x40u) : 0x80u)) { + if (cst.i1 < (copcon & 2 ? ((currprefs.chipset_mask & CSMASK_AGA) ? 0 : 0x40u) : 0x80u)) { cst.state = COP_stop; eventtab[ev_copper].active = 0; return; @@ -2587,6 +2756,11 @@ static void vsync_handler (void) cnt--; } + /* For now, let's only allow this to change at vsync time. It gets too + * hairy otherwise. */ + if (beamcon0 != new_beamcon0) + init_hz (); + lof_changed = 0; cop_state.ip = cop1lc; @@ -2636,6 +2810,8 @@ static void vsync_handler (void) #endif if (ievent_alive > 0) ievent_alive--; + if (timehack_alive > 0) + timehack_alive--; CIA_vsync_handler(); } @@ -2771,6 +2947,7 @@ void customreset (void) mousestate = normal_mouse; } ievent_alive = 0; + timehack_alive = 0; clx_sprmask = 0xFF; clxdat = 0; @@ -2787,11 +2964,14 @@ void customreset (void) dskdmaen = 0; cycles = 0; - audio_reset (); - bplcon4 = 0x11; /* Get AGA chipset into ECS compatibility mode */ bplcon3 = 0xC00; + new_beamcon0 = ntscmode ? 0x00 : 0x20; + init_hz (); + + audio_reset (); + init_eventtab (); init_sprites (); @@ -2859,6 +3039,8 @@ static void gen_custom_tables (void) void custom_init (void) { + uaecptr pos; + #ifdef OS_WITHOUT_MEMORY_MANAGEMENT int num; @@ -2869,6 +3051,18 @@ void custom_init (void) delay_changes = xmalloc (max_delay_change * sizeof (struct delay_change)); #endif + pos = here (); + + org (0xF0FF70); + calltrap (deftrap (mousehack_helper)); + dw (RTS); + + org (0xF0FFA0); + calltrap (deftrap (timehack_helper)); + dw (RTS); + + org (pos); + init_decisions (); gen_custom_tables (); @@ -2917,11 +3111,7 @@ uae_u32 REGPARAM2 custom_wget (uaecptr a case 0x01A: return DSKBYTR(); case 0x01C: return INTENAR(); case 0x01E: return INTREQR(); -#if AGA_CHIPSET == 1 - case 0x07C: return 0xF8; -#elif defined ECS_DENISE - case 0x07C: return 0xFC; -#endif + case 0x07C: return DENISEID(); default: custom_wput(addr,0); return 0xffff; @@ -3095,18 +3285,12 @@ void REGPARAM2 custom_wput_1 (int hpos, break; case 0x36: JOYTEST (value); break; -#if defined (ECS_AGNUS) || (AGA_CHIPSET == 1) - case 0x5A: BLTCON0L(value); break; + case 0x5A: BLTCON0L (value); break; case 0x5C: BLTSIZV (value); break; case 0x5E: BLTSIZH (value); break; -#endif -#ifdef ECS_DENISE case 0x1E4: DIWHIGH (hpos, value); break; -#endif -#if AGA_CHIPSET == 1 case 0x10C: BPLCON4 (hpos, value); break; - case 0x1FC: fmode = value; calcdiw (); break; -#endif + case 0x1FC: FMODE (value); break; } }