6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun May 12, 2024 10:34 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: WDC816CC and sprintf
PostPosted: Tue Apr 30, 2024 11:19 am 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 267
Location: South Africa
... Or it might be better to call this WDC816CC and anything from fcntl as it seems that all the low level I/O stuff is missing.

Still if anyone has managed to use sprintf with WDC's C compiler I would dearly love to know how.

Compiling with the Large memory model (-ml) and linking with the Large C library (-lcl)
Code:
wdc816cc.exe  -bs -DUSING_816 -ml -wr -wu -so -sp -lt -pb -pp -px -o Main.obj Main.c
wdcln.exe -C20000,00000 -g -t -sz -HB -obin\VideoUpload.bin Main.obj -lcl -lml
then I get the following undefined symbols:
Code:
Undefined symbol: ~~unlink
Undefined symbol: ~~close
Undefined symbol: ~~isatty
Undefined symbol: ~~write
Undefined symbol: ~~lseek


I also tried compiling with the Small memory model (-ms) and linking with the Small C library (-lcs)
Code:
wdc816cc.exe  -bs -DUSING_816 -mcs -wr -wu -so -sp -lt -pb -pp -px -o Main.obj Main.c
wdcln.exe -g -t -sz -HB -obin\VideoUpload.bin Main.obj -lcs -lms
but still get similar undefined symbols:
Code:
Undefined symbol: _~unlink
Undefined symbol: _~close
Undefined symbol: _~isatty
Undefined symbol: _~write
Undefined symbol: _~lseek

So I don't think it's a Large or Compact only deficiency.


Top
 Profile  
Reply with quote  
 Post subject: Re: WDC816CC and sprintf
PostPosted: Wed May 01, 2024 4:00 am 
Offline
User avatar

Joined: Tue Feb 28, 2023 11:39 pm
Posts: 146
Location: Texas
Does anything work in their library?

If you need a printf() function, I have one of those I wrote:
https://raw.githubusercontent.com/Kelma ... snprintf.c


XD


Top
 Profile  
Reply with quote  
 Post subject: Re: WDC816CC and sprintf
PostPosted: Wed May 01, 2024 5:36 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8180
Location: Midwestern USA
Yuri wrote:
Does anything work in their library?

If you need a printf() function, I have one of those I wrote:
https://raw.githubusercontent.com/Kelma ... snprintf.c

I suspect the TIDE library is all relocatable assembly language stuff.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: WDC816CC and sprintf
PostPosted: Wed May 01, 2024 5:10 pm 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 267
Location: South Africa
Yuri wrote:
Does anything work in their library?

If you need a printf() function, I have one of those I wrote
Thank you, that looks nice and compact - I do believe I will be borrowing it :D

Most of the standard C library works (it's only the far heap stuff and fcntl I've had issues with) and the mathematical stuff works, floats, long ints, quotients, multiplication etc... The problem is that some of the standard functions depend on malloc (as opposed to farmalloc) and I don't fully understand how to make that play nicely with the large memory model.

BigDumbDinosaur wrote:
I suspect the TIDE library is all relocatable assembly language stuff.[/color]
It's gotta be. I haven't tried decompiling it (and don't have an emulator to step through it yet either) but the locations of the standard C functions move around and some of the calls seem non-C; i.e. they must be assembly.


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

All times are UTC


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: