Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #1850

"Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2)

Newsgroups comp.sys.apple2.programmer
Date 2015-10-15 19:15 -0700
Message-ID <3dfeb2b4-f124-40fe-afe1-cfde8912151d@googlegroups.com> (permalink)
Subject "Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2)
From jamesiwalker77@gmail.com

Show all headers | View raw


My family had an Apple IIe when I was young, but the furthest I got in game programming on the Apple IIe as a kid (age 6-13, after which I migrated to C++ programming on Windows PC's) was animated text games in the upper-left corner of the screen (because the Apple IIe didn't animate fast in BASIC and I couldn't find a book that explained Apple II assembly graphics programming in a way that I could understand at the time).  I am now getting into Apple II assembly programming on the Apple IIe emulator, AppleWin. I am using the Merlin assembler, and have learned a lot of what I know so far from "Programming the Apple II in Assembly Language" by Rodnay Zaks, which I bought a hard-copy of on Amazon.  I'm wondering, I have not seen any commands in the Assembly language instruction set that can put values into an address in memory that is specified by a 2-byte "variable."  The closest I see to that is specifying a static 2-byte address, which can take a 1-byte "variable" offset, which I think can be accomplished with STA, if I correctly understand the instruction set. If you only have 1 byte of variability with STA, and in Apple IIe hi-res games, a sprite moves all around a screen that spans 8,192 bytes, what is a typical way that a game programmer would plot pixels to the screen for animation in assembly language? I already understand how screen memory is mapped on the Apple IIe, and how a particular byte will display a particular 7-pixel pattern, so I don't need an explanation of that.  (I created a program in C# .NET that spits out all of the starting address for each row in hi-res page 2 memory, according to a formula from Rodnay Zaks' book.) It seems to me that 1 byte of variability in the offset would only allow you to plot to 256 bytes of memory dynamically, and if you wanted to plot to more, you would have to jump through a lot of hoops in order to do so.  So, is there an assembly language instruction that I am not aware of that allows 2 byte variability?  And, if not, what techniques did (or do) Apple II assembly language programmers typically use to accomplish animation where sprites move all around the screen, which provide an optimum balance of both memory storage and processing speed?  I would really appreciate if anyone would answer this question for me, as I haven't yet found an answer to this on the internet and I really want to know how to do it, preferably in a way that would be recommended for best coding practices given the available instruction set. Thanks.

Back to comp.sys.apple2.programmer | Previous | NextNext in thread | Find similar


Thread

"Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2) jamesiwalker77@gmail.com - 2015-10-15 19:15 -0700
  Re: "Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2) Michael J. Mahon <mjmahon@aol.com> - 2015-10-16 01:58 -0500
    Re: "Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2) jamesiwalker77@gmail.com - 2015-10-16 08:38 -0700
  Re: "Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2) mmphosis <mmphosis@macgui.com> - 2015-10-16 07:01 +0000
    Re: "Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2) jamesiwalker77@gmail.com - 2015-10-16 08:49 -0700
  Re: "Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2) "Anton Treuenfels" <teamtempest@yahoo.com> - 2015-10-16 08:32 -0500
  Re: "Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2) John Brooks <jbrooks@blueshiftinc.com> - 2015-10-16 08:08 -0700
  Re: "Best practices" for animating sprites in Apple II Assembly? (HGR/HGR2) jamesiwalker77@gmail.com - 2015-10-16 08:34 -0700

csiph-web