Ultimate Amiga

Network Boards => AMOS Language Discussion => AMOS Factory => AMOS Professional Forum => Topic started by: Volvo_0ne on September 27, 2017, 06:18:14 PM

Title: "SPECTRUM" type screenbars?
Post by: Volvo_0ne on September 27, 2017, 06:18:14 PM
Hi, I wondered if there is any way I can make ZX Spectrum type screen bars (The tape loading type ones) in AmosPro?

I've tried swapping different colour screens as fast as I can, then putting in random delays but it doesn't seem to make the effect I'd like.

Anyone got any ideas please?
Title: Re: "SPECTRUM" type screenbars?
Post by: KevG on September 27, 2017, 07:56:45 PM
Hi there. Here are two ways you could do it....

1. Create a rainbow for colour 0 (border colour) with a long list of values then rotate
the rainbow.

2. Create a larger than normal screen in low res so that the amiga sets it to overscan mode. You can then use random thin rectangles to create the effect.

Hope this helps. Kev G
Title: Re: "SPECTRUM" type screenbars?
Post by: adrazar on September 28, 2017, 12:15:33 PM
Code: [Select]
Dim C(1)
C(0)=$F
C(1)=$FF0
Repeat
   Doke $DFF182,C(Rnd(1))
Until Mouse Click or Inkey$<>0

Actually you should Doke to $DFF180 instead, but then I can't guarantee you will see anything in case you use an emulator.
Title: Re: "SPECTRUM" type screenbars?
Post by: Sidewinder on September 28, 2017, 01:00:00 PM
Code: [Select]
Dim C(1)
C(0)=$F
C(1)=$FF0
Repeat
   Doke $DFF182,C(Rnd(1))
Until Mouse Click or Inkey$<>0

A similar color cycling trick can also be done without the poking by using the the AMOS Flash command:

Code: [Select]
Ink 2
Bar 0,10 to 320,20
Flash 2,"(00F,2)(0FF,3)(FFF,1)"
Repeat
Until Mouse Click
Flash Off
Title: Re: "SPECTRUM" type screenbars?
Post by: adrazar on September 28, 2017, 02:27:05 PM
Quote
A similar color cycling trick can also be done without the poking by using the the AMOS Flash command
It can't be possible to break the background into bars if you use the Flash command, so I think rainbows are the only option if my proposed doking doesn't look clean enough.
Title: Re: "SPECTRUM" type screenbars?
Post by: Sidewinder on September 28, 2017, 07:42:31 PM
It can't be possible to break the background into bars if you use the Flash command, so I think rainbows are the only option if my proposed doking doesn't look clean enough.

True.  If the Rainbow command isn't exactly what you need (It only changes one color per scan line), you could try programming the Copper list directly.  See Appendix F of the AMOS Pro manual for more info.
Title: Re: "SPECTRUM" type screenbars?
Post by: Volvo_0ne on October 04, 2017, 08:29:24 PM
Code: [Select]
Dim C(1)
C(0)=$F
C(1)=$FF0
Repeat
   Doke $DFF182,C(Rnd(1))
Until Mouse Click or Inkey$<>0

Actually you should Doke to $DFF180 instead, but then I can't guarantee you will see anything in case you use an emulator.

WOW that is just what I wanted, thanks :)

How does it work tho?
I understand  the BASIC, but not the "DOKE" (or rather what that address actually does)

And is there a list anywhere of useful AMOS POKE/DOKE/LOKE addresses which influence the system similar to the ZX Spectrum's System Variables area?

Thanks for your help.
Title: Re: "SPECTRUM" type screenbars?
Post by: Sidewinder on October 05, 2017, 01:03:17 AM
How does it work tho?
I understand  the BASIC, but not the "DOKE" (or rather what that address actually does)

The DOKE command sets the value of a word (2 contiguous bytes) in the computer's memory.  Some of the locations (addresses) in memory have been reserved for the Amiga's custom chip registers.  Usually, these registers start at address $DFF000 which is known as the register base address.  Base + $180 is the color register for color 0.  So changing this value will change what color is displayed as color 0 on the display.  Changing this while the screen is being drawn causes effects like color cycling, rainbows, or dynamic HAM displays.  Typically these reisters are modified by the COPPER chip using custom copper lists, but the DOKE command will also work if timing doesn't need to be exact.

Quote
And is there a list anywhere of useful AMOS POKE/DOKE/LOKE addresses which influence the system similar to the ZX Spectrum's System Variables area?

See the Amiga Hardware Reference Manual for more details on the registers, and the color registers specifically:

http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0027.html

http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0011.html
Title: Re: "SPECTRUM" type screenbars?
Post by: adrazar on October 05, 2017, 12:57:27 PM
I'll add a few links too :)

Here is a complete list of the avaliable registers: http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0060.html (http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0060.html)

And here is a much easier way to learn what they actually does: http://ada.evergreen.edu/~tc_nik/files/AmigaHardRefManual.pdf (http://ada.evergreen.edu/~tc_nik/files/AmigaHardRefManual.pdf)
Title: Re: "SPECTRUM" type screenbars?
Post by: Volvo_0ne on November 19, 2017, 06:27:00 PM
Thanks guys, much appreciated :)

BTW is there any way to make the border (EG anything which is not screen) black and Keep it that way regardless of colour changes in the screen area?

I know Colour Back should do this, but if (for example) you move a rainbow below the bottom of the screen area, it colours the lower border which looks really pants!
Title: Re: &quot;SPECTRUM&quot; type screenbars?
Post by: SamuraiCrow on November 20, 2017, 05:46:49 AM
Only on AGA.  The only other way to keep the border color black is to apply the Copper rainbow to some other palette entry.
Title: Re: "SPECTRUM" type screenbars?
Post by: Volvo_0ne on January 16, 2018, 06:27:34 PM
Thanks SamuraiCrow

Next question.....

Is there a way to read the Track &/Or Sector number being accessed by a Disk In realtime?

TIA
V1
Title: Re: &quot;SPECTRUM&quot; type screenbars?
Post by: SamuraiCrow on January 16, 2018, 10:48:13 PM
You're welcome but please put your next question in another thread.  Otherwise it will result in off-topic remarks.
Title: Re: "SPECTRUM" type screenbars?
Post by: Volvo_0ne on January 22, 2018, 06:56:33 PM
Message recieved and understood  ;D