FIELD



[0002] This invention relates to systems, methods, techniques, data structures, and other features for running software applications including but not limited to video games on platforms different from the ones the software is intended or designed to run on.



BACKGROUND AND SUMMARY



[0003] Nintendo's GAME BOY.RTM. hand-held video game platforms have been extraordinarily successful. Nintendo released the first GAME BOY.RTM. in the late 1980s. Since then, this product and its successors (GAME BOY COLOR.RTM. and GAME BOY ADVANCE.RTM.) have captured the imaginations of millions of video game players throughout the world.



[0004] A wide number of different software applications (including but not limited to video games) have been designed to run on these platforms. People throughout the world enjoy these applications every day. One can see them being used on subways, at sports arenas, after school, and in a number of other contexts. See FIG. 1A.



[0005] Nintendo's GAME BOY.RTM., GAME BOY COLOR.RTM. and GAME BOY ADVANCE.RTM. are examples of platforms having specialized hardware that is optimized for low cost, excellent performance and good graphics. These devices are not really general purpose computers; rather, they are special-purpose devices with specialized capabilities particularly adapted to video game play. These special capabilities provide low cost and exciting video game play action with good graphics and sound.



[0006] While GAME BOY.RTM. platforms are inexpensive and have long battery life, there may be situations in which it would be desirable to play or use applications developed for GAME BOY.RTM. on other platforms. For example, an airline, train or other vehicle passenger might want to play video games during a long journey. As shown in FIG. 1B, airlines are installing seat-back computer displays into the backs of airline seats. Such seat-back displays may provide a low cost personal computer including a processor, random access memory, liquid crystal display and input device(s). Similar displays could be installed in other vehicles (e.g., trains, ships, vans, cars, etc.) or in other contexts (e.g., at walk-up kiosks, within hotel rooms, etc.). It would be desirable under certain circumstances to allow users to execute all sorts of different applications including GAME BOY.RTM. video games and other applications using the general-purpose computer capabilities of such seat-back or similar display devices.



[0007] Personal computers have also proliferated throughout the world and are now available at relatively low cost. A trend has shifted some entertainment from the home television set to the home personal computer, where children and adults can view interesting web pages and play downloaded video games and other applications. In some circumstances, it may be desirable to allow users to play GAME BOY.RTM. video games on their home personal computers (see FIG. 1C).



