English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 02 September 2010, 11:19   #141
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by AlfaRomeo View Post
Wrote this routine from the only example asm code I found to include next to Open screen routine in the code I post above but don´t know if its ok because don´t know how to obtain the screen ViewPort.
Code:
    include    intuition/screens.i

; open screen
    ...

    lea    sc_ViewPort(a0),a1
Also, can you explain me "your" SetPalette routine? What exactly does it do, how does it work?

Quote:
Originally Posted by AlfaRomeo View Post
Maybe it´s easy for a begginer to deal with color banks directly instead Gfx libraries
It isn't. If you don't understand how to use LoadRGB32 I don't think you'll understand how to deal with colorbanks etc. either which is required if you want to set a Palette directly.

Last edited by StingRay; 02 September 2010 at 11:35.
StingRay is offline  
Old 02 September 2010, 12:03   #142
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
I must admit that in some ways I agree with AlfaRomeo in that, with a lack of understanding of C code, I sometimes struggle to understand how to "use" system library functions with asm. Yeah, I know, probably me just being dumb but hey, them's the breaks.

Is there a way to "read" the library docs that I'm missing that makes asm calls to library routines more understandable...?
pmc is offline  
Old 02 September 2010, 12:28   #143
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by pmc View Post
I must admit that in some ways I agree with AlfaRomeo in that, with a lack of understanding of C code, I sometimes struggle to understand how to "use" system library functions with asm. Yeah, I know, probably me just being dumb but hey, them's the breaks.
What I ususally do if something isn't clear in the docs, I just check the includes which most of the time helps to clarify things. If not, well, trial and error. However, in this particular case I don't think there should be any problems to understand the LoadRGB32 documentation since all is explained pretty well so I don't see what is complex about it.
Besides, in my opinion, you don't learn coding if you always give up when a problem arises. But maybe I'm old-fashioned here.
StingRay is offline  
Old 02 September 2010, 12:35   #144
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by StingRay
What I ususally do if something isn't clear in the docs, I just check the includes which most of the time helps to clarify things.
Ah, OK - yeah, I can see your point - checking the include routines should clarify the docs. OK cool.

Quote:
Originally Posted by StingRay
If not, well, trial and error.
My usual coding method!

Quote:
Originally Posted by StingRay
Besides, in my opinion, you don't learn coding if you always give up when a problem arises. But maybe I'm old-fashioned here.
Agreed. Not old fashioned at all.

Overcoming the obstacles is where the learning is in my experience. When I think about something for ages and ages none of that time's wasted when the "oh, I get it!" moment finally comes...
pmc is offline  
Old 02 September 2010, 13:02   #145
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 829
Quote:
Originally Posted by pmc View Post
I sometimes struggle to understand how to "use" system library functions with asm.
Hi,

First I'm trying to simplify my problem. I have also problem with LoadRGB32 function. I started with one color till I figured out how set it in proper way ( started from black color then trying with white and so on... ). Then I'm trying to extend amount of colors. When I'm stuck then I usually compile C example and resource it . If I still stuck then I check all source codes which I have and trying to find solution. And the last If everything fails then I put my question on EAB

Regards

Last edited by Asman; 02 September 2010 at 13:52. Reason: correct typo
Asman is offline  
Old 02 September 2010, 13:33   #146
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
First thanks for the help with ViewPort

Quote:
Originally Posted by StingRay View Post

Also, can you explain me "your" SetPalette routine? What exactly does it do, how does it work?
I tried to make a table with colors but as I had no glue on how to find ViewPort I did not tried the routine because I have no way to see the colors. Now I see nosense in that routine.
AlfaRomeo is offline  
Old 02 September 2010, 13:39   #147
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
Quote:
Originally Posted by StingRay View Post
Besides, in my opinion, you don't learn coding if you always give up when a problem arises. But maybe I'm old-fashioned here.
I´m not giving up but as I have so few time and with so few examples if I have no help it´s an almost impossible task because as the days go by the morale go down. Besides as I will learn more and next time I know where to search to kill my doubts without help

Thanks again
AlfaRomeo is offline  
Old 02 September 2010, 13:46   #148
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by AlfaRomeo View Post
I tried to make a table with colors but as I had no glue on how to find ViewPort I did not tried the routine because I have no way to see the colors. Now I see nosense in that routine.
Be honest, the reason why you see no sense in the routine is because you didn't write it. The routine is fine btw! Try to understand what it does (like: which format has the input palette?) and don't just copy routines from someone else. That's not how you learn coding.
StingRay is offline  
Old 02 September 2010, 17:12   #149
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
Quote:
Originally Posted by StingRay View Post
Be honest, the reason why you see no sense in the routine is because you didn't write it. The routine is fine btw! Try to understand what it does (like: which format has the input palette?) and don't just copy routines from someone else. That's not how you learn coding.
You´re right StingRay the routine of colors in particular was not written by me, my intention was include the routine in the code and see if the window would have more colors and then try to understand how it works modifying the routine how I like. How I can understand the routine if even can´t visualise the results? To find that routine inside another code I had to strip the 1st code and tried to understand how it works to take the code needed to work with MY other code. I don´t just copy routines without tried to understand how it works.

