It is currently Tue May 21, 2019 12:28 am

All times are UTC - 7 hours



Forum rules





Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Apr 27, 2019 12:11 pm 
Offline

Joined: Sun Dec 24, 2017 10:16 am
Posts: 12
Hello,

I think tcc65816 provided with Snes SDK has its own version of wla which has been modified to work with it :
https://github.com/optixx/snes-sdk

I would like to upgrade wla (version 9.4) to the latest 9.8.

I tried to compile a simple hello_world (i saw that parameters change) but i get this error :

wla-65816 -v -o hello_world.obj hello_world.asm
Pass 1...
hello_world.asm:53: DIRECTIVE_ERROR: ROM banks == 8, selected bank 127.
hello_world.asm:53: ERROR: Couldn't parse "ram.data".

"make": *** [hello_world.obj] Error 1

asm file generated is like that, it seems to be the same that we get it in old version of wla dx :

Code:
.include "hdr.asm"
.accu 16
.index 16
.16bit
.define __main_locals 0
.section ".text_0x0" superfree
main:
.ifgr __main_locals 0
tsa
sec
sbc #__main_locals
tas
.endif
jsr.l consoleInit
pea.w (0 * 256 + 1)
sep #$20
rep #$20
jsr.l setMode
pla
sep #$20
lda #1
pha
rep #$20
jsr.l bgSetDisable
tsa
clc
adc #1
tas
sep #$20
lda #2
pha
rep #$20
jsr.l bgSetDisable
tsa
clc
adc #1
tas
jsr.l setScreenOn
__local_0:
jsr.l WaitForVBlank
bra __local_0
lda.w #0
sta.b tcc__r0
__local_1:
.ifgr __main_locals 0
tsa
clc
adc #__main_locals
tas
.endif
rtl
.ends
.ramsection "ram.data" bank $7f slot 3
__local_dummy.data dsb 1
.ends
.section ".data" superfree
__local_dummy.data: .db 0
.ends
.section ".rodata" superfree
__local_dummy.rodata: .db 0
.ends

.ramsection ".bss" bank $7e slot 2
__local_dummybss dsb 1
.ends


I guess that it is related to tcc and not wla.

Do you have any informations on how to solve it ?


edit : has been solved today by wla dx developer, it was a bug


Last edited by hoit on Sat May 18, 2019 11:03 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat May 18, 2019 11:03 am 
Offline

Joined: Sun Dec 24, 2017 10:16 am
Posts: 12
In fact i still need help :)

I built tcc816 with latest wla dx version. But the initial tcc816 was provided with a special wla dx 9.4 and had some modifications.
Now, i would like to compile a hello world project based on pvsneslib which use files that comes from snessdk.

I created a minimal project to test it directly on windows. The first version is here :

http://s000.tinyupload.com/?file_id=768 ... 7718687994

I removed makefiles and only joined COMMAND_LIST.txt which gives command i used.

The first error i had was :

crt0_snes.obj: crt0_snes.asm:205: PARSE_STACK: Unresolved reference to "__nmi_handler".

it has been solved by renaming __nmi_handler to nmi_handler (because "If you have a label that starts with "__", then it is not visible outside the section / file where it was defined. Not any more with v9.8...")

Then the second error :
crt0_snes.asm:251: PARSE_STACK: Unresolved reference to "__endsection.data".

So i tried the same thing, remove "__" when variable start with (__endsection, __startsection, __endramsection and __startramsection)

but it produce

crt0_snes.obj: crt0_snes.asm:251: PARSE_STACK: Unresolved reference to "endsection.data".

VHelin (wla dx owner) has changed wla dx to include this treatment in the latest commit. This is a new -x parameter that create labels SECTIONSTART_[section name] and SECTIONEND_[section name] (it was specific to wla dx 9.4 version provided with tcc816)

I replaced startsectionxxx and endsectionxxx by the new SECTIONSTART and SECTIONEND.
Then i got a lot of errors of Unresolved reference to xxxxx which came from libc_c.asm. For each, i just removed the "_" or "__" before the name like for nmi_handler. (i don't know what will be the final impact on the rom...)

Now, wlalink.exe linkfile test.sfc produce this error :

crt0_snes.obj: crt0_snes.asm:243: COMPUTE_PENDING_CALCULATIONS: Result (339/$153) of a computation is out of 8-bit range.

crt0_snes.asm line 243 is : sta.b nmi_handler + 2
and nmi_handler is declared like that : nmi_handler dsb 4

I replaced sta.b by sta.w (16 bit constraint) and the same error occurs few lines after. I replaced all lines with this error to use ".w" to finally get :

libm.obj: libm.asm:319: COMPUTE_PENDING_CALCULATIONS: Result (443/$1bb) of a computation is out of 8-bit range.

on this line :

- sty tcc__E - 1,X

This is the final version i uploaded with the latest change i explained :

http://s000.tinyupload.com/?file_id=627 ... 5930283348

Wla 9.8 and 9.4 are differents and this explain some issues but i think constraints with 8/16/24 bits are the same and this "out fo range" are strange.

I am not fluent in asm and not to sure to be on the right way.

Does somebody can help me ?

Thanks


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: calima and 3 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