Debug apparatus and method for debugging game program in ROM cartridge

Abstract: In a developing environment, a game program exists in a product ROM and a debug program exists in another ROM which is a test ROM. The debug program includes a time adjusting program and cther debug routine programs. The game program includes some statements for the debug program. When a ROM cartridge is produced as a product ROM cartridge, the test ROM is detached from the ROM cartridge and the statements for the debug program are deleted from the game program in the product ROM. The deleted area in the product ROM is left as an unusable area. However, the deleted area is very few, because the size of the statements for debug program is much fewer than the size of the debug program. Therefore, the game program is able to use almost all product ROM area.

Description: The invention relates to a debug apparatus and a method for debugging a game program in a ROM (Read-Only Memory) cartridge, and more particularly, to debug apparatus and a method for debugging a program of a virtual reality type game, which are played by using time and clock functions, in a ROM (Read-Only Memory). A conventional game system comprises a game unit and a ROM cartridge, as shown in US-A-4949298. This game unit has a CPU (Central Processing Unit), a RAM (Random Access Memory), a ROM (Read-Only Memory), and an I/O (Input/Output) interface. The ROM cartridge has an I/O interface and a ROM for storing a game program. The game unit and the ROM cartridge are connected with each other through the each I/O interface. In developing a game program, when the error is occurred during playing a game, a manner called as "check-print", is generally used by a debugger. In the check-print, the debugger selects an error factor and an error point in a game program, then "check-print" commands are inserted into any points of the game program related to the error factor and point. Next, the results of the check-print commands are outputted, then the debugger examines the results. In this manner, the error of the game program is debugged. In the conventional debug apparatus and method for debugging a game program, however, there are disadvantages in that a game program area in the ROM is eroded by the area used for the debug program. Accordingly, it is an object of the invention to provide a debug apparatus and method for debugging a game program in which the game program is able to use almost all ROM area. According to the present invention, there is provided a game apparatus comprising: a game unit and a ROM cartridge, said ROM cartridge comprises first storing means storing a game program, and characterised by said ROM cartridge further comprising: second storing means storing a debugging program and means for controlling debugging operation by using said debugging program. According to the present invention, there is provided a method for debugging a game program using a debugging program in a game apparatus having a game unit and a ROM cartridge comprising at least two storing means, comprising the steps of: storing said game program into first storing means of said ROM cartridge; storing said debugging program into second storing means of said ROM cartridge; and debugging said game program by using said debugging program, controlling the operation of said debugging by means of a controlling means by using said debugging program. The invention will be described in more detail in conjunction with the accompanying drawings, wherein: FIG. 1 is a flow chart of a time process of a virtual reality type game; FIG. 2 is a flow chart of a debug process of the time process in FIG. 1; FIG. 3 is a block diagram of a debug process of a game program; FIG. 4 is a block diagram of a ROM in a conventional ROM cartridge; FIG. 5 is a block diagram of a debug system of the present invention; FIG. 6 is a block diagram of a product ROM and a test ROM in a ROM cartridge of the present invention; FIG. 7 is a flow chart of processing a debug program; and FIG. 8 is a flow chart of processing a time adjusting program of the debug program. Before explaining a debug apparatus and method for debugging a game program in the preferred embodiment according to the invention, the above mentioned conventional debug apparatus and method for debugging a game program will be explained in FIGs 1 to 3. A conventional game apparatus comprises a game unit and a ROM cartridge. The game unit has a CPU ( Central Processing Unit), a RAM (Random Access Memory), a ROM (Read-Only Memory), I/O (Input/Output) interfaces, and a timer. A conventional ROM cartridge has an I/O interface and a ROM for storing a game program and a debug program. The game unit and the conventional ROM cartridge are connected with each other through the respective I/O interface. In developing a game program, a game program debug wastes working-time and working-load. Game program errors include three types errors which are a compile error, a link error and an executing error. The compile error and link error are easy to be debugged, because each error point of the two types errors is detected by a compiler or a linker in a computer system. On the other hand, the executing error is hard to be debugged, because the computer system does not detect an error point of the executing error. In particular, when the game program is ended without hanging up the game program at the midge and the result of the game program is incorrect, the executing error is very hard to be debugged. Therefore, when an executing error occurs, a manner called as "check-print" is generally used by a debugger. The check-point is to output contents of a point indicated by the debugger in the game program. In the check-print, the debugger selects an error factor and an error point in a game program, then "check-print" commands are optionally inserted into any point of the game program related to the error factor and point. Next, the results of the check-print commands are outputted, then the debugger examines the results. In this manner, the executing error of the game program is debugged. On the other hand, a game apparatus with an RTC (Real Time Clock) for playing a virtual reality type game is developed. The RTC is an IC (Integrated Circuit) having a clock function and a calendar function. A virtual real time of a game is corresponded with a real time by the clock function and the calendar function in the RTC. Namely, the RTC saves year, month, day, day of the week, hour, minute, and second of the real time therein as the virtual real time of the game by using the clock function and the calendar function. FIG. 1 is a flow chart of a time process of a virtual reality type game. In FIG. 1, a game program processes a virtual real time including month, day, and clock time. In the time process, the virtual real time including month (M), day (D), and clock time (T) is set into the game program from a RTC at the step 100. At the step 110, the M, D, and T of the game program is processed (MDT process). At the step 120, if the M is equal to "12", then the step 130 follows, else the step 150 follows and a process C is executed. At the step 130, if the D is equal to "24", then the step 140 follows, else the time process ended. At the step 140, if the T is less than "18", then the step 160 follows and a process B is executed, else the step 170 follows and a process A is executed. In this case, a conventional debug apparatus and method for debugging a game program are explained on assumption that an error has occurred in the process A. FIG. 2 is a flow chart of a debug process of the time process in FIG. 1. In FIG. 2, the step 115 is inserted into between the step 110 and the step 120 to reproduce the error at the process A. At the step 115, the M, D, and T are set to be "12", "24", "19", respectively. Therefore, the step 170 follows through the step 120, 130, and 140. Then the error is reproduced in the process A at the step 170. The debugger can debug the game program based on the reproduced error. Further, in the above case, at sharing one debug PC (Personal Computer), if the timer in the PC is changed by one developer, tests of other developers are affected. FIG. 3 is a block diagram of a debug process of a game program. A debug program is created in a ROM as a subroutine A which is a time adjusting subroutine for the debug process. A call statement to call the subroutine A is inserted into a game program which is to be debugged. When the subroutine A is called in the game program, the subroutine A is executed. Then, when the subroutine A is ended, a game process control is returned to the game program. In a virtual reality type game, an error situation of the game program using the virtual real time is hard to be reproduced, because, an event of the game is often inconsistent with a time of the game. Specially, when the event of the game is affected by other factors such as year and day of the week, the error situation often is very hard to be reproduced in the game. In the virtual reality type game, therefore, the subroutines of a debug process use a large quantity of memory area to consider all error factors. FIG. 4 is a block diagram of a ROM in a conventional ROM cartridge. In a developing environment, a debug program and a game program exists in a same ROM. The debug program includes a time adjusting program and other debug routine programs. The game program includes some statements for the debug program. When a ROM cartridge is produced as a product ROM cartridge, the debug program and the statements for the debug program are deleted from the ROM in the ROM cartridge. The deleted area in the ROM is left as an unusable area. In the conventional debug apparatus and method for debugging a game program, however, there are disadvantages in that a game program area in a ROM is eroded, because, a debug program as well as the game program exists in a same ROM. If a size of the debug program is very large, a size of the game program is very small. Thus, the game becomes to be poor. Therefore, a debug apparatus and a method for debugging a game program, in which the game program is able to use almost all ROM area, are necessary to be provided. Next, a debug apparatus and a method for debugging a game program in the first preferred embodiment according to the invention will be explained in FIGs. 5 to 8. FIG. 5 is a block diagram of a debugging system of the present invention. In FIG. 5, the debugging system comprises a game unit 10 and a ROM cartridge 20. The game unit 10 has a CPU 1, a ROM (Read Only Memory) 6, a RAM (Random Access Memory) 7, and timer 8. The ROM cartridge 20 has a MRC (Memory and RTC controller) 2, a product ROM 3, a test ROM 4, and an RTC (Real Time Clock) 5. The CPU 1, the ROM 6, and the RAM 7 are connected with each other in the game unit 10. The CPU 1 is for performing programs and instructions. The ROM 6 is for storing programs and instructions of an operating system of the debugging system. The RAM 7 is used as a main memory by the CPU 1. In the ROM cartridge 20, the product ROM 3 is for storing a virtual reality type game program. The test ROM 4 is for storing a debug program such as a time adjusting program. The RTC 5 is an IC (Integrated Circuit) having a clock function and a calendar function. A time of the game corresponds to a real time by the clock function and the calendar function in the RTC 5. Namely, the RTC 5 saves year, month, day, day of the week, hour, minute, and second of the real time therein at the time of the game by using the clock function and the calendar function. Further the RTC 5 includes a battery. The RTC 5 is supplied with a power by the battery. Therefore, if the ROM cartridge 20 is detached from the game unit 10, the RTC 5 correctly saves the time of the game therein independent of the game unit 10. The MRC 2 is for controlling memory addresses of the game program in the product ROM 3 and the debug program in the test ROM 4. Further, the MRC 2 includes a register 21. The register 21 is for controlling a memory address of the debug program in the test ROM 4. The game unit 10 is connected with the ROM cartridge 20 through I/O interfaces (is not shown). The CPU 1 accesses the product ROM 3, the test ROM 4, and the RTC 5 through the MRC 2. When the CPU 1 loads the game program from the product ROM 3 and contents in the RTC 5, the game program and the contents are placed on the fixed address area in the RAM 7 by the MRC 2. Then, the CPU 1 processes the game program according to the contents from the RTC 5. For debugging the game program in the above configuration a debugging program is loaded form the test ROM 4 and placed on another address area in the RAM 7 by the register 21 in the MRC 2. Namely, in the RAM 7, the memory area of the game program for a product game is divided from the memory area of the debug program. Therefore, when the test ROM 4 is detached from a ROM cartridge 20, the memory area of the debug program is not accessed by the game program. Namely, a debug routine can be accessed by using only the register 21 and the game program can not access the debug routine. Further, when an error occurs in the product ROM cartridge from which the test ROM 4 is detached (i. e. a user uses the product ROM cartridge without the test ROM 4), a debug environment is easy to be reconstructed by inserting the test ROM 4 into the product ROM cartridge and adjusting the register 21 in the MRC 2. FIG. 6 is a block diagram of a product ROM and a test ROM in a ROM cartridge of the present invention. In a developing environment, a game program exists in a product ROM 3 and a debug program exists in another ROM which is a test ROM 4. The debug program includes a time adjusting program and other debug routine programs. The game program includes some statements for the debug program. When a ROM cartridge is produced as a product ROM cartridge, the test ROM is detached from the ROM cartridge and the statements for the debug program are deleted from the game program in the product ROM. The deleted area in the product ROM is left as an unusable area. However, the deleted area is very small, because the size of the statements for debug program is much smaller than the size of the debug program. FIG. 7 is a flow chart of processing a debug program. When a debug process is started, "EXECUTE DEBUG PROGRAM ?" message is displayed on a display unit at the step 710. If "YES" is selected, the step 720 follows. If "NO" is selected, the step 740 follows. At the step 740, a game program is started. Then the debug process is finished. At the step 720, it is confirmed whether a test ROM for debug program exists in a ROM cartridge or not. If the test ROM exists in the ROM cartridge, the debug program is executed at the step 730. If the test ROM dose not exist, the game program is executed at the step 740. FIG. 8 is a flow chart of processing a time adjusting program of the debug program. When a time adjusting program is started, at the step 802, a current time is read from the RTC 5. The current time is a virtual real time but not a real time. At the step 804, the current time is copied to an edit time. The edit time is used as a work area for calculating a debugging time in the game. At the step 806, the current time is displayed on a display unit. At the step 808, the edit time is displayed on the display unit. The current time is changed with the RTC time. The edit time is fixed at the copied time. The steps 802 to 808 are in an initial process. At the step 810, when a read operation of the current time is operated by a key operation, the initial process is re-executed from the step 802 and then the edit time is updated by a new current time. If the read operation of the current time is not operated by the key operation at the step 810, the step 812 follows. At the step 812, when a write operation of the edit time is operated by the key operation, the step 820 follows. At the step 820, the current time in the RTC is updated by the edit time. If the write operation of the edit time is not operated by the key operation at the step 812, the step 814 follows. At the step 814, when a set operation of the edit time is operated by the key operation, the step 830 follows. At the step 830, Year, month, day, hour, minute, second, and day of the week of the edit time are updated by the key operation and then the initial process must be re-executed to update the RTC time. In FIG. 8, after the step 820 the initial process can follow. In this case, the time adjusting process becomes a loop process without exit. The loop program is able to be stopped by an interrupt operation such as pushing a special key. Further, the time adjusting program is able to be started by another interrupt operation at the middle of the debug of the game program. Therefore, the game program is able to use almost all product ROM area. Further, the game program can be debugged correctly. As this invention may be embodied in several forms the present embodiment is therefore illustrative and not restrictive, since the scope of the invention is defined by the appended claims.

Claims: A game apparatus comprising: a game unit (10) and a ROM cartridge (20), said ROM cartridge (20) comprising first storing means (3) storing a game program, and characterised by said ROM cartridge further comprising: second storing means (4) storing a debugging program and means (2) for controlling debugging operation by using said debugging program. A game apparatus according to claim 1, wherein: said second storing means stores a time adjusting program which is a part of said debugging program. A game apparatus according to claim 2, wherein said ROM cartridge comprises: a real time clock (5) supplied with an electric power from a battery. A game apparatus according to claim 1, wherein said controlling means (2) comprises a register (21) which controls a memory address of said debugging program in said ROM (4). A method for debugging a game program using a debugging program in a game apparatus having a game unit (10) and a ROM cartridge (20) comprising at least two storing means, comprising the steps of: storing said game program into first storing means (3) of said ROM cartridge; storing said debugging program into second storing means (4) of said ROM cartridge; and debugging said game program by using said debugging program, controlling the operation of said debugging by means of a controlling means (2) by using said debugging program. A method for debugging a game program according to claim 5, wherein: said debugging program includes a time adjusting program. A method for debugging a game program according to claim 6, further comprising the steps of controlling a time in a game based on said time adjusting program. A method for debugging a game program according to claim 7, wherein said debugging program and said time controlled in said time-controlling step are used in said debugging step.

Inventors: NAKAJIMA TOMOHIKO, NAKAJIMA, TOMOHIKO, Nakajima, Tomohiko, Hudson Soft Co., Ltd.
Applicants: HUDSON SOFT CO LTD, HUDSON SOFT CO., LTD.
Application year: 1996
Main classification: G06F11
IPC codes: G06F11