HuC6280
The Hudson Soft HuC6280 is the 8-bit CPU of NEC's PC Engine console. It contains a customized version of a 65SC02 core, a timer, and sound generation hardware. The HuC6280 is referred to as "Dr. Pepper" or "DRP" by NEC-HE.
Contents
Description
The HuC6280 contains a modified | 65C02 core which has several enhancements.
- additional instructions
- instructions to more efficiently write predefined values to the VDC (HuC6270)
- internal peripheral functions such as an interrupt controller
- a Memory Management Unit
- a timer
- an 8-bit parallel I/O port
- a Programmable Sound Generator.
The processor operates at two speeds, 1.7897725 MHz and 7.15909 MHz.
Programmable Sound Generator
Full article: Programmable Sound Generator
The PSG (Programmable Sound Generator) provides 6 sound channels, which can be conveniently paired according to the functionality they provide:
0-1 - Waveform playback Frequency modulation (channel 1 muted) 2-3 - Waveform playback only 4-5 - Waveform playback White noise generation
Waveform playback is the most common and allows a 32 byte, 5 bit unsigned linear sample to be played back at selected frequencies. Frequency modulation takes this one step further, allowing the playback frequency to be dynamically adjusted according to a specified pattern. White noise is used to simulate percussion instruments and effects, such as explosions, by means of a pseudo-random square wave.
Alternatively, each channel can be individually switched to Direct D/A mode in which the programmer can send data directly to the sound mixer, allowing more complex sound patterns to be generated, such as speech. Inevitably, this requires more programming effort and CPU time.
Memory Mapping
The HuC6280 has a 64 KB logical address space and a 2 MB physical address space. To access this entire memory space, the HuC6280 uses an MMU (Memory Management Unit) that splits the memory space into a 8 KB page. The logical address space is split as follows:
Each logical 8 KB page (or page) is associated with an 8-bit register (MPR0-7) (Mapped Page Register) that contains the index of the 8 KB page in physical memory to map in this page.
Memory Map
The HuC6280 can address 21 bits (2 MB) of physical memory but uses 16-bit logical addresses (e.g. LDA $8020). The 64KB logical address space is split into eight 8 KB pages. The location within this pages is defined by the lower 13 bits of the logical address. The remaining upper three bits are are used to select the MPR. Each 8KB pages (of the 64KB logical addressing space) has a corresponding 8-bit MPR which is used to create a 21 bit (13 lower bits of logical address + 8 bits of corresponding MPR) address sent over the bus.
PhysicalAddress = (LogicalAddress AND 0x1FFF) OR ( MPR[LogicalAddress / 0x2000] * 0x2000 )
MPR | Logical Memory Range |
---|---|
0 | $0000 - $1FFF |
1 | $2000 - $3FFF |
2 | $4000 - $5FFF |
3 | $6000 - $7FFF |
4 | $8000 - $9FFF |
5 | $A000 - $BFFF |
6 | $C000 - $DFFF |
7 | $E000 - $FFFF |
Only two instructions are used to access these registers:
Instruction Set
Timer
The HuC6280's timer operates off of the 7.15909 MHz clock. This clock is first sent into a divide-by-1024 counter, and the output of the clock divider is used to decrement the timer counter register, if the timer is enabled. When the timer counter register decrements when its value is 0, the timer counter will reload with the value contained in the timer latch, and the timer's IRQ line is activated. The timer's IRQ vector is located at logical address $FFFA. The timer IRQ can be acknowledged(IE the timer's IRQ line made inactive again to prevent future interrupts) by reading from the IRQ mask register, or writing to the read-only IRQ status register.
Address(in I/O page) | R/W | Bits | Description |
---|---|---|---|
$0C00 | R | Bit 0 - 6 | Current timer counter value. |
Bit 7 | (Undefined, I/O data buffer D7) | ||
W | Bit 0 - 6 | Timer latch value. | |
Bit 7 | Unused | ||
$0C01 | W | Bit 0 | Timer enabled if set to 1. Writing 0, then 1, will force a reload of the timer counter from the timer latch and reset the divide-by-1024 counter. |
Bit 1 - 7 | Unused |
Pin assignments
Pin | Signal | Direction | Description |
---|---|---|---|
1 | A5 | out | Address bus, bit 5 |
2 | A4 | out | Address bus, bit 4 |
3 | A3 | out | Address bus, bit 3 |
4 | A2 | out | Address bus, bit 2 |
5 | A1 | out | Address bus, bit 1 |
6 | A0 | out | Address bus, bit 0 |
7 | GND | s | Ground (VSS1) |
8 | +5V | s | Power Supply (VAA) |
9 | XOUT | out | Follows XIN polarity (different pulse shape) (Not Connected on PC Engine) |
10 | XIN | in | 21.477270 MHz clock input (OSC1) |
11 | RESET | in | Reset signal input |
12 | RDY | in | Induce wait state while pulled low |
13 | SX | out | Complementary CPU clock output (1 = 7.15909, 0 = 1.7897725 MHz) |
14 | HSM | out | High Speed Mode (1 = 7.15909, 0 = 1.7897725 MHz) |
15 | +5V | s | Power Supply (VPDD) |
16 | GND | s | Ground (VSS5) |
17 | LOUT | out | Audio output, Left channel |
18 | ROUT | out | Audio output, Right channel |
19 | +5V | s | Audio Power (VPPA) |
20 | +2.5V | s | Power Supply (VEE) |
21 | AGND | s | Ground |
22 | K0 | in | Input port, bit 0 (@FF:1000) |
23 | out | Unknown/Undocumented (combination of SX, BSY, A0?) (Not Connected on PC Engine) | |
24 | K1 | in | Input port, bit 1 (@FF:1000) |
25 | K2 | in | Input port, bit 2 (@FF:1000) |
26 | K3 | in | Input port, bit 3 (@FF:1000) |
27 | K4 | in | Input port, bit 4 (@FF:1000) |
28 | K5 | in | Input port, bit 5 (@FF:1000) |
29 | K6 | in | Input port, bit 6 (@FF:1000) |
30 | K7 | in | Input port, bit 7 (@FF:1000) |
31 | O0 | out | Output port, bit 0 (@FF:1000) |
32 | O1 | out | Output port, bit 1 (@FF:1000) |
33 | O2 | out | Output port, bit 2 (@FF:1000) |
34 | O3 | out | Output port, bit 3 (@FF:1000) |
35 | O4 | out | Output port, bit 4 (@FF:1000) |
36 | O5 | out | Output port, bit 5 (@FF:1000) |
37 | O6 | out | Output port, bit 6 (@FF:1000) |
38 | O7 | out | Output port, bit 7 (@FF:1000) |
39 | EAT | out | Not Connected on PC Engine |
40 | EA3 | out | Not Connected on PC Engine |
41 | EA2 | out | Not Connected on PC Engine |
42 | EA1 | out | Not Connected on PC Engine |
43 | IRQ2 | in | IRQ2 interrupt input |
44 | IRQ1 | in | IRQ1 interrupt input |
45 | NMI | in | NMI interrupt input |
46 | SYNC | out | Memory read type; (1 = Opcode fetch, 0 = Not opcode fetch) |
47 | +5V | s | Power Supply (VDD) |
48 | GND | s | Ground (VSS4) |
49 | D0 | in / out | Data bus, bit 0 |
50 | D1 | in / out | Data bus, bit 1 |
51 | D2 | in / out | Data bus, bit 2 |
52 | D3 | in / out | Data bus, bit 3 |
53 | D4 | in / out | Data bus, bit 4 |
54 | D5 | in / out | Data bus, bit 5 |
55 | D6 | in / out | Data bus, bit 6 |
56 | D7 | in / out | Data bus, bit 7 |
57 | +5V | s | Power supply (VCC) |
58 | GND | s | Ground |
59 | CEK | out | HuC6260 CS (@ FF:0400-0700) |
60 | CE7 | out | HuC6270 CS (@ FF:0000-03FF) |
61 | CER | out | Work RAM CS (@ F8:0000-1F00) |
62 | RD | out | Memory read strobe |
63 | WR | out | Memory write strobe |
64 | A20 | out | Address bus, bit 20 |
65 | A19 | out | Address bus, bit 19 |
66 | A18 | out | Address bus, bit 18 |
67 | A17 | out | Address bus, bit 17 |
68 | A16 | out | Address bus, bit 16 |
69 | A15 | out | Address bus, bit 15 |
70 | A14 | out | Address bus, bit 14 |
71 | A13 | out | Address bus, bit 13 |
72 | A12 | out | Address bus, bit 12 |
73 | A11 | out | Address bus, bit 11 |
74 | A10 | out | Address bus, bit 10 |
75 | GND | s | Ground (VSS2) |
76 | +5V | s | Power Supply (VBB) |
77 | A9 | out | Address bus, bit 9 |
78 | A8 | out | Address bus, bit 8 |
79 | A7 | out | Address bus, bit 7 |
80 | A6 | out | Address bus, bit 6 |
Patents
- Memory Access
- Memory Mapping
- VRAM access by VDC/CPU
- Block Transfers Instructions
- Store Immediate Instructions
- High/Low Speed Modes
- Programmable Sound Generator
Patent for Memory Access
Note: terminals with a High value are a binary 1 and Low is a binary 0.
United States Patent Number: 4970642AN APPARATUS FOR ACCESSING A MEMORY
In [Figure 1], there is shown an apparatus for displaying a color image to which an apparatus for controlling the access of a memory according to the invention is applied In the apparatus for controlling the access of a memory, a CPU (1) performs a predetermined control in accordance with a program stored in ROM (5) so that data, arithmetical results etc. are stored into a RAM (6) temporarily. A Video Display Controller (2) is provided therein to supply a Video Color Encoder (3) with video data of a story, for instance, for a so-called television game read from a VRAM (7) in accordance with a control of the CPU (1) which deciphers a program for the television game stored in the ROM (5). The Video Color Encoder (3) to which the video data are supplied produces RGB analog signals obtained in accordance with color data stored therein, or produces video color signal including a luminance signal and color difference signals obtained in accordance with the color data. Further, a Programmable Sound Generator (4) is provided therein to produce analog sound signals as left and right stereo sounds in accordance with a content of the ROM (5) which is supplied through the CPU (1) thereto. The video color signal produced in the Video Color Encoder (3) is supplied through an interface (8) to a receiving circuit of a video display (9) as a composite signal, and the RGB analog signal is supplied through an interface (10) directly to a video display (9) which functions as an exclusive use monitor means. On the other hand, the left and right analog sound signals are supplied through amplifiers 11a and 11b to speakers 12a and 12b to produce sounds. |
|
[Figure 2] shows the CPU (1) and the Programmable Sound Generator (4) as encircled by a dotted line in [Figure 1]. The CPU (1) in which an apparatus for controlling a transfer of data in the embodiment is included and comprises an instruction register (20), an instruction decoder (21), a bus interface register (22), an Arithmetic Logic Unit (ALU) (23), a set of registers (24), a Mapping Register (25), a chip enable decoder (26), a timing and control unit (27), an input and output port (28), a Timer (29), an interrupt request register (30), an interrupt disable register (31), and so on. These units will be explained as follows.
|
|
In [Figure 3], there is shown the aforementioned Mapping Register (25) comprising 8 registers MPR0 to MPR7 each being of 8 bits, and connected through the B-bus (32) to an input output controller (50) and through an output selector (51) to the output terminals A13 to A20. The output selector (51) selects one register from the 8 registers MPR0 to MPR7 of the Mapping Register (25) in accordance with upper 3 bits H5 to H7 of upper data of a logical address on the H-bus (35). |
|
[Figure 4] shows a relation between the upper 3 bits H5 to H7 and one register selected from the 8 registers MPR0 to MPR7. If it is assumed that the upper 3 bits H5 to H7 are 010, the register MPR2 is selected from the 8 registers MPR0 to MPR7. Data are read from the Mapping Register (25) by a command TMAi where i is an integer selected from 0 to 7. For instance, data are read from the register MPR2 to be transferred through the B-bus (32) to the Accumulator (38) in accordance with a command TMA2. On the other hand, data are written into the Mapping Register (25) by a command TAMi where i is an integer selected from 0 to 7. For instance, data are transferred to be written into the register MPR0 from the Accumulator (38) by a command TAM0. The commands TMAi and TAMi are composed of two byte respectively, and lower byte thereof includes a bit of 1 corresponding in a bit number to a register number which is selected from the 8 registers MPR0 to MPR7 and remaining 7 bits of 0. When one of the 8 registers MPR0 to MPR7 is selected in accordance with upper 3 bits of the H-bus (35), a content of the selected register is supplied through the output terminals A13 to A20 to a following stage so that a physical address of 21 bit is obtained together with a content of the logical address low register (48) to be supplied through the output terminals A0 to A7 thereto, and lower 5 bits of the logical address high register (49) to be supplied through the output terminals A8 to A12 thereto. When the most significant bit A20 of a physical address A0 to A20 is 1, a command by which data designated in accordance with the physical address A0 to A20 are immediate-transferred to the Video Display Controller (2) is conducted. The command includes ST0, ST1 and ST2 by which codes are produced on A0 and A1 of the address bus at a write cycle as shown in [Figure 6]. The command is set in the instruction register (20). In operation, lower data of a logical address are set in the logic address low register (48), and lower 5 bits of upper data of the logical address are set in the logical address high register (49). Here, it is assumed that address data are set in the 8 registers MPR0 to MPR7 of the Mapping Register (25) respectively. When upper 3 bits of upper data of the logical address, that is to say, upper 3 bits H5 to H7 of the H-bus (35) are 001, the register MPR1 is selected so that a content 0xF8 of the register MPR1 is supplied through the output terminals A13 to A20 to the following stage. These output signals are combined with output signals of the output terminals A8 to A12 and A0 to A7 to produce a physical address A0 to A20. Then, the chip enable decoder (26) decodes upper 11 bits A10 to A20 of the physical address A0 to A20 to produce a chip enable signal CER of 0 by which a data memory is enabled. |
|
___ | |
[Figure 7] shows a relation between a logical address of the CPU (1) and a physical address of the RAM (6) wherein a block 0xF8 of a physical address region having 2M bytes is allocated in accordance with a content 0xF8 of the selected register MPR1 in a case where a logic address of 16 bits on the L and H-buses (34 and 35) corresponds to one address selected from addresses 0x2000 to 0x3FFF of a logical address region having 64K bytes as indicated by hatching lines therein. Thus, a memory of 2M bytes in which an address signal of 21 bits is required for the access thereof can be accessed by an address signal of 16 bits. At this time, data at a corresponding address of a memory are immediate-transferred to a Video Display Controller (2) in a case where lower 2 bits A0 and A1 of the physical address are of a content as shown in [Figure 6]. |
|
[Figure 8] shows a physical address region of the RAM (6) to which a chip enable signal CER is allocated. The chip enable signal CER is produced in accordance with a content of upper 11 bits A10 to A20 of a physical address A0 to A20 which is decoded in the chip enable decoder (26). For instance, the chip enable signal CER is allocated to a region of physical addresses 0x1F0000 to 0x1F7FFF in which zero page and stack regions are existed in a case where a content of the selected register MPR1 is 0xF8. The zero page and stack regions are of a region to which contents of the Accumulator (38), the X register (39), and the Y register (40) are evacuated temporarily. |
Patent for Memory Mapping
United States Patent Number: 5566313APPARATUS FOR CONTROLLING THE TRANSFER OF DATA
In [Figure 1] , there is shown an apparatus for displaying a color image to which an apparatus for controlling the transfer of data according to the invention is applied. In the apparatus for controlling the transfer of data, a CPU (1) performs a predetermined control in accordance with a program stored in ROM (5) so that data, arithmetical results etc. are stored into a RAM (6) temporarily. A Video Display Controller (2) is provided therein to supply a Video Color Encoder (3) with video data of a story, for instance, for a so-called television game read from a video RAM (VRAM) 7 in accordance with a control of the CPU (1) which deciphers a program for the television game stored in the ROM (5). The Video Color Encoder (3) to which the video data are supplied produces RGB analog signals obtained in accordance with color data stored therein, or produces video color signal including a luminance signal and color difference signals obtained in accordance with the color data. Further, a programable sound generator 4 is provided therein to produce analog sound signals as left and right stereo sounds in accordance with a content of the ROM (5) which is supplied through the CPU (1) thereto. The video color signal produced in the Video Color Encoder (3) is supplied through an interface (8) to a receiving circuit of a video display (9) as a composite signal, and the RGB analog signal is supplied through an interface (10) directly to a video display (9) which functions as an exclusive use monitor means. On the other hand, the left and right analog sound signals are supplied through amplifiers 11a and 11b to speakers 12a and 12b to produce sounds. |
File:US5566313-fig.png [Figure 1] is a block diagram showing an apparatus for displaying a color image in which an apparatus for controlling the transfer of data is included. |
[Figure 2] shows the CPU (1) and the programable sound generator 4 as encircled by a dotted line in [Figure 1]. The CPU (1) in which an apparatus for controlling a transfer of data in the embodiment is included and comprises an instruction register (20), an instruction decoder (21), a bus interface register (22), an Arithmetic Logic Unit (ALU) (23), a set of registers (24), a Mapping Register (25), a chip enable decoder (26), a timing and control unit (27), an input and output port (28), a Timer (29), an interrupt request register (30), an interrupt disable register (31), and so on. These units will be explained as follows. (1) instruction register (20) The register (20) is loaded with an instruction code at an instruction fetch cycle. (2) instruction decoder (21) The decoder 21 performs a sequential operation determined in accordance with an output of the instruction register (20), an interrupt input from a peripheral circuit or a reset input, and further performs a control of a branch command changing a flow of a program in accordance with informations of a status register described later. (3) bus interface register (22) The register (22) controls a transfer of data among a B-bus (32), a U-bus (33) and an external bus D0 to D7. The ALU (23) and the set of registers (24) are connected by the B-bus (32) and the U-bus (33), and is connected to internal peripheral circuits. Further, an L-bus (34) for transferring lower 8 bits of a logical address and a H-bus (35) for transferring upper 8 bits of the logical address are provided. A logical address low register (48) is connected to the L-bus (34), and a logical address high register (49) is connected to the H-bus (35). (4) ALU (23) The ALU (23) is provided with an A register (36) and a B register (37), and performs all of arithmetic and logic operation. The A and B registers 36 and 37 are loaded with one or two data so that an arithmetic operation is performed in accordance with a control signal of the instruction decoder (21) to supply one of the B, L and H-buses 32, 34 and 35 with a result of the arithmetic operation. (5) set of registers (24) The set of registers (24) comprises the following 10 registers each being of 8 bits. (a) Accumulator (38) The Accumulator (38) is a wide use register which plays the most important role in an arithmetic and logic operation to be conducted when a memory arithmetic flag T of a status register described later is 0. Data thereof is supplied to an input of the ALU (23), and a result of the arithmetic is stored therein. The Accumulator (38) is also used for a transfer of data between memories and between a memory and a peripheral circuit, and for a count of a data block length when a block transfer of data is performed. A lower data of the length are stored therein after data stored therein are evacuated into a stack region of the RAM (6). (b) X and Y registers 39 and 40 The registers 39 and 40 are wide use registers which are mainly used for an index addressing. The X register (39) is used for a designation of an address on page 0 of a memory which is a destination of an arithmetic operation, and for a storage of lower data of a source address after data stored therein are evacuated into a stack region of the RAM (6) when a block transfer of data is performed. On the other hand, the Y register (40) stores lower data of a destination address after data stored therein are evacuated into a stack region of the RAM (6) when a block transfer of data is performed. (c) program counters 41 and 42 An up counter of 16 bits is composed of the Program Counter (41) of upper 8 bits and the Program Counter (42) of lower 8 bits. The up counter is automatically incremented in accordance with the conduct of a command to designate an address of a command or operand to be next conducted. Contents of the counters 41 and 42 are evacuated into a stack region of the RAM (6) in a case where a command of sub-routine is conducted, and an interrupt is produced, or after an interruption command of a software is conducted. (d) Stack Pointer (43) The Stack Pointer (43) designates lower 8 bits of the highest address on a stack region of the RAM (6), and is decremented after the pushing of data into the stack region and incremented before the pulling of the data from the stack region. For instance, 256 bytes of addresses 2100 to 21FF are allocated to the stack region in a logical address. (e) source high register (45), destination high register (46), and length high register (47) These registers function in case of a command of a block transfer. The source high register (45) provides an upper byte of a source address to designate the source address together with a content of the x register (39). The destination high register (46) provides an upper byte of a destination address to designate the destination address together with a content of the Y register (40). The length high register (47) provides upper 8 bits for a down counter together with a content of the Accumulator (38) so that a length of a block transfer is counted by a byte unit. (6) Mapping Register (25) The Mapping Register (25) is composed of 8 registers each being of 8 bits to convert a logical address of 16 bits to a physical address of 21 bits, and is selected by upper 3 bits of the H-bus (35). (7) chip enable decoder (26) The chip enable decoder (26) provides chip enable outputs for the following peripheral circuits by decoding upper 11 bits of a physical address. (a) a chip enable for the RAM (6) . . . CER (b) a chip enable for the Video Display Controller (2) . . . CE7 (c) a chip enable for the Video Color Encoder (3) . . . CEK (d) a chip enable for the programable sound generator 4 . . . CEP (e) a chip enable for the Timer (29) . . . CET (f) a chip enable for the input and output port . . . CEIO (g) a chip enable for the interrupt request register (30) and the interrupt disable register (31) . . . CECG (8) timing and control unit (27) The unit 27 is connected to following terminals. (a) RD terminal A read timing signal is supplied through the RD terminal at a reading cycle. (b) WRterminal A write timing signal is supplied through the WR terminal at a writing cycle. (c) SYNC terminal A synchronous signal of High is supplied through the SYNC terminal at an instruction fetch cycle, that of Low is supplied therethrough at a system reset timing. (d) NMI terminal A non-maskable interrupt is produced when NMI input signal is supplied through the NMI terminal. A sub-routine call is conducted by reading lower address from the logical address FFFC and upper address from the logical address FFFD when a command which is conducted in a program is completed. (e) IRQ1 and IRQ2 terminals A sub-routine call is conducted by reading lower address from the logical address FFF8 and upper address from the logical address FFF9 when IRQ1 input becomes Low in a case where a corresponding bit in the interrupt disable register (31) is 0, and a corresponding bit in the Status Register (44) is 0. At this time, the corresponding bit is set in the Status Register (44), and other corresponding bits are reset therein. A sub-routine call is conducted by reading lower address from the logical address FFF6 and upper address from the logical address FFF7 when IRQ2 input becomes Low in a case where a corresponding bit in the interrupt disable register (31) is 0, and a corresponding bit in the Status Register (44) is 0. At this time, the corresponding bit is set in the Status Register (44), and other corresponding bits are reset therein. (f) RESET terminal A program is started by reading lower address from the physical address 001FFE and upper address from the physical address 001FFF when a RESET input becomes Low. (g) RDY terminal The CPU (1) is started to operate when a RDY input is changed from Low to High. (h) SX terminal A complementary signal of a system clock signal is supplied through the SX terminal. (i) OSC1 terminal An external clock signal is input through the OSC1 terminal. EAl to EA3 terminals These are input terminals for a test of the CPU (1). (k) HSM terminal A speed signal of High is supplied through the HSM terminal in case of a high speed mode of 21.47727 MHz/3, and that of Low is supplied therethrough in case of a low speed mode of 21.47727 MHz/12. (9) input and output port (28) The input and output port (28) is connected to following terminals. (a) K0 to K7 terminals The terminals are input ports from which data are written in accordance with the conduct of a reading cycle in regard to the physical addresses 1FF000 to 1FF3FF. (b) 00 to 07 terminals The terminals are output ports with latches to which data are supplied in accordance with the conduct of a writing cycle in regard to the physical addresses 1FF000 to 1FF3FF. (10) Timer (29) The Timer (29) is connected to a test input terminal EAT for the CPU (1) and provides a timer signal through the U-bus thereto. (11) interrupt request register (30) The register (30) is of 8 bits among which 5 bits are not used, while the remaining 2 bits are 1 to show the IRQ1 and IRQ2 terminals Low and the remaining 1 bit is 1 to show a timer interrupt caused. The register (30) is only used for read. (12) interrupt disable register (31) The register (31) is of 8 bits among which 5 bits are not used, while the remaining 2 bits are 0 to show an interrupt request of the IRQ1 and IRQ2 terminals disable, and the remaining one is 0 to show an interrupt request disable in accordance with the timer interrupt. |
File:US5566313-fig.png [Figure 2] is a block diagram showing an apparatus for controlling the transfer of data in an embodiment according to the invention. |
In [Figure 3], there is shown the aforementioned Mapping Register (25) comprising 8 registers MPR0 to MPR7 each being of 8 bits, and connected through the B-bus (32) to an input output controller (50) and through an output selector (51) to the output terminals A13 to A20. The output selector (51) selects one register from the 8 registers MPR0 to MPR7 of the Mapping Register (25) in accordance with upper 3 bits H5 to H7 of upper data of a logical address on the H-bus (35). |
File:US5566313-fig.png [Figure 3] is a block diagram showing a mapping register circuit in an apparatus for controlling the transfer of data in the embodiment. |
[Figure 4] shows a relation between the upper 3 bits H5 to H7 and one register selected from the 8 registers MPR0 to MPR7. If it is assumed that the upper 3 bits H5 to H7 are 010, the register MPR2 is selected from the 8 registers MPR0 to MPR7. Data are read from the Mapping Register (25) by a command TMAi where i is an integer selected from 0 to 7. For instance, data are read from the register MPR2 to be transferred through the B-bus (32) to the Accumulator (38) in accordance with a command TMA2. On the other hand, data are written into the Mapping Register (25) by a command TAMi where i is an integer selected from 0 to 7. For instance, data are transferred to be written into the register MPR0 from the Accumulator (38) by a command TAM0. The commands TMAi and TAMi are composed of two byte respectively, and lower byte thereof includes a bit of 1 corresponding in a bit number to a register number which is selected from the 8 registers MPR0 to MPR7 and remaining 7 bits of 0. When one of the 8 registers MPR0 to MPR7 is selected in accordance with upper 3 bits of the H-bus (35), a content of the selected register is supplied through the output terminals A13 to A20 to a following stage so that a physical address of 21 bit is obtained together with a content of the logical address low register (48) to be supplied through the output terminals A0 to A7 thereto, and lower 5 bits of the logical address high register (49) to be supplied through the output terminals A8 to A12 thereto. When the most significant bit A20 of a physical address A0 to A20 is 1, a command by which data designated in accordance with the physical address A0 to A20 are immediate-transferred to the Video Display Controller (2) is conducted. The command includes ST0, ST1 and ST2 by which codes are produced on A0 and A1 of the address bus at a write cycle as shown in [Figure 6]. The command is set in the instruction register (20). In operation, lower data of a logical address are set in the logical address low register (48), and lower 5 bits of upper data of the logical address are set in the logical address high register (49). Here, it is assumed that address data are set in the 8 registers MPR0 to MPR7 of the Mapping Register (25) respectively. When upper 3 bits of upper data of the logical address, that is to say, upper 3 bits H5 to H7 of the H-bus (35) are 001, the register MPR1 is selected so that a content F8 of the register MPR1 is supplied through the output terminals A13 to A20 to the following stage. These output signals are combined with output signals of the output terminals A8 to A12 and A0 to A7 to produce a physical address A0 to A20. Then, the chip enable decoder (26) decodes upper 11 bits A10 to A20 of the physical address A0 to A20 to produce a chip enable signal CER of 0 by which a data memory is enabled. When the immediate data transfer command is produced, the signal CE7 is 0, the MSB A20 is 1, and the bits A0 and A1 are of a content as shown in [Figure 6] so that data are transferred from the CPU (1) to the Video Display Controller (2) as shown in detail in [Figure 7]. |
File:US5566313-fig.png [Figure 4] is an explanatory diagram showing a mapping register selection code when a physical address is produced in an apparatus for controlling the transfer of data in the embodiment. |
[Figure 7] shows the Video Display Controller (2) which comprises a control unit (70), an address unit (71) a CPU read/write buffer (72), a Sprite Attribute Table buffer (73), a sprite attribute shift register (74), a background shift register (75), a data bus buffer (76), a synchronous circuit (77), and a priority circuit (78). The control unit (70) is provided with a BUSY terminal through which 0 is supplied to the CPU (1) in a case where the Video Display Controller (2) is not in time for the writing/reading of data from the CPU (1) to the VRAM (7) so that the CPU (1) is held under the state, a IRQ terminal through which an interrupt request signal is supplied to an external circuit, a CK terminal through which a clock signals having a frequency for one pixel (one picture element) is received, a RESET terminal through which a reset signal for initiallization is received, and a EX8/16 terminal through which a data bus change-over signal for changing over a data bus width is received. The address unit (71) is connected to address terminals MA0 to MA15 through which an address signal of the VRAM is supplied thereto. An address region of the VRAM (7) is of a capacity, for instance, 65.536 words, provided that one word is of 16 bits. The address unit (71), the CPU read/write buffer (72), the Sprite Attribute Table (73), the sprite shift register (74) and the background shift register (75) are connected through data bus to data terminals MD0 to MD15 through which data of the VRAM (7) are transferred for the writing thereinto or the reading therefrom. The Sprite Attribute Table buffer (73) is a memory for storing a display position (X, Y), color, pattern number and so on of a sprite (16 bits). The sprite shift register (74) is supplied with a pattern number, sprite color etc. read from the Sprite Attribute Table buffer (73) to access the VRAM (7), and stores data for a pattern, color etc. of a sprite read from a sprite generator in the VRAM (7). The background shift register (75) stores a pattern and CG color of a background. The pattern is read from a character generator in accordance with an address of the character generator in the VRAM (7) obtained from a character code which is read from an attribute table in the VRAM (7) together with the CG color. The data bus buffer (76) is connected to terminals D0 to D15 through which data are supplied to and received from an external circuit. The Video Display Controller (2) can select one of 8 bit interface and 16 bit interface in compliance with a data width of a system including the CPU (1). When the 8 bit interface is selected, the terminals D0 to D7 are used among the terminals D0 to D15. The synchronous circuit (77) is connected to a DISP terminal through which a signal for indicating a display period is supplied to an external circuit, a VSYNC terminal through which a signal for a vertical synchronization of a CRT is supplied to the video display (9) and an external vertical synchronous signal is received, and a HSYNC terminal through which a signal for a horizontal synchronization of the CRT is supplied to the video display (9) and an external horizontal synchronous signal is received. The priority circuit (78) is connected to terminals VD0 to VD7 through which video data are supplied to an external circuit, and a SP/BG (VDB) terminal through which a signal 1 is supplied to an external circuit when the video data are for a sprite and a signal 0 is supplied thereto when the video data are for a background. The aforementioned control unit (70) is further provided with a CS terminal through which a signal 0 is received so that registers therein are accessed for the writing and reading of data from the CPU (1), RD and WR terminals through which read and write-timing signals are received, and terminals A0 and A1 connected to the address bus of the CPU (1) as shown in [Figure 2]. The Video Display Controller (2) is further provided with a MRD terminal and a MWR terminal. When the MRD terminal is under a state of 0, data are read from the VRAM (7) to the CPU (1). On the other hand when the MWR terminal is under a state of 0, data are written into the VRAM (7) from the CPU (1). The control unit (70) includes a memory address write register and a VRAM data write register together with other registers. In operation, when an immediate data transfer command (STO, ST1 or ST2) is produced, data transferred from the CPU (1) are stored in the VRAM data write register. The aforementioned physical address A0 to A20 is automatically set in the memory address write register without receiving an address setting command. As a result, the data are written into the VRAM (7) in synchronization with a write signal of 0 applied to the WR terminal in accordance with a single transfer command which is called "an immediate data transfer command". That is to say, a chip including the aforementioned memory address write register and VRAM data write register is enabled in accordance with a chip enable signal CE7 which becomes 0 in the conduct of the immediate data transfer command of ST0, ST1 or ST2. As a result, bits A0 and A1 of a physical address A0 to A20 of 21 bits becomes a bit state dependent on the command (STO, St1 or ST2). Accordingly, the data transferred from the CPU (1) are automatically stored in the VRAM (7) without the necessity that an address is set in the memory address write register by a command. |
File:US5566313-fig.png [Figure 7] is a block diagram showing the video display controller in the apparatus for displaying a color image. |
[Figure 8] shows a relation between a logical address of the CPU (1) and a physical address of the RAM (6) wherein a block F8 of a physical address region having 2M bytes is allocated in accordance with a content F8 of the selected register MPR1 in a case where a logical address of 16 bits on the Land H-buses 34 and 35 corresponds to one address selected from addresses 2000 to 3FFF of a logical address region having 64K bytes as indicated by hatching lines therein. Thus, a memory of 2M bytes in which an address signal of 21 bits is required for the access thereof can be accessed by an address signal of 16 bits. At this time, data at a corresponding address of a memory are immediately transferred to a Video Display Controller (2) in a case where lower 2 bits A0 and A1 of the physical address are of a content as shown in [Figure 6]. |
File:US5566313-fig.png [Figure 8] is an explanatory diagram showing a relation between logical and physical address regions in an apparatus for controlling the transfer of data in the embodiment. |
[Figure 9] shows a physical address region of the RAM (6) to which a chip enable signal CER is allocated. The chip enable signal CER is produced in accordance with a content of upper 11 bits A10 to A20 of a physical address A0 to A20 which is decoded in the chip enable decoder (26). For instance, the chip enable signal CER is allocated to a region of physical addresses 1F0000 to 1F7FFF in which zero page and stack regions exist in a case where a content of the selected register MPR1 is F8. The zero page and stack regions are of a region to which contents of the Accumulator (38), the X register (39), and the Y register (40) are evacuated temporarily. Although the invention has been described with respect to specific embodiment for complete and clear disclosure, the appended claims are not to thus limited but are to be construed as embodying all modification and alternative constructions that may occur to one skilled in the art which fairly fall within the basic teaching herein set forth. |
File:US5566313-fig.png [Figure 9] is an explanatory diagram showing an allocation of a chip enable signal to a physical address region in an apparatus for controlling the transfer of data in the embodiment. |
Patent for VRAM access via VDC/CPU
Note: terminals with a High value are a binary 1 and Low is a binary 0.
United States Patent Number: 5030946APPARATUS FOR THE CONTROL OF AN ACCESS TO A VIDEO MEMORY
Patent for Block Transfers Instructions
United States Patent Number: 5034886COMPUTER SYSTEM FOR REDUCING NUMBER OF DEDICATED REGISTERS USING MEMORY STOCK AND SHARING OF ADDRESS AND GENERAL PURPOSE REGISTERS
In [Figure 1], there is shown an apparatus for displaying a color image to which an apparatus for controlling a transfer of data according to the invention is applied. In the apparatus for displaying a color image, a CPU (1) performs a predetermined control in accordance with a program stored in ROM (5) so that data, arithmetical results etc. are stored into a RAM (6) temporarily. A Video Display Controller (2) is provided therein to supply a Video Color Encoder (3) with video data of a story, for instance, for a so-called television game read from a video RAM (VRAM) 7 in accordance with a control of the CPU (1) which deciphers a program for the television game stored in the ROM (5). The Video Color Encoder (3) to which the video data are supplied produces RGB analog signals obtained in accordance with color data stored therein, or produces video color signal including a luminance signal and color difference signals obtained in accordance with the color data. Further, a Programmable Sound Generator (4) is provided therein to produce analog sound signals as left and right stereo sounds in accordance with a content of the ROM (5) which is supplied through the CPU (1) thereto. The video color signal produced in the Video Color Encoder (3) is supplied through an interface 8 to a receiving circuit of a video display (9) as a composite signal, and the RGB analog signal is supplied through an interface (10) directly to a CRT of the television set which functions as an exclusive use monitor means. On the other hand, the left nd right analog sound signals are supplied through amplifiers 11a and 11b to speakers 12a and 12b to produce sounds. |
|
[Figure 2] shows the CPU (1) and the Programmable Sound Generator (4) as encircled by a dotted line in [Figure 1]. The CPU (1) in which an apparatus for controlling a transfer of data in the embodiment is included and comprises:
These units will be explained as follows. [list=1] [*] instruction register (20) The instruction register (20) is loaded with an instruction code at an instruction fetch cycle. [*] instruction decoder (21) The instruction decoder (21) performs a sequential operation determined in accordance with an output of the instruction register (20), an interruption input from a peripheral circuit or a reset input, and further performs a control of a divergence command changing a flow of a program in accordance with informations of a status register described later. [*] bus interface register (22) The bus interface register (22) controls a transfer of data among a B-bus (32), a U-bus (33) and an external bus D0 to D7. The ALU (23) and the set of registers (24) are connected by the B-bus (22), and the U-bus (33) is connected to internal periphery circuits. Further, a L-bus (34) for transferring lower 8 bits of a logical address and a H-bus (35) for transferring upper 8 bits of the logical address are provided. A logical address low register 48 is connected to the L-bus (34), and a logical address high register 49 is connected to the H-bus (35). [*] ALU (23) The ALU (23) is provided with an A register (36) and a B register (37), and performs all of arithmetic and logic operation. The A and B registers 36 and 37 are loaded with one or two data so that an arithmetic operation is performed in accordance with a control signal of the instruction decoder (21) to supply one of the B-bus (32), L-bus (34) and H-bus (35) with a result of the arithmetic operation. [*] set of registers (24) The set of registers (24) comprises following 10 registers each being of 8 bits. [list=1] [*] Accumulator (38) The Accumulator (38) is a wide use register which plays the most important role in an arithmetic and logic operation to be conducted when a memory arithmetic flag T of a status register described later is 0. Data thereof is supplied to an input of the ALU (23), and a result of the arithmetic is stored therein. The Accumulator (38) is also used for a transfer of data between memories and between a memory and a peripheral circuit, and for a count of a data block length when a block transfer of data is performed. A lower data of the length are stored therein after data stored therein at the very moment are evacuated into a stack region of the RAM (6). [*] X and Y registers (39 and 40) The X and Y registers (39 and 40) are wide use registers which are mainly used for an index addressing. The X register (39) is used for a designation of an address on page 0 of a memory which is a destination of an arithmetic operation, and for a storage of lower data of a source address after data stored therein at the very moment are evacuated into a stack region of the RAM (6) when a block transfer of data is performed. On the other hand, the Y register (40) stores lower data of a destination address after data stored therein at the very moment are evacuated into a stack region of the RAM (6) when a block transfer of data is performed. [*] Program Counters (41 and 42) An up counter of 16 bits is composed of the Program Counter (41) of upper 8 bits and the Program Counter (42) of lower 8 bits. The up counter is automatically incremented in accordance with the conduct of a command to designate an address of a command or operand to be next conducted. Contents of the Program Counters (41 and 42) are evacuated into a stack region of the RAM (6) in a case where a command of subroutine is conducted, and an interrupt is produced, or after an interruption command of a software is conducted. [*] Stack Pointer (43) The Stack Pointer (43) designates lower 8 bits of the highest address on a stack region of the RAM (6), and is decremented after the pushing of data into the stack region and incremented before the pulling of the data from the stack region. For instance, 256 bytes of addresses 0x2100 to 0x21FF are allocated to the stack region in a logical address. [*] source high register (45), destination high register (46), and length high register (47) These registers function in case of a command of a block transfer. The source high register (45) provides an upper byte of a source address to designate the source address together with a content of the X register (39). The destination high register (46) provides an upper byte of a destination address to designate the destination address together with a content of the Y register (40). The length high register (47) provides lower 8 bits for a down counter together with upper 8 bits which are a content of the Accumulator (38) so that a length of a block transfer is counted by a byte unit. [/list] [*] Mapping Register (25) The Mapping Register (25) is composed of 8 registers each being of 8 bits to convert a logical address of 16 bits to a physical address of 21 bits, and is selected by upper 3 bits of the H-bus (35). [*] chip enable decoder (26) The chip enable decoder (26) provides chip enable outputs for following peripheral circuits by decoding upper 11 bits of a physical address. [list=1] [*] a chip enable for the RAM (6)...CER [*] a chip enable for the Video Display Controller (2)...CE7 [*] a chip enable for the Video Color Encoder (3)...CEK [*] a chip enable for the Programmable Sound Generator (4)...CEP [*] a chip enable for the Timer (29)...CET [*] a chip enable for the input and output port...CE10 [*] a chip enable for the interrupt request register (30) and the interrupt disable register (31)...CECG [/list] [*] timing and control unit (27) The timing and control unit (27) is connected to the following terminals. [list=1] [*] RD terminal A read timing signal is supplied through the RD terminal at a reading cycle. [*] WR terminal A write timing signal is supplied through the WR terminal at a writing cycle. [*] SYNC terminal A synchronous signal of High is supplied through the SYNC terminal at an instruction fetch cycle, that of Low is supplied therethrough at a system reset timing. [*] NMI terminal A non-maskable interruption is produced when NMI input signal is supplied through the NMI terminal. A sub-routine call is conducted by reading lower address from the logical address 0xFFFC and upper address from the logical address 0xFFFD when a command which is conducted in a program is completed. [*] IRQ1 and IRQ2 terminals A sub-routine call is conducted by reading lower address from the logical address 0xFFF8 and upper address from the logical address 0xFFF9 when IRQ1 input becomes Low in a case where a corresponding bit in the interrupt disable register (31) is 0, and a corresponding bit in the Status Register (44) is 0. At this time, the corresponding bit is set in the Status Register (44), and other corresponding bits are reset therein. A sub-routine call is conducted by reading lower address from the logical address 0xFFF6 and upper address from the logical address 0xFFF7 when IRQ2 input becomes Low in a case where a corresponding bit in the interrupt disable register (31) is 0, and a corresponding bit in the Status Register (44) is 0. At this time, the corresponding bit is set in the Status Register (44), and other corresponding bits are reset therein. [*] RESET terminal A program is started by reading lower address from the physical address 0x00001FFE and upper address from the physical address 0x00001FFF when a RESET input becomes Low. [*] RDY terminal The CPU (1) is started to operate when a RDY input is changed from Low to High. [*] SX terminal A complementary signal of a system clock signal is supplied through the SX terminal. [*] OSCI terminal An external clock signal is input through the OSCI terminal. [*] EA1 to EA3 terminals These are input terminals for a test of the CPU (1). [*] HSM terminal A speed mode signal of High is supplied through the HSM terminal in case of a high speed mode of 21.477270 MHz/3, and that of Low is supplied therethrough in case of a low speed mode of 21.477270 MHz/12. [/list] [*] input and output port (28) The input and output port (28) is connected to following terminals. [list=1] [*] K0 to K7 terminals The terminals are input ports from which data are written in accordance with the conduct of a reading cycle in regard to the physical addresses 0x001FF000 to 0x001FF3FF. [*] 00 to 07 terminals The terminals are output ports with latches to which data are supplied in accordance with the conduct of a writing cycle in regard to the physical addresses 0x001FF000 to 0x001FF3FF. [/list] [*] Timer (29) The Timer (29) is connected to a test input terminal EAT for the CPU (1) and provides a timer signal through the U-bus thereto. [*] interrupt request register (30) The interrupt request register (30) is of 8 bits among which 5 bits are not used, while the remaining 2 bits are 1 to make the IRQ1 and IRQ2 terminals Low and the remaining 1 bit is 1 to produce a timer interrupt signal. The interrupt request register (30) is only used for read. [*] interrupt disable register (31) The interrupt disable register (31) is of 8 bits among which 5 bits are not used, while the remaining 2 bits are 1 to make an interrupt request of the IRQ1 and IRQ2 terminals disable, and the remaining one is 1 to make an interrupt request disable in accordance with the timer interrupt signal. [/list] In operation, when one of commands TII, TIN, TIA, TAI and TDD for a block transfer of data as shown in [Figure 3] is produced, contents of the Accumulator (38), the X register (39) and the Y register (40) are evacuated into a stack region of the RAM (6). Thereafter, the Accumulator (38) stores lower data of a length for the block transfer, the X register (39) stores lower data of a source address, and the Y register (40) stores lower data of a destination address. Simultaneously, the source high register (45) stores upper data of the source address, the destination high register (46) stores upper data of the destination address, and the length high register (47) stores upper data of the length for the block transfer. Thus, corresponding registers are loaded with the source address, the destination address, and the block length respectively. At the present stage, the memory arithmetic flag T of the Status Register (44) is 0. Next, the aforementioned block transfer commands TII, TIN, TIA, TAI and TDD will be explained in conjunction with [Figure 3] to 7. [list=1] [*] TII ([Figures 3 and 4]) In accordance with the command TII, data are transferred in a block of a predetermined length such that the source and destination addresses are automatically incremented. At first, contents of the Accumulator (38), the X register (39), and Y register (40) are evacuated into the stack region MS as shown in [Figure 4] (block 410) by MS ↠Y, MS ↠A and MS ↠X, and the Stack Pointer (43) is decremented after the pushing of data into the stack region MS as shown in [Figure 4] (block 410) by S ↠S - 1. Thus, the block transfer of data is performed from a memory MSS designated by the source high and X registers (45 and 39) to a memory MDD designated by the destination high and Y registers (46 and 40) as shown in [Figure 4] (block 420) by MDD ↠MSS. During this transferring stage,the source and destination addresses are incremented by each transfer of one byte as shown in [Figure 4] (block 420) by SL ↠SL + 1, SH ↠SH + C, DL ↠DL + 1, DH ↠DH + C. When contents of the length high register (47) and the Accumulator (38) for the length counter becomes 0, that is, Low is 0, in accordance with a down count as shown in [Figure 4] (block 430, block 420) by LL ↠LL - 1, LH ↠LH - C, the block transfer is completed. At this moment, data which have been evacuated in the stack region MS are restored in the Accumulator (38), the X register (39), and the Y register (40) as shown in [Figure 4] (block 440) by X ↠MS, A ↠MS and Y ↠MS, and the Stack Pointer (S) is incremented as shown in [Figure 4] (block 440) by S ↠S + 1. [*] TIN ([Figures 3 and 5]) Although like operating steps are indicated by like expressions between [Figures 4 and 5], the difference is that an address of a source memory is incremented by each transfer of one byte, while an address of a destination address is fixed (block 510). [*] TIA ([Figures 3 and 6]) Although an address of a source memory is incremented by each transfer of one byte, an address of a destination memory is incremented and decremented alternately by each transfer of one byte (blocks 610 and 620). [*] TAI ([Figure 3]) Although a flow chart is not shown for the embodiment, an address of a source memory is incremented and decremented alternately by each transfer of one byte, an address of a destination memory is only incremented. [*] TDD ([Figures 3 and 7]) Both addresses of a source memory and a destination memory are decremented by each transfer of one byte (block 710). [/list] In the embodiments in which increment and decrement of an address are alternately performed, it becomes easy to set up an interface between the apparatus of the invention and a peripheral integrated circuit. |
Patent for Store Immediate Instructions
United States Patent Number: 5226140APPARATUS FOR CONTROLLING THE TRANSFER OF DATA
In [Figure 1], there is shown an apparatus for displaying a color image to which an apparatus for controlling the transfer of data according to the invention is applied. In the apparatus for controlling the transfer of data, a CPU (1) performs a predetermined control in accordance with a program stored in ROM (5) so that data, arithmetical results etc. are stored into a RAM (6) temporarily. A Video Display Controller (2) is provided therein to supply a Video Color Encoder (3) with video data of a story, for instance, for a so-called television game read from a video RAM (VRAM) 7 in accordance with a control of the CPU (1) which deciphers a program for the television game stored in the ROM (5). The Video Color Encoder (3) to which the video data are supplied produces RGB analog signals obtained in accordance with color data stored therein, or produces video color signal including a luminance signal and color difference signals obtained in accordance with the color data. Further, a programmable sound generator 4 is provided therein to produce analog sound signals as left and right stereo sounds in accordance with a content of the ROM (5) which is supplied through the CPU (1) thereto. The video color signal produced in the Video Color Encoder (3) is supplied through an interface 8 to a receiving circuit of a video display (9) as a composite signal, and the RGB analog signal is supplied through an interface 10 directly to a video display (9) which functions as an exclusive use monitor means. On the other hand, the left and right analog sound signals are supplied through amplifiers 11a and 11b to speakers 12a and 12b to produce sounds. |
|
[Figure 2] shows the CPU (1) and the programmable sound generator 4 as encircled by a dotted line in [Figure 1]. The CPU (1) in which an apparatus for controlling a transfer of data in the embodiment is included and comprises an instruction register (20), an instruction decoder (21), a bus interface register (22), an Arithmetic Logic Unit (ALU) (23), a set of registers (24), a Mapping Register (25), a chip enable decoder (26), a timing and control unit (27), an input and output port (28), a Timer (29), an interrupt request register (30), an interrupt disable register (31), and so on. These units will be explained as follows.
|
|
In [Figure 3], there is shown the aforementioned Mapping Register (25) comprising 8 registers MPR0 to MPR7 each being of 8 bits, and connected through the B-bus (32) to an input output controller (50) and through an output selector (51) to the output terminals A13 to A20. The output selector (51) selects one register from the 8 registers MPR0 to MPR7 of the Mapping Register (25) in accordance with upper 3 bits H5 to H7 of upper data of a logical address on the H-bus (35). |
|
[Figure 4] shows a relation between the upper 3 bits H5 to H7 and one register selected from the 8 registers MPR0 to MPR7. If it is assumed that the upper 3 bits H5 to H7 are 010, the register MPR2 is selected from the 8 registers MPR0 to MPR7. Data are read from the Mapping Register (25) by a command TMAi where i is an integer selected from 0 to 7. For instance, data are read from the register MPR2 to be transferred through the B-bus (32) to the Accumulator (38) in accordance with a command "TMA2 ". On the other hand, data are written into the Mapping Register (25) by a command TAMi where i is an integer selected from 0 to 7. For instance, data are transferred to be written into the register MPR0 from the Accumulator (38) by a command TAM0. The commands TMAi and TAMi are composed of two byte respectively, and lower byte thereof includes a bit of 1 corresponding in a bit number to a register number which is selected from the 8 registers MPR0 to MPR7 and remaining 7 bits of 0. When one of the 8 registers MPR0 to MPR7 is selected in accordance with upper 3 bits of the H-bus (35), a content of the selected register is supplied through the output terminals A13 to A20 to a following stage so that a physical address of 21 bit is obtained together with a content of the logical address low register (48) to be supplied through the output terminals A0 to A7 thereto, and lower 5 bits of the logical address high register (49) to be supplied through the output terminals A8 to A12 thereto. When the most significant bit A20 of a physical address A0 to A20 is 1, a command by which data designated in accordance with the physical address A0 to A20 are immediate-transferred to the Video Display Controller (2) is conducted. The command includes ST0, ST1 and ST2 by which codes are produced on A0 and A1 of the address bus at a write cycle as shown in [Figure 6]. The command is set in the instruction register (20). In operation, lower data of a logical address are set in the logical address low register (48), and lower 5 bits of upper data of the logical address are set in the logical address high register (49). Here, it is assumed that address data are set in the 8 registers MPR0 to MPR7 of the Mapping Register (25) respectively. When upper 3 bits of upper data of the logical address, that is to say, upper 3 bits H5 to H7 of the H-bus (35) are 001, the register MPR1 is selected so that a content F8 of the register MPR1 is supplied through the output terminals A13 to A20 to the following stage. These output signals are combined with output signals of the output terminals A8 to A12 and A0 to A7 to produce a physical address A0 to A20. Then, the chip enable decoder (26) decodes upper 11 bits A10 to A20 of the physical address A0 to A20 to produce a chip enable signal CER of 0 by which a data memory is enabled. When the immediate data transfer command is produced, the signal CE7 is 0, the MSB A20 is 1, and the bits A0 and A1 are of a content as shown in [Figure 6] so that data are transferred from the CPU (1) to the Video Display Controller (2) as shown in detail in [Figure 7]. |
|
[Figure 7] shows the Video Display Controller (2) which comprises a control unit (70), an address unit (71), a CPU read/write buffer (72), a Sprite Attribute Table buffer (73), a sprite attribute shift register 74, a background shift register (75), a data bus buffer (76), a synchronous circuit (77), and a priority circuit (78). The control unit (70) is provided with a BUSY terminal through which 0 is supplied to the CPU (1) in a case where the Video Display Controller (2) is not in time for the writing / reading of data from the CPU (1) to the VRAM (7) so that the CPU (1) is held under the state, a IRQ terminal through which an interrupt request signal is supplied to an external circuit, a CK terminal through which a clock signals having a frequency for one pixel (one picture element) is received, a RESET terminal through which a reset signal for initialization is received, and a EX8/16 terminal through which a data bus change-over signal for changing over a data bus width is received. The address unit (71) is connected to address terminals MA0 to MA15 through which an address signal of the VRAM is supplied thereto. An address region of the VRAM (7) is of a capacity, for instance, 65,536 words, provided that one word is of 16 bits. The address unit (71), the CPU read/write buffer 72, the Sprite Attribute Table (73), the sprite shift register (74) and the background shift register (75) are connected through data bus to data terminals MD0 to MD15 through which data of the VRAM (7) are transferred for the writing thereinto or the reading therefrom. The Sprite Attribute Table buffer (73) is a memory for storing a display position (X, Y), color, pattern number and so on of a sprite (16 bits). The sprite shift register (74) is supplied with a pattern number, sprite color etc. read from the Sprite Attribute Table buffer (73) to access the VRAM (7), and stores data for a pattern, color etc. of a sprite read from a sprite generator in the VRAM (7). The background shift register (75) stores a pattern and CG color of a background. The pattern is read from a character generator in accordance with an address of the character generator in the VRAM (7) obtained from a character code which is read from an attribute table in the VRAM (7) together with the CG color. The data bus buffer (76) is connected to terminals D0 to D15 through which data are supplied to and received from an external circuit. The Video Display Controller (2) can select one of 8 bit interface and 16 bit interface in compliance with a data width of a system including the CPU (1). When the 8 bit interface is selected, the terminals D0 to D7 are used among the terminals D0 to D15. The synchronous circuit (77) is connected to a DISP terminal through which a signal for indicating a display period is supplied to an external circuit, a VSYNC terminal through which a signal for a vertical synchronization of a CRT is supplied to the video display (9) and an external vertical synchronous signal is received, and a HSYNC terminal through which a signal for a horizontal synchronization of the CRT is supplied to the video display (9) and an external horizontal synchronous signal is received. The priority circuit (78) is connected to terminals VD0 to VD7 through which video data are supplied to an external circuit, and a SP/BG (VD8) terminal through which a signal 1 is supplied to an external circuit when the video data are for a sprite and a signal 0 is supplied thereto when the video data are for a background. The aforementioned control unit (70) is further provided with a CS terminal through which a signal 0 is received so that registers therein are accessed for the writing and reading of data from the CPU (1), RD and WR terminals through which read write-timing signals are received, and terminals A0 and A1 connected to the address bus of the CPU (1) as shown in [Figure 2]. The Video Display Controller (2) is further provided with a MRD terminal and a MWR terminal. When the MRD terminal is under a state of 0, data are read from the VRAM (7) to the CPU (1). On the other hand, when the MWR terminal is under a state of 0, data are written into the VRAM (7) from the CPU (1). The control unit (70) includes a memory address write register and a VRAM data write register together with other registers. In operation, when an immediate data transfer command (ST0, ST1 or ST2) is produced, data transferred from the CPU (1) are stored in the VRAM data write register. The aforementioned physical address A0 to A20 is automatically set in the memory address write register without receiving an address setting command. As a result, the data are written into the VRAM (7) in synchronization with a write signal of 0 applied to the WR terminal in accordance with a single transfer command which is called "an immediate data transfer command". That is to say, a chip including the aforementioned memory address write register and VRAM data write register is enabled in accordance with a chip enable signal CE7 which becomes 0 in the conduct of the immediate data transfer command of ST0, ST1 or ST2. As a result, bits A0 and A1 of a physical address A0 to A20 of 21 bits becomes a bit state dependent on the command (ST0, ST1 or ST2). Accordingly, the data transferred from the CPU (1) are automatically stored in the VRAM (7) without the necessity that an address is set in the memory address write register by a command. |
|
[Figure 8] shows a relation between a logical address of the CPU (1) and a physical address of the RAM (6) wherein a block F8 of a physical address region having 2M bytes is allocated in accordance with a content F8 of the selected register MPR1 in a case where a logical address of 16 bits on the L and H-buses 34 and 35 corresponds to one address selected from addresses 0x2000 to 0x3FFF of a logical address region having 64K bytes as indicated by hatching lines therein. Thus, a memory of 2M bytes in which an address signal of 21 bits is required for the access thereof can be accessed by an address signal of 16 bits. At this time, data at a corresponding address of a memory are immediate-transferred to a Video Display Controller (2) in a case where lower 2 bits A0 and A1 of the physical address are of a content as shown in [Figure 6]. |
|
[Figure 9] shows a physical address region of the RAM (6) to which a chip enable signal CER is allocated. The chip enable signal CER is produced in accordance with a content of upper 11 bits A10 to A20 of a physical address A0 to A20 which is decoded in the chip enable decoder (26). For instance, the chip enable signal CER is allocated to a region of physical addresses 0x1F0000 to 0x1F7FFF in which zero page and stack regions exist in a case where a content of the selected register MPR1 is F8. The zero page and stack regions are of a region to which contents of the Accumulator (38), the X register (39), and the Y register (40) are evacuated temporarily. Although the invention has been described with respect to specific embodiment for complete and clear disclosure, the appended claims are not to thus limited but are to be construed as embodying all modification and alternative constructions that may occur to one skilled in the art which fairly fall within the basic teaching herein set forth. |
Patent for the Programmable Sound Generator
United States Patent Number: 4924744APPARATUS FOR GENERATING SOUND THROUGH LOW FREQUENCY AND NOISE MODULATION
In [Figure 1], there is shown an apparatus for generating sound in an embodiment according to the invention in which six sound sources of channels 1 to 6 are provided. The channels 1 to 6 comprise register arrays 11 to 16, respectively, each including registers to be described later. The apparatus further comprises a channel selecting register (R0) (2), a main sound volume adjusting register (R1) (3), a low frequency oscillator (LFO) frequency register (R8) (4), and a low frequency oscillator (LFO) control register (R9) (5). Each of the register arrays 11 to 16 includes a fine frequency adjusting register (R2), a rough frequency adjusting register (R3), a channel ON/sound volume register (R4), a left and right sound volume register (R5), and a waveform register (R6). Even more, the register arrays 15 and 16 of the channels 5 and 6 further includes a noise enable/noise frequency register (R7). In the channels 11 to 14, there are provided waveform generators 61 to 64 for supplying output sounds to attenuators 71 to 74 in which the output sounds are converted from digital signal to analog signal, and adjusted to have predetermined sound volumes. On the other hand, one of outputs of a waveform generator 65 and a noise generator 8a, and one of outputs of a waveform generator 66 and a noise generator 8b are selected to be supplied to attenuators 75 and 76 in the channels 5 and 6 by selectors 9a and 9b. Outputs of the attenuators 71 to 76 are divided to be supplied to left and right attenuators 10a1 and 10b1 to 10a6 and 10b6 in which the outputs are attenuated with predetermined attenuation factors to be mixed separately by left and right sounds. The left and right mixed signals are adjusted in main attenuators 11a and 11b to have predetermined sound volumes, and then passed through buffer amplifiers 12a and 12b to be supplied through output terminals LOUT and ROUT to a following stage. The register arrays 11 to 16, the channel selecting register (R0) (2), the main sound volume adjusting register (R1) (3), the low frequency oscillator (LFO) frequency register (R8) (4), and the low frequency control register (R9) (5) are connected through data bus (D0) to D7 (8 bits) 13 and address bus (A0) to A3 (4 bits) 14 to CPU (not shown) thereby receiving address signals and data therefrom. Each register described above is connected to a register control circuit (15) to which a chip selecting signal CS and a writing instruction signal WR0 are applied from the CPU so that data transferred through the data bus (13) from the CPU are written at an address designated by an address signal on the address bus (14) into one of the registers. |
|
In [Figure 2], there are shown the aforementioned registers R0 to R9 each being of 8 bits which will be explained as follows. (1) channel selecting register (R0) Channel selecting data ch SEL are stored in lower 3 bits. |
|
[Figure 3A] shows a relation between channel selecting data 0x0 to 0x5 and on of the channels 1 to 6 which is selected. For instance, if the channel selecting data are 011 (equal to 3), the channel 4 "ch 4" is selected. On the other hand, the registers R2 to R7 of the register arrays 11 to 16 and the other registers R1, R8 and R9 are addressed by the address signal A0 to A3 on the address bus (14). A relation thereof is shown in [Figure 3B]. The address signal is one of the values 0x0 to 0x9 dependent on a content of A0 to A3. For instance, if the address signal is 2 (0010), the fine frequency adjusting register (R2) is selected. (2) main sound volume adjusting register (R1) The left and right attenuators 11a and 11b are controlled to adjust volumes of the left and right mixed sounds by the register (R1). Upper 4 bits LMAL are data for defining attenuation amount of the left attenuator 11a, while lower 4 bits RMAL are that for the right attenuator 11b. When the 4 bit data is 0xF, sound volume is the maximum, and is decreased by approximately 3 dB in a case where a set value of the register (R1) is decreased by 1. (3) fine frequency adjusting register (R2) Fine frequency adjusting data "FRQ LOW" of 8 bits are set. (4) rough frequency adjusting register (R3) Rough frequency adjusting data "FRQ HIGH" of lower 4 bits are set. Here, data of 12 bits including the data "FRQ LOW" of 8 bits as lower data and the data "FRQ HIGH" of 4 bits as upper data are obtained. If it is assumed that the 12 bit data are F, a frequency f1 of a waveform output is defined in each channel as follows: ##EQU1## In the above equation, 7.15909 MHz is a master frequency which is supplied from the CPU. (5) channel ON/sound volume register (R4) Sound output of each channel and the writing of the waveform register (R6) which will be described later are controlled in accordance with "ch ON" of the MSB, a direct D/A mode which will be described later is controlled in accordance with DDA of the second bit, and attenuation amounts of the attenuators 71 to 76 are controlled in accordance with AL of lower 5 bits |
|
[Figure 4] shows the control which is conducted in accordance with a content of the MSB and second bit of the Register (R4). As apparent from the descriptions therein, sound output is supplied from a corresponding channel in a case where the MSB is 1, while sound output is not supplied therefrom, and data on the data bus (13) are possible to be written into a corresponding waveform register (R6) in a case where the MSB "ch ON" is 0. Further, an address counter for the waveform register (R6) is reset, and a direct D/A mode is possible to be performed in a case where the second bit DDA is 1. The direct D/A mode is a mode in which data transferred through the data bus (13) from the CPU are passed through a corresponding one of the register arrays 11 to 16 and supplied directly to a corresponding one of the attenuators 71 to 76 without being passed through any of the waveform generators 61 to 66. In the corresponding attenuator, the data thus transferred are converted from digital signal to analog signal to be supplied through the output terminals LOUT and ROUT to a following stage. The lower 5 bits AL controls attenuation amounts of the attenuators 71 to 76 such that the maximum output is obtained when 0x1F is set therein, and an amplitude of output is decreased by 1.5 dB each time when a set value is decreased by 1. (6) left and right sound volume register (R5) In each channel, the register (R5) controls a corresponding pair of the attenuators 10a1 and 10b1 to 10a6 and 10b6 for adjusting left and right dividing sound volumes. Sound volume of left output is decided by upper 4 bits LAL, while that of right output by lower 4 bits RAL. When the LAL or RAL is 0xF, the sound volume is the maximum, and is decreased by approximately 3 dB each time when a set value is decreased by 1. (7) waveform register (R6) The waveform register (R6) is shown in [Figure 5] in which a word is composed of lower 5 bits for setting waveform data. As shown therein, the waveform register (R6) includes thirty-two addresses 0, 1, 2, ... 1E, 0x1F, and thirty-two waveform data corresponding to the addresses and defining one period of a waveform. Therefore, the thirty-two addresses are accessed in an order of address numbers by a predetermined frequency and number so that a sound signal of a predetermined frequency is produced in a corresponding one of the waveform generators 61 to 66. |
|
In [Figure 6], there is shown a relation between an address (horizontal axis) and an amplitude (vertical axis) in which the amplitude is increased from 0x00 to 0x1F by one each time when the address is increased from 0x00 to 0x1F by one. In a case where a waveform register having data as shown in [Figure 6] is accessed in an order of address numbers by a predetermined frequency, a sawtooth wave sound is generated. |
|
[Figure 7] shows a data conversion in which a sinusoidal waveform of one period is divided equally by thirty-two addresses so that thirty-two amplitudes corresponding to the thirty-two addresses are expressed by 5 bit words which are stored into the waveform register (R6). Accordingly, when the waveform register (R6) is addressed in an order of address numbers, a waveform pattern as shown in [Figure 7] is generated in a corresponding one of the waveform generators 61 to 66. In a case where sound other than a sinusoidal waveform is generated, a waveform of the sound is observed in a waveform observing apparatus such as a synchroscope thereby being converted in regard to data thereof in the same manner as described in a case of a sinusoidal waveform. The converted data are written into the waveform register (R6) in a following procedure. As explained in the channel ON/sound volume register (R4) in [Figure 4], a mode in which an address of the waveform register (R6) is increased by one each time when data are written thereinto in a case where both the upper 2 bits of the register (R4) are 0 ("ch ON" is 0, and DDA is 0). Thus, thirty-two words (thirty-two waveform data) are written into the thirty-two addresses thereof. At this stage, one of the channels 1 to 6 is selected by the channel selecting register (R0) (2), and address data (5) (A0 to A3) of the address bus (14) is controlled to be 6 so that data are transferred through the data bus (13) from CPU to the waveform register (R6). When data are finished to be written thereinto, the upper 2 bits of the register (R4) are controlled to be 10 ("ch ON" is 1, and DDA is 0) to provide an output mode. When the starting address of the waveform register (R6) is wanted to be 0 at the moment that data are begun to be written thereinto, the upper 2 bits of the register (R4) are set to be 00 after the bits are once set to be 01. Thus, an address counter for the waveform register (R6) is reset to be 0 in accordance with the control of software program. In the aforementioned direct D/A mode, on the other hand, a preparation for generating sound is completed when the upper 2 bits of the register (R4) are set to be 00, 00 is written into the waveform register (R6), and the upper 2 bits of the register (R4) are then set to be 11. In the circumstance, when data are repeated to be written into the waveform register (R6), sound is generated because data are transferred to a corresponding one of the attenuators 71 to 76 (D/A converters) at each time of the data writing. In this case, although data are transferred to the waveform register (R6), the data may be considered to be passed therethrough. That is to say, a content of the waveform register (R6) remains unchanged to be maintained therein. By adopting this mode, a voice can be supplied through the apparatus from the CPU to a following stage in place of an artificial sound supplied from the waveform register (R6). (8) noise enable/noise frequency register (R7) A change-over between noise sounds and musical sounds is controlled by the MSB bit NE. When the NE is 1, the noise sounds are enabled to cease output of the musical sounds. Noise frequency is controlled by lower 5 bits. As described before, the noise generators 8a and 8b are provided in the channels 5 and 6. For this reason, the register (R7) is provided only in each of the channels 5 and 6. In the control of noise frequency, clock signal which is supplied to the noise generators 8a and 8b is controlled such that sound is shifted from low frequency to high frequency when a content of the lower 5 bits is varied from 0x00 to 0x1F. The noise frequency f2 is defined as follows: ##EQU2## Where NF is a content of the lower 5 bits of the register (R7). The noise sound is a waveform of pseudo random, and output waveform is a rectangle wave which is applied to the generating of rhythm sound-effects sound. (9) low frequency oscillator (LFO) frequency register (R8) (4) A low frequency oscillator (LFO) is used for the control of frequency-modulation, and is composed of low frequency oscillator (LFO) frequency register (R8) (4) and a frequency counter for musical sounds in the channel 2. Here, it is defined that the frequency-modulation is a frequency-modulation in which sound of the channel 1 is frequency-modulated by using a waveform data of the channel 2. A frequency f3 of the low frequency oscillator (LFO) is controlled by low frequency oscillator (LFO) frequency register (R8) (4), and the fine frequency adjusting register (R2) and the rough frequency adjusting register (R3) in the channel 2. Effects sound-vibrato is generated in accordance with the frequency modulation. (10) low frequency oscillator (LFO) control register (R9) (5) The low frequency oscillator (LFO) control register (R9) (5) includes the MSB "LF TRG" and lower 2 bits "LF CTL". A low frequency oscillator (LFO) is reset to return to the initial state when 1 is written into the "LF TRG". At this stage, a content at the address 0 of the waveform register (R6) in the channel 2 is an output which is used as frequency-modulation data, and the frequency-modulation is then stopped. While, the frequency-modulation is started when the "LF TRG" is 0. That is to say, sound of the channel 1 is frequency-modulated by waveform data of the waveform register (R6) in the channel 2 to generate effects soundvibrato. The lower 2 bits "LF CTL" controls a modulation degree of the frequency-modulation. |
|
[Figure 8] shows a relation between the low frequency oscillator (LFO) and the frequency-modulation. A frequency f3 of the low frequency oscillator (LFO) which is an address frequency for addressing the waveform register (R6) in the channel 2 is defined as follows: ##EQU3## Where F' is data value (decimal) of 12 bits including 8 bit data of the register (R2) in the channel 2 as lower data and 4 bit data of the register (R3) as upper data, and F" is data value (decimal) of 8 bits of the low frequency oscillator (LFO) register (R8) (4). The frequency-modulation of the channel 1 is performed by data of the waveform register (R6) which is addressed in the channel 2 by the address frequency f3. That is to say, data of the waveform register (R6) in the channel 2 are added to or subtracted from the fine frequency adjusting register (R2) in the channel 1. |
|
[Figure 9] shows frequency-modulation data (LFO data) corresponding to waveform data of waveform 0x00 to 0x1F of the waveform register (R6) in the channel 2 whereby addition is performed in a case where the MSB of the waveform data is 1 (the waveform from 0x10 to 0x1F), while subtraction is performed in a case where the MSB of the waveform data is 0x00 (the waveform 0x00 to 0x0F). Sound of the channel 1 is shifted in a direction of low frequency by the addition, and in a direction of high frequency by the subtraction. For instance, when the waveform data of an address which is addressed in the waveform register (R6) of the channel 2 are 11100, lower 4 bits 1100 (0xC) of the waveform data 11100 are added to four corresponding bits of the fine frequency adjusting register (R2) of the channel 1. |
|
[Figures 10A to 10C show 4 bits of the fine frequency adjusting register (R2) in the channel 1 to which the aforementioned lower 4 bits of the waveform data are added. That is to say, 4 bits of positions decided by a content of the lower 2 bits "LF CTL" of the low frequency oscillator (LFO) control register (R9) (5) are selected in the fine frequency adjusting register (R2) as follows:
|
|
[Figure 11] shows a timing at which data are set in the registers (R0 to R9). Data are set in one of the registers R0, R1, R8 and R9 wherein a chip is enabled in accordance with 0 of CEP0 signal, one of the registers is selected in accordance with the address A0 to A3 of the address bus (14), and data D0 to D7 which are set on the data bus (13) are written thereinto in accordance with 0 of the writing signal WR. On the other hand, data are set in one of the registers R2 to R7 wherein one of the channels 1 to 6 is set in the channel selecting register (R0), and the same procedure as described above is thereafter performed to write data into a register in a channel thus selected. Next, operations will be explained in the apparatus for generating sound in the embodiment according to the invention. [OPERATION 1] It is assumed that predetermined data are already written in the registers (R0 to R9). In the circumstance, the whole system in the apparatus is enabled when the chip selecting signal CS0 (=0) is applied to the register control circuit (15). When at least one of the channels and those of the registers are selected in accordance with a content of the channel selecting register (R0) and an address A0 to A3 on the address bus (14), the addresses 0x00 to 0x1F of the waveform register (R6) are addressed in accordance with a frequency dependent on contents of the fine frequency adjusting register (R2) and the rough frequency adjusting register (R3) in the channel where the upper 2 bits of the channel ON/sound volume register (R4) are 10 so that output sound is generated in at least one of the waveform generators 61 to 66 in which waveform data of the waveform register (R6) are developed. The attenuation amounts of the attenuators 71 to 76 are set to be predetermined values in accordance with the lower 4 bits of the channel ON/sound volume register (R4), and the attenuation amounts of the attenuators 10a1 and 10b1 to 10a and 10b6 are set by the left and right (LR) sound volume register (R5). Output sound of each channel is converted from digital signal to analog signal in a corresponding one of the attenuators 71 to 76, and are adjusted to be a predetermined sound volume therein. The output sound is divided in each channel to be supplied to a corresponding pair of the attenuators 10a1 and 10b1 to 10a6 and 10b6, and the output sounds thus divided are mixed to provide left and right output sounds which are then controlled in the left and right main attenuators 11a and 11b set by the main sound volume adjusting register (R1) thereby providing the left and right output sounds with predetermined main sound volumes. The left and right stereo sounds of the main volumes thus adjusted are passed through the buffer amplifiers 12a and 12b to be supplied through the output terminals LOUT and ROUT to a following stage. In the operation described above, when the MSB of the noise enable noise/frequency register (R7) is 1 in the channels 5 and 6, noise is generated in the noise generator 8a or 8b in accordance with a noise frequency of the lower 5 bits of the register (R7), and then selected to be supplied to the attenuator 75 or 76 by the selectors 9a or 9b thereby producing rhythm sound-effects sound. Further, the MSB of the low frequency oscillator (LFO) control register (R9) is changed from 1 to 0, frequency-modulation of output sound is started in the channel 1 again. At this moment, an address frequency f3 by which the waveform register (R6) is addressed is decided by a content of the low frequency oscillator (R9) and contents of the fine and rough frequency adjusting registers (R2 and R3). In accordance with the access of the waveform register (R6), lower 4 bits of the waveform register (R6) are added to or subtracted from selected 4 bits of the fine frequency adjusting register (R2) in the channel 1 dependent on the "LF CTL" (lower 2 bits) of the low frequency oscillator (LFO) control register (R9) to result in frequency-modulation of output sound thereby producing effects sound-vibrato. On the other hand, when upper 2 bits of the channel ON/sound volume register (R4) are 11, there is realized a direct D/A mode in which voice sound is supplied from the CPU through the data bus (13) to at least a corresponding one of the register arrays 11 to 16 each time when the writing signal WR0 is applied to the register control circuit (15) in accordance with the resetting of the address counter for the waveform register (R6) to be transferred through a line which does not pass on a corresponding one of the waveform generators 61 to 66 to at least a corresponding one of the attenuators 71 to 76 in which voice sound is converted from digital signal to analog signal, and adjusted to be a predetermined sound volume thereby being supplied through the output terminals LOUT and ROUT in the same manner as described above. This results in the generation of voice sound which is utilized for effects sounds in place of artificial sound. As apparent from the explanations, simultaneous generation of six musical sounds and of four musical sounds and two noise sounds and so on can be performed, although the number of waveform generators and noise generators is not limited to that of the embodiment. [OPERATION 2] An address A0 to A3 of the address bus (14) are controlled to be 0000, and the channel selecting register (R0) is addressed from the CPU as shown in [Figure 3B]. In the circumstance, 0 is written into lower 3 bits "ch SEL" thereof from the data bus (13) so that the channel 1b is selected as shown in [Figure 3A]. Next, the address A0 to A3 are controlled to be 0100, and the channel ON/sound volume register (R4) is addressed in the channel 1. Under the situation, predetermined data are written into upper 2 bits "ch ON" and DDA of the register (R4) to conduct following operations. (a) "ch ON"=0, and DDA=0 The waveform register (R6) is addressed in accordance with an address 0111 on the address bus (14). The addresses of the waveform register (R6) are serially addressed, when a counted value of the internal address counter is increased by one as shown in [Figure 5], so that waveform data transferred through the data bus (13) ar written thereinto. Such waveform data can be stored in the waveform register (R6) by performing a data conversion of a predetermined waveform as explained before. In this case, the writing of waveform data is started from a non-fixed address dependent on a then-counted value of the internal address counter. (b) "ch ON"=0, and DDA=1 After upper 2 bits of the register R4 are set as 0 and 1, the 2 bits are set to be 0 and 0 so that the address counter for the register R4 is reset to be 0. Thereafter, data are written thereinto in an order of the addresses 0x00 to 0x1F. Thus, waveform data can be written into the waveform register (R6) in the channel 1. After the upper 2 bits of the channel ON/sound volume register (R4) are set to be 1 and 0, respectively, so that output sound of the channel 1 is converted from analog signal to digital signal in the attenuator 71 and adjusted to have a predetermined sound volume, and then divided to be supplied to the attenuators 10a1 and 10b1 from which left and right output sounds of the channel 1 are supplied to the main attenuators 11a and 11b. On the other hand, 0 (="ch ON") and 1 (=DDA) are written through the data bus (13) into the upper 2 bits of the channel ON/sound volume register (R4), and 00 are written into the waveform register (R6) so that the direct D/A mode is demanded. Thereafter, 1 (="ch ON") and 1 (=DDA) are written into the upper 2 bits of the register (R4) so that voice sound signals which are transferred through the data bus (13) are repeated to be written into the waveform register (R6), and supplied to the attenuator (D/A converter) 71 through a path which does not pass the waveform generator (R6) to provide voice sound output at each time of the writing of the waveform register (R6). In this case, although data are seemingly transferred to the waveform register (R6), a whole content of the waveform register (R6) is held to remain unchanged. Although the operation of the channel 1 is explained above, the same operation is possible to be performed in the other channels 2 to 6 or in a plurality thereof simultaneously. [OPERATION 3] When lower 2 bits "LF CTL" of the low frequency oscillator control register (R9) are not zero, that is, the bits are one of 1, 2 and 3, a low frequency oscillator is turned on to produce a low frequency signal f3. The frequency f3 is calculated in the aforementioned equation, and depends on contents of the fine and rough frequency register (R2 and R3) and on a content of the low frequency oscillator (LFO) frequency register (R8). When 1 is written into the MSB "LF TRG" of the low frequency oscillator (LFO) control register (R9) (5), the low frequency oscillator (LFO) is reset to return to the initial state. At this moment, frequency-modulation is stopped in a state that waveform data at the address 0 of the waveform register (R6) in the channel 2 is read out as frequency-modulation data. In the circumstance, 0 is written into the MSB "LF TRG" of the control register (R9), frequency-modulation is started again with the low frequency signal f3 by which the waveform register (R6) of the channel 2 is serially addressed from the address 0 to the address 1F. If the low frequency f3 is high, an addressing speed is of a high speed, while the addressing speed is low if the low frequency f3 is low. Waveform data of the waveform register (R6) in the channel 2 are accessed in an order of the addresses 0x00 to 0x1F so that lower 4 bits of the waveform data are added to or subtracted from selected 4 bits of the fine frequency adjusting register (R2). At this moment, when the upper bit of the 5 bit waveform data is 1, addition is performed, and when the upper bit is 0, subtraction is performed. Here, when lower 2 bits "LF OTL" of the low frequency oscillator (LFO) control register (R9) is 01, addition or subtraction is performed as shown in [Figure 10A], and when the "LF CTL" is 10 and 11 respectively, addition or subtraction is correspondingly performed as shown in [Figures 10B and 10C]. In this case, modulation degree is larger in [Figure 10B] than in [Figure 10A], and larger in [Figure 10C] than in [Figure 10B]. In this manner, when waveform data of the waveform register (R6) in the channel 2 are added to a content of the fine frequency adjusting register (R2) in the channel 1, output sound of the channel 1 is frequency-modulated by the result of the addition or subtraction and a content of the rough frequency adjusting register (R3) thereby producing output sound of effects sound-vibrato in the channel 1. [OPERATION 4] A mixing mode is set when 10 are set into upper 2 bits "ch ON" and DDA of the channel ON/sound volume register (R4) in each of the channel 1 to 6 where the waveform register (R6) is addressed with a frequency decided by the frequency adjusting registers (R2 and R3) so that output sound is generated in each of the waveform generators 11 to 16 of the channels 1 to 6. The output sound is converted from digital signal to analog signal and adjusted to be a predetermined sound volume decided by lower 5 bits AL of the channel ON/sound volume register (R4) in each of the attenuators (71 to 76). The output sound of the predetermined sound volume is than divided to be supplied to each left and right pair of the attenuators 10a1 and 10b1 to 10a6 and 10b6 in which the output sound is adjusted to be predetermined levels in accordance with contents of upper 4 bits LAL and lower 4 bits " RAL" of the left and right sound volume register (R5). Therefore, left output sounds of the attenuators 10a1 to 10a6 and right output sounds of the attenuators 10b1 to 10b6 are separately mixed with each other to be supplied to the left and right main attenuators 11a and 11b in which the whole left and right sounds are adjusted in regard to sound volume to be supplied through the buffer amplifiers 12a and 12b to the output terminals LOUT and ROUT. As a result, the left and right sound outputs of predetermined sound volumes are obtained at the output terminals LOUT and ROUT. The attenuation amounts of the left and right main attenuators (11a and 11b) are decided by the upper 4 bits LMAL and the lower 4 bits RMAL of the main sound volume register (R1). Accordingly, when it is assumed that the maximum sound volume is 0xF , far and near sounds are generated in accordance with contents of the LMAL and RMAL. [OPERATION 5] Upper 2 bits "ch ON" and DDA of the channel ON/sound volume register (R4) are set as 10 in a corresponding channel so that a mixing mode is set to address the waveform register (R6) with a frequency decided by the fine and rough frequency adjusting registers (R2 and R3). As shown in [Figure 5], waveform data are stored at the addresses 0x00 to 0x1F of the waveform register (R6) so that waveform data are developed in an order of addresses at each time when a counted value of the address counter for counting address frequency is increased by one thereby producing waveform in a corresponding one of the waveform generators 61 to 66. In the corresponding channel, output sound is generated by repeating the addressing of the waveform register (R6) in a period of a waveform thus produced. Waveform of each channel is converted from digital signal to analog signal and adjusted to be a predetermined sound volume in each of the attenuators 71 to 76, and divided to be supplied to each pair of the left and right attenuators 10a1 and 10b1 to 10a6 and 10b6 in which left and right sounds are separately adjusted to be predetermined sound volumes. The left sounds of the channels are mixed to be supplied to the left main attenuator 11a, and the right sounds of the channels are mixed to be supplied to the right main attenuator 11b. The left and right sounds thus mixed are adjusted therein to be predetermined sound volumes and supplied through the buffer amplifiers 12a and 12b to the output terminals LOUT and ROUT. The sound volume adjustment of the respective attenuators is performed in accordance with contents of the main sound volume adjusting register (R1), the channel ON/sound volume register (R4), and the left and right sound volume register (R5). As described before, output sound volume is changed by 3 dB when contents of the register (R1 and R5) are changed by one, and the former is changed by 1.5 dB when the latter is changed by one. Here, it is assumed that contents of the registers are as follows: (a) main sound volume adjusting register (R1) LMAL is 0xC RMAL is 0x8 (b) channel ON/sound volume register (R4) upper 4 bits of AL are 0xE sound volume is controlled in accordance with lower 1 bit of AL by 1.5 dB. (c) left and right sound volume register (R5) LAL is 0xF RAL is 0x8 In accordance with the above assumptions, an attenuation value of the left output value will be calculated as follows because the maximum sound value is 0xF. (0xF - 0xC) + (0xF - 0xE) + (0xF - 0xF) = 0x4 4 × 3 dB = 12 dB Accordingly, a level down of 12 dB is resulted. On the other hand, an attenuation value of the right output value will be calculated as follows: (F-8)+(F-E)+(F-8)=15 15×3 dB=45 dB Accordingly, a level down of 45 dB is resulted. Here, if it is assumed that a dynamic range is 45 dB in a circuit, no output sound is obtained at the right output terminal ROUT. Further, the main sound volume adjusting register (R1) can be used for fade in and fade out of a whole sound and for a left to right shift of the whole sound, while the channel ON/sound volume register (R4) can be used for an output level adjustment of a channel sound, and the left and right sound volume register (R5) can be used for a left and right distribution of a channel sound and for an output level adjustment of the channel sound. [OPERATION 6] The channel selecting register (R0) is addressed in accordance with an address signal 0 (A0 to A3) on the address bus (14) so that data for selecting one of the channels 1 to 6 are set into lower 3 bits thereof. If the data are 0, the channel 1 is selected. Next, the left and right sound volume register (R5) is addressed by address data (5) (A0 to A3) so that sound volume adjusting data are set into upper and lower 4 bits LAL and RAL respectively. Thus, sound volume adjusting levels are set into the left and right attenuators 10a1 and 10b1 to 10a6 and 10b6 of the channel 1 to 6. When upper 2 bits "ch ON" and DDA of the channel ON/sound volume register (R4) are set to be 10 in each channel, a mixing mode is set to address the waveform register (R6) with an address frequency decided by the frequency registers (R2 and R3). In accordance with the addressing of the waveform register (R6), waveform data are developed in the waveform generators 61 to 66 to produce output sounds which are converted from digital signals to analog signals and adjusted to be predetermined sound volumes in the attenuators 71 to 76. The output sounds of the attenuators 71 to 76 are divided to be supplied to the left and right attenuators 10a1 and 10b1 to 10a6 to 10b6 in which predetermined attenuation amounts decided by the left and right sound volume register (R5) are given to output sounds of the channels. Thereafter, output sounds are supplied through the output terminals LOUT and ROUT to a following stage in the same manner as described before, although repeated explanations are omitted here. |
Patent for High/Low Speed Modes
United States Patent Number: 5483659APPARATUS FOR CONTROLLING A SIGNAL PROCESSING SYSTEM TO OPERATE IN HIGH AND LOW SPEED MODES
In [Figure 1], there is shown an apparatus for displaying a color image to which an apparatus for controlling a signal processing system (CPU) (1) according to the invention is applied. In the apparatus for displaying a color image, a CPU (1) performs a predetermined control in accordance with a program stored in ROM (5) so that data, arithmetical results etc. are stored into a RAM (6) temporarily. A Video Display Controller (2) is provided therein to supply a Video Color Encoder (3) with video data of a story, for instance, for a so-called television game read from a video RAM (VRAM) 7 in accordance with a control of the CPU (1) which deciphers a program for the television game stored in the ROM (5). The Video Color Encoder (3) to which the video data are supplied produces RGB analog signals obtained in accordance with color data stored therein, or produces video color signal including a luminance signal and color difference signals obtained in accordance with the color data. Further, a programable sound generator 4 is provided therein to produce analog sound signals as left and right stereo sounds in accordance with a content of the ROM (5) which is supplied through the CPU (1) thereto. The video color signal produced in the Video Color Encoder (3) is supplied through an interface 8 to a receiving circuit of a video display (9) as a composite signal, and the RGB analog signal is supplied through an interface 10 directly to a video display (9) which functions as an exclusive use monitor means. On the other hand, the left and right analog sound signals are supplied through amplifiers 11a and 11b to speakers 12a and 12b to produce sounds. |
|
[Figure 2] shows the CPU (1) and the programable sound generator 4 as encircled by a dotted line in [Figure 1]. The CPU (1) in which an apparatus for controlling a signal processing system in the embodiment is included and comprises an instruction register (20), an instruction decoder (21), a bus interface register (22), an Arithmetic Logic Unit (ALU) (23), a set of registers (24), a Mapping Register (25), a chip enable decoder (26), a timing and control unit (27), an input and output port (28), a Timer (29), an interrupt request register (30), an interrupt disable register (31), and so on. These units will be explained as follows. (1) Instruction Register 20 The register 20 is loaded with an instruction code at an instruction fetch cycle. (2) Instruction Decoder 21 The decoder 21 performs a sequential operation determined in accordance with an output of the instruction register (20), an interrupt input from a peripheral circuit or a reset input, and further performs a control of a brunch command changing a flow of a program in accordance with informations of a status register described later. (3) Bus Interface Register 22 The register 22 controls a transfer of data among a B-bus (32), a U-bus (33) and an external bus D0 to D7. The ALU (23) and the set of registers (24) are connected by the B-bus (22) and the U-bus (33), and is connected to internal peripheral circuits. Further, a L-bus (34) for transferring lower 8 bits of a logical address and a H-bus (35) for transferring upper 8 bits of the logical address are provided. A logical address low register (48) is connected to the L-bus (34), and a logical address high register (49) is connected to the H-bus (35). (4) ALU (23) The ALU (23) is provided with an A register (36) and a B register (37), and performs all of arithmetic and logical operation. The A and B registers 36 and 37 are loaded with one or two data so that an arithmetic operation is performed in accordance with a control signal of the instruction decoder (21) to supply one of the B, L and H-buses 32, 34 and 35 with a result of the arithmetic operation. (5) Set of Registers 24 The set of registers (24) comprises following 10 registers each being of 8 bits. (a) Accumulator (38) The Accumulator (38) is a wide use register which plays the most important role in an arithmetic and logical operation to be conducted when a memory arithmetic flag T of a status register described later is 0. Data thereof is supplied to an input of the ALU (23), and a result of the arithmetic is stored therein. The Accumulator (38) is also used for a transfer of data between memories and between a memory and a peripheral circuit, and for a count of a data block length when a block transfer of data is performed. A lower data of the length are stored therein after data stored therein at the very moment are evacuated into a stack region of the RAM (6). (b) X and Y registers 39 and 40 The registers 39 and 40 are wide use registers which are mainly used for an index addressing. The X register (39) is used for a designation of an address on page 0 of a memory which is a destination of an arithmetic operation, and for a storage of lower data of a source address after data stored therein at the very moment are evacuated into a stack region of the RAM (6) when a block transfer of data is performed. On the other hand, the Y register (40) stores lower data of a destination address after data stored therein at the very moment are evacuated into a stack region of the RAM (6) when a block transfer of data is performed. (c) program counters 41 and 42 An up counter of 16 bits is composed of the Program Counter (41) of upper 8 bits and the Program Counter (42) of lower 8 bits. The up counter is automatically incremented in accordance with the conduct of a command to designate an address of a command or operand to be next conducted. Contents of the counters 41 and 42 are evacuated into a stack region of the RAM (6) in a case where a command of sub-routine is conducted, and an interrupt is produced, or after an interruption command of a software is conducted. (d) Stack Pointer (43) The Stack Pointer (43) designates lower 8 bits of the highest address on a stack region of the RAM (6), and is decremented after the pushing of data into the stack region and incremented before the pulling of the data from the stack region. For instance, two hundreds fifty-six (256) bytes of addresses 2100 to 21FF are allocated to the stack region in a logical address. (e) source high register (45), destination high register (46), and length high register (47) These registers function in case of a command of a block transfer. The source high register (45) provides an upper byte of a source address to designate the source address together with a content of the X register (39). The destination high register (46) provides an upper byte of a destination address to designate the destination address together with a content of the Y register (40). The length high register (47) provides upper 8 bits for a down counter together with a content of the Accumulator (38) so that a length of a block transfer is counted by a byte unit. (6) Mapping Register 25 The Mapping Register (25) is composed of 8 registers each being of 8 bits to convert a logical address of 16 bits to a physical address of 21 bits, and is selected by upper 3 bits of the H-bus (35). (7) Chip Enable Decoder 26 The chip enable decoder (26) provides chip enable outputs for following peripheral circuits by decoding upper 11 bits of a physical address. (a) a chip enable for the RAM (6) . . . CER (b) a chip enable for the Video Display Controller (2) . . . CE7 (c) a chip enable for the Video Color Encoder (3) . . . CEK (d) a chip enable for the programable sound generator 4 . . . CEP (e) a chip enable for the Timer (29) . . . CET (f) a chip enable for the input and output port . . . CEIO (g) a chip enable for the interrupt request register (30) and the interrupt disable register (31) . . . CECG (8) Timing and Control Unit 27 The unit 27 is connected to following terminals. (a) RD terminal A read timing signal is supplied through the RD terminal at a reading cycle. (b) WR terminal A write timing signal is supplied through the WR terminal at a writing cycle. (c) SYNC terminal A synchronous signal of High is supplied through the SYNC terminal at an instruction fetch cycle, that of Low is supplied therethrough at a system reset timing. (d) NMI terminal A non-maskable interrupt is produced when NMI input signal is supplied through the NMI terminal. A sub-routine call is conducted by reading lower address from the logic address FFFC and upper address from the logical address FFFD when a command which is conducted in a program is completed. (e) IRQ1 and IRQ2 terminals A sub-routine call is conducted by reading lower address from the logical 1 address FFF8 and upper address from the logical address FFF9 when IRQ1 input becomes Low in a case where a corresponding bit in the interrupt disable register (31) is 0, and a corresponding bit in the Status Register (44) is 0. At this time, the corresponding bit is set in the Status Register (44), and other corresponding bits are reset therein. A sub-routine call is conducted by reading lower address from the logical address FFF6 and upper address from the logical address FFF7 when IRQ2 input becomes Low in a case where a corresponding bit in the interrupt disable register (31) is 0, and a corresponding bit in the Status Register (44) is 0. At this time, the corresponding bit is set in the Status Register (44), and other corresponding bits are reset therein. (f) REST terminal A program is started by reading lower address from the physical address 001FFE and upper address from the physical address 001FFF when a RESET input becomes Low. (g) RDY terminal The CPU1 is started to operate when a RDY input is changed from Low to High. (h) SX terminal A complementary signal of a system clock signal is supplied through the SX terminal. (i) OSCI terminal An external clock signal is input through the OSCI terminal. (j) EA1 to EA3 terminals These are input terminals for a test of the CPU1. (k) HSM terminal A speed signal of High is supplied through the HSM terminal in case of a high speed mode of 21.477270 MHz/3, and that of Low is supplied therethrough in case of a low speed mode of 21.477270 MHz/12. (9) Input and Output Port 28 The input and output port (28) is connected to following terminals. (a) K0 to K7 terminals The terminals are input ports from which data are written in accordance with the conduct of a reading cycle in regard to the physical addresses 1FF000 to 1FF3FF. (b) (00) to 07 terminals The terminals are output ports with latches to which data are supplied in accordance with the conduct of a writing cycle in regard to the physical addresses 1FF000 to 1FF3FF. (10) Timer 29 The Timer (29) is connected to a test input terminal EAT for the CPU1 and provides a timer signal through the U-bus thereto. (11) Interrupt Request Register 30 The register 30 is of 8 bits among which 5 bits are not used, while the remaining 2 bits are 1 to show the IRQ1 and IRQ2terminals Low and the remaining 1 bit is 1 to show a timer interrupt caused. The register 30 is only used for read. (12) Interrupt Disable Register 31 The register 31 is of 8 bits among which 5 bits are not used, while the remaining 2 bits are 0 to make an interrupt request of the IRQ1 and IRQ2 terminals disable, and the remaining one is 0 to make an interrupt request disable in accordance with the timer interrupt signal. Next, operation of an apparatus for controlling a signal processing system to operate in high and low speed modes in the embodiment will be explained. (1) High Speed Mode (HSM) When external clock signals of 21.477270 MHz is supplied through the terminal OSCI to the timing and control unit (27) as shown in [Figure 2], the CPU (1) interprets a program stored in ROM (5) thereby determining a high speed mode to be selected so that a command of CSH (Change Speed High) is conducted to set a high speed mode. In the high speed mode, system clock signals S1, S2, and S3 (7.15909 MHz) as shown in [Figure 3] are produced by dividing the external clock signals of 21.477270 MHz by one-third. Simultaneously, a high speed mode signal 1 is supplied through the terminal HSM to a peripheral circuit. As a result, the Video Display Controller (2), the Video Color Encoder (3), the programmable sound generator 4 and so on which are connected to the CPU (1) are controlled to operate in the high speed mode. The system clock signals S1, S2, and S3 are supplied as complementary signals through the terminal SX to a periphery circuit wherein one bus cycle is defined as a period from a rising edge of the system clock signal S1, to a next rising edge thereof. The one bus cycle is a basic bus cycle by which a command conduct cycle is defined in each of commands. (2) Low Speed Mode (LSM) External clock signals of 21.477270 MHz which are supplied through the terminal OSCI in accordance with a command CSL (Change Speed Low) are divided by one-twelfth. As a result, system clock signals (1.7897725 MHz) are produced as shown in [Figure 4], and supplied as complementary signals through the terminal SX to a peripheral circuit. Simultaneously, a low speed mode signal 0 is supplied through the terminal HSM to peripheral circuit. (3) Change Over Between Two Modes |
|
[Figure 5] shows a change over between high and low speed modes. Here, it is assumed that a command CSH by which a processing speed of the CPU (1) is set as a high speed mode, a non-operation command NOP, and a command CSL by which a processing speed of the CPU (1) is set as a low speed mode are produced at timings shown therein. A starting time at which the command CSH is produced is in a low speed mode during which system clock signals S1, S2 and S3 are of 1.7897725 MHz in accordance with one-twelfth frequency division and supplied as complementary signals through the terminal SX. At this time, a mode signal HSM is 0. After one bus cycle is then elapsed, a high speed mode is realized in accordance with the command CSH so that system clock signals are of 7.15909 MHz in accordance with one-third frequency division. At this time, a mode signal HSM is 1. Next, when a command CSL is produced, a low speed mode is then realized after one cycle bus thereof. During operations, a program is counted by a Program Counter (PC). Although the invention has been described with respect to specific embodiment for complete and clear disclosure, the appended claims are not to thus limited but are to be construed as embodying all modification and alternative constructions that may occur to one skilled in the art which fairly fall within the basic teaching herein set forth. |