comparison src/console/Hes_Cpu.cxx @ 341:986f098da058 trunk

[svn] - merge in blargg's changes
author nenolod
date Thu, 07 Dec 2006 15:20:41 -0800
parents fb513e10174e
children
comparison
equal deleted inserted replaced
340:9e5a7158fa80 341:986f098da058
1 // Game_Music_Emu 0.5.1. http://www.slack.net/~ant/ 1 // Game_Music_Emu 0.5.2. http://www.slack.net/~ant/
2 2
3 #include "Hes_Cpu.h" 3 #include "Hes_Cpu.h"
4 4
5 #include "blargg_endian.h" 5 #include "blargg_endian.h"
6 6
225 //#define PAGE_CROSS_PENALTY( lsb ) (void) (s_time += (lsb) >> 8) 225 //#define PAGE_CROSS_PENALTY( lsb ) (void) (s_time += (lsb) >> 8)
226 #define PAGE_CROSS_PENALTY( lsb ) 226 #define PAGE_CROSS_PENALTY( lsb )
227 227
228 // Branch 228 // Branch
229 229
230 // TODO: more efficient way to handle negative branch that wraps PC around
230 #define BRANCH( cond )\ 231 #define BRANCH( cond )\
231 {\ 232 {\
232 fint16 offset = (BOOST::int8_t) data;\ 233 fint16 offset = (BOOST::int8_t) data;\
233 pc++;\ 234 pc++;\
234 if ( !(cond) ) goto branch_not_taken;\ 235 if ( !(cond) ) goto branch_not_taken;\
235 pc += offset;\ 236 pc = BOOST::uint16_t (pc + offset);\
236 goto loop;\ 237 goto loop;\
237 } 238 }
238 239
239 case 0xF0: // BEQ 240 case 0xF0: // BEQ
240 BRANCH( !((uint8_t) nz) ); 241 BRANCH( !((uint8_t) nz) );