It is currently Wed Nov 14, 2018 3:52 am

All times are UTC - 7 hours



Forum rules





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jan 11, 2018 12:01 pm 
Offline

Joined: Wed Apr 26, 2017 2:26 pm
Posts: 17
I'm confused about how the PC is loaded if I do a JML or JSL. If I understand the mapping correctly, it means that

Code:
SNES Address    ROM Address
$00:8000        $00:0000
$01:8000        $00:8000
$02:8000        $01:0000
.
.
.

And so on. How do absolute long jumps then work? Let's say I tell my assembler to place my reset routine at ROM $00:0000 and my drawing at ROM $01:0000. So If I write
Code:
Reset:
    ; some code
    jsl DrawRoutine
    ; more code

This will become
Code:
jsl $010000

But loading $010000 into the PC of the SNES will point me to the RAM mirror in SNES $01:0000 - which is wrong. How do I adjust this?

I work with cc65, so I guess it would me possibly to write a memory config for the linker that would adjust the addresses of the subroutines accordingly, but that seems somehow too convoluted to me. So again the question, how do I jump between pages/bankes? Assuming I do not want to use the SNES banks $0C or higher.


Top
 Profile  
 
PostPosted: Thu Jan 11, 2018 12:21 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7714
Location: Seattle
With ld65, you really have to structure your LoROM application as a series of 32 KiB slices. Look at tepples's lorom template


Top
 Profile  
 
PostPosted: Thu Jan 11, 2018 12:24 pm 
Offline

Joined: Wed Apr 26, 2017 2:26 pm
Posts: 17
lidnariq wrote:
With ld65, you really have to structure your LoROM application as a series of 32 KiB slices. Look at tepples's lorom template


Very helpful, thanks!


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 7 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