Re: [cc65] a question about the write function

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2007-02-12 20:36:40
Hi!

On Mon, Feb 12, 2007 at 01:26:50PM -0500, Jac Ato wrote:
> Still does not work. Here is the log from fceuxdsp, my debugger, and
> that's using sprintf. I thought that they would be using the same
> calling methods, which they do.
>
> $84B8:88        DEY                        A:00 X:60 Y:01 P:nvubdIZC
> $84B9:A5 0C     LDA $000C = #$06           A:00 X:60 Y:00 P:nvubdIZC
> $84BB:91 02     STA ($02),Y @ $07DC = #$06 A:06 X:60 Y:00 P:nvubdIzC
> $84BD:20 00 60  JSR $6000                  A:06 X:60 Y:00 P:nvubdIzC
> $6000:01 01     ORA ($01,X) @ $0000 = #$00 A:06 X:60 Y:00 P:nvubdIzC
> $6002:01 00     ORA ($00,X) @ $0000 = #$00 A:06 X:60 Y:00 P:nvubdIzC
>
> The culprit here is JSR $6000. As I said before, this corresponds to
> the calloutfunc. Did anyone checked this out before?

What about other programs, do they work? CallOutFunc is just a jmp instruction
in the data segment (because it is modified at runtime). It looks like this:

-----------------------------------------------------------------------------
.data

; Stuff from OutData. Is used as a vector and must be aligned
CallOutFunc:    jmp     $0000
-----------------------------------------------------------------------------

Since the contents of CallOutFunc on your system seems to be $01/$00/$??,
while the source says it should be $20/$00/$00, the file is either not loaded
correctly, or the data gets corrupted at runtime.

Please check that simple programs accessing data load and run correctly. The
nes.cfg file says that an "additional 8K SRAM bank" is located at $6000. Is
this RAM present in your system? If not, you have to use a modified linker
config.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Feb 12 20:36:55 2007

This archive was generated by hypermail 2.1.8 : 2007-02-12 20:36:58 CET