On the net there are no examples and I do not understand why a beginner has to learn the more arduous way, why who has the knowledge can´t help, why the begginer must to invent the wheel again. It seems that because people had to spend a long time to learn think the begginers will have to go through the same now. Usually the amiga coders learned when they were younger and had enough time, the same does not happen now because almost all of us have 30/40 years old, have family and work. I also learned Z80 assembler when I was younger with only one book of about 150 pages but now I could not do it again on Amiga because now I don´t have the time I spent in the early days to learn how to program Amiga.
What I see is that those who tried to learn Amiga assembler in recent years had given up for failure time and the same goes with me. If I'm in the middle of an assembler problem but, for lack of time, do not finish it when I return to the same problem 15 days past I have to start from the beginning because I do not remember where was and how I got there.

If a friend of yours ask you for help to learn how to code with objective questions what do you do?
I don´t want anybody to give me the fish, only they help me to learn how to fishing

Last edited by AlfaRomeo; 02 September 2010 at 21:37.
AlfaRomeo is offline  
Old 02 September 2010, 22:54   #150
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by bippym View Post

Alot of the notes initially will be from the Mastering Amiga Assembler by Paul Overaa which is the book I am going to start (again) with!

My boss used to work with Paul Overaa. I know Paul has written a few books, but that's about it. Is he what we might call a coding god? Did he code anything worth playing/watching?


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 03 September 2010, 00:06   #151
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by bippym View Post
Read the HRM


Ok, just finished this thread from start to finish!

I learnt ASM a couple of years ago from examining code and from the book "Amiga Machine Language: A practical guide to learning 68000 assembly language on the Amiga" published by Abacus.
It does a decent job of teaching ASM, with OS friendly routines. I did learn a few tips and tricks from this thread though

As regarding the HRM (Hardware Reference Manual), I am lucky enough to have paper editions of various Amiga RKRM's (Rom Kernel Reference Manual)/HRM's (1985 and 1989 editions)

Unless you are the lucky owner of an Amiga Developer CD, or paper versions of the Amiga RKM's/HRM's, you may find this site useful:

http://amigadev.elowar.com/


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 03 September 2010, 02:21   #152
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by AlfaRomeo View Post
You´re right StingRay the routine of colors in particular was not written by me, my intention was include the routine in the code and see if the window would have more colors and then try to understand how it works modifying the routine how I like. How I can understand the routine if even can´t visualise the results? To find that routine inside another code I had to strip the 1st code and tried to understand how it works to take the code needed to work with MY other code. I don´t just copy routines without tried to understand how it works.
Well, I know where you took the routine from and well, except for some very small modifications (the GfxBase stuff) you just copied it 1:1. That it didn't really teach you anything is obvious since the routine "made no sense" to you (and you forgot a crucial rts ). I can understand that it can be hard to understand routines like that for a beginner, however, if you had tried to write a routine like that yourself you would have learned MUCH more! Why? Because you would have thought about the problem you're trying to solve. You don't learn much when you just copy/paste routines someone else coded.

Quote:
Originally Posted by AlfaRomeo View Post
On the net there are no examples and I do not understand why a beginner has to learn the more arduous way, why who has the knowledge can´t help, why the begginer must to invent the wheel again.
You can find more than enough examples on the net if you just google a bit. Also, to me it looks like you only want to be spoon-feeded and this is not how you learn coding, not at all! What does it help if you just copy/paste routines from someone else? And it has nothing to do with "reinventing the wheel", you want to learn coding so YOU should write the routines in the first place!

Quote:
Originally Posted by AlfaRomeo View Post
It seems that because people had to spend a long time to learn think the begginers will have to go through the same now. Usually the amiga coders learned when they were younger and had enough time, the same does not happen now because almost all of us have 30/40 years old, have family and work.
Yes, of course, time is a problem since we are not 15 anymore. However, this is no excuse for just wanting someone else to write code for you. I am not a fan of the "I need a tutorial for anything no matter how trivial it might be" generation because I think this is the totally wrong approach to learn something. See PMC (hi ) for example, he also doesn't have much time, yet, he still managed to learn coding and it was (and still is) really interesting to follow his progress. He tried to solve problems on his own first and only if he got stuck he asked questions. And look what he's able to do now!


Quote:
Originally Posted by AlfaRomeo View Post
If I'm in the middle of an assembler problem but, for lack of time, do not finish it when I return to the same problem 15 days past I have to start from the beginning because I do not remember where was and how I got there.
I see where you are coming from but this is just a matter of practice. Do you remember when you learned how to drive a car? You didn't learn it by just looking at someone else driving a car, you learned it by driving the car yourself. At the beginning it wasn't that easy and you probably stalled the engine a few times or made some other beginner mistakes. But the more you practiced the better you learned how to drive.
It's the same with coding, remember, skill comes with practice!


