6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Apr 27, 2024 3:05 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Nov 02, 2017 4:37 pm 
Offline

Joined: Wed Sep 27, 2017 8:57 am
Posts: 2
I have a question about the align attribute in my memory config:
Code:
MEMORY {
    BANK00:     start=$8000, size=$8000, fill=yes;
    BANK01:     start=$f000, size=$8000, fill=yes;
}

SEGMENTS {
    CODE:       load=BANK00, align=$8000;           # bank 0 at $00:$8000
    HEADER:     load=BANK00, start=$ffc0;
    ROMINFO:    load=BANK00, start=$ffd5;
    VECTOR:     load=BANK00, start=$ffe4;
    GRAPHICS:   load=BANK01, align=$8000;           # bank 1 at $01:$8000
}

Background: I'm playing around with programming SNES game bits for fun, the code is working fine. For ease of use I decided to have one 32KB segment/bank for my code(include the reset vectors and SNES specific data) and a second 32KB bank for the graphics I use(note that both data could fit completely into one bank, I simply do this for educational reasons).

Now, when I build my program the output file is as expected 64KB in size, so I except my code to start at $0000 of the output file, and the graphics data at $8000. Yet my graphics data starts at $9000. I also get this warning from ld65:
Code:
ld65: Warning: lorom128.cfg(11): The first segment in memory area `BANK01' needs fill bytes for alignment.

When I remove the second align attribute in the last line, my graphics are placed at $8000 as expected. I understand the align attribute to be a tool to make sure, that segements of a certain size won't overlap.

What am I getting wrong about align and why does it move my data to $9000 instead of $8000?


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 03, 2017 7:00 am 
Offline

Joined: Fri Apr 15, 2016 1:03 am
Posts: 135
In "MEMORY", in "BANK01", you have "start=$f000" - should this be $18000?

I think LD65 is inserting 4KBytes of padding so GRAPHICS can be aligned on a $8000 boundary.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 07, 2017 10:58 pm 
Offline

Joined: Wed Sep 27, 2017 8:57 am
Posts: 2
Sorry for my late reply. I haven't got behind it yet, since I kept working on it with my old config file. When I find more time, I'll investigate further and keep you posted.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 04, 2018 4:19 pm 
Offline

Joined: Wed Dec 24, 2014 11:15 pm
Posts: 7
Hi, georgjz !

I have a question to you, but I can't find how to send a private message here.

How can I contact you?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 04, 2018 6:07 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
iLavr wrote:
but I can't find how to send a private message here.

How can I contact you?

Attachment:
HowToSendPM.gif
HowToSendPM.gif [ 40.22 KiB | Viewed 3222 times ]

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 04, 2018 11:18 pm 
Offline

Joined: Wed Dec 24, 2014 11:15 pm
Posts: 7
Thanks, GARTHWILSON !

I have a habit that a "private message" button must be on top... ))))


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 32 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: