It is currently Tue Oct 23, 2018 4:49 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Apr 02, 2018 2:43 pm 
Offline

Joined: Mon Apr 02, 2018 4:20 am
Posts: 16
Here Is The Picture and You Djudj:


Attachments:
Sans titre.png
Sans titre.png [ 137.27 KiB | Viewed 1593 times ]


Last edited by robocop on Mon Apr 02, 2018 6:12 pm, edited 1 time in total.
Top
 Profile  
 
PostPosted: Mon Apr 02, 2018 2:55 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20688
Location: NE Indiana, USA (NTSC)
Does the startup code wait for vblank twice before calling main()?

Why are there braces around the TEXT string?

Have you looked at the assembly language output that the C compiler is generating?


Top
 Profile  
 
PostPosted: Mon Apr 02, 2018 3:04 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10914
Location: Rio de Janeiro - Brazil
It doesn't look like you're initializing e attribute tables either, so there are no guarantees that the first palette is bring used where the text is.


Top
 Profile  
 
PostPosted: Mon Apr 02, 2018 6:17 pm 
Offline

Joined: Mon Apr 02, 2018 4:20 am
Posts: 16
tepples wrote:
Does the startup code wait for vblank twice before calling main()?

Why are there braces around the TEXT string?

Have you looked at the assembly language output that the C compiler is generating?

Here Is The Source I Get It:
https://nesdoug.com/2015/11/17/3-our-first-program/


Top
 Profile  
 
PostPosted: Mon Apr 02, 2018 6:27 pm 
Offline
User avatar

Joined: Sun Dec 12, 2010 10:27 pm
Posts: 324
Location: Hong Kong
Have you included appropriate CHR data into the ROM? If there are no graphics data, there will be no... graphics, i.e. no text can be seen.


Top
 Profile  
 
PostPosted: Mon Apr 02, 2018 6:55 pm 
Online
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2308
Location: DIGDUG
Post the ROM, should be easy to diagnose.

Quote:
Does the startup code wait for vblank twice before calling main()?

Why are there braces around the TEXT string?


See...comments like this make me think that nobody has actually reviewed the code on my blog. There are probably 1000 non-standard things that I am doing that people should notify me about.

Every example code needs a good rewriting. One day.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Mon Apr 02, 2018 11:07 pm 
Offline

Joined: Mon Apr 02, 2018 4:20 am
Posts: 16
Gilbert wrote:
Have you included appropriate CHR data into the ROM? If there are no graphics data, there will be no... graphics, i.e. no text can be seen.

How ????? Give Me The Way.


Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 1:14 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1783
Location: Gothenburg, Sweden
in most assemblers, you simply write .incbin filename.chr or .bin filename.chr in the appropriate place.

idk what this program is using though. Looks like it might have some GUI going on.. maybe there’s an import chr button or something

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 2:37 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3640
Location: Mountain View, CA
I downloaded lesson1.zip and took a peek. I don't know how this would work exactly with Visual Studio because I'm not familiar with that. There is a general Makefile (GNU-ish, sort of), and also a compile.bat. It appears to have reliance on the cc65 suite and nes.lib. There is indeed a nes.cfg (for ld65). There is a bunch of assembly code also involved. There is an 8kByte .chr file called Alpha.chr that appears to be a basic alphabet, ASCII-mapped.

nes.cfg contains the below (comments removed for brevity):

Code:
MEMORY {
    ZP: start = $00, size = $100, type = rw, define = yes;
   OAM1: start = $0200, size = $0100, define = yes;
   RAM: start = $0300, size = $0400, define = yes;
    HEADER: start = $0, size = $10, file = %O ,fill = yes;
    PRG: start = $c000, size = $3ffa, file = %O ,fill = yes, define = yes;
    VECTORS: start = $fffa, size = $6, file = %O, fill = yes;
    CHR: start = $0000, size = $2000, file = %O, fill = yes;
}

SEGMENTS {
    HEADER:   load = HEADER,         type = ro;
    STARTUP:  load = PRG,            type = ro,  define = yes;
    LOWCODE:  load = PRG,            type = ro,                optional = yes;
    INIT:     load = PRG,            type = ro,  define = yes, optional = yes;
    CODE:     load = PRG,            type = ro,  define = yes;
    RODATA:   load = PRG,            type = ro,  define = yes;
    DATA:     load = PRG, run = RAM, type = rw,  define = yes;
    VECTORS:  load = VECTORS,        type = rw;
    CHARS:    load = CHR,            type = rw;
    BSS:      load = RAM,            type = bss, define = yes;
    HEAP:     load = RAM,            type = bss, optional = yes;
    ZEROPAGE: load = ZP,             type = zp;
    ONCE:     load = PRG,            type = ro,  define = yes;
}

FEATURES {
    CONDES: segment = INIT,
        type = constructor,
        label = __CONSTRUCTOR_TABLE__,
        count = __CONSTRUCTOR_COUNT__;
    CONDES: segment = RODATA,
        type = destructor,
        label = __DESTRUCTOR_TABLE__,
        count = __DESTRUCTOR_COUNT__;
    CONDES: type = interruptor,
        segment = RODATA,
        label = __INTERRUPTOR_TABLE__,
        count = __INTERRUPTOR_COUNT__;
}

SYMBOLS {
    __STACKSIZE__: type = weak, value = $0100;
   __STACK_START__: type = weak, value = $700;
}

reset.s contains this, which comes after .segment "VECTORS"; rest of the assembly code omitted for brevity:

Code:
.segment "CHARS"

   .incbin "Alpha.chr"


Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 7:22 am 
Offline

