6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Jun 05, 2024 2:22 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Apr 01, 2021 10:40 am 
Offline

Joined: Tue Jul 07, 2020 10:35 am
Posts: 40
Location: Amsterdam, NL
My previous version of my SBC had ROM in the entire upper address space: $8000...$FFFF. However, I rarely use that space so I've reconfigured it to have RAM $0000...$BEFF, I/O $BF00...$BFFF and finally ROM $C000...$FFFF. I am using an AT28C256 for my ROM. However, now that I've done this, my ROM should have length $4000 and so it doesn't fill the entire ROM and I can't use minipro to install it.

Is there a way in a cc65 cfg file to configure cc65 to make a file with length $8000, pad with zeroes until the start of my code section at $C000, and then fill out the rest with the real bytes? Or, alternatively, can i write a file starting at a specific location in minipro?

EDITED: I had "finally RAM" and it should be "finally ROM"


Last edited by Procrastin8 on Thu Apr 01, 2021 1:37 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 01, 2021 3:25 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10822
Location: England
Sorry, this isn't directly answering the question...

While there might be a way to configure cc65 as you want it, another possible way is just to write your assembly code such that it starts with 4k of zeroes. (I'm assuming you are writing in assembly, not in C.)

And another way is to use some other tool like dd to prepend 4k of zeroes to the 4k ROM binary you can write.

But another way is this: your glue logic determines which bits of the ROM land at which addresses. You could arrange for the low half of the ROM to land at C000, perhaps just by tying off an address input.


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 01, 2021 4:15 pm 
Offline

Joined: Sun May 07, 2017 3:59 pm
Posts: 20
Some ways to set this up in the ld65 linker config:

16K padding section:
Code:
MEMORY {
   DUMMY:  start = $8000, size = $4000, type = ro, fill = yes;
   ROM:    start = $C000, size = $4000, type = ro, fill = yes;
}

SEGMENTS {
   CODE: load = ROM, type = ro;
}

32K section with coded loaded at 16K offset:
Code:
MEMORY {
   ROM:  start = $8000, size = $8000, type = ro, fill = yes;
}

SEGMENTS {
   CODE: load = ROM, type = ro, offset = $4000;
}


Personally, I'd to what Ed suggested and handle the padding as a separate step in a script. If your only concern is the correct file size, you could just double up the file:
Code:
cat 16k.bin 16k.bin > 32k.bin

(or "type" instead of "cat" on Windows)


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 07, 2021 12:37 pm 
Offline

Joined: Tue Jul 07, 2020 10:35 am
Posts: 40
Location: Amsterdam, NL
Yeah ok, I wrote a python script to pad the beginning it appears to be working. Added it to my makefile when installing so it's not too bad. Thanks!


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 07, 2021 9:06 pm 
Offline
User avatar

Joined: Thu May 14, 2015 9:20 pm
Posts: 155
Location: UK
If you have unused EPROM/EEPROM space, it’s better to pad with 0xFF than 0x00 as then it programs quicker. Unless of course you actually need the values stored to be 0x00.

0xFF is the ‘blank’ value that memory addresses in a EPROM/EEPROM go to when erased.

Mark


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 08, 2021 11:35 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 693
Location: North Tejas
There is another advantage of padding with $FF: You can burn new code into the padding later without having to erase and reprogram the whole thing.


Top
 Profile  
Reply with quote  
PostPosted: Thu Apr 08, 2021 2:04 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
Using the AT28C256, you can program it insitu... very simple to do. You don't have to pad it with anything. I have routines in my Monitor code that will allow changing one byte at a time or moving any length block from RAM to ROM.

On another note: not sure why there was a need to pad the file to program with... but I'm guessing the schematic was probably changed.... posting that would be helpful to figure out why any changes were needed.

_________________
Regards, KM
https://github.com/floobydust


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

All times are UTC


Who is online

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