RNG

ZXNet echo conference «code.zx»

From Wladimir Bulchukey To Arseniy Astapenko 23 July 1999

Hello Arseniy! 22 Jul 99 08:57, Arseniy Astapenko -> All: AA> Tell me a couple of good subjects in ASMA AA> in an arbitrary range 0..X (X<=255 - set). AA> Only without R and tables. Now, I remember, it’s called... ;) Valuable ;) source - my first and _last_ participation in an event related to what is now called a stage... And one more noteworthy moment: my first and last participation in a creative group... === Cut === ; Title of the work: "If there was a sea of beer..." ; Nomination: 512 bytes intro ; File name: demo6.com ; Release date: 07/15/1996. ; --- ; Author: Wladimir Bulchukey. ; Phone: 462-8902. ; E-mail: zxnet@deol.ru Subject: 095/403.4 ; --- ; Group: ; MSX-2 Corp. Hard & Soft. Dmitry Managarov, Alexey Lvov, Vladimir Bulchkey. ; 431-40-18 375-81-17 462-89-02 ; 305-88-02 ; --- ; Effect: dynamic pseudo-random symmetric block graphics. ; Also contains shooting at a beer mug (for fun). ; It was done and debugged (from the word "crap") on the "DAEWOO CPC-400S"!!! ; Not tested on Yamaha!!! Please don't kick! ; --- .z80 Aseg Org 0100h ;---------------- MaxX equ 240; mug movement limits MaxY equ 176 ;--------------; Macro definition of a BIOS call with separate entry of address bytes into IX: LBIOS Macro addr db 0DDh ld l,low addr; in AS.COM you can write "ld lx,low addr" call bioslx EndM ;--------------- ; Start of the program: ldhl,0F3E0h; copy of register 1 VDP set 1,(hl); set the bits for the sprites to be larger res 0,(hl) ; ld a,4 lbios 005Fh; screen 4 ;- ld bc,3FFEh xor a ld l,a ld h,a lbios 0056h; fill the video memory with 0s. This simultaneously sets 0 ; in the PNT table. ;- lbios 0069h; initializing sprites to zero (and full) ;- MainLp: ; Initialization of mug (0) and sight (4) sprites: IniSpr: ld d,38h or 40h; sprite template generator table ld hl,sprptg call grsell inc hl ld d,1Ch or 40h; sprite color chart call grsell ;------------------------------ ld b,7; background breathing period in ticks Interv: ei halt; stand; I will shoot (even if the address 0038h is RET) push bc ; Flight of the mug with bounces (flight of the author with bounces?): ld hl,yspr ld de,(yxflag) ld a,(hl) add a,e; Y increment by 1 or -1 (#FF) jr nz,move1 ld e,1; set increment 1 move1: cp max jr c,move2 ld e,0FFh; set increment -1 move2: ld (hl),a inc hl ld a,(hl) add a,d; X+dX jr nz,move3 ld d,1 move3: cp maxx jr c,move4 ld d,0FFh move4: ld (hl),a ld(yxflag),de; save new dY,dX ; Shooting: xor a lbios 00D5h; cursor poll ld e,a ld hl,ykrestld a,(hl) dec e; 1 call z,k_up dec e; 2 dec e; 3 call z,k_rt dec e; 4 dec e; 5 call z,k_dw dec e; 6 dec e; 7 call z,k_lt xor a lbios 00D8h; poll space or a call nz,fire call putspr pop bc djnz interv ;----------------------- ; Pseudo-random number generator: RND: ld hl,(seed) ld a,h or l jr nz,rnd1 inc l rnd1: ld a,l rlca xor h rlca rlca xor h rlca xor h rlca adc hl,hl ld (seed),hl ;------------------------- ; Byte alignment: ld b,4 ld a,l ld de,data0; DE will come in handy for mirroring! ld l,e; this is ld l,0 Pix1: rlca rr l djnz pix1 and 0Fh or l; A=pixel ;--------------------- ; Unmirroring image bytes: ; (here the fact of hard data0 binding is used everywhere ; to absolute address 0300h) ld hl,data0+1 ld c,d ld b,e; do this "ld bc,0003h" push bc ldir ld(hl),a ld(de),a pop bc add hl,bc; so we add 3 ld de,data1+2 ex de,hl lddr ;- ; Transferring the current image of the ornament symbol and its colors to the video memory: ld d,0 or 40h; 0000h template generator base call ldirv3 ld d,20h or 40h; 2000h color chart base call ldirv3 ;- ; The final element of the main loop: Break: lbios 00B7h; poll CTRL+STOP jp nc,mainlp; if not pressed, then to the main loop ;-------------------------------------------------------- ; Exit from demo: Exit: lbios 00D2h; transfer to previous text moderst 0; exit to DOS ;------------------------------ ; CALL procedures of the demo: ; Ornament data forwarder (Data0 array) in three thirds of the screen: ; Input: DE = video memory address: E=0 (LSB), D=MSB or 40h LdirV3: ld b,3 lv3loo: push bc push de ld hl,data0 ld b,8 call ldirvm pop de ld a,d add a,08h ld d,a pop bc djnz lv3loo ret ;- ; Ceremonial laying of the sprite: PutSpr: ld d,1Eh or 40h; ld hl,yxspr ld b,8 ;---------- ; Transferring a block to video memory: ; Input: HL = RAM address ; DE = video RAM address, D=MSB or 40h, E=0 (LSB) ; B = block length: LdirVM: call vdpwri lvmloo: ld a,(hl) out (98h),a inc hl djnz lvmloo ret VDPWri:xor a vdpwr1: out (99h),a ld a,d out (99h),a ret ;- ; The procedure for sending a compressed sprite data block to video memory: ; Input: HL = block address in RAM; ; DE = destination address in video memory: GrSell: call vdpwri grsel1: ld a,(hl) cp0AAh; #AA - end of block marker ret z cp 55h; #55 - repetition number prefix jr z,groupb out (98h),a grsel2: inc hl jr grsel1 groupb: inc hl ld b,(hl) inc hl group1: ld a,(hl) out (98h),a djnz group1 jr grsel2 ;- YXFlag: dw 0101h ;- YXSpr: YKrest: db 90 XKrest: db 120 db 0 db 0 YSpr: db 80 XSpr: db 80 db 4; sprite number in SAT db 15 ;------------------------ BIOSLX: db 0DDh ld h,0; ld hx,0 BIOSIX: ld iy,(0FCC0h) jp 001Ch ;------------------------ ; Poll of cursor keys:K_LT: inc hl ld a,(hl) K_UP: kk1: or a ret z dec (hl) dec (hl) ret K_DW: cp maxy+8 kk2: ret nc inc(hl) inc(hl) ret K_RT: inc hl ld a,(hl) cp maxx+8 jr kk2 ;----------------------- ; Shot processing: Fire: ld a,(0F3EBh); border color push af cpl; flash in reverse color out (99h),a ld a,87h out (99h),a lbios 00C0h; beep signal pop af out(99h),a; restore normal border ld a,87h out (99h),a ld hl,ykrest ld a,(yspr) sub (hl) jr nc,fire1 neg fire1: cp 7 jr nc,mimo inc hl ld a,(xspr) sub (hl) jr nc,fire2 neg fire2: cp 7 jr nc,mimo ; perforating the mug: ld a,(seed) and 00011111b ld e,a ld d,0 ld hl,image0 add hl,de ld a,(seed+1) and (hl) cp 55h; check for random matches with markers jr nz,fire3 inc a fire3: cp 0AAh jr nz,fire4 inc a fire4: ld (hl),a ret ; perforating the background: Mimo: ld a,(ykrest) add a,7 and 11111000b ld l,a ld h,0 ld d,18h or 40h add hl,hl add hl,hl ld a,(xkrest) add a,7 and 11111000b rrca rrca rrca ld e,a add hl,de; calculated the video memory address of the aiming point ex de,hl ld a,e call vdpwr1 ld a,1; instead of zer they wrote down count out (98h),a ret ;------------------------ ; Data blocks: ; Sprite "KPECT": SprPtg: ;0: db 55h,6 db 00000001b db 00000000b db 11111100b ;1: db 11111100b db 00000000b db 55h,6 db 00000001b ;2: db 55h,6db 10000000b db 00000000b db 00111111b ;3: db 00111111b db 00000000b db 55h,6 db 10000000b ; Sprite "Beer mug": Image0: db 00001100b db 00111111b db 01111111b db 01111111b db 11111111b db 11111111b db 11111111b db 11111111b ;1: db 11111111b db 11111111b db 11111111b db 11111111b db 11111111b db 01111111b db 01111111b db 00111111b ;2: db 11000000b db 11100000b db 11100000b db 11110000b db 11110000b db 11110000b db 11110000b db 11111110b ;3: db 11110010b db 11110010b db 11110010b db 11110100b db 11111000b db 11100000b db 11000000b db 10000000b ;- db 0AAh; end of sprite image ; Colors (compressed block) of sprites: ; sight colors: SprClL: db 55h,16 db 8 ; mug colors: db 55h,4 db 00001111b db 55h,12 db 00001011b db 0AAh; end of sprite color block ;- ; External areas: Data0 equ 0300h; ornament buffer Data1 equ data0+4 Seed equ data1+16; current RND ;- End ; Dimka, without you this would not have happened! ABOUT!! (c) SOLiDSOFT (Egor Voznesensky) Results of the 1st International 512 bytes MSX INTRO COMPETITION. Intros in the order of Appearance: NAME | SOLiD BoSS WolF KiRshe | RESULT 509 | 5 3 8 6 | 24 COLINES | 8 7 7 8 | 30 IWORLD | 8 6 7 8 | 29 NEW | 4 4 6 7 | 21 SHADERS | 6 7 8 9 | 30 FIRE | 8 9 8 8 | 33 512! | 10 10 10 9 | 39TRUNKS | 6 4 6 7 | 23 NOP-SCRL | 3 5 5 3 | 16 NOP-STRW | 8 8 9 8 | 33 NOP-ZOOM | 8 7 8 8 | 31 DEMO6 | 4 6 8 6 | 24 <--- вот эта pабота PROBA4 | 5 8 7 7 | 27 512DEMO | 1 3 4 2 | 10 | | First 3 places are: (I) "512!" by Techno Crew -- 39 points (II) "FIRE" by SOLID and "NOP-STRW" by N.O.P. -- 33 points (III) "NOP-ZOOM" by N.O.P. -- 31 points Greetings to Techno Crew! HDD controller goes to you! Greetings in random order from SOLiD, WolF, BoSS, and KiRshe Hey! Here goes some interestin' note: anybody can get the Compo Report from ETERNAL on 2DD disk for just $7. Call us now: +7-(095)-196-5691 2:5020/664.15@fidonet.org kirshe@redline.ru Signed, KiRshe, WolF, BoSS, SOLiD. at 21/07/96 === Cut === Эх, были вpемена! :) С yважением, Wladimi

