PC Engine / TurboGrafx open bus

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
Post Reply
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

PC Engine / TurboGrafx open bus

Post by lidnariq »

In the "default" minimal memory map - no CD, no expansions - is most of the memory map open bus?

This page: http://www.archaicpixels.com/Memory_Map
says that the default HuCard enables its ROM whenever A20 is low (banks 0-$7F), and the TurboGrafx itself puts things in banks $F8-$FB and $FF. But what about all the other 123 banks? Are they just open bus, and a HuCard could safely map something there?
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: PC Engine / TurboGrafx open bus

Post by Pokun »

Anything that can be tested with an Everdrive?

Some HuCards do put stuff in blocks/banks besides ROM. The Arcade Card I/O blocks are in $40~$43 and Populous puts its 32 kB RAM somewhere there as well. Not sure where Ten no Koe BANK puts its RAM. I'm not aware of any HuCards putting anything past $7F though.



No idea if it's helpful in any way, but here is what the HuC6280 docs says about resetting:
System Resetting Procedure
(1) System can be reset by setting the /RESET input pin to "L" level. Returning the pin to "H"
level causes the system to start.
The "L" level applied to the pin must be a pulse which has a duration of at least 28 clock
cycles with the clock input at OSC 1 fully stabilized.
(2) Internal States after System Reset
When the system resumes after a reset, the program reads the low byte at physical address
001FFEh and the high byte at physical address 001FFFh, and starts.
A system reset causes the following internal states:
• Interrupt Disable (I) is set.
• The Decimal flag (D) is reset.
• "00h" is set in the MPR7 mapping register.
• The timer is stopped.
• The interrupt disable register is all reset.
• Timer Interrupt Request (TIQ) is reset.
• Low speed mode is set.
• "H" level is output to the output port (port O).
• The interrupt circuit is initialized.
• The Memory Operation flag (T) is reset.
• The ready state is cleared.
• "H" level is output to the /RD//WR pins.
• "L" level is output to the SYNC pin.
• Both the data bus and address bus provide invalid data.
• /CE7, /CEK, /CER and A20 provide invalid data.
Only one of these four pins produces "L" level.
• System clock is output to the SX pin.
• "L" level is output to the HSM pin.
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: PC Engine / TurboGrafx open bus

Post by turboxray »

lidnariq wrote: Wed Oct 21, 2020 8:24 pm In the "default" minimal memory map - no CD, no expansions - is most of the memory map open bus?

This page: http://www.archaicpixels.com/Memory_Map
says that the default HuCard enables its ROM whenever A20 is low (banks 0-$7F), and the TurboGrafx itself puts things in banks $F8-$FB and $FF. But what about all the other 123 banks? Are they just open bus, and a HuCard could safely map something there?
With no attachments, I believe so. And parts of $ff bank are open bus (arcade cards map their ports here). But yeah typical hucards restrict themselves to $00-$7f, but they are definitely not limited to that lower range.

Also just to note, hardware bank $ff doesn't need to be mapped to page $0000 (it can exists anywhere in the MMU registers) - only ram is mapped to page $2000, but you can map more than just system ram here. I've mapped SuperCD ram here too (as a make shift 'multiple stacks/zp' approach) - just don't map regular CDRAM (banks $80-87) there because for some reason it causes corruption to the ram (it could be that access to ZP range on the PCE is slightly faster/shorter bus cycle than normal memory access, and CD base 64k ram can't handle it).
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: PC Engine / TurboGrafx open bus

Post by lidnariq »

Pokun wrote: Thu Oct 22, 2020 4:19 pm Anything that can be tested with an Everdrive?
I could probably write a test ROM? I'm not certain if there's a way to do this without a test ROM. Tsushin Booster BASIC would pedantically count as a way to do this but that's kinda silly.

I'll see if ccovell has something I can use as a convenient starting point.
The Arcade Card I/O blocks are in $40~$43 and Populous puts its 32 kB RAM somewhere there as well.
Mednafen's source implies that Populous puts its RAM in the exact same place the Arcade Card does. Hardware parsimony says it's probably mirrored over $40-$7F.
turboxray wrote: Thu Oct 22, 2020 4:55 pmonly ram is mapped to page $2000, but you can map more than just system ram here.
I get the "zero page instructions address logical address $20xx", but ... is there some other restriction I'm confused by?
turboxray
Posts: 348
Joined: Thu Oct 31, 2019 12:56 am

Re: PC Engine / TurboGrafx open bus

Post by turboxray »

lidnariq wrote: Thu Oct 22, 2020 5:04 pm I get the "zero page instructions address logical address $20xx", but ... is there some other restriction I'm confused by?
Just that, and stack, are fixed to that page location. I mean, you could temporarily map hardware bank and rom banks there if you really wanted to.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: PC Engine / TurboGrafx open bus

Post by Pokun »

Oh I just remembered that I only have a PCE Duo-R (built-in Super CD-ROM^2 and no expansion port). It doesn't report in input port K as a CD system being connected though for some reason. Not sure if that's just how the Duo systems work or if I did something wrong when reading the input port.

lidnariq wrote: Thu Oct 22, 2020 5:04 pm
The Arcade Card I/O blocks are in $40~$43 and Populous puts its 32 kB RAM somewhere there as well.
Mednafen's source implies that Populous puts its RAM in the exact same place the Arcade Card does. Hardware parsimony says it's probably mirrored over $40-$7F.
Anything about where the Ten no Koe BANK ROMRAM HuCard puts its RAM?

lidnariq wrote: Thu Oct 22, 2020 5:04 pm
turboxray wrote: Thu Oct 22, 2020 4:55 pmonly ram is mapped to page $2000, but you can map more than just system ram here.
I get the "zero page instructions address logical address $20xx", but ... is there some other restriction I'm confused by?
Stack? It must be in $21xx to work correctly I think.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: PC Engine / TurboGrafx open bus

Post by lidnariq »

Pokun wrote: Thu Oct 22, 2020 5:53 pm Anything about where the Ten no Koe BANK ROMRAM HuCard puts its RAM?
Looks like bank $10. Or at least, the number of times banks $10 and $F7 are enabled (TAM #8 and TAM #$10 respectively) increases by one for each time I get the error beep in an emulator.

Possible it's actually a 2KB subset in each of banks $10-$13. I'm not sufficiently clear on how mednafen works to implement this.

It also probes banks $40, $60, $68, and $78, but it's not clear what for.
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: PC Engine / TurboGrafx open bus

Post by ccovell »

About the TennoKoe Bank, all 4 save slots are in a single 8K bank. The access method:
Okay, I just confirmed with my program, PCEMon, and a Ten no Koe Bank card on a PCE/SuperGrafx.
Write #$68 to $0000 in bank $68. Then write 0 to $0000 in bank $78, then write #$73 to $0000 in bank $78 three times.
You can now map in bank $40 into, eg. $8000 and read up to $9FFF.
I think I did make a few simple test ROMs that run from HuCard, copy themselves to RAM, then test all banks.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: PC Engine / TurboGrafx open bus

Post by lidnariq »

Huh. Any guesses as to why it's accessing other banks?
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: PC Engine / TurboGrafx open bus

Post by ccovell »

I'm guessing that the TennoKoe bank has address decoding logic that monitors the upper addresses, read/write line, and some of the data lines; and which activates / disables the presence of the Bank RAM depending on those accesses.

Also, the TennoKoe card has to access bank $F7 to map in the BRAM.
Post Reply