It is currently Mon Nov 19, 2018 1:54 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 1452 posts ]  Go to page Previous  1 ... 93, 94, 95, 96, 97
Author Message
PostPosted: Mon Apr 16, 2018 10:56 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10974
Location: Rio de Janeiro - Brazil
Even when using CHR-ROM, addresses $0000-$1FFF can be used to READ from the pattern tables, as some NROM and CNROM games did back in the day. Since these games had very limited PRG-ROM space, they used some of the CHR-ROM space to hold data.


Top
 Profile  
 
PostPosted: Mon Apr 16, 2018 2:28 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 940
Location: cypress, texas
tokumaru wrote:
Even when using CHR-ROM, addresses $0000-$1FFF can be used to READ from the pattern tables, as some NROM and CNROM games did back in the day. Since these games had very limited PRG-ROM space, they used some of the CHR-ROM space to hold data.
That's really cool! Thank you for sharing, tokumaru! :D

I never thought of doing that :oops:; but, was pondering if we could somehow transfer bank15 from ROM to CHR-RAM to bank!15, our 15th bank if the P bit is set inside "CHR bank 0" (using SXROM), in ROM; but, that's not possible, I think, because ROM can only be set during assembly and RAM must be set after assembly.

There isn't ever a time when one could make a transfer from RAM to ROM. Remember learning that earlier in this thread, I think. :)


Top
 Profile  
 
PostPosted: Mon Apr 16, 2018 3:48 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20783
Location: NE Indiana, USA (NTSC)
unregistered wrote:
There isn't ever a time when one could make a transfer from RAM to ROM.

True of mask ROM, false of flash memory. Some recent homebrew games, such as Study Hall, save by writing back to flash instead of using battery RAM.


Top
 Profile  
 
PostPosted: Mon Apr 30, 2018 10:35 am 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 940
Location: cypress, texas
Trying to use a signed comparison because a part of our game needs one, I believe; my question, after reading this really helpful page, is: is the SO pin free from connections to it in our game?

After using bvs in our game before and it, our game, working just fine on the powerpack, it seems to me that the 6502.org article, linked above, is talking about editing other already-created games. :?


Top
 Profile  
 
PostPosted: Mon Apr 30, 2018 10:38 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7720
Location: Seattle
unregistered wrote:
Trying to use a signed comparison because a part of our game needs one, I believe; my question, after reading this really helpful page, is: is the SO pin free from connections to it in our game?
Yes, the SO pin is floating inside the 2A03. (Visual2A03 node 11246)


Top
 Profile  
 
PostPosted: Mon Apr 30, 2018 2:41 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 940
Location: cypress, texas
Thanks lidnariq! :) So there must be different 2A03s inside NESes? Or did 6502.org make that 5.2 section for people who attach things to the SO pin? Well, that pin is inside the 2A03 chip... so maybe I'll go research this on my own so my questions aren't rediculous. :)


Top
 Profile  
 
PostPosted: Mon Apr 30, 2018 2:51 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20783
Location: NE Indiana, USA (NTSC)
The 2A03 contains a second source 6502, a PSG, and a primitive DMA controller. The SO pin of the 6502 in the 2A03 isn't connected to anything.


Top
 Profile  
 
PostPosted: Mon Apr 30, 2018 3:13 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 940
Location: cypress, texas
tepples wrote:
The 2A03 contains a second source 6502, a PSG, and a primitive DMA controller. The SO pin of the 6502 in the 2A03 isn't connected to anything.
Thank you so much tepples! That's excellent! It's great to not have to worry about the SO pin! :mrgreen: :D Learned from this wikipedia page that the SO pin is at the upper right corner of the 6508 chip... and so that's what it means to connect something to the pin. :idea: Thank you lidnariq and tepples for helping my small understanding of the SO pin. :)

edit: It is also nice to understand that 6502.org explains about 6502 chips used in many different types of machines. And that the NES's 2A03 is a unique 6502-based chip. :)


Top
 Profile  
 
PostPosted: Thu May 24, 2018 11:14 am 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 940
Location: cypress, texas
Just trying to get a variable to display in hex format using the Lua Script Window of Mesen. After some searching I discovered that C functions can be used in Lua and that I would need to use a C function to convert the integer to hex format. And after opening a pdf titled libc.pdf pages 286-290 showed me that printf can transform integers into hex formated numbers. (I've never used C or Lua before; well, played with Lua yesterday.) My Lua file says something that includes:
Code:
altoX = emu.readWord(0x0038, emu.memaType.cpuDebug)
emu.drawString(12, 30, "38 | altoX: " .. printf("%4X"), 0xFFFFFF, 0xFF000000, 1)
It says:
Quote:
Loading script...
Script loaded successfully.
MemDisplay00.lua:16: attempt to call a nil value (global 'printf')
etc.
Did try to add int before the text on the line where altoX was assigned but, received an error. Please help me; I don't know how to make this work. :?


Top
 Profile  
 
PostPosted: Thu May 24, 2018 11:18 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 3138
Location: Tampere, Finland
You'll want to use string.format (e.g., string.format("%4X", 1234))

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi


Top
 Profile  
 
PostPosted: Thu May 24, 2018 1:47 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 940
Location: cypress, texas
Thank you so much thefox! :mrgreen: :D Replacing printf("%4X") with string.format("%4.4X", altoX) caused the 80 to be preceeded by 00 (for the high byte)! Precision is so cool! (When our game starts she is at 0080 and that's what it shows. :))


Top
 Profile  
 
PostPosted: Thu Oct 11, 2018 1:04 pm 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 940
Location: cypress, texas
Kasumi in the middle of page 67 wrote:
Anytime you add a number and result would have been greater than the byte can hold, the carry is set. Otherwise it is cleared.
I realize now that you were talking about addition, but wouldn't the carry always be affected after subtraction too?

If so, since the carry flag is affected by cpx, why does cpx #00 not clear the carry... ohh, think I get it now... you would say, "Anytime you subtract a number and the result would have been less than the byte can hold, the carry is cleared. Otherwise it is set." That seems correct to me. I'm so happy now!! :mrgreen: :D


edit: Kasumi already answered this in the same post in page 67:
Kasumi wrote:
1. The carry is ALWAYS taken into account when you use adc or sbc, so make sure it's right for the operation you intend to do before that operation runs. (Clear before addition, set before subtraction)
2. The carry will become the opposite of what you would normally initialize it to if the operation goes outside the boundaries of a byte. (So if an addition would have yielded more than 255, or a subtraction would have yielded less than 0.) Otherwise, the carry becomes what you would normally initialize it to.
:oops:


final-edit: highlighted most important part of quote. | 20181012: corrected 69 to 67 :oops:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1452 posts ]  Go to page Previous  1 ... 93, 94, 95, 96, 97

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 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:  
cron
Powered by phpBB® Forum Software © phpBB Group