Quote:
Originally Posted by AlfaRomeo View Post
If a friend of yours ask you for help to learn how to code with objective questions what do you do?
I would tell him that he should start with simple stuff first, like, displaying a 1 bitplane picture or something similar. Like, in your case, you said that the LoadRGB32 stuff is too complex for your current knowledge. This is absolutely nothing to be ashamed of, it just means that you are not ready for things like that yet. Thus, try simpler things first. Also, I have the impression that you don't really know what you actually want to do. So, my question to you, what do you actually want to do, i.e. what interests you in Amiga coding?


Quote:
Originally Posted by AlfaRomeo View Post
I don´t want anybody to give me the fish, only they help me to learn how to fishing
That's the right mindset!
StingRay is offline  
Old 03 September 2010, 02:30   #153
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
@Lonewolf10

That site it´s very useful, I already know it.
Anyway what I miss it´s AGA examples because most of examples on the net are for ECS.
Usualy, they aren´t OS friendly, instead they bang the hardware directly. Even the book you mension, despite it´s still very useful to do the 1st steps, the code inside it´s for AOS 1.2 and older machines.
AlfaRomeo is offline  
Old 03 September 2010, 08:43   #154
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by StingRay
I would tell him that he should start with simple stuff first, like, displaying a 1 bitplane picture or something similar. Like, in your case, you said that the LoadRGB32 stuff is too complex for your current knowledge. This is absolutely nothing to be ashamed of, it just means that you are not ready for things like that yet. Thus, try simpler things first. Also, I have the impression that you don't really know what you actually want to do. So, my question to you, what do you actually want to do, i.e. what interests you in Amiga coding?
I've got to agree with StingRay when he says this. A couple of months ago now I said something similar to you:

Quote:
Originally Posted by pmc
It seems to me that, at the moment, you're jumping from place to place trying to understand everything at once. It might be better to think of just one thing you want to code and then try and think logically, step by step, how to code it from start to finish and then just keep on working on it until it's done.
Routines in asm comprise of lots of small steps. Think about it. Each command in asm does one thing, each command is one step. The key is to spend less time coding and more time thinking of the different steps involved in each routine. Once you know what the steps are, the code almost writes itself.

That mindset is, for me, the key to asm coding.
pmc is offline  
Old 03 September 2010, 13:34   #155
AlfaRomeo
A1200 040 SAM440EP 667
 
AlfaRomeo's Avatar
 
Join Date: Jan 2008
Location: Lisbon / Portugal
Posts: 873
@StingRay
@pmc
I know you are right but I think there is some misunderstood.
I started with small things, like accompanying the "Amiga Machine Language" book from abacus, but when I reached the section in that I had to open a screen the example code from book would not work because it was too old, so I work to see how to opened a screen but since I was working on AGA I preferred to begin to understand how to do it in AGA. Despite having opened a 256 color screen, only 2 colors are present and this led me to try to understand the color banks, so StingRay told me to use LoadRGB32() but as I only found 1 example on how to use it in asm and first must had a palette I copied the routine to generate the table with the palette. My only intention was to expedite the process of creating a palette instead of making a table with 256 * 3 long word values for RRGGBB at hand. All this because I do not have much time and wanted to understand how to use the function LoadRGB32 instead of spending the time to create a table with a palette.
So as you can see, when we have interest, a small step leads to a biggg steps

Anyway thanks for your help

P.S I'm already creating a color table, I go now the tenth color

Last edited by AlfaRomeo; 03 September 2010 at 13:42.
AlfaRomeo is offline  
Old 03 September 2010, 20:13   #156
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
@AlfaRomeo

Well, I have never really used AGA machines. I don't have a keyboard or other devices for my Amiga CD32, so that only gets used for games.
I own 2 Amiga 600's which I use and have learned to love, plus I am happy with OS2.0.

Either way, the book is a pretty good start for ASM programming. Can anyone recommend anything better, or as easy to pick up?


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 03 September 2010, 20:25   #157
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by Lonewolf10
Can anyone recommend anything better, or as easy to pick up?
Not Amiga specific but my favourite for learning 68k asm, extremely easy to pick up and extremely cheap too:

http://www.abebooks.co.uk/products/isbn/9780672224058

and it's more advanced companion, more expensive but also great in my opinion:

http://www.abebooks.co.uk/products/isbn/9780672225444

Those plus the HRM and you should be well away.
pmc is offline  
Old 03 September 2010, 21:45   #158
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Thanks, I'll check them out tonight


Regards,
Lonewolf10
Lonewolf10 is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Downfall - diary of a game... Graham Humphrey Amiga scene 505 15 March 2015 19:26
Uridium 2 : Diary of a Game silkworm Amiga scene 15 09 August 2011 09:00
19 Part One - Boot Camp Retro-Nerd project.aGTW 2 19 February 2008 22:11
Help....what is this part 2? Dizzy Retrogaming General Discussion 7 05 June 2007 15:27

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 Jump


All times are GMT +2. The time now is 03:13.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12912 seconds with 14 queries