NES Rom File Don't Show The Text.

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

robocop
Posts: 16
Joined: Mon Apr 02, 2018 4:20 am

NES Rom File Don't Show The Text.

Post by robocop »

Here Is The Picture and You Djudj:
Attachments
Sans titre.png
Last edited by robocop on Mon Apr 02, 2018 6:12 pm, edited 1 time in total.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: NES Rom File Don't Show The Text.

Post by tepples »

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?
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: NES Rom File Don't Show The Text.

Post by tokumaru »

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.
robocop
Posts: 16
Joined: Mon Apr 02, 2018 4:20 am

Re: NES Rom File Don't Show The Text.

Post by robocop »

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/
User avatar
Gilbert
Posts: 564
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: NES Rom File Don't Show The Text.

Post by Gilbert »

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.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: NES Rom File Don't Show The Text.

Post by dougeff »

Post the ROM, should be easy to diagnose.
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
robocop
Posts: 16
Joined: Mon Apr 02, 2018 4:20 am

Re: NES Rom File Don't Show The Text.

Post by robocop »

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.
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: NES Rom File Don't Show The Text.

Post by FrankenGraphics »

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
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: NES Rom File Don't Show The Text.

Post by koitsu »

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: Select all

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: Select all

.segment "CHARS"

	.incbin "Alpha.chr"
robocop
Posts: 16
Joined: Mon Apr 02, 2018 4:20 am

Re: NES Rom File Don't Show The Text.

Post by robocop »

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: Select all

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: Select all

.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
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: NES Rom File Don't Show The Text.

Post by dougeff »

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
Last edited by dougeff on Tue Apr 03, 2018 7:59 am, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
User avatar
FrankenGraphics
Formerly WheelInventor
Posts: 2064
Joined: Thu Apr 14, 2016 2:55 am
Location: Gothenburg, Sweden
Contact:

Re: NES Rom File Don't Show The Text.

Post by FrankenGraphics »

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: Select all

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.
robocop
Posts: 16
Joined: Mon Apr 02, 2018 4:20 am

Re: NES Rom File Don't Show The Text.

Post by robocop »

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: Select all

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.
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: NES Rom File Don't Show The Text.

Post by dougeff »

I just told you where the problem is.

nes.cfg, line 72. attribute expected.


EDIT.
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
robocop
Posts: 16
Joined: Mon Apr 02, 2018 4:20 am

Re: NES Rom File Don't Show The Text.

Post by robocop »

dougeff wrote:I just told you where the problem is.

nes.cfg, line 72. attribute expected.


EDIT.
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.
Post Reply