English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 17 December 2017, 17:50   #1
Hcktrox
 
Posts: n/a
VLINK doubts: Can't reference "re-linked" symbols?

Hello, I have worked with Motorola 68000 instruction set for some time, developing games for the Sega MegaDrive, SegaCD and Sega 32x.


Up until time ago, I have only arranged my source codes by adding all code and files to a single tree, to assemble the cartridge's ROM image "directly" (or for each individual SegaCD files depending the case).

I'm writing a new "cross-platform" engine of sorts, compatible in Megadrive and all its addons at the same time, just needing a different makefile per different target platform.
In order to do this, I have thought in a design that links many objects into individual objects, to be linked inside other layer of objects, and so on. This would allow me to arrange different layers of objects in different order according to what goes best to target platform.


I'm beginning with the "Megadrive Alone" setup; before explaining the issue, let me show you four key files:

Makefile.MD
$(SRC)\romMd.ld (Thanks Frank Wille)
$(SRC)\screens\maingameloop.asm
$(SRC)\screens\sega\main.asm

The problem here is, I seem to be unable to do jmp GM_Sega from maingameloop.asm, unless I force it as Long address or simply disable optimizations. And Bra simply doesn't work.
It throws an error I don't know what even means:
Quote:
Error 35: s1built.bin (mainloop+0xc): Calculated value 0x2080c doesn't fit into relocation type R_PC (offset=0, size=16, mask=0xffffffffffffffff).
None of this is the case from $(SRC)\init\gameinit.md.asm, where I can do bra MainGameLoop just fine.
The difference on each case is that, in the former, sega.scr.o has been repacked inside screens.md.o. While in the latter, those object files haven't.

I'd miss quite a lot of optimization if I'm forced to do Long library calls!
Is re-linking objects like this even possible? Do I have to configure different settings?
Or... is it more recommended to, instead of packing inside objects, pack filenames into lists, for inside the Makefile itself or a vlink list?

Last edited by Hcktrox; 17 December 2017 at 18:31.
 
Old 17 December 2017, 18:30   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
I can't build it, some files are missing, but from the link-script it looks like the two relevant sections are placed about 128K apart.
Leffmann is offline  
Old 17 December 2017, 18:54   #3
Hcktrox
 
Posts: n/a
Hm, I sent the source code as PM.. but actually scratch that, here it is:
EDIT: <No more :P>

You can try by enabling/disabling the optimization flags from src\screens\maingameloop.asm.

EDIT: Well that was awkward. Didn't realize it was a branch error because it didn't appear like so at first glance. Sorry for wasking your time. And thanks, Leffmann!

Last edited by Hcktrox; 17 December 2017 at 19:03.
 
Old 17 December 2017, 18:57   #4
Hcktrox
 
Posts: n/a
EDIT: Trash, it didn't appear earlier

Last edited by Hcktrox; 17 December 2017 at 19:02.
 
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" DemosongIHunter request.Music 45 23 May 2022 20:07
"Screech!! v2.41" & "Screech!! [AGA] v2.51" - "HD install" --> "ADFs" DamienD request.Old Rare Games 45 15 June 2020 12:42
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" rockape News 4 30 January 2013 00:06
CD32 Image-Name-Bug: "...(bla)[!].zip" -> "...(bla)[" / "...[test].zip" -> "...[tes" cfTrio support.WinUAE 8 18 December 2012 16:31
Problems with "Thespywholovedme", "Flood", "Shinobi" sareks support.Games 12 03 May 2006 14:52

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11165 seconds with 15 queries