Search found 40 matches

by vbc
Wed Aug 05, 2020 11:29 pm
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

Does sprintf (or any other function needing vargs) not work at the moment / not work at all? It seems to copy the format string if there are no placeholders and no vargs supplied, but otherwise appears to do nothing at all. I really don't even need sprintf, I just need a quick way to convert an int...
by vbc
Mon Aug 03, 2020 2:58 pm
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

It's not 100% fixed, because when I compile the same code, sometimes I get a good $41xx r/w behaviour and sometimes a bad one. Uninitialised variable somewhere in the compiler? Most of the time it's good but sometimes it's bad, and because of the randomness difficult to reproduce. Seems there was a...
by vbc
Fri Jul 31, 2020 8:04 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

#define IO8(addr) (*(volatile ubyte *)(addr)) void test() { ubyte val; IO8(0x4147) = IO8(0x4147) & 0xBF; val = IO8(0x4147) & 0xDF; IO8(0x4147) = val; IO8(0x4147) = val | 0x20; } results in the following reads/writes R 4147 41 W 4147 01 01 21 but it should be R 4147 41 W 4147 01 R 4147 41 W 4147 41 ...
by vbc
Thu Jul 30, 2020 6:51 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

timschuerewegen wrote:
Thu Jul 30, 2020 3:35 am
I think I found a bug. See attached project. It should display "0808" when you press up but it displays "1808" instead.

menu.zip
Indeed. There was a code path that was missing a clc before an adc. I have updated the files on my page.

Thanks for the report.
by vbc
Thu Jul 30, 2020 1:28 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

Banshaku wrote:
Wed Jul 29, 2020 7:56 pm
-g, not sure yet how it works after reading the doc, seems that you need to add the code yourself if I understood what it meant.
Yes, you should be able to use some kind of script to create a mixed C/assembly files. Not sure how good the results will be, though.
by vbc
Wed Jul 29, 2020 5:09 pm
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

I have uploaded a new version to: http://www.compilers.de/vbcc.html Major changes since Alpha 2: - first version of an Atari 8bit target (Atari) - configuration for running banked code with REU (C64) - configuration for TxROM mapper (NES) - some speed and size optimizations of the C library (thanks ...
by vbc
Wed Jul 29, 2020 8:10 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

yaros wrote:
Wed Jul 29, 2020 7:40 am
If we already defined that s1 is of type point is it possible to simplify

Code: Select all

lda s1+point.x
to

Code: Select all

lda s1.x
?
Unfortunately not. To vasm it is just a symbol. vasm does not keep track of something like type information. That's what vbcc is for. :-)
by vbc
Wed Jul 29, 2020 8:05 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

I don't know how hard it would be to add but if zpage could work like global and allow a list on one line that would be great. It's quite tedious to have to write every variables one by one. To allow to group them like global makes the list smaller Agreed. Will be added. It seems that the concept o...
by vbc
Mon Jul 27, 2020 2:00 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

Although I can do the same thing, running the underlying `vbcc6502` and `vasm6502_oldstyle` commands in my makefile manually, but it appears that when `vc` is run with '-O3', it generates an opaque command script that it passes to `vbcc6502` using the '-cmd' option. I can't make `vc` show me what's...
by vbc
Mon Jul 27, 2020 1:30 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

vbc, the more I play with this, the more I love it. Thanks to the advanced nature of the optimizations present here, I've been able to convert almost all of my project over to pure C, with only some parts left in assembly. Nice to hear, thank you. Would it be possible to get two small "creature com...
by vbc
Mon Jul 27, 2020 1:18 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

One thing I would suggest is even though the code at first was not public, the startup/banking code should be documented so that if people need to adapt they can do it on their own. I could figure it out (at the least the startup code) since I did once for cc65 but some people may have less experie...
by vbc
Thu Jul 23, 2020 8:22 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

Apparently it was specified like that in GNU ld and vlink tries to be compatible. We added RESERVE to get around the problems it causes. I see but isn't fill the same idea as reserve somehow? what is the difference? fill only inserts the space if some data follows. You cannot use it to fill space a...
by vbc
Thu Jul 23, 2020 8:14 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

The problem with the nes compared to other console is that there is a multitude of mapper which uses different way to bank-switch so there is no easy way to support all of them in vbcc. And there are also other 6502 targets using other forms of banking that I want to support. That has always been t...
by vbc
Wed Jul 22, 2020 3:38 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

I think my idea I had in mind for segment won't work. What I need to confirm is that you select rawseg instead of rawbin1, each segments generated will contains more information that I think is related to how elf work, is it correct? If this is the case then my idea just went out the windows (using...
by vbc
Wed Jul 22, 2020 3:03 am
Forum: NESdev
Topic: VBCC Optimizing C-compiler now supports NES
Replies: 123
Views: 8382

Re: VBCC Optimizing C-compiler now supports NES

Hi, I made a small Q&D test for mapper4/MMC3/TBROM: mapper4.zip (source and cartridge binary included, see buildtests.sh how to compile) It only uses manual bankswitching instead of vbcc6502's cool auto bankswitching feature. So it might need some additional tweaking. But it's a start. I have creat...