Jump to content
IGNORED

Table of addresses to render sprites


Recommended Posts

I am attempting to use indirect addressing to render a sprite, by referencing a table of addresses to various sprite frames. I did read http://atariage.com/forums/topic/198867-address-table-question-urgent/page__hl__+indirect%20+address?do=findComment&comment=2536600, but I seem unable to correctly apply this to my code.

 

What is rendered is not the sprite I intended, but whatever happens to be in whatever address I happen to be incorrectly referencing. Please help me uncover the error.

 

Here is a snippet:

 

FRAME_POINTER will point to the current frame by address. (In this snippet there is only one frame).

 

SEG.U VARS

ORG $80

FRAME_POINTER ds 2

SEG CODE

 

 

LDA TankImageTable

 

STA FRAME_POINTER

LDA TankImageTable + 1

STA FRAME_POINTER + 1

 

Gfx Kernel reducted to only the relevant part.

 

LDY #2

LDX #7

TankArea

LDA (FRAME_POINTER),X

STA GRP0

STY WSYNC

DEX

BPL TankArea

 

Sprite Definition:

 

TankImageFrame0

.byte #%01111110

.byte #%11010101

.byte #%10101011

.byte #%11111110

.byte #%10111000

.byte #%10011000

.byte #%00011000

.byte #%00011000

 

TankImageTable

.word TankImageFrame0

Link to comment
Share on other sites

Wow, I feel like such a code monkey. I read the addressing modes over and over, but still didn't pick up what was being laid down.

 

Anyway, it works now.

 

I was using DASM 1.09. I've upgraded to DASM 2.20.11. Either way, no error was reported concerning the invalid addressing mode at any verbosity. :/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...