Interface 1 - Noisy Serial Communications

For experts to discuss very technical stuff and newbies to ask why the Spectrum they bought off ebay doesn't work.
Post Reply
User avatar
jpnz
Berk
Posts: 6
Joined: Tue Nov 14, 2017 4:07 pm

Interface 1 - Noisy Serial Communications

Post by jpnz » Thu Apr 19, 2018 6:54 am

Normally the Interface 1 is silent when performing serial port communications.

Today I learnt that you can make a serial port transfer "noisy" by poking the system variable IOBORD (0x5cc6) [border colour during I/O] with a value outside of the usual 0-7 range.

Here's a quiet transfer at 9600 bps followed by a noisy one:




Let's do that again at 19200 bps:



You learn something new every day!
2 x

User avatar
Ast A. Moore
Manic Miner
Posts: 598
Joined: Mon Nov 13, 2017 3:16 pm

Re: Interface 1 - Noisy Serial Communications

Post by Ast A. Moore » Thu Apr 19, 2018 7:55 am

Yup. That’s because input/output routines simply take the entire byte and write it to port $FE.

Code: Select all

	LD A,($5CC6)
	OUT ($FE),A
Since this port is shared between the border and the beeper, if you also change Bit 4, it’ll toggle the speaker, and you’ll get your “noise.”

It’s part of the standard tape loading/saving routine. ;)
1 x
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.

User avatar
jpnz
Berk
Posts: 6
Joined: Tue Nov 14, 2017 4:07 pm

Re: Interface 1 - Noisy Serial Communications

Post by jpnz » Thu Apr 19, 2018 9:46 am

Ast A. Moore wrote:
Thu Apr 19, 2018 7:55 am
Yup. That’s because input/output routines simply take the entire byte and write it to port $FE.

Code: Select all

	LD A,($5CC6)
	OUT ($FE),A
Since this port is shared between the border and the beeper, if you also change Bit 4, it’ll toggle the speaker, and you’ll get your “noise.”

It’s part of the standard tape loading/saving routine. ;)
Thanks for the explanation - that's great!

Would the same thing happen with the network channel?
0 x

User avatar
Ast A. Moore
Manic Miner
Posts: 598
Joined: Mon Nov 13, 2017 3:16 pm

Re: Interface 1 - Noisy Serial Communications

Post by Ast A. Moore » Thu Apr 19, 2018 10:46 am

jpnz wrote:
Thu Apr 19, 2018 9:46 am
Would the same thing happen with the network channel?
Not a hundred percent sure, but there’s at least one instance where the border is being changed in the Get Packet from Network routine.
0 x
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.

Post Reply