[A83] Re: Excuse me for asking:


[Prev][Next][Index][Thread]

[A83] Re: Excuse me for asking:




Apology accepted :)

I probably was a bit harsh in my email, but I do get a little irritated when
I write nice long email (just counted, 10 paragraphs) explaining how to do
something, and then someone asks the same question again without giving hint
as to even having read the explanation.

First, forget about grayscale for now.  It probably sucks anyway on the 83.
Second, it's not much different from black/white programming, when you know
what you are doing.  It does complicate things a little and can cut
performance in half, and take twice as much room data wise, due to the fact
that there is double the pixel data (for both planes).

Second, full screen scrolling in eight directions is probably the hardest
thing to do, especially fast, when it comes to 2d graphics programming on
the z80.  Yes, there are harder things, like 3d programming, complex math
programming like a computer algebra system (i.e. 89/92).  But if you'll
notice, most of the side scrollers are only one way, not even two, much less
four.  There's a reason for that.  Granted, what you are trying to do is
much simpler because it's all display and it's static data, but it's still
not trivial and easy when you are inexperienced with assembly.

There are several things that make assembly programming hard.  Lack of
experience with programming in general is probably the worst thing, because
you won't understand "simple" concepts like sprites, tilemaps, etc.  I wrote
some stuff to draw tilemaps the first few days I was learning z80, without
looking at any examples or needing code from people.  Yet it is asked very
frequently on these mailing lists.  If you don't know how to do it in any
language, then doing it in assembly is going to be that much harder.

The other things are unfamiliarity with the platform and hardware, lack of
experience programming in assembly and lack of experience programming in
that assembly language.  If you want to be comfortable programming something
in assembly, you need to understand how it works.  You need to understand
how the memory is layed out, how the hardware works, how it's controlled,
etc.  You also need to understand that instruction set of the processor.
The easiest way to overcome that is to simply write code.

Start with simple things and work your way down from there, like you would
with any other programming language and environment.  Sure, writing a "hello
world" program is not a lot of fun, but it assures a number of things
(though on some platforms like the Game Boy, a program that actually prints
"hello world" does take a significant amount of code and a good bit
understanding).  It gets you familiar with the process of assembling the
code and running it on the target platform.  Sometimes, getting to the point
of "hello world" is the hardest part.  Once you get that far, you can play
around, and experiment.  Like changing the text, changing how it's
displayed, where it's displayed, etc.  Printing numbers instead of text.
Use your imagination.

Once you can actually run some code of your own, look at what other people
have written.  Pick something simple, like tic-tac-toe.  That was my first
"large" assembly program for the 86 (the source is even on ticalc.org, if
you want to see how much I sucked at z80 back then).  It is good to pick a
goal because it will force you to learn some things that you might not learn
just playing around, and it forces you to write more code than just little
test snippets.  It gets you going with things like data structures, control
structures, logic, etc., which are a bit hard to do at first in assembly.

So, get to work on that "hello world" program, and in time you'll gain the
skills necessary to write a grayscale picture scroller :)

> I guess i did overreact a bit. To you "David Phillips", i apologise for my
> words, and for making an incorrect assumption of you. Hopefully you aren't
> too annoyed with me at the moment. It is true that i am new to the z80 asm
> scene, but i am eager to learn. And thanks to Peter Martijn, for the
example
> code.






References: