| 252 | } |
| 253 | |
| 254 | int GetPRGAddress(int A){ |
| 255 | int result; |
| 256 | if(A > 0xFFFF) |
| 257 | return -1; |
| 258 | if (GameInfo->type == GIT_FDS) { |
| 259 | if (A < 0xE000) { |
| 260 | result = &Page[A >> 11][A] - PRGptr[1]; |
| 261 | if ((result > (int)PRGsize[1]) || (result < 0)) |
| 262 | return -1; |
| 263 | else |
| 264 | return result; |
| 265 | } else { |
| 266 | result = &Page[A >> 11][A] - PRGptr[0]; |
| 267 | if ((result > (int)PRGsize[0]) || (result < 0)) |
| 268 | return -1; |
| 269 | else |
| 270 | return result + PRGsize[1]; |
| 271 | } |
| 272 | } else { |
| 273 | result = &Page[A >> 11][A] - PRGptr[0]; |
| 274 | if ((result > (int)PRGsize[0]) || (result < 0)) |
| 275 | return -1; |
| 276 | else |
| 277 | return result; |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | /** |
| 282 | * Returns the bank for a given offset. |
no outgoing calls
no test coverage detected