| 1 | /* Cygne |
| 2 | * |
| 3 | * Copyright notice for this file: |
| 4 | * Copyright (C) 2002 Dox [email protected] |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | */ |
| 20 | |
| 21 | #include <string.h> |
| 22 | |
| 23 | #include "../mednafen-types.h"cxx . . $ `<file>/mednafen/mednafen-types.h`/ |
| 24 | #include "wswan-memory.h"cxx . . $ `<file>/mednafen/wswan/wswan-memory.h`/ |
| 25 | |
| 26 | static uint8cxx . . $ uint8# tilescxx . . $ tiles.[256][256][2][8]; |
| 27 | uint8cxx . . $ uint8# wsTCachecxx . . $ wsTCache.[512*64]; |
| 28 | uint8cxx . . $ uint8# wsTCache2cxx . . $ wsTCache2.[512*64]; |
| 29 | uint8cxx . . $ uint8# wsTCacheFlippedcxx . . $ wsTCacheFlipped.[512*64]; |
| 30 | uint8cxx . . $ uint8# wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[512*64]; |
| 31 | uint8cxx . . $ uint8# wsTCacheUpdatecxx . . $ wsTCacheUpdate.[512]; |
| 32 | uint8cxx . . $ uint8# wsTCacheUpdate2cxx . . $ wsTCacheUpdate2.[512]; |
| 33 | uint8cxx . . $ uint8# wsTileRowcxx . . $ wsTileRow.[8]; |
| 34 | int wsVModecxx . . $ wsVMode.; |
| 35 | |
| 36 | void WSWan_TCacheInvalidByAddrcxx . . $ WSWan_TCacheInvalidByAddr(cb2f890c2fdad230).(uint32cxx . . $ uint32# ws_offset) |
| 37 | { |
| 38 | if(wsVModecxx . . $ wsVMode. && (ws_offset>=0x4000)&&(ws_offset<0x8000)) |
| 39 | { |
| 40 | wsTCacheUpdatecxx . . $ wsTCacheUpdate.[(ws_offset-0x4000)>>5]=falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; /*invalidate tile*/ |
| 41 | return; |
| 42 | } |
| 43 | else if((ws_offset>=0x2000)&&(ws_offset<0x4000)) |
| 44 | { |
| 45 | wsTCacheUpdatecxx . . $ wsTCacheUpdate.[(ws_offset-0x2000)>>4]=falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; /*invalidate tile*/ |
| 46 | return; |
| 47 | } |
| 48 | |
| 49 | if(wsVModecxx . . $ wsVMode. && (ws_offset>=0x8000)&&(ws_offset<0xc000)) |
| 50 | { |
| 51 | wsTCacheUpdate2cxx . . $ wsTCacheUpdate2.[(ws_offset-0x8000)>>5]=falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; /*invalidate tile*/ |
| 52 | return; |
| 53 | } |
| 54 | else if((ws_offset>=0x4000)&&(ws_offset<0x6000)) |
| 55 | { |
| 56 | wsTCacheUpdate2cxx . . $ wsTCacheUpdate2.[(ws_offset-0x4000)>>4]=falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!; /*invalidate tile*/ |
| 57 | return; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | void wsSetVideocxx . . $ wsSetVideo(918ebd27a9ddbad3).(int number,boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! force) |
| 62 | { |
| 63 | if((number!=wsVModecxx . . $ wsVMode.)||(force)) |
| 64 | { |
| 65 | wsVModecxx . . $ wsVMode.=number; |
| 66 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(wsTCacheUpdatecxx . . $ wsTCacheUpdate.,0,512); |
| 67 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(wsTCacheUpdate2cxx . . $ wsTCacheUpdate2.,0,512); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | void wsMakeTilescxx . . $ wsMakeTiles(49f6e7a06ebc5aa8).(void) |
| 72 | { |
| 73 | int x,y,b0,b1,b2,b3,b4,b5,b6,b7; |
| 74 | for(x=0;x<256;x++) |
| 75 | for(y=0;y<256;y++) |
| 76 | { |
| 77 | b0=(x&128)>>7;b1=(x&64)>>6;b2=(x&32)>>5;b3=(x&16)>>4;b4=(x&8)>>3;b5=(x&4)>>2;b6=(x&2)>>1;b7=(x&1); |
| 78 | b0|=(y&128)>>6;b1|=(y&64)>>5;b2|=(y&32)>>4;b3|=(y&16)>>3;b4|=(y&8)>>2;b5|=(y&4)>>1;b6|=(y&2);b7|=(y&1)<<1; |
| 79 | tilescxx . . $ tiles.[x][y][0][0]=b0; |
| 80 | tilescxx . . $ tiles.[x][y][0][1]=b1; |
| 81 | tilescxx . . $ tiles.[x][y][0][2]=b2; |
| 82 | tilescxx . . $ tiles.[x][y][0][3]=b3; |
| 83 | tilescxx . . $ tiles.[x][y][0][4]=b4; |
| 84 | tilescxx . . $ tiles.[x][y][0][5]=b5; |
| 85 | tilescxx . . $ tiles.[x][y][0][6]=b6; |
| 86 | tilescxx . . $ tiles.[x][y][0][7]=b7; |
| 87 | tilescxx . . $ tiles.[x][y][1][0]=b7; |
| 88 | tilescxx . . $ tiles.[x][y][1][1]=b6; |
| 89 | tilescxx . . $ tiles.[x][y][1][2]=b5; |
| 90 | tilescxx . . $ tiles.[x][y][1][3]=b4; |
| 91 | tilescxx . . $ tiles.[x][y][1][4]=b3; |
| 92 | tilescxx . . $ tiles.[x][y][1][5]=b2; |
| 93 | tilescxx . . $ tiles.[x][y][1][6]=b1; |
| 94 | tilescxx . . $ tiles.[x][y][1][7]=b0; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | void wsGetTilecxx . . $ wsGetTile(b565df6bee9b73e5).(uint32cxx . . $ uint32# number,uint32cxx . . $ uint32# line,int flipv,int fliph,int bank) |
| 99 | { |
| 100 | uint32cxx . . $ uint32# t_adr,t_index,i; |
| 101 | uint8cxx . . $ uint8# byte0,byte1,byte2,byte3; |
| 102 | |
| 103 | if((!bank)||(!(wsVModecxx . . $ wsVMode. &0x07))) |
| 104 | { |
| 105 | #ifdef TCACHE_OFF |
| 106 | wsTCacheUpdate[number]=false; |
| 107 | #endif |
| 108 | |
| 109 | if(!wsTCacheUpdatecxx . . $ wsTCacheUpdate.[number]) |
| 110 | { |
| 111 | wsTCacheUpdatecxx . . $ wsTCacheUpdate.[number]=truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 112 | switch(wsVModecxx . . $ wsVMode.) |
| 113 | { |
| 114 | case 7: |
| 115 | t_adr=0x4000+(number<<5); |
| 116 | t_index=number<<6; |
| 117 | for(i=0;i<8;i++) |
| 118 | { |
| 119 | byte0=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 120 | byte1=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 121 | byte2=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 122 | byte3=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 123 | wsTCachecxx . . $ wsTCache.[t_index]=byte0>>4; |
| 124 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=byte3&15; |
| 125 | wsTCachecxx . . $ wsTCache.[t_index]=byte0&15; |
| 126 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=byte3>>4; |
| 127 | wsTCachecxx . . $ wsTCache.[t_index]=byte1>>4; |
| 128 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=byte2&15; |
| 129 | wsTCachecxx . . $ wsTCache.[t_index]=byte1&15; |
| 130 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=byte2>>4; |
| 131 | wsTCachecxx . . $ wsTCache.[t_index]=byte2>>4; |
| 132 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=byte1&15; |
| 133 | wsTCachecxx . . $ wsTCache.[t_index]=byte2&15; |
| 134 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=byte1>>4; |
| 135 | wsTCachecxx . . $ wsTCache.[t_index]=byte3>>4; |
| 136 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=byte0&15; |
| 137 | wsTCachecxx . . $ wsTCache.[t_index]=byte3&15; |
| 138 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=byte0>>4; |
| 139 | } |
| 140 | break; |
| 141 | |
| 142 | case 6: |
| 143 | t_adr=0x4000+(number<<5); |
| 144 | t_index=number<<6; |
| 145 | for(i=0;i<8;i++) |
| 146 | { |
| 147 | byte0=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 148 | byte1=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 149 | byte2=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 150 | byte3=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 151 | wsTCachecxx . . $ wsTCache.[t_index]=((byte0>>7)&1)|(((byte1>>7)&1)<<1)|(((byte2>>7)&1)<<2)|(((byte3>>7)&1)<<3); |
| 152 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=((byte0)&1)|(((byte1)&1)<<1)|(((byte2)&1)<<2)|(((byte3)&1)<<3); |
| 153 | wsTCachecxx . . $ wsTCache.[t_index]=((byte0>>6)&1)|(((byte1>>6)&1)<<1)|(((byte2>>6)&1)<<2)|(((byte3>>6)&1)<<3); |
| 154 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=((byte0>>1)&1)|(((byte1>>1)&1)<<1)|(((byte2>>1)&1)<<2)|(((byte3>>1)&1)<<3); |
| 155 | wsTCachecxx . . $ wsTCache.[t_index]=((byte0>>5)&1)|(((byte1>>5)&1)<<1)|(((byte2>>5)&1)<<2)|(((byte3>>5)&1)<<3); |
| 156 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=((byte0>>2)&1)|(((byte1>>2)&1)<<1)|(((byte2>>2)&1)<<2)|(((byte3>>2)&1)<<3); |
| 157 | wsTCachecxx . . $ wsTCache.[t_index]=((byte0>>4)&1)|(((byte1>>4)&1)<<1)|(((byte2>>4)&1)<<2)|(((byte3>>4)&1)<<3); |
| 158 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=((byte0>>3)&1)|(((byte1>>3)&1)<<1)|(((byte2>>3)&1)<<2)|(((byte3>>3)&1)<<3); |
| 159 | wsTCachecxx . . $ wsTCache.[t_index]=((byte0>>3)&1)|(((byte1>>3)&1)<<1)|(((byte2>>3)&1)<<2)|(((byte3>>3)&1)<<3); |
| 160 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=((byte0>>4)&1)|(((byte1>>4)&1)<<1)|(((byte2>>4)&1)<<2)|(((byte3>>4)&1)<<3); |
| 161 | wsTCachecxx . . $ wsTCache.[t_index]=((byte0>>2)&1)|(((byte1>>2)&1)<<1)|(((byte2>>2)&1)<<2)|(((byte3>>2)&1)<<3); |
| 162 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=((byte0>>5)&1)|(((byte1>>5)&1)<<1)|(((byte2>>5)&1)<<2)|(((byte3>>5)&1)<<3); |
| 163 | wsTCachecxx . . $ wsTCache.[t_index]=((byte0>>1)&1)|(((byte1>>1)&1)<<1)|(((byte2>>1)&1)<<2)|(((byte3>>1)&1)<<3); |
| 164 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=((byte0>>6)&1)|(((byte1>>6)&1)<<1)|(((byte2>>6)&1)<<2)|(((byte3>>6)&1)<<3); |
| 165 | wsTCachecxx . . $ wsTCache.[t_index]=((byte0)&1)|(((byte1)&1)<<1)|(((byte2)&1)<<2)|(((byte3)&1)<<3); |
| 166 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=((byte0>>7)&1)|(((byte1>>7)&1)<<1)|(((byte2>>7)&1)<<2)|(((byte3>>7)&1)<<3); |
| 167 | } |
| 168 | break; |
| 169 | |
| 170 | default: |
| 171 | t_adr=0x2000+(number<<4); |
| 172 | t_index=number<<6; |
| 173 | for(i=0;i<8;i++) |
| 174 | { |
| 175 | byte0=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 176 | byte1=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 177 | wsTCachecxx . . $ wsTCache.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][0]; |
| 178 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][0]; |
| 179 | wsTCachecxx . . $ wsTCache.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][1]; |
| 180 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][1]; |
| 181 | wsTCachecxx . . $ wsTCache.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][2]; |
| 182 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][2]; |
| 183 | wsTCachecxx . . $ wsTCache.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][3]; |
| 184 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][3]; |
| 185 | wsTCachecxx . . $ wsTCache.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][4]; |
| 186 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][4]; |
| 187 | wsTCachecxx . . $ wsTCache.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][5]; |
| 188 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][5]; |
| 189 | wsTCachecxx . . $ wsTCache.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][6]; |
| 190 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][6]; |
| 191 | wsTCachecxx . . $ wsTCache.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][7]; |
| 192 | wsTCacheFlippedcxx . . $ wsTCacheFlipped.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][7]; |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | if(flipv) |
| 197 | line=7-line; |
| 198 | if(fliph) |
| 199 | memcpycxx . . $ memcpy(cc817cb175f282d).(&wsTileRowcxx . . $ wsTileRow.[0],&wsTCacheFlippedcxx . . $ wsTCacheFlipped.[(number<<6)|(line<<3)],8); |
| 200 | else |
| 201 | memcpycxx . . $ memcpy(cc817cb175f282d).(&wsTileRowcxx . . $ wsTileRow.[0],&wsTCachecxx . . $ wsTCache.[(number<<6)|(line<<3)],8); |
| 202 | } |
| 203 | else |
| 204 | { |
| 205 | |
| 206 | #ifdef TCACHE_OFF |
| 207 | wsTCacheUpdate2[number]=false; |
| 208 | #endif |
| 209 | |
| 210 | if(!wsTCacheUpdate2cxx . . $ wsTCacheUpdate2.[number]) |
| 211 | { |
| 212 | wsTCacheUpdate2cxx . . $ wsTCacheUpdate2.[number]=truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!; |
| 213 | switch(wsVModecxx . . $ wsVMode.) |
| 214 | { |
| 215 | case 7: |
| 216 | t_adr=0x8000+(number<<5); |
| 217 | t_index=number<<6; |
| 218 | for(i=0;i<8;i++) |
| 219 | { |
| 220 | byte0=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 221 | byte1=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 222 | byte2=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 223 | byte3=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 224 | wsTCache2cxx . . $ wsTCache2.[t_index]=byte0>>4; |
| 225 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=byte3&15; |
| 226 | wsTCache2cxx . . $ wsTCache2.[t_index]=byte0&15; |
| 227 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=byte3>>4; |
| 228 | wsTCache2cxx . . $ wsTCache2.[t_index]=byte1>>4; |
| 229 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=byte2&15; |
| 230 | wsTCache2cxx . . $ wsTCache2.[t_index]=byte1&15; |
| 231 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=byte2>>4; |
| 232 | wsTCache2cxx . . $ wsTCache2.[t_index]=byte2>>4; |
| 233 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=byte1&15; |
| 234 | wsTCache2cxx . . $ wsTCache2.[t_index]=byte2&15; |
| 235 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=byte1>>4; |
| 236 | wsTCache2cxx . . $ wsTCache2.[t_index]=byte3>>4; |
| 237 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=byte0&15; |
| 238 | wsTCache2cxx . . $ wsTCache2.[t_index]=byte3&15; |
| 239 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=byte0>>4; |
| 240 | } |
| 241 | break; |
| 242 | case 6: |
| 243 | t_adr=0x8000+(number<<5); |
| 244 | t_index=number<<6; |
| 245 | for(i=0;i<8;i++) |
| 246 | { |
| 247 | byte0=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 248 | byte1=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 249 | byte2=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 250 | byte3=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 251 | wsTCache2cxx . . $ wsTCache2.[t_index]=((byte0>>7)&1)|(((byte1>>7)&1)<<1)|(((byte2>>7)&1)<<2)|(((byte3>>7)&1)<<3); |
| 252 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=((byte0)&1)|(((byte1)&1)<<1)|(((byte2)&1)<<2)|(((byte3)&1)<<3); |
| 253 | wsTCache2cxx . . $ wsTCache2.[t_index]=((byte0>>6)&1)|(((byte1>>6)&1)<<1)|(((byte2>>6)&1)<<2)|(((byte3>>6)&1)<<3); |
| 254 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=((byte0>>1)&1)|(((byte1>>1)&1)<<1)|(((byte2>>1)&1)<<2)|(((byte3>>1)&1)<<3); |
| 255 | wsTCache2cxx . . $ wsTCache2.[t_index]=((byte0>>5)&1)|(((byte1>>5)&1)<<1)|(((byte2>>5)&1)<<2)|(((byte3>>5)&1)<<3); |
| 256 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=((byte0>>2)&1)|(((byte1>>2)&1)<<1)|(((byte2>>2)&1)<<2)|(((byte3>>2)&1)<<3); |
| 257 | wsTCache2cxx . . $ wsTCache2.[t_index]=((byte0>>4)&1)|(((byte1>>4)&1)<<1)|(((byte2>>4)&1)<<2)|(((byte3>>4)&1)<<3); |
| 258 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=((byte0>>3)&1)|(((byte1>>3)&1)<<1)|(((byte2>>3)&1)<<2)|(((byte3>>3)&1)<<3); |
| 259 | wsTCache2cxx . . $ wsTCache2.[t_index]=((byte0>>3)&1)|(((byte1>>3)&1)<<1)|(((byte2>>3)&1)<<2)|(((byte3>>3)&1)<<3); |
| 260 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=((byte0>>4)&1)|(((byte1>>4)&1)<<1)|(((byte2>>4)&1)<<2)|(((byte3>>4)&1)<<3); |
| 261 | wsTCache2cxx . . $ wsTCache2.[t_index]=((byte0>>2)&1)|(((byte1>>2)&1)<<1)|(((byte2>>2)&1)<<2)|(((byte3>>2)&1)<<3); |
| 262 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=((byte0>>5)&1)|(((byte1>>5)&1)<<1)|(((byte2>>5)&1)<<2)|(((byte3>>5)&1)<<3); |
| 263 | wsTCache2cxx . . $ wsTCache2.[t_index]=((byte0>>1)&1)|(((byte1>>1)&1)<<1)|(((byte2>>1)&1)<<2)|(((byte3>>1)&1)<<3); |
| 264 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=((byte0>>6)&1)|(((byte1>>6)&1)<<1)|(((byte2>>6)&1)<<2)|(((byte3>>6)&1)<<3); |
| 265 | wsTCache2cxx . . $ wsTCache2.[t_index]=((byte0)&1)|(((byte1)&1)<<1)|(((byte2)&1)<<2)|(((byte3)&1)<<3); |
| 266 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=((byte0>>7)&1)|(((byte1>>7)&1)<<1)|(((byte2>>7)&1)<<2)|(((byte3>>7)&1)<<3); |
| 267 | } |
| 268 | break; |
| 269 | default: |
| 270 | t_adr=0x4000+(number<<4); |
| 271 | t_index=number<<6; |
| 272 | for(i=0;i<8;i++) |
| 273 | { |
| 274 | byte0=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 275 | byte1=wsRAMcxx . . $ wsRAM.[t_adr++]; |
| 276 | wsTCache2cxx . . $ wsTCache2.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][0]; |
| 277 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][0]; |
| 278 | wsTCache2cxx . . $ wsTCache2.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][1]; |
| 279 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][1]; |
| 280 | wsTCache2cxx . . $ wsTCache2.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][2]; |
| 281 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][2]; |
| 282 | wsTCache2cxx . . $ wsTCache2.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][3]; |
| 283 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][3]; |
| 284 | wsTCache2cxx . . $ wsTCache2.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][4]; |
| 285 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][4]; |
| 286 | wsTCache2cxx . . $ wsTCache2.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][5]; |
| 287 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][5]; |
| 288 | wsTCache2cxx . . $ wsTCache2.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][6]; |
| 289 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][6]; |
| 290 | wsTCache2cxx . . $ wsTCache2.[t_index]=tilescxx . . $ tiles.[byte0][byte1][0][7]; |
| 291 | wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[t_index++]=tilescxx . . $ tiles.[byte0][byte1][1][7]; |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | if(flipv) |
| 296 | line=7-line; |
| 297 | if(fliph) |
| 298 | memcpycxx . . $ memcpy(cc817cb175f282d).(&wsTileRowcxx . . $ wsTileRow.[0],&wsTCacheFlipped2cxx . . $ wsTCacheFlipped2.[(number<<6)|(line<<3)],8); |
| 299 | else |
| 300 | memcpycxx . . $ memcpy(cc817cb175f282d).(&wsTileRowcxx . . $ wsTileRow.[0],&wsTCache2cxx . . $ wsTCache2.[(number<<6)|(line<<3)],8); |
| 301 | } |
| 302 | } |