Skip to content

Commit

Permalink
ams-qd: Add EqualRgn trap handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuran committed Mar 14, 2021
1 parent dda3d93 commit e7dae0e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions v68k/modules/ams-qd/Regions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,26 @@ pascal unsigned char RectInRgn_patch( const Rect* r, MacRegion** rgn )
return SectRect_patch( r, &rgn[0]->rgnBBox, &intersection );
}

pascal unsigned char EqualRgn_patch( MacRegion** a, MacRegion** b )
{
if ( a == b )
{
return true;
}

if ( a[0]->rgnSize != b[0]->rgnSize )
{
return false;
}

if ( EmptyRgn_patch( a ) && EmptyRgn_patch( b ) )
{
return true;
}

return fast_memcmp( *a, *b, a[0]->rgnSize ) == 0;
}

pascal unsigned char EmptyRgn_patch( MacRegion** rgn )
{
/*
Expand Down
2 changes: 2 additions & 0 deletions v68k/modules/ams-qd/Regions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ pascal void RectRgn_patch( MacRegion** rgn, const Rect* r );

pascal unsigned char RectInRgn_patch( const Rect* r, MacRegion** rgn );

pascal unsigned char EqualRgn_patch( MacRegion** a, MacRegion** b );

pascal unsigned char EmptyRgn_patch( MacRegion** rgn );

#endif
1 change: 1 addition & 0 deletions v68k/modules/ams-qd/ams-qd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ static void install_QuickDraw()
TBTRAP( OffsetRgn ); // A8E0
TBTRAP( InsetRgn ); // A8E1
TBTRAP( EmptyRgn ); // A8E2
TBTRAP( EqualRgn ); // A8E3
TBTRAP( SectRgn ); // A8E4
TBTRAP( UnionRgn ); // A8E5
TBTRAP( DiffRgn ); // A8E6
Expand Down

0 comments on commit e7dae0e

Please sign in to comment.