From Oleg Grigoriev To Arseniy Astapenko 29 July 1999

Let your enemies, Arseniy, die without sons! Thu 22 Jul 1999 at 08:57, Arseniy Astapenko ═> All: AA> Tell me a couple of good subjects in ASMA AA> in an arbitrary range 0..X (X<=255 - set). AA> Only without R and tables. Precisely random? Or are pseudo-random ones sufficient? In zx review'96/4-5 there was not a bad article. I usually use this: rnd ld hl #0000 ld a h add a #77 ld h a rlc l add a l ld l a ld(rnd+#01)hl ret By the way, unlike many generators, this one can be used without fear mask digits on and xx. [WBR, Oleg. ] [ 19:52 29 July XXXIV A.S. ]

From Wladimir Bulchukey To Arseniy Astapenko 7 August 1999

Hello Arseniy! 29 Jul 99 09:51, Arseniy Astapenko -> Wladimir Bulchukey: AA> :) Why did you leave us? :) Yes, here I am, here... :) AA> Thx for the subject. You should code us on the spectrum ;) I have a lot of work on the Spectrum. But they are either outdated or they wrote it “for themselves”. Well, what was more or less big lately? CDOS upgraded to version 1.15; died safely after the advent of EMS. Little things: print driver for ZX-Word for any unsophisticated printer (the ugly font was made by another person). It’s even hard to remember the little things! And of the big ones, probably only the guys from FFC remember, exes even before Alex Letaev - Ruslan Gareev and Evgeniy Balaev, and spectromists from the Kalita Center company... What happened then? Database management system BM-DATA (1991; BMD-DATA - recorded in 1993); automatic duplication system WB-AUTO cassettes (1993); assembler GENS-128 with electronic disk, those who do not consume main memory (1992); a couple of bottles for game discs (1993)... God knows... Well, and finally, the most cumbersome and labor-intensive creation - the game "Adventure in the subway", written in 1989 on homemade 48K machine without a disk drive, with a TV "Temp 6M" as a monitor... Many children at school say which is generally not bad... ;-) There are “Fans” to go through the labyrinth of 256 dungeons,4 trains, 3 overground and 1 underground passages, 8 streets and many old women and crying boys, whom you can bestow with goodness, and they will not forget it... The legend of this game is quite long, and on the eve of its 10th anniversary her creations, I even have the idea of meeting her heroes and talk about how they lived these years... AA> By the way, MSX also has AY, maybe there is AA> representation AA> about music player for AY? If we are talking about technical access to AY, then at least now. True, there will be some complexity with pseudographic symbols, since in MSX they are represented by two codes, therefore the conversion result is not better... But nevertheless: === Cut === MSX-MUSIC Specification. ---------------------- < retelling from Japanese by E. Voznesensky (095) 1414069 > MSX-MUSIC - a new standard for sound generator on MSX2+. This is a fairly powerful FM synthesizer with 9 voices and two-operator synthesis. The quality of the music is quite professional, but real instruments are imitated somewhat harsh, especially Piano. As already mentioned, MSX-MUSIC has 9 voices, and The synthesizer can operate in one of two modes: - Melodic (voices 0..8 synthesize the music) - Rhythm (0..5 melody, 6,7,8 - drum kit)In melodic mode, each voice can work either in one of 15 standard algorithms (maintenance), or in programmable algorithm, one for all voices of the melody (for polyphonic solo and special effects). MSX-MUSIC registers. MSX-MUSIC uses the same ports as MSX-AUDIO, i.e. 0C0h (data) and 0C1h (register address). In addition, there is a special BIOS. The synthesis is carried out by the YM2413 chip (Yamaha). #0: 76543210 (parameters for the modulator) *......AM amplitude modulation .*...... VIB - vibrato ..0.....string instrument ..1..... wind instrument ...*.... KSR - Key Strike Rate ???? ....0000 MULTI - divide the note frequency by 2 ....**** MULTI - multiply the note frequency by 1..15, #1: the same (parameters for the mixer) #2: 76543210 **...... KSL KeyStrikeLevel (?) 0..3 for modulator ..****** VOL overall volume MAX=0, MIN=63 #3: 76543210 **...... KSL for mixer ..*..... DM distortion effect in modulator 1==ON ...*.... DC same for mixer ....0... not defined .....*** Feedback level in the modulator 0..7 #4: 76543210 (for modulator) ****.... AR - attack time 0..15....**** DR - decline time #5: the same (parameters for the mixer) #6: 76543210 (for modulator) ****.... SL - sustain level 0..15 ....**** RR - decay time 0..15 #7: the same (parameters for the mixer) #E: 76543210 (rhythm block control) 00...... not significant ..0.....melody mode 9 ..1.....rhythm mode 6+3 ...*.... Large drum @Y ....*... Snare drum .....*.. Tom-tom 1=Strike. ......*. Upper plate .......* Hi-Hat (cymbal with pedal)@[ Registers #10..#18 76543210 ******** - FNumber (division factor) bits 0..7 for votes 0..8 Registers #20..#28 76543210 00...... Not described ..1..... Sustain pedal pressed ..0..... Pedal released ...*.... Key press 1=pressed ....***. Octave 0..7 .......* Bit division frequency 8 The note is specified as follows: Let Fmus be the frequency of the desired note, then: BLOCK = octave FNumber = (Fmus * 2^18/50000)/(2^(BLOCK-1)) Example play"o4a" (440 Hz) BLOCK=4 FNumber=( 440 * 2^18/50000) / 8 = 288 Registers #30..#3876543210 ****.... INST - instrument 0..15 ....**** VOL - voice volume 0=MAX 15=MIN Tools: 0 - user (defined by registers 0..7) 1 - violin 2 - guitar 3 - piano 4 - flute 5 - clarinet 6 - oboe 7 - trombone 8 - organ 9 - pipe 10 - synthesizer 11 - harp? 12 - vibraphone 13 - SynBass (YAMAHA) 14 - electric piano 1 15 - electric piano 2 Drum section (rhythm mode) #36: 76543210 00...... Not described ..****** relates. bass drum frequency #37: 76543210 0....... Not described .*...... Hi-hat tone ..****** relative snare frequency #38: 76543210 0....... Not described .*......Tom-tom tone ..****** relates. frequency of the upper plate PROGRAMMABLE SOUND GENERATOR To control the three PSG Audio Channels, two eight are used. bit data ports, called interface ports A and B, through which exchange data with the joystick and cassette input. house. The PSG is accessible through three I/O ports called the Address Port, Data Write Port and Data Read Port. Address Port(I/O port A0H)PSG has 16 internal registers, which are fully defined. ut its operations. The selection of a register is carried out by writing down its number (0:15) to Address Port. After selection, repeated access to this register. this can be done through 2 Data Ports. Data Recording Port (i/v port A1H) This port is used to write to any register after how this register was selected using the Address Port. Frequency = 111.861 kHz/period {period 1-4095} REGISTER 1 REGISTER 0 ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ▐ * ▐ * ▐ * ▐ * ▐senior nibble▐ ▐ low byte of period ▐ ▐ ▐ ▐ ▐ ▐voice A period ▐ ▐ for voice A ▐ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 REGISTER 3 REGISTER 2 ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ▐ * ▐ * ▐ * ▐ * ▐senior nibble▐ ▐ low byte of period ▐ ▐ ▐ ▐ ▐ ▐voice B period ▐ ▐ for voice B ▐ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 REGISTER 5 REGISTER 4 ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№▐ * ▐ * ▐ * ▐ * ▐senior nibble▐ ▐ low byte of period ▐ ▐ ▐ ▐ ▐ ▐voice period C▐ ▐ for voice C ▐ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 REGISTER 6 ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ▐ * ▐ * ▐ * ▐ period ▐ ▐ ▐ ▐ ▐ noise ▐ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 REGISTER 7 ═╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟ ▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟№ ▐ Port ▐ Port ▐ C ▐ B ▐ A ▐ C ▐ B ▐ A ▐ ▐ B Dir ▐ A Dir ▐ Noise ▐ Noise ▐ Noise ▐ Tone ▐ Tone ▐ Tone ▐ ▄╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟ ╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 This register allows or does not allow the operation of the Tone and Noise Generators for each of the three channels: 0 - allows, 1 - does not allow. It also controls the direction of interface ports A and B, to which connect the joystick and cassette player: 0 - input, 1 - output. Register 7 always contains 10xxxxxx, otherwise the PSG may be damaged. xia, because active devices (????) are connected to its connectors i.v. The "SOUND" operator in MSX-Basice will set these bits toas above, but there is no protection at the level of machine codes. REGISTER 8 ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟╟╟╟▌ ╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ▐ * ▐ * ▐ * ▐ Mode ▐ amplitude ▐ ▐ ▐ ▐ ▐ ▐ channel A ▐ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╟╟╟╘ ╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 Four Amplitude Bits set the fixed amplitude of Channel A from 0 (minimum) to 15 (maximum). The Mode bit selects the amplitude: 0 - fixed, 1 - modulated. When a modulated amplitude is selected, the amplitude is fixed. The slab is ignored and the channel is modulated according to the Phos Generator. We. REGISTER 9 ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟╟╟╟▌ ╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ▐ * ▐ * ▐ * ▐ Mode ▐ amplitude ▐ ▐ ▐ ▐ ▐ ▐ channel B ▐ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╟╟╟╘ ╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 REGISTER 10 ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟╟╟╟▌ ╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ▐ * ▐ * ▐ * ▐ Mode ▐ amplitude ▐ ▐ ▐ ▐ ▐ ▐ channel C ▐ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╟╟╟╘ ╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 REGISTER 12 REGISTER 11 ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ▐ * ▐ * ▐ * ▐ * ▐senior nibble▐ ▐ low byte of period ▐ ▐ ▐ ▐ ▐ ▐ period of Generator ▐ ▐ Form Generator ▐▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 b7 b6 b5 b4 b3 b2 b1 b0 These two registers control the frequency of the primary (single) Gene. rator Shapes for amplitude modulation. Same as for the Tonal Generator. torus, this frequency is determined by sending the divider to the registers. Delhi. The value can be in the range from 1 to 65535. The main frequency for The Shape Generator is 6991 Hz, i.e. the frequency of the Shape Generator can fluctuate from 6991 to 0.11 Hz. REGISTER 13 No. ▐ * ▐ * ▐ * ▐ * ▐ Form number ▐ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟╟╟╟╟╟╟╟╟╟╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 Four bits of the shape number determine the shape of the amplitude module. tion produced by the Form Generator (Envelope Generator). 3 2 1 0 Signal shape ═╟╟╟▌╟╟╟▌╟╟╟▌╟╟╟№ ▐ 0 ▐ 0 ▐ x ▐ x ▐ ▐__________________________ .╟╟╟█╟╟╟█╟╟╟█╟╟╟▀ ▐ 0 ▐ 1 ▐ x ▐ x ▐ /▐__________________________ .╟╟╟█╟╟╟█╟╟╟█╟╟╟▀ ▐ 1 ▐ 0 ▐ 0 ▐ 0 ▐ ▐▐▐▐▐▐▐▐▐▐▐▐▐▐\n .╟╟╟█╟╟╟█╟╟╟█╟╟╟▀ ▐ 1 ▐ 0 ▐ 0 ▐ 1 ▐ ▐__________________________ .╟╟╟█╟╟╟█╟╟╟█╟╟╟▀ ▐ 1 ▐ 0 ▐ 1 ▐ 0 ▐ ////////////// .╟╟╟█╟╟╟█╟╟╟█╟╟╟▀ __________________________ ▐ 1 ▐ 0 ▐ 1 ▐ 1 ▐ ▐ .╟╟╟█╟╟╟█╟╟╟█╟╟╟▀ ▐ 1 ▐ 1 ▐ 0 ▐ 0 ▐ /▐/▐/▐/▐/▐/▐/▐/▐/▐/▐/▐/▐/▐/▐.╟╟╟█╟╟╟█╟╟╟█╟╟╟▀ ___________________________ ▐ 1 ▐ 1 ▐ 0 ▐ 1 ▐ / .╟╟╟█╟╟╟█╟╟╟█╟╟╟▀ ▐ 1 ▐ 1 ▐ 1 ▐ 0 ▐ //////////////\n .╟╟╟█╟╟╟█╟╟╟█╟╟╟▀ ▐ 1 ▐ 1 ▐ 1 ▐ 1 ▐ /▐__________________________ ▄╟╟╟╘╟╟╟╘╟╟╟╘╟╟╟═ РЕГИСТР 14 ═╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟№ ▐ Cas ▐ Kbd ▐ Joy ▐ Joy ▐ Joy ▐ Joy ▐ Joy ▐ Joy ▐ ▐ Input ▐ mode ▐Trg. B ▐Trg. A ▐ Right ▐ Left ▐ Back ▐ Fwd ▐ ▄╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 Этот pегистp использyется для чтения интеpфейсного поpта А PSG. Шесть битов джойстика опpеделяют четыpе положения pычажка и нажатия двyх кнопок (тpигеppов): 0 - нажато, 1 - не нажато. Вместо джойстика могyт быть пpисоединены шесть игpовых pычажков (games paddle). Большинство MSX-машин имеют два девятиштыpьковых pазьема, пpичем одновpеменно может читаться только один из них. Тот, котоpый должен читаться, выбиpается битом выбоpа джойстика в pегис. тpе R15 PSG. Бит выбоpа клавиатypы обычно не использyется на англий. ских машинах. (On Japenese mashines it is tied to a jumper link to determine the keyboard's character set). Бит Cas Input использyется для чтения сигнала из линейного выхода (EAR output) кассетника (вы.move to bare phones). It goes through a comparator for cleaning from noise and is converted into a digital signal. REGISTER 15 ═╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟ ▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟▌╟╟╟╟╟╟╟№ ▐ Kana ▐ Joy ▐ Pulse ▐ Pulse ▐ 1 ▐ 1 ▐ 1 ▐ 1 ▐ ▐ LED ▐ Sel ▐ 2 ▐ 1 ▐ ▐ ▐ ▐ ▐ ▄╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟ ╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟╘╟╟╟╟╟╟╟═ b7 b6 b5 b4 b3 b2 b1 b0 This register is used for output to interface port B of the PSG. The lower four bits are used as a buffer for pins 6 and 7 each. go joystick connector. Normally these bits are set to 1, but if a joystick or game stick is connected, they can be used for input, and if a graphics tablet is connected, then they are used to enter the coordinates of the touch point. Pulse bits are used if external timers are connected. Bit 6 determines which joystick the input is from. which is done through port A: 0 - joystick 1, 1 - joystick 2. English cars use the Kana LED bit, and Japanese cars use can use it as an indicator of the keyboard mode (????). === Cut === Best regards, Wladimi