Hey peepz!
Is it possible to put multiple games of 1 mapper on a board? maybe by switching it.
If so, must I use seperate eproms for each game?
or is it possibe to create a menu or something?
downloader wrote:
Is it possible to put multiple games of 1 mapper on a board? maybe by switching it.
Sure is. Wire the switch to the high address bits of the PRG and CHR memories.
Quote:
or is it possibe to create a menu or something?
Yes. Use a latch as your switch, put in a decoder that allows writes to a specific CPU address to write to the latch, set the power up state of the latch to point to your menu, and then have the menu code write to the latch before starting the game. The last step will have to be done from code in RAM because a bank switch takes effect immediately; it might look like this:
Code:
latch = $5FFF
:
ldx #5
lda code_for_7F0,x
sta $07F0,x
dex
bpl :-
lda chosenGame
jmp $07F0
code_for_7F0:
sta latch
jmp ($FFFC) ; simulate reset
What games were you planning on putting in the cart?
no clue yet, but I just want to know if it was possible
thanx for the info man!
Wouldn't it be fairly simple to write a rom image maker that would take the given roms, and auto create the menu code for them, combining them into the binaries for burning/flashing?
Not sure if something like that exists yet or not, but it seems like it should by now
Not if the menu code is supposed to reside in (one of) the game banks; an unintelligent program can't tell usable empty space from data.
kyuusaku wrote:
Not if the menu code is supposed to reside in (one of) the game banks; an unintelligent program can't tell usable empty space from data.
It doesn't take much intelligence to
- discover a huge block of $00 00 00 00 or $FF FF FF FF in the PRG and CHR of some larger (MMC1/MMC3 class) game, or
- create a new bank of all empty space and shove the menu in there, such that a 15-in-1 would have 15 games and one menu.
Yeah, I figured dedicating 1 bank just for the menu, suppose that'd be a waste of space in some (or many) instances though
What about physical switches?
-Rob
rbudrick wrote:
What about physical switches?
-Rob
Well..
tepples wrote:
downloader wrote:
Is it possible to put multiple games of 1 mapper on a board? maybe by switching it.
Sure is. Wire the switch to the high address bits of the PRG and CHR memories.
I think I would use a physical switch.
I think that would be the easy way for me.
I don't know JACK about programming a menu (assembling isn't my strong pint ya know)
Physical switching is possible. I played around with it a little and in theory it should work.
tepples wrote:
kyuusaku wrote:
Not if the menu code is supposed to reside in (one of) the game banks; an unintelligent program can't tell usable empty space from data.
It doesn't take much intelligence to
- discover a huge block of $00 00 00 00 or $FF FF FF FF in the PRG and CHR of some larger (MMC1/MMC3 class) game, or
- create a new bank of all empty space and shove the menu in there, such that a 15-in-1 would have 15 games and one menu.
But it would then require user intervention to verify that the space is acceptible since the game may not like this "empty" space to be altered.
Also what if a bank really doesn't have empty space? There's a good chance that the game will initialize to that bank and won't have the routine to switch to the menu. In this case, space will have to be made--that's a lot of intelligence IMO.
gannon wrote:
rbudrick wrote:
What about physical switches?
-Rob
Well..
tepples wrote:
downloader wrote:
Is it possible to put multiple games of 1 mapper on a board? maybe by switching it.
Sure is. Wire the switch to the high address bits of the PRG and CHR memories.
Oh, ok sorry. I must have misunderstood. Reminds me of those old pirate VCS carts with something like 1 to 8 switches on them (or maybe 1 to 4...not sure if I've ever seen one with more than 4, to be honest) to switch banks.
-Rob
To answer your question about spereate EPROMS. It would be a lot easier to just use on e big one for the PRG and one more for the CHR ROM.
If you do go with DIP switches or something similar, you should consider having the switch for the CHR bank seperate from the cart via a ribbon cable or something. Then you could swap out the different CHR blocks while playing the game. Granted they probably won't line up to well, but it would be ammusing none the less.
As for wiring up the switches, it's quite easy. Say you have 4 games each using 32KB of PRG ROM. The ROM gets hooked up just like it were one game. Except the extra 2 address lines (A15 and A16) would go to your switch.
If the games you want to combine are different sizes, you can either just put each game in a block size equal to the biggest or have an extra switch. As cheap as ROM's are I would recommend just wasting the memory space so you can keep the circuit simple.
How would such a switch actually work? It would be used to set or clear a bit in one of the higher address lines, right? Would you do that by selecting between connecting GND or +5V to it?
tokumaru wrote:
How would such a switch actually work? It would be used to set or clear a bit in one of the higher address lines, right? Would you do that by selecting between connecting GND or +5V to it?
Yes. 2 different ways to do it come to mind.
1. SPDT switch (3 pins), obvious way to select address between GND and 5V.
2. SPST switch (2 pins) + 10kOhm resistor (or similar). 5V connects to the address pin through the resistor. Other end of the switch connects to GND.
i'll go for the 3 pins option.
middle pin connected to gnd.
left pin to 5v on 1 rom.
right pin to 5 volt on rom 2.
downloader wrote:
i'll go for the 3 pins option.
middle pin connected to gnd.
left pin to 5v on 1 rom.
right pin to 5 volt on rom 2.
Did you mean middle pin connected to +5V source? I hope you're not planning on using the switch to pull the ROM supply voltage to GND.
Also something to consider is making sure the switch you use is a break before make type. You don't want to power up both ROM's at the same time when switching between the two.
Well....what pin would you connect where?
downloader wrote:
Well....what pin would you connect where?
You should be pulling whichever ROM's
address lines or
chip/output* enable to specific states.
If you're going to put all of the games on a single ROM chip (which is recommended, since otherwise your cartridge board will be huge), you'll want switches to pull the ROM's upper address lines (A15+ if each game is 32K, A18+ if each game is 256K, etc.) to either +5V or GND; if you use one ROM for each game, then you'll want a switch to pull one ROM's enable to GND and pull all of the others to +5V (since enables tend to be active low).
* Generally, NES carts tie one enable to GND always and connect the other one to /(A15 & M2) - whichever one isn't connected to the cart edge/mapper can be hooked up to your switches.
Or if you mean what pin of the switch, check it's datasheet (or better yet, verify it with a multimeter).
Personally if I was gonna do it I'd use a DIP-switch and mount it with resistors on a little universal PCB (like the little ones they've got at Radio Shack - almost the only part for a decent price there..). I guess it depends on how many games you'll have on it though. Having a bunch of individual switches hanging by wires would be kinda messy. 32 NROM games on a 1Mbyte EPROM would use 5 switches.
Im still confused on this. Im planning on putting 2 smb1 hacks on same eprom. The only difference between the 2 will be the graphics for the same hack, so i plan to use a 27c256 for the prg. I also plan on using same for chr but only because thats what I have already ordered.
So let me see if I got this part right for the chr, which i have two different ones.
copy /b original.chr+originaltoo.chr+edit.chr+edittoo.chr chr.bin
For the switch I plan on using a DPDT latching push button because i already have some. This where I get confused. What goes to what pin on 256 eprom and switch and 128 eprom in cass I get some?
27C64/128/256/512 EPROM pinout
---_---
+5V- |01 28| - +5V
A12 - |02 27| - A14
[PGM] A7 - |03 26| - A13
[NC] A6 - |04 25| - A8
A5 - |05 24| - A9
A4 - |06 23| - A11
A3 - |07 22| - /OE
A2 - |08 21| - A10
A1 - |09 20| - /CE
A0 - |10 19| - D7
D0 - |11 18| - D6
D1 - |12 17| - D5
D2 - |13 16| - D4
GND - |14 15| - D3
-------
The switch will only change the CHR then? SMB1 is NROM, meaning it has 8KB CHR-ROM, so a 16KB EPROM (27c128) would be enough, but you can use a 32KB one without problems.
13 address lines are necessary to address 8KB, so A0 to A12 should be soldered to the board normally. A14 (if you're using a 32KB chip) should be soldered to GND, because you'll not be using the upper half of the chip. A13 goes to the switch, which will select between connecting it to GND or +5V.
Yeah just don't get confused about CHR A13 from the NES cart edge. It still goes to the rom's /CE line. Like tokumaru said the rom's A13 goes to your switch.
Ok let me see if i got this. Bend up A13, pin 26, and solder every thing else like normal. Wire A13 to center of switch. Wire left to +5v, pin 1 or 28. And right to GRD, pin 14. Still new to this and dont really comprehend all it yet so forgive me if i totally screwed that up.
The way you're copying the data, if you switch A13 and ground A14, you'll always select the first ROM. You'd better copy the ROMs in alternating order, or put the switch on A14 instead.
Memblers wrote:
The way you're copying the data, if you switch A13 and ground A14, you'll always select the first ROM.
What? I don't see it...
tokumaru wrote:
Memblers wrote:
The way you're copying the data, if you switch A13 and ground A14, you'll always select the first ROM.
What? I don't see it...
Quote:
So let me see if I got this part right for the chr, which i have two different ones.
copy /b original.chr+originaltoo.chr+edit.chr+edittoo.chr chr.bin
When A14 is low he's have the original, when it's high he'd have the edit. If he grounds A14 he'll only get the original .chr.
Ah, I didn't see he was copying the files like that. Yeah, if you ground A14 and switch A13 you have to copy the files like original.chr + edit.chr + whatever + whatever. I suggested it like that because he considered using a 16KB EPROM, in which case it would just go original.chr + edit.chr and A14 wouldn't even exist.
downloader wrote:
I think I would use a physical switch.
I think that would be the easy way for me.
I don't know JACK about programming a menu (assembling isn't my strong pint ya know)
Physical switching is possible. I played around with it a little and in theory it should work.
If you want a easy example, Try out No Carrier's 9999-in-1 (3-in-1) example on how to make a menu.
Hamtaro126 wrote:
If you want a easy example, Try out No Carrier's 9999-in-1 (3-in-1) example on how to make a menu.
You could easily hack the game to CNROM and do something stupidly easy like selecting a CHR bank based on whether A is pressed during power on (e.g. when A is pressed switch to the second tileset, otherwise use the first). This would only require a very minor hack to the reset routine.
Think I got it. Do everthing like I last posted, but do the below instead of what i previously thought.
copy /b original.chr+edit.chr+8KB.chr+8KB.chr chr.bin
To have it like an easter egg, I would love to be able to hack it to CNROM and have it swap to alternate chr bank due to button press on start up but believe thats out my league for now.
Yeah, you got it.
proveaux wrote:
I would love to be able to hack it to CNROM and have it swap to alternate chr bank due to button press on start up but believe thats out my league for now.
This is not that hard, really. You need to find some free room (if I counted right, you'll need 23 bytes) where you can insert the following code (or similar):
Code:
lda #$01
sta $4016
lsr
sta $4016
lda $4016
and #%0000001
tax
sta table, x
jmp $XXXX
table:
.db $00, $01
This reads the status of the A button and uses it to activate CHR bank 0 or 1. With this code in place, you have to call it somehow, before the game displays any graphics. The best thing to do is look for a JMP or JSR instruction near the beginning of the program and modify the target address so that this function is called instead, and then you put the address you replaced in the "$XXXX" part of this code. This will briefly hijack the program in order to perform the switch, but it will resume without problems because of the JMP $XXXX instruction.
Yep thats definitely more than I know how to do. I wouldnt even know where to start. I'm just a mediocre hex editor.
After checking out my hack of the hack I did it looks like I will need to copy the edited prg to the original and use a 27c512 eprom. Since I'm using a DPDT switch I'm guessing I wire the prg side of the switch the same as the chr side but where does the center need to go?
proveaux wrote:
I'm just a mediocre hex editor.
But this is basically just hex editing that sequence of instructions into the ROM. =)
Quote:
Since I'm using a DPDT switch I'm guessing I wire the prg side of the switch the same as the chr side but where does the center need to go?
A15 of the PRG-ROM.
Thanks for all your help! Seems to be working great.