diff options
author | twinaphex | 2016-08-08 22:23:20 +0200 |
---|---|---|
committer | twinaphex | 2016-08-08 22:23:20 +0200 |
commit | d27ff7c5ede6914193d0912f130616d1b334e953 (patch) | |
tree | 70f02f1091543b55e4efb479dc2d825e6d2b276d | |
parent | b5fb2184e43cd1022771532391d0691380559e3d (diff) | |
download | snesemu-d27ff7c5ede6914193d0912f130616d1b334e953.tar.gz snesemu-d27ff7c5ede6914193d0912f130616d1b334e953.tar.bz2 snesemu-d27ff7c5ede6914193d0912f130616d1b334e953.zip |
Get rid of register keyword
-rw-r--r-- | source/gfx.c | 81 | ||||
-rw-r--r-- | source/memmap.c | 6 | ||||
-rw-r--r-- | source/tile.c | 60 | ||||
-rw-r--r-- | source/tile.h | 2 | ||||
-rw-r--r-- | version | 4 |
5 files changed, 74 insertions, 79 deletions
diff --git a/source/gfx.c b/source/gfx.c index add2621..633e2ab 100644 --- a/source/gfx.c +++ b/source/gfx.c @@ -256,17 +256,17 @@ void DrawLargePixel16Sub1_2(uint32_t Tile, int32_t Offset, bool S9xInitGFX() { - register uint32_t PixelOdd = 1; - register uint32_t PixelEven = 2; + uint32_t PixelOdd = 1; + uint32_t PixelEven = 2; uint8_t bitshift; for (bitshift = 0; bitshift < 4; bitshift++) { - register int i; + int i; for (i = 0; i < 16; i++) { - register uint32_t h = 0; - register uint32_t l = 0; + uint32_t h = 0; + uint32_t l = 0; #if defined(MSB_FIRST) if (i & 8) @@ -3116,11 +3116,11 @@ static void DrawBGMode7Background16Sub1_2(uint8_t* Screen, int bg) static uint32_t Q_INTERPOLATE(uint32_t A, uint32_t B, uint32_t C, uint32_t D) { - register uint32_t x = ((A >> 2) & HIGH_BITS_SHIFTED_TWO_MASK) + + uint32_t x = ((A >> 2) & HIGH_BITS_SHIFTED_TWO_MASK) + ((B >> 2) & HIGH_BITS_SHIFTED_TWO_MASK) + ((C >> 2) & HIGH_BITS_SHIFTED_TWO_MASK) + ((D >> 2) & HIGH_BITS_SHIFTED_TWO_MASK); - register uint32_t y = (A & TWO_LOW_BITS_MASK) + + uint32_t y = (A & TWO_LOW_BITS_MASK) + (B & TWO_LOW_BITS_MASK) + (C & TWO_LOW_BITS_MASK) + (D & TWO_LOW_BITS_MASK); @@ -3514,13 +3514,12 @@ void S9xUpdateScreen() { // The game has switched from lo-res to hi-res mode part way down // the screen. Scale any existing lo-res pixels on screen - register uint32_t y; + uint32_t y; for (y = 0; y < starty; y++) { - register uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + 255; - register uint16_t* q = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + 510; - - register int x; + int x; + uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + 255; + uint16_t* q = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + 510; for (x = 255; x >= 0; x--, p--, q -= 2) * q = *(q + 1) = *p; } @@ -3542,7 +3541,7 @@ void S9xUpdateScreen() // The game has switched from non-interlaced to interlaced mode // part way down the screen. Scale everything. - register int32_t y; + int32_t y; for (y = (int32_t) GFX.StartY - 1; y >= 0; y--) { // memmove converted: Same malloc, different addresses, and identical addresses at line 0 [Neb] @@ -3685,9 +3684,9 @@ void S9xUpdateScreen() uint32_t y; for (y = starty; y <= endy; y++) { - register uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2); - register uint8_t* d = GFX.SubZBuffer + y * GFX.ZPitch; - register uint8_t* e = d + IPPU.RenderedScreenWidth; + uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2); + uint8_t* d = GFX.SubZBuffer + y * GFX.ZPitch; + uint8_t* e = d + IPPU.RenderedScreenWidth; while (d < e) { @@ -3737,11 +3736,11 @@ void S9xUpdateScreen() { if (GFX.r2131 & 0x40) { - // Subtract, halving the result. - register uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; - register uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; - register uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; - register uint8_t* e = d + Right; + /* Subtract, halving the result. */ + uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; + uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; + uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; + uint8_t* e = d + Right; uint16_t back_fixed = COLOR_SUB(back, GFX.FixedColour); d += Left; @@ -3767,10 +3766,10 @@ void S9xUpdateScreen() else { // Subtract - register uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; - register uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; - register uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; - register uint8_t* e = d + Right; + uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; + uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; + uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; + uint8_t* e = d + Right; uint16_t back_fixed = COLOR_SUB(back, GFX.FixedColour); d += Left; @@ -3796,10 +3795,10 @@ void S9xUpdateScreen() } else if (GFX.r2131 & 0x40) { - register uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; - register uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; - register uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; - register uint8_t* e = d + Right; + uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; + uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; + uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; + uint8_t* e = d + Right; uint16_t back_fixed = COLOR_ADD(back, GFX.FixedColour); d += Left; while (d < e) @@ -3823,10 +3822,10 @@ void S9xUpdateScreen() } else if (back != 0) { - register uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; - register uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; - register uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; - register uint8_t* e = d + Right; + uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; + uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; + uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; + uint8_t* e = d + Right; uint16_t back_fixed = COLOR_ADD(back, GFX.FixedColour); d += Left; while (d < e) @@ -3856,10 +3855,10 @@ void S9xUpdateScreen() // copy the sub-screen to the main screen // or fill it with the back-drop colour if the // sub-screen is clear. - register uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; - register uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; - register uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; - register uint8_t* e = d + Right; + uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + Left; + uint8_t* d = GFX.ZBuffer + y * GFX.ZPitch; + uint8_t* s = GFX.SubZBuffer + y * GFX.ZPitch + Left; + uint8_t* e = d + Right; d += Left; while (d < e) { @@ -4003,12 +4002,12 @@ void S9xUpdateScreen() { // Mixture of background modes used on screen - scale width // of all non-mode 5 and 6 pixels. - register uint32_t y; + uint32_t y; for (y = starty; y <= endy; y++) { - register uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + 255; - register uint16_t* q = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + 510; - register int x; + int x; + uint16_t* p = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + 255; + uint16_t* q = (uint16_t*)(GFX.Screen + y * GFX.Pitch2) + 510; for (x = 255; x >= 0; x--, p--, q -= 2) * q = *(q + 1) = *p; } diff --git a/source/memmap.c b/source/memmap.c index 257b4ec..ac6384d 100644 --- a/source/memmap.c +++ b/source/memmap.c @@ -153,7 +153,7 @@ static int check_char(unsigned c) } void S9xDeinterleaveType2(bool reset); -uint32_t caCRC32(uint8_t* array, uint32_t size, register uint32_t crc32); +uint32_t caCRC32(uint8_t* array, uint32_t size, uint32_t crc32); extern char* rom_filename; @@ -1265,9 +1265,9 @@ void S9xDeinterleaveType2(bool reset) } //CRC32 for char arrays -uint32_t caCRC32(uint8_t* array, uint32_t size, register uint32_t crc32) +uint32_t caCRC32(uint8_t* array, uint32_t size, uint32_t crc32) { - register uint32_t i; + uint32_t i; for (i = 0; i < size; i++) crc32 = ((crc32 >> 8) & 0x00FFFFFF) ^ crc32Table[(crc32 ^ array[i]) & 0xFF]; return ~crc32; diff --git a/source/tile.c b/source/tile.c index a9619fa..d3d63eb 100644 --- a/source/tile.c +++ b/source/tile.c @@ -99,7 +99,7 @@ extern uint32_t TailMask [5]; static uint8_t ConvertTile(uint8_t* pCache, uint32_t TileAddr) { - register uint8_t* tp = &Memory.VRAM[TileAddr]; + uint8_t* tp = &Memory.VRAM[TileAddr]; uint32_t* p = (uint32_t*) pCache; uint32_t non_zero = 0; uint8_t line; @@ -111,7 +111,7 @@ static uint8_t ConvertTile(uint8_t* pCache, uint32_t TileAddr) { uint32_t p1 = 0; uint32_t p2 = 0; - register uint8_t pix; + uint8_t pix; if ((pix = *(tp + 0))) { @@ -164,7 +164,7 @@ static uint8_t ConvertTile(uint8_t* pCache, uint32_t TileAddr) { uint32_t p1 = 0; uint32_t p2 = 0; - register uint8_t pix; + uint8_t pix; if ((pix = *(tp + 0))) { p1 |= odd_high[0][pix >> 4]; @@ -196,7 +196,7 @@ static uint8_t ConvertTile(uint8_t* pCache, uint32_t TileAddr) { uint32_t p1 = 0; uint32_t p2 = 0; - register uint8_t pix; + uint8_t pix; if ((pix = *(tp + 0))) { p1 |= odd_high[0][pix >> 4]; @@ -360,7 +360,7 @@ void DrawTile16(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; RENDER_TILE(WRITE_4PIXELS16, WRITE_4PIXELS16_FLIPPED, 4) } @@ -370,7 +370,7 @@ void DrawClippedTile16(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16, WRITE_4PIXELS16_FLIPPED, 4) @@ -380,7 +380,7 @@ void DrawTile16HalfWidth(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; RENDER_TILE(WRITE_4PIXELS16_HALFWIDTH, WRITE_4PIXELS16_FLIPPED_HALFWIDTH, 2) } @@ -390,7 +390,7 @@ void DrawClippedTile16HalfWidth(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16_HALFWIDTH, @@ -401,7 +401,7 @@ void DrawTile16x2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; RENDER_TILE(WRITE_4PIXELS16x2, WRITE_4PIXELS16_FLIPPEDx2, 8) } @@ -411,7 +411,7 @@ void DrawClippedTile16x2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16x2, WRITE_4PIXELS16_FLIPPEDx2, 8) @@ -421,7 +421,7 @@ void DrawTile16x2x2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; RENDER_TILE(WRITE_4PIXELS16x2x2, WRITE_4PIXELS16_FLIPPEDx2x2, 8) } @@ -431,7 +431,7 @@ void DrawClippedTile16x2x2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16x2x2, WRITE_4PIXELS16_FLIPPEDx2x2, 8) @@ -443,7 +443,7 @@ void DrawLargePixel16(uint32_t Tile, int32_t Offset, { TILE_PREAMBLE - register uint16_t* sp = (uint16_t*) GFX.S + Offset; + uint16_t* sp = (uint16_t*) GFX.S + Offset; uint8_t* Depth = GFX.DB + Offset; uint16_t pixel; @@ -456,7 +456,7 @@ void DrawLargePixel16HalfWidth(uint32_t Tile, int32_t Offset, { TILE_PREAMBLE - register uint16_t* sp = (uint16_t*) GFX.S + Offset; + uint16_t* sp = (uint16_t*) GFX.S + Offset; uint8_t* Depth = GFX.DB + Offset; uint16_t pixel; @@ -706,7 +706,7 @@ void DrawTile16Add(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; uint8_t Pixel; uint16_t* Screen = (uint16_t*) GFX.S + Offset; uint8_t* Depth = GFX.ZBuffer + Offset; @@ -832,7 +832,7 @@ void DrawClippedTile16Add(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16_ADD, WRITE_4PIXELS16_FLIPPED_ADD, 4) @@ -842,7 +842,7 @@ void DrawTile16Add1_2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; RENDER_TILE(WRITE_4PIXELS16_ADD1_2, WRITE_4PIXELS16_FLIPPED_ADD1_2, 4) } @@ -852,7 +852,7 @@ void DrawClippedTile16Add1_2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16_ADD1_2, WRITE_4PIXELS16_FLIPPED_ADD1_2, 4) @@ -862,7 +862,7 @@ void DrawTile16Sub(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; RENDER_TILE(WRITE_4PIXELS16_SUB, WRITE_4PIXELS16_FLIPPED_SUB, 4) } @@ -872,7 +872,7 @@ void DrawClippedTile16Sub(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16_SUB, WRITE_4PIXELS16_FLIPPED_SUB, 4) @@ -882,7 +882,7 @@ void DrawTile16Sub1_2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; RENDER_TILE(WRITE_4PIXELS16_SUB1_2, WRITE_4PIXELS16_FLIPPED_SUB1_2, 4) } @@ -892,7 +892,7 @@ void DrawClippedTile16Sub1_2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16_SUB1_2, WRITE_4PIXELS16_FLIPPED_SUB1_2, 4) @@ -982,7 +982,7 @@ void DrawTile16FixedAdd1_2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; RENDER_TILE(WRITE_4PIXELS16_ADDF1_2, WRITE_4PIXELS16_FLIPPED_ADDF1_2, 4) } @@ -992,7 +992,7 @@ void DrawClippedTile16FixedAdd1_2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16_ADDF1_2, @@ -1003,7 +1003,7 @@ void DrawTile16FixedSub1_2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; RENDER_TILE(WRITE_4PIXELS16_SUBF1_2, WRITE_4PIXELS16_FLIPPED_SUBF1_2, 4) } @@ -1013,7 +1013,7 @@ void DrawClippedTile16FixedSub1_2(uint32_t Tile, int32_t Offset, uint32_t StartLine, uint32_t LineCount) { TILE_PREAMBLE - register uint8_t* bp; + uint8_t* bp; TILE_CLIP_PREAMBLE RENDER_CLIPPED_TILE(WRITE_4PIXELS16_SUBF1_2, @@ -1026,7 +1026,7 @@ void DrawLargePixel16Add(uint32_t Tile, int32_t Offset, { TILE_PREAMBLE - register uint16_t* sp = (uint16_t*) GFX.S + Offset; + uint16_t* sp = (uint16_t*) GFX.S + Offset; uint8_t* Depth = GFX.ZBuffer + Offset; uint16_t pixel; @@ -1045,7 +1045,7 @@ void DrawLargePixel16Add1_2(uint32_t Tile, int32_t Offset, { TILE_PREAMBLE - register uint16_t* sp = (uint16_t*) GFX.S + Offset; + uint16_t* sp = (uint16_t*) GFX.S + Offset; uint8_t* Depth = GFX.ZBuffer + Offset; uint16_t pixel; @@ -1064,7 +1064,7 @@ void DrawLargePixel16Sub(uint32_t Tile, int32_t Offset, { TILE_PREAMBLE - register uint16_t* sp = (uint16_t*) GFX.S + Offset; + uint16_t* sp = (uint16_t*) GFX.S + Offset; uint8_t* Depth = GFX.ZBuffer + Offset; uint16_t pixel; @@ -1083,7 +1083,7 @@ void DrawLargePixel16Sub1_2(uint32_t Tile, int32_t Offset, { TILE_PREAMBLE - register uint16_t* sp = (uint16_t*) GFX.S + Offset; + uint16_t* sp = (uint16_t*) GFX.S + Offset; uint8_t* Depth = GFX.ZBuffer + Offset; uint16_t pixel; diff --git a/source/tile.h b/source/tile.h index 5200270..7971b3f 100644 --- a/source/tile.h +++ b/source/tile.h @@ -107,7 +107,7 @@ if (BG.Buffered [TileNumber] == BLANK_TILE) \ return; \ \ - register uint32_t l; \ + uint32_t l; \ uint16_t *ScreenColors; \ if (BG.DirectColourMode) \ { \ diff --git a/version b/version deleted file mode 100644 index e6ed958..0000000 --- a/version +++ /dev/null @@ -1,4 +0,0 @@ -2010.11.09 -version 1.06 -This is the first release soure version - |