[0008] A wide variety of so-called personal digital assistants (PDA's) have become available in recent years. Such devices now comprise an entire miniature computer within a package small enough to fit into your pocket. Mobile cellular telephones are also becoming increasingly computationally-intensive and have better displays so they can access the World Wide Web and perform a variety of downloaded applications. In some circumstances, it may be desirable to enable people to play GAME BOY.RTM. video games and other GAME BOY.RTM. applications on a personal digital assistant, cellular telephone or other such device (see FIG. 1D).



[0009] The special-purpose sound and graphics circuitry provided by the GAME BOY.RTM. platforms is not generally found in the various other platforms shown in FIGS. 1B, 1C and 1D. Providing these missing capabilities is one of the challenges to running a GAME BOY.RTM. video game (or other GAME BOY.RTM. application) on these other target platforms.



[0010] Another challenge relates to instruction set compatibility. Nintendo's GAME BOY.RTM. is based on an older, relatively inexpensive microprocessor (the Zilog Z80) that is no longer being used in most modern general purpose computer systems such as personal computers, seat-back displays and personal digital assistants. The Z80 instruction set (the language in which all GAME BOY.RTM. games and other GAME BOY.RTM. applications are written in) is not directly understood by the more modern Intel microprocessors (e.g., the 8086, 80286, 80386, Pentium and other processors in the Intel family) that are now widely used and found in most personal computers, seat-back displays, personal digital assistants, and the like. While it is possible to "port" certain GAME BOY.RTM. games or other applications to different microprocessor families (e.g., by cross-compiling the source code to a different target microprocessor), there may be an advantage in certain contexts to being able to play or execute the same binary images stored in GAME BOY.RTM. cartridges on target platforms other than GAME BOY.RTM..



[0011] One way to provide a cross-platform capability is to provide a GAME BOY.RTM. software emulator on the target platform. Generally, a software emulator is a computer program that executes on a desired target platform (e.g., a seat-back display device, a personal computer or a personal digital assistant shown in FIGS. 1B-1D) and uses software to supply native platform capabilities that are missing from the target platform. For example, a software emulator may perform some or all of GAME BOY.RTM.'s specialized graphics functions in software, and may interface with whatever graphics resources are available on the target platform to display resulting images. A software emulator may translate or interpret Z80 instructions so the microprocessor of the target platform can perform the functions that GAME BOY.RTM. would perform if presented with the same instructions. The software emulator may include software code that emulates hardware capabilities within the GAME BOY.RTM. circuitry (e.g., audio and/or graphics processing) and/or translate associated GAME BOY.RTM. application requests into requests that can be handled by the hardware resources available on the target platform. For example, the target platform may include a graphics adapter and associated display that is incompatible with GAME BOY.RTM.'s graphics hardware but which can perform some of the basic graphics functions required to display GAME BOY.RTM. graphics on a display.



[0012] A number of GAME BOY.RTM. emulators have been written for a variety of different platforms ranging from personal digital assistants to personal computers. However, further improvements are possible and desirable.



[0013] One area of needed improvement relates to obtaining acceptable speed performance and high quality sound and graphics on a low-capability platform. A low-capability platform (e.g., a seat-back display or a personal digital assistant) may not have enough processing power to readily provide acceptable speed performance. Unless the software emulator is carefully designed and carefully optimized, it will not be able to maintain real time speed performance when running on a slower or less highly capable processor. Slow-downs in game performance are generally unacceptable if the average user can notice them since they immediately affect and degrade the fun and excitement of the game playing experience.



[0014] Performance problems are exacerbated by the penchant of some video game developers to squeeze the last bit of performance out of the GAME BOY.RTM. platform. Performance tricks and optimizations within a GAME BOY.RTM. application may place additional demands on any emulator running the application. Some prior art emulators provide acceptable results when running certain games but unacceptable results (or do not work at all) for other games. An ideal emulator provides acceptable results across a wide range of different games and other applications such that the emulator can run virtually any game or other application developed for the original platform.



[0015] Another challenge to designing a good software emulator relates to maintaining excellent image and sound quality. Ideally, the software emulator running on the target platform should be able to produce graphic displays that are at least the same quality as those that would be seen on the native platform. Additionally, the color rendition and other aspects of the image should be nearly if not exactly the same. Sounds (e.g., music and speech) from the emulator should have at least the same quality as would be heard on the original platform. All of these capabilities should be relatively closely matched even on platforms with radically different sound and graphics hardware capabilities.



[0016] One prior attempt to develop a video game platform emulator is disclosed in U.S. Pat. No. 6,115,054 to Giles. That patent describes a general purpose computer based video game platform software emulator including an execution skipping feature that evaluates the ability of the general purpose computer to generate video frames fully synchronized with the target platform computer system. If the evaluation determines that the emulator is falling behind the target system, the emulator executes only a first subset of the graphics commands while skipping execution of a second subset of graphics commands so as to partially render the frame. For example, the patent discloses fully executing certain graphics commands while partially executing others (e.g., clipped drawing commands) to provide a partial rendering of the frame. One disadvantage to the approach described in the Giles patent is that partial rendering of a frame can lead to uncertain imaging results that will degrade the quality of the image being produced by the emulator.



[0017] The present invention solves these and other problems by providing a unique software emulator capable of providing acceptable speed performance and good image and sound quality on even a low-capability target platform such as a seat back display for example.



[0018] The preferred embodiment software emulator provided by this invention maintains high-quality graphics and sound in real time across a wide variety of video games and other applications--and nearly duplicates the graphics and sound that would be experienced by a user of the GAME BOY.RTM., GAME BOY COLOR.RTM. and/or GAME BOY ADVANCE.RTM. platform running the same game or other application. The preferred embodiment emulator achieves this through a unique combination of features and optimizations including, for example: [0019] use of a virtual liquid crystal display controller (state machine) to maintain real time synchronization with events as they would occur on the native platform, [0020] use of a hardware-assisted bit BLIT memory transfer operation to efficiently transfer graphics information into video memory, [0021] pre-computed translation table for translating native platform graphics character formats into formats more compatible with standard graphics adapters, [0022] emulation of native platform color palette information to provide compatibility with games and other applications that change color palettes within a frame, [0023] emulation of major registers and other hardware-based memory structures within the native platform in RAM under software control, [0024] use of a jump table able to efficiently parse incoming binary instruction formats, [0025] use of a unique page table to control memory access by remapping memory access instructions into different memory locations and/or function calls, [0026] availability of a ROM protection function to eliminate ROM overwriting during emulated operations, [0027] responsive to video game compatibility modes and registration data, [0028] models native platform using state machine defining search, transfer, horizontal blank and vertical blank states, [0029] cycle counter to determine when a modeled state has expired and transition to a new state is desired, [0030] selective frame display update skipping while maintaining execution of all instructions to maintain state information while minimizing game play slowdowns, [0031] optional NOP loop look ahead feature to avoid wasting processing time in NOP loops, [0032] redundant emulated RAM and ROM storage to optimize execution efficiency, [0033] separate page tables for read and write operations, [0034] modeling of native microprocessor registers as a union of byte, word and long register formats, [0035] modeling native instruction CPU flags to allow efficient updating after operations are performed by target platform microprocessor, [0036] mapping emulated program counter into target platform microprocessor general purpose register, [0037] reads and writes via index register go through pointer tables to increase execution efficiency, [0038] adaptable input controller emulator to provide user inputs from a variety of different user input devices, [0039] emulated object attribute memory, and [0040] use of screen memory buffers larger than screen size to increase paging efficiency by eliminating clipping calculations and using the hardware BitBlt to transfer a subset of the memory buffer to displayed video memory.