Joined: Mon Apr 02, 2018 4:20 am
Posts: 16
koitsu wrote:
I downloaded lesson1.zip and took a peek. I don't know how this would work exactly with Visual Studio because I'm not familiar with that. There is a general Makefile (GNU-ish, sort of), and also a compile.bat. It appears to have reliance on the cc65 suite and nes.lib. There is indeed a nes.cfg (for ld65). There is a bunch of assembly code also involved. There is an 8kByte .chr file called Alpha.chr that appears to be a basic alphabet, ASCII-mapped.

nes.cfg contains the below (comments removed for brevity):

Code:
MEMORY {
    ZP: start = $00, size = $100, type = rw, define = yes;
   OAM1: start = $0200, size = $0100, define = yes;
   RAM: start = $0300, size = $0400, define = yes;
    HEADER: start = $0, size = $10, file = %O ,fill = yes;
    PRG: start = $c000, size = $3ffa, file = %O ,fill = yes, define = yes;
    VECTORS: start = $fffa, size = $6, file = %O, fill = yes;
    CHR: start = $0000, size = $2000, file = %O, fill = yes;
}

SEGMENTS {
    HEADER:   load = HEADER,         type = ro;
    STARTUP:  load = PRG,            type = ro,  define = yes;
    LOWCODE:  load = PRG,            type = ro,                optional = yes;
    INIT:     load = PRG,            type = ro,  define = yes, optional = yes;
    CODE:     load = PRG,            type = ro,  define = yes;
    RODATA:   load = PRG,            type = ro,  define = yes;
    DATA:     load = PRG, run = RAM, type = rw,  define = yes;
    VECTORS:  load = VECTORS,        type = rw;
    CHARS:    load = CHR,            type = rw;
    BSS:      load = RAM,            type = bss, define = yes;
    HEAP:     load = RAM,            type = bss, optional = yes;
    ZEROPAGE: load = ZP,             type = zp;
    ONCE:     load = PRG,            type = ro,  define = yes;
}

FEATURES {
    CONDES: segment = INIT,
        type = constructor,
        label = __CONSTRUCTOR_TABLE__,
        count = __CONSTRUCTOR_COUNT__;
    CONDES: segment = RODATA,
        type = destructor,
        label = __DESTRUCTOR_TABLE__,
        count = __DESTRUCTOR_COUNT__;
    CONDES: type = interruptor,
        segment = RODATA,
        label = __INTERRUPTOR_TABLE__,
        count = __INTERRUPTOR_COUNT__;
}

SYMBOLS {
    __STACKSIZE__: type = weak, value = $0100;
   __STACK_START__: type = weak, value = $700;
}

reset.s contains this, which comes after .segment "VECTORS"; rest of the assembly code omitted for brevity:

Code:
.segment "CHARS"

   .incbin "Alpha.chr"

I just Chenged The Name Of The Project and the path.
look the message that is sho it to me.


Attachments:
Sans titre.png
Sans titre.png [ 154.87 KiB | Viewed 1414 times ]
Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 7:55 am 
Online
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2308
Location: DIGDUG
LD65 error, line 72 of nes.cfg, attribute expected.

They changed cc65/ld65 at some point, and I had to update the linker file (nes.cfg). Are you sure you are using the most recent version of my code?

Anyway...the attribute that was missing was something like "value = $100"...I can't remember since I didn't save a copy of the oldest version of lesson1 (the older version allowed something like "start = $100" maybe).

Also, I changed __STACK_SIZE__ to __STACKSIZE__. I don't know if this is related, but that is what's located at line 72

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Last edited by dougeff on Tue Apr 03, 2018 7:59 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 7:59 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1783
Location: Gothenburg, Sweden
According to the reference,

defined symbols only need to have a type (it's mandatory), but if the type is weakor export it also needs a value.

the lesson1.zip that was linked contains the following:
Code:
SYMBOLS {
    __STACKSIZE__: type = weak, value = $0100;     # 1 page stack
   __STACK_START__: type = weak, value = $700;
}


which should be correct, unless something else has changed and they forgot to update the reference guide.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 8:14 am 
Offline

Joined: Mon Apr 02, 2018 4:20 am
Posts: 16
FrankenGraphics wrote:
According to the reference,

defined symbols only need to have a type (it's mandatory), but if the type is weakor export it also needs a value.

the lesson1.zip that was linked contains the following:
Code:
SYMBOLS {
    __STACKSIZE__: type = weak, value = $0100;     # 1 page stack
   __STACK_START__: type = weak, value = $700;
}


which should be correct, unless something else has changed and they forgot to update the reference guide.

the probleme is not in c code it's in the bat file.


Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 8:18 am 
Online
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2308
Location: DIGDUG
I just told you where the problem is.

nes.cfg, line 72. attribute expected.


EDIT.
Quote:
I just Chenged The Name Of The Project and the path.


Perhaps you have 2 versions of cc65 on your machine, and changing the path redirected it to the other version. See my comment just above about ld65 changed and I had to rewrite the linker file (nes.cfg)

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Tue Apr 03, 2018 9:40 am 
Offline

Joined: Mon Apr 02, 2018 4:20 am
Posts: 16
dougeff wrote:
I just told you where the problem is.

nes.cfg, line 72. attribute expected.


EDIT.
Quote:
I just Chenged The Name Of The Project and the path.


Perhaps you have 2 versions of cc65 on your machine, and changing the path redirected it to the other version. See my comment just above about ld65 changed and I had to rewrite the linker file (nes.cfg)

Ok When You Chenge It Just Type It Here In The Topic.
Thanx.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 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