It is currently Fri Dec 15, 2017 7:15 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Jun 02, 2017 4:22 pm 
Offline
User avatar

Joined: Mon Dec 07, 2009 11:08 am
Posts: 79
Location: USA
I have hit a wall in debugging an issue. I hope typing up the issue and/or getting in front of other sets of eyes may help me move forward. Suggestions for what is going on here or what I might try next are welcome!

First, here is a snippet of a file which contains an encoded level:
Code:
.pushseg
.segment "LEVELS"
.proc playground
 
  ...
  ; metasprite count
  .byte 2
   
  ; metasprite IDs
  .word metasprite_ids

  ; metasprite column positions
  .word metasprite_cols

  ; metasprite row and length bytes
  .word metasprite_rows
 
  ; metasprite_args
  .word metasprite_args

  ...

  metasprite_ids:
    .byte metasprite_names::door, metasprite_names::z75

  metasprite_cols:
    .byte 17, 22

  metasprite_rows:
    .byte 4, 7
   
  metasprite_args:
    .byte 7

I recently added metasprite_args which points at a list of bytes which are arguments for metasprites. The weird thing is that this label evaluates to $00 when assembled with ca65. The previous label metasprite_rows points at a non-zero address, but not metasprite_args.

Why is this label $00 rather than address(metasprite_rows) + 2?


Top
 Profile  
 
PostPosted: Fri Jun 02, 2017 5:41 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
Let's form a Minimal, Complete, and Verifiable Example (MCVE). In particular, give us something we can assemble that still produces the misbehavior. I understand your actual source code may contain proprietary information that you want to keep confidential until your product is released. But you cut out so much, and in such a way, that your snippet doesn't assemble:
Code:
dotdotdot.s(5): Error: Unexpected trailing garbage characters
dotdotdot.s(21): Error: Unexpected trailing garbage characters
dotdotdot.s(24): Error: No such scope: `metasprite_names'
dotdotdot.s(24): Error: Unexpected trailing garbage characters

What else can you cut out of your original file to keep it assembling while preserving the misbehavior?


Top
 Profile  
 
PostPosted: Fri Jun 02, 2017 9:22 pm 
Offline
User avatar

Joined: Mon Dec 07, 2009 11:08 am
Posts: 79
Location: USA
Thanks for your reply Tepples. :D I stepped through the code again and found the root cause--the level loader was inc'ing Y one too many times due to an old field I had removed from the level format.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group