From e2eab7f4081e7706b2e834c91690a8f310c4d4b6 Mon Sep 17 00:00:00 2001 From: ekeeke31 Date: Wed, 27 Jan 2010 07:14:45 +0000 Subject: [PATCH] defined HVC tables as 'const' for some optimization (?) --- source/hvc.h | 20 ++++++++++---------- source/vdp.h | 14 +++++++------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/hvc.h b/source/hvc.h index c23134b..8a74083 100644 --- a/source/hvc.h +++ b/source/hvc.h @@ -124,7 +124,7 @@ #define _HVC_H_ /* V counter values for NTSC 192-line display */ -uint8 vc_ntsc_192[262] = { +const uint8 vc_ntsc_192[262] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, @@ -145,7 +145,7 @@ uint8 vc_ntsc_192[262] = { }; /* V counter values for NTSC 224-line display */ -uint8 vc_ntsc_224[262] = { +const uint8 vc_ntsc_224[262] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, @@ -166,7 +166,7 @@ uint8 vc_ntsc_224[262] = { }; /* V counter values for NTSC 240-line display (invalid mode) */ -uint8 vc_ntsc_240[262] = { +const uint8 vc_ntsc_240[262] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, @@ -187,7 +187,7 @@ uint8 vc_ntsc_240[262] = { }; /* V counter values for PAL 192-line display */ -uint8 vc_pal_192[313] = { +const uint8 vc_pal_192[313] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, @@ -212,7 +212,7 @@ uint8 vc_pal_192[313] = { }; /* V counter values for PAL 224-line display */ -uint8 vc_pal_224[313] = { +const uint8 vc_pal_224[313] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, @@ -237,7 +237,7 @@ uint8 vc_pal_224[313] = { }; /* V counter values for PAL 240-line display */ -uint8 vc_pal_240[313] = { +const uint8 vc_pal_240[313] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, @@ -276,7 +276,7 @@ uint8 vc_pal_240[313] = { /* */ /***************************************************************/ -uint8 cycle2hc40[3420] = +const uint8 cycle2hc40[3420] = { /* end of active display (16 pixels -> 128 Mcycles) , HINT triggered , Vcounter jump */ 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, @@ -513,7 +513,7 @@ uint8 cycle2hc40[3420] = 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, 0xa4, }; -uint8 cycle2hc32[3420] = +const uint8 cycle2hc32[3420] = { /* end of active display (16 pixels -> 160 Mcycles) , HINT triggered ? , Vcounter jump */ 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, @@ -751,8 +751,8 @@ uint8 cycle2hc32[3420] = 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, }; -uint8 *vctab; -uint8 *hctab; +const uint8 *vctab; +const uint8 *hctab; #endif /* _HVC_H_ */ diff --git a/source/vdp.h b/source/vdp.h index 125340d..b20bfb2 100644 --- a/source/vdp.h +++ b/source/vdp.h @@ -65,13 +65,13 @@ extern uint8 odd_frame; extern uint8 vdp_pal; extern uint16 lines_per_frame; -extern uint8 *vctab; -extern uint8 *hctab; -extern uint8 vc_ntsc_224[262]; -extern uint8 vc_pal_224[313]; -extern uint8 vc_pal_240[313]; -extern uint8 cycle2hc32[3420]; -extern uint8 cycle2hc40[3420]; +extern const uint8 vc_ntsc_224[262]; +extern const uint8 vc_pal_224[313]; +extern const uint8 vc_pal_240[313]; +extern const uint8 cycle2hc32[3420]; +extern const uint8 cycle2hc40[3420]; +extern const uint8 *vctab; +extern const uint8 *hctab; /* Function prototypes */ extern void vdp_init(void);