English Amiga Board Basic question about ligthning a pixel and the associatd cost
 Register Amiga FAQ Rules & Help Members List  /  Moderators List Today's Posts Mark Forums Read

 26 February 2019, 23:35 #1 TEG Registered User   Join Date: Apr 2017 Location: France Posts: 36 Basic question about ligthning a pixel and the associatd cost My memory of Amiga assembly programming is a bit far and I searched the web but not found a clear explanation. Let's assume black is colour 0 of the palette and white is colour 15 of the palette. If I want to light pixel 0,0 from black to white on a 4 bitplanes 300x200 screen, I must make 4 moves of the byte (in binary) 10000000, each byte separated by 320*200=64000 bits. Right? Last edited by TEG; 27 February 2019 at 00:23.
27 February 2019, 01:13   #2
phx
Natteravn

Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,538
Quote:
 Originally Posted by TEG If I want to light pixel 0,0 from black to white on a 4 bitplanes 300x200 screen, I must make 4 moves of the byte
Assuming you have 4 bitplanes, which are sufficient for 16 colours, you have to set the pixel in each of the 4 planes, yes.

Quote:
 (in binary) 10000000,
Correct. The MSB is the leftmost pixel in the plane's first byte.

Quote:
 each byte separated by 320*200=64000 bits. Right?
Only if your bitplanes have a modulo of 0 and are following directly attached to each other in memory. Then the offset to the next plane would be 40*200 = 8000 bytes or 64000 bits.

But it is your choice to allocate bitplanes whereever you want in the Chip RAM. Or you might decide to use interleaved bitplanes, which speeds up blitter operations (then the bitplane-modulo would be 3*40=120 and offset to the next plane would become 40 bytes).

 27 February 2019, 21:53 #3 TEG Registered User   Join Date: Apr 2017 Location: France Posts: 36 Thanks Phx. All tutorial wrote back in time I read, explain the bitplanes concept and then give the listing of a copperlist to explain how to display something. So you have to decode what the copperlist do and it's confusing and of course nobody state that the same can be achieve with the cpu or the blitter. Thanks for the modulo hint I had forgot about, but I don't get your 3*40. Isn't it 4*40 (4 bitplans in my example) ? Another question: on an Amiga with a 16 bits bus, is writing a byte or a word in the memory, have the same cost in term of cpu cycles and bus availability ?
27 February 2019, 23:07   #4
phx
Natteravn

Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,538
Quote:
 Originally Posted by TEG Thanks for the modulo hint I had forgot about, but I don't get your 3*40. Isn't it 4*40 (4 bitplans in my example) ?
The modulo defines the number of bytes to skip in a plane, after each line. Usually the next line follows directly in memory (modulo=0), but with interleaved bitplanes you have to skip the lines of three other bitplanes to find the next line of your current plane.

Quote:
 Another question: on an Amiga with a 16 bits bus, is writing a byte or a word in the memory, have the same cost in term of cpu cycles and bus availability ?
Yes. That's why it is called 16-bit bus.

28 February 2019, 00:10   #5
TEG
Registered User

Join Date: Apr 2017
Location: France
Posts: 36
Quote:
 Originally Posted by phx The modulo defines the number of bytes to skip in a plane, after each line. Usually the next line follows directly in memory (modulo=0), but with interleaved bitplanes you have to skip the lines of three other bitplanes to find the next line of your current plane.

I got it, we must count "after the end of our own line".

Quote:
 Originally Posted by phx Yes. That's why it is called 16-bit bus.
Well, I asked in case special magic would allow to simultaneously use 8 lines for the cpu and the other 8 for, let's say, the blitter.

I was thinking about the blitter and modulo and I guess the blitter have to do multiple operations to wrote to the different addresses the data for each plane and I wonder if it use less cycles than the cpu to do the same. I find a thread about blitter timing here, so I will try to find the answer.

 09 March 2019, 03:51 #6 Photon Moderator   Join Date: Nov 2004 Location: Eksjö / Sweden Posts: 4,799 I think the question is answered by PHX, but wanted to say that yes, this is the way of performant graphics for all uses for computers in the MHz range. Bitplanes was the only way to avoid slow framerates. Most computers used strange schemes, which was even worse. For a single pixel, the CPU will be faster but for anything larger than say 8x8 even for just 1 bitplane, the Blitter which was made to process bitplanes can go faster, since you have to OR or BSET the pixel in place. For clearing you can track your pixels if they're few and use MOVE to clear. If you intend sequential scanline algorithm plotting, shift into one register per bitplane and write them to (An)+ when full. And I did phone up Amiga to try to convince them to let us write a byte for a pixel. This was 3 years before Akiko, which was not ideal either. "Just give us a mode!!" So to make things faster you use these tricks, or to "get the mode!!" you get a graphics card (which also takes its toll on performance).

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 Similar Threads Thread Thread Starter Forum Replies Last Post dex project.Sprites 15 18 August 2015 12:06 r0ber7 support.Other 2 18 February 2011 20:18 dword support.Games 3 19 July 2008 02:41 Tbird support.Apps 18 24 January 2003 00:31 Muzkat New to Emulation or Amiga scene 2 23 February 2002 13:06

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home News Main     Amiga scene     Retrogaming General Discussion     Nostalgia & memories Support     New to Emulation or Amiga scene         Member Introductions     support.WinUAE     support.WinFellow     support.OtherUAE     support.FS-UAE         project.AmigaLive     support.Hardware         Hardware mods         Hardware pics     support.Games     support.Demos     support.Apps     support.Amiga Forever     support.Amix     support.Other Requests     request.UAE Wishlist     request.Old Rare Games     request.Demos     request.Apps     request.Modules     request.Music     request.Other     Looking for a game name ?     Games images which need to be WHDified abime.net - Hall Of Light     HOL news     HOL suggestions and feedback     HOL data problems     HOL contributions abime.net - Amiga Magazine Rack     AMR news     AMR suggestions and feedback     AMR data problems     AMR contributions abime.net - Home Projects     project.Amiga Lore     project.EAB     project.IRC     project.Mods Jukebox     project.Wiki abime.net - Hosted Projects     project.aGTW     project.APoV     project.ClassicWB     project.Jambo!     project.Green Amiga Alien GUIDES     project.Maptapper     project.Sprites     project.WinUAE - Kaillera Other Projects     project.Amiga Demo DVD     project.Amiga Game Factory     project.CARE     project.EAB File Server     project.CD32 Conversion     project.Game Cover Art         GCA.Feedback and Suggestions         GCA.Work in Progress         GCA.Cover Requests         GCA.Usefull Programs         GCA.Helpdesk     project.KGLoad     project.MAGE     project.Missing Full Shareware Games     project.SPS (was CAPS)     project.TOSEC (amiga only)     project.WHDLoad         project.Killergorilla's WHD packs Misc     Amiga websites reviews     MarketPlace         Swapshop     Kinky Amiga Stuff     Collections     EAB's competition Coders     Coders. General         Coders. Releases         Coders. Tutorials     Coders. Asm / Hardware     Coders. System         Coders. Scripting         Coders. Nextgen     Coders. Language         Coders. C/C++         Coders. AMOS         Coders. Blitz Basic     Coders. Contest         Coders. Entries Creation     Graphics         Graphics. Work In Progress         Graphics. Finished Work         Graphics. Tutorials     Music         Music. Work In Progress         Music. Finished Work         Music. Tutorials Off Topic     OT - General     OT - Entertainment     OT - Sports     OT - Technical     OT - Gaming

All times are GMT +2. The time now is 01:22.

 -- EAB3 skin ---- EAB2 skin ---- Mobile skin Archive - Top