Hi John West , you made things very easy for me to understand
Actually , mapping that way is awesome , though it shows some errors
I am sure the general idea is fine , you've gave me the proper method
I made some modifications as bellow :
header=(uint8_t*)malloc(0x10); // header of the Nes file ...
Search found 14 matches
- Wed May 12, 2021 2:50 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
- Tue May 11, 2021 9:13 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
Is there a common way to map the prg-rom ?
the following method works fine for the beginning of the buffer , but it doesn't give the right values at the end of the buffer
the following method works fine for the beginning of the buffer , but it doesn't give the right values at the end of the buffer
Code: Select all
fread (0xC000+buffer,sizeof(unsigned char),24592,fp);- Tue May 11, 2021 3:53 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
If the disassembler tells you that the program code begins at C000, it's because it is smart enough to read the two bytes at FFFC.
In the *.nes file, the 16 byte header is followed directly by the 16k PRG ROM, and you'll see towards the end of that 16k ROM the bytes
ffff ffff ffff ffff ff40 c0c0 ...
In the *.nes file, the 16 byte header is followed directly by the 16k PRG ROM, and you'll see towards the end of that 16k ROM the bytes
ffff ffff ffff ffff ff40 c0c0 ...
- Tue May 11, 2021 12:23 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
I am sure you are all completely right , the problem is that I am new to that stuff
I just cant understand why the disassembler gives me these results
may I ask you guys to have a look at that page and tell me if its any good ?
https://xem.github.io/nes/
I have attached the rom I am working on ...
I just cant understand why the disassembler gives me these results
may I ask you guys to have a look at that page and tell me if its any good ?
https://xem.github.io/nes/
I have attached the rom I am working on ...
- Tue May 11, 2021 10:55 am
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
What's the problem? You already have the answer in this thread.
You've mentioned that the reset-vector at $FFFC
but it was at $C000 according to the disassembler I've used
It's location is vary , each nes file has it's own location for it , and some are equal
I have to find a formula to find it ...
- Mon May 10, 2021 8:23 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
Thanks guys for your explanations
I make my conclusions as the following :
1. The 16 bytes of Nes header contains some information about the nes file (size of prg-rom , size of chr-rom , mappers , ...)
2. reset vector location is vary (I have no idea how to make my emulator get it)
3. prg-rom ...
I make my conclusions as the following :
1. The 16 bytes of Nes header contains some information about the nes file (size of prg-rom , size of chr-rom , mappers , ...)
2. reset vector location is vary (I have no idea how to make my emulator get it)
3. prg-rom ...
- Sun May 09, 2021 8:25 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
The same data has to appear twice in the memory map, because that's how the machine works.
You are right
I have used a simple disassembler on my .nes file , I found the following :
Mapper
-------------------------------
NMI vector $C0C0
Reset vector $C000
IRQ vector $FFF9 ...
You are right
I have used a simple disassembler on my .nes file , I found the following :
Mapper
-------------------------------
NMI vector $C0C0
Reset vector $C000
IRQ vector $FFF9 ...
- Sun May 09, 2021 7:04 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
Hi BigEd
1. What I can understand of that is :
the 16k prog. data will start at $8000 and end at $C000
2. is the meaning of map it
put it at a new addresses ranges which are ($8000 - $C000) to be suitable for the 6502 nes system ?
Quote:
- 16k of program data to be mapped at $8000 and also at $C000
the 16k prog. data will start at $8000 and end at $C000
2. is the meaning of map it
put it at a new addresses ranges which are ($8000 - $C000) to be suitable for the 6502 nes system ?
- Sun May 09, 2021 5:00 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
BigEd wrote:
Hmm, what did you make of my message mentioning the PRG and CHR ROMs?
but I can't figure how a rom ends with address $6000, can be addressed with range $8000 and $c000 !
- Sun May 09, 2021 1:56 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
Hi Martin
your explanation is interested
is that the way how emulators get the start address of the program ?
I am currently working on a (mapper 0) rom , (no mapper ,no scrolling right now)
I just need to start with a simple emulator (currently the CPU)
I am still confused how addresses like ...
your explanation is interested
is that the way how emulators get the start address of the program ?
I am currently working on a (mapper 0) rom , (no mapper ,no scrolling right now)
I just need to start with a simple emulator (currently the CPU)
I am still confused how addresses like ...
- Sun May 09, 2021 9:50 am
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
JimBoyd wrote:
Hexadecimal $C000 = 49152 decimal.
Hexadecimal $C0000 = 786432 decimal.
Hexadecimal $C0000 = 786432 decimal.
- Sat May 08, 2021 9:37 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
I am using a C compiler to read the entire rom inside a buffer byte array as the following :
rom = (unsigned char*) malloc (sizeof(unsigned char)*64001); // allocate enough space
fread (rom,sizeof(unsigned char),24592,fp); //
I checked my array compared to the hex editor , and it's fine , both are ...
rom = (unsigned char*) malloc (sizeof(unsigned char)*64001); // allocate enough space
fread (rom,sizeof(unsigned char),24592,fp); //
I checked my array compared to the hex editor , and it's fine , both are ...
- Sat May 08, 2021 9:19 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Re: Nes 6 kb rom program address ?
Thanks for welcoming me :)
you are right
I opened it with a hex viewer , last address was 6000 , but that is in hexadecimal !
then it should be 24576 bytes , windows explorer says it is 24.0 KB (24,592 bytes)
I will check the link you've posted , I will be back soon , I need to ask some more ...
you are right
I opened it with a hex viewer , last address was 6000 , but that is in hexadecimal !
then it should be 24576 bytes , windows explorer says it is 24.0 KB (24,592 bytes)
I will check the link you've posted , I will be back soon , I need to ask some more ...
- Sat May 08, 2021 7:48 pm
- Forum: Newbies
- Topic: Nes 6 kb rom program address ?
- Replies: 29
- Views: 5497
Nes 6 kb rom program address ?
Hi everybody
I am new here
I am doing some basic work reading Nes rom , I've choosed a small size rom (Nuts & Milk) , which is 6000 bytes
I have read that the program's banks addresses are :
$8000 $4000 PRG-ROM
$C000 $4000 PRG-ROM
how that would be applicable on the rom I've mentioned above ?
any ...
I am new here
I am doing some basic work reading Nes rom , I've choosed a small size rom (Nuts & Milk) , which is 6000 bytes
I have read that the program's banks addresses are :
$8000 $4000 PRG-ROM
$C000 $4000 PRG-ROM
how that would be applicable on the rom I've mentioned above ?
any ...