Background of the Invention
1. Field of the Invention
This invention relates to an apparatus and method for retrieving data from a joystick. More particularly, this invention relates to a data reading device comprising a timing generator and a multiple-bit data register and being positioned between a joystick and a video game machine.
2. Description of Background Art
To date, the existing method for retrieving data from a joystick is to retrieve data generated by the joystick bit by bit by, for example, a central processing unit (CPU) of a video game machine. Therefore, it is necessary for the CPU to generate and supply, for example, 8 read signals to the joystick and then to sequentially retrieve eight bits of data from the joystick at each cycle of data transfer. However, the CPU will spend most of its time retrieving data from joysticks when the game machine is connected to several (e.g., 2 or 4) joysticks. This results in a poor efficiency of the CPU provided in the game machine. To improve this drawback, a CPU with a faster clock frequency can be employed, however, this increases the cost of the video game machine.
Summary of the Invention
It is therefore an object of the present invention to provide an improved technique which overcomes the drawbacks and disadvantages associated with the aforementioned data retrieving devices and methods.
It is another object of the present invention to provide an apparatus and method for retrieving multiple bits of data from a joystick in response to a read signal supplied by the CPU of the video game machine.
It is still another object of the present invention to provide a data retrieving device between joysticks and a video game machine in order to improve the efficiency of the CPU provided in the video game machine.
In accordance with an embodiment of this invention, apparatus and method is provided for retrieving data between joysticks and a video game machine. The data retrieving device sends a data locking signal and a data retrieving signal to the joysticks and receives multiple bits of data from joysticks after receiving a data read signal from the CPU of the game machine.
In accordance with another embodiment of this invention, apparatus and method is provided for retrieving data from at least one joystick connected to a video game machine by receiving a data read signal from the video game machine, generating and supplying a data locking signal to lock multiple bits of data in the joystick and a data retrieving signal in response to the received data read signal, consecutively receiving and storing the multiple bits of data from the joystick in accordance with the data retrieving signal, and outputting the multiple bits of data in parallel in accordance with the data read signal.
As an aspect of the invention, the video game machine is connected to two joysticks in which the apparatus operates by generating and supplying to the two joysticks the data locking signal and the data retrieving signal in response to one data read signal supplied by the video game machine, receiving and storing data from the two joysticks, outputting to the video game machine the data corresponding to one of the two joysticks in response to the data read signal, and outputting to the video game machine the data corresponding to the other joystick in response to a second data read signal supplied by the video game machine.
Various other objects, advantages and features of the present invention will become readily apparent from the ensuing detailed description, and the novel features will be particularly pointed out in the appended claims .
Brief Description of the Drawings
The following detailed description, given by way of example and not intended to limit the invention solely to the embodiments described herein, will best be understood in conjunction with the accompanying drawings in which:
FIG. 1 is a block diagram of the data retrieving device of the present invention;
FIG. 2 is a circuit diagram of the data retrieving device in accordance with a preferred embodiment of the present invention;
FIG. 3 is a timing diagram of the data retrieving device when 8-bits of data are retrieved in accordance with the present invention; and
FIG. 4 is a timing diagram of the data retrieving device when 16-bits of data are retrieved in accordance with the present invention.
In all of the figures, like reference numerals represent the same or similar components of the data retrieving device utilized for the description of the present invention.
Detailed Description of the Preferred Embodiments
Reference is now made to FIG. 1, which illustrates a block diagram of the data retrieving device of the present invention, which comprises a timing generator 20 which generates and supplies a data locking signal PS and a data retrieving signal CK to a joystick 6 after receiving a read signal READ supplied by a CPU 8 of the game machine; and a data register 10 which is connected at its input port to the data output terminal of joystick 6 and which is connected at its output port to a data bus of CPU 8, for consecutively receiving a plurality of data bits transferred from joystick 6, converting the plurality of data bits to a parallel signal, and then outputting the parallel signal to CPU 8 of the game machine. As shown in FIG. 1, timing generator 20 includes a data locking signal generator 21 which generates data locking signal PS in order to lock (i.e. hold) the current key-pressed status in a data register 6a of joystick 6 and a data retrieving signal generator 22 which generates data retrieving signal CK in order to retrieve the data stored in data register 6a of joystick 6.
FIG. 2 is a detailed circuit diagram of the data retrieving device of the present invention. As shown, data register 10 includes a shift register 11, which includes a series of cascaded flip-flops 11a to 11h, and an output controller 12 which includes a series of cascades tri-state buffers 12a to 12h for controlling the output of the data stored in shift register 11 in response to data read signal READ supplied by CPU 8.
Data locking signal generator 21 of timing generator 20 includes a data multiplying parameter register 211, a counting circuit 212 and a comparing circuit 213. Data multiplying parameter register 211 stores a data multiplying parameter which is employed for setting the generation period of data locking signal PS, i.e., the number of data retrieving signals needed and which corresponds to the period for generating one data locking signal. The stored data multiplying parameter represents the number of joysticks connected to the game machine or the amount of data supplied by CPU 8. For example, the value of the data multiplying parameter is 2 when there are 2 joysticks connected to the game machine. Counting circuit 212 calculates the number of data read signals READ supplied by CPU 8. Comparing circuit 213 compares the value of the data multiplying parameter with the value in counting circuit 212, and sends a data locking signal PS to the joysticks in order to lock the current key-pressed status of the joysticks while the data multiplying parameter equals the value contained in counting circuit 212.
FIG. 2 illustrates an exemplary circuit diagram of data retrieving signal generator 22 which is essentially an oscillator which generates consecutive pulses. Data retrieving signal generator 22 generates 8 consecutive data retrieving signals (CK) in response to each data read signal supplied by CPU 8. However, 16, 32 or 64, etc., consecutive data retrieving signals may be generated if needed.
When the value of the data multiplying parameter is set to 1, the number of data bits from joystick 6 (or joysticks) is equal to or less than the number of data bits of CPU 8 of the game machine. Therefore, to retrieve data supplied by the joystick 6, a data read signal READ supplied by CPU 8 is first sent to timing generator 20. Thereafter, data locking signal generator 21 supplies a data locking signal PS to the joysticks to lock the current key-pressed status in data register 6a of the joystick(s). Also, data retrieving signal generator 22 generates and outputs a data retrieving signal consisting of a plurality of consecutive pulses, e.g., 8 pulses. The data locked in data register 6a of joystick 6 is retrieved at each rising edge of the consecutive pulses, and sent to data register 10 at each falling edge of the consecutive pulses. As shown in FIG. 3, 8 bits of data, D1-D8, stored in joystick 6 are retrieved and sent to data register 10 in response to each data read signal READ which enables counting circuit 212 to produce 8 consecutive pulses.
Every time CPU 8 retrieves data from data register 10, CPU 8 adds 1 to the value in counting circuit 212 to maintain the equal relationship between the value set in data multiplying parameter register 211 and the value in counting circuit 212. Thus, comparing circuit 213 still sends a data locking signal PS to the joysticks to lock the next data in joystick 6, and also to counting circuit 212 to clear the data content stored therein (i.e. reset counting circuit 212). As seen in the timing diagram of FIG. 3, data locking signal generator 21 generates a data locking signal PS in response to data read signal READ from CPU 8 after CPU 8 retrieves 8 bits of data.
When there are 2 joysticks connected to the game machine, the value of the data multiplying parameter is set to 2, which indicates that there are 16 bits of data to retrieve (8 bits per joystick). Referring now to FIG. 4, the value stored in data multiplying parameter register 211 is equal to the value in counting circuit 212 only when CPU 8 retrieves data from data register 10 two times (i.e., when 2 data read signals are generated). Then, comparing circuit 213 sends a data locking signal PS to lock the data in the joysticks and to clear the count in counting circuit 212 so as to restart the pulse number count of the data retrieving signal. Data retrieving signal generator 22 generates two data retrieving signals (which includes 16 pulses) in response to two data read signals supplied by CPU 8 while data locking signal generator 21 generates a data locking signal PS to lock the current key-pressed status of the joysticks. Then, the two 8-bit data of the two joysticks are respectively sent to data register 10 in sequence. In other words, CPU 8 retrieves data from data register 10 two times in response to two data read signals READ. Therefore, CPU 8 may retrieve data of one or more joysticks directly from data register 10 with a higher performance and a faster speed.
As described above, by setting the value of data multiplying parameter register 211 with different numbers, a plurality of 8-bit data from a plurality of joysticks connected to the game machine can be consecutively retrieved sequentially by the data retrieving device.
In accordance with the apparatus and method for retrieving data from joysticks as described above, it should be understood that the present invention can provide the CPU of the game machine with a higher efficiency due to the reduction of the number of the data read signals being necessary for retrieving a certain amount of data.
While the present invention has been particularly shown and described with reference to preferred embodiment, it will be readily appreciated by those of ordinary skill in the art that various changes and modifications may be made without departing from the spirit and scope of the invention. For example, the present invention is not limited to 8-bit devices, and may be utilized with 16, 32, 64, 128, etc., bit devices. In addition, other applications including communication with other devices that are similar to joysticks in how they supply data may be utilized with the present invention.
Therefore, it is intended that the claims be interpreted to cover the disclosed embodiment, those alternatives which have been discussed above and all equivalents thereto.