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
Manic Miner
Posts: 303
Joined: Tue Nov 14, 2017 4:07 pm
Location: Hamilt[r]on - City Of The Future - NZ

Interface 1 - Noisy Serial Communications

Post by jpnz »

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:

https://youtu.be/8o6uD5054JQ


Let's do that again at 19200 bps:

https://youtu.be/anBHb-hwtP0

You learn something new every day!
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Interface 1 - Noisy Serial Communications

Post by Ast A. Moore »

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. ;)
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
Manic Miner
Posts: 303
Joined: Tue Nov 14, 2017 4:07 pm
Location: Hamilt[r]on - City Of The Future - NZ

Re: Interface 1 - Noisy Serial Communications

Post by jpnz »

Ast A. Moore wrote: Thu Apr 19, 2018 8: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?
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2640
Joined: Mon Nov 13, 2017 3:16 pm

Re: Interface 1 - Noisy Serial Communications

Post by Ast A. Moore »

jpnz wrote: Thu Apr 19, 2018 10: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.
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