Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Bank switching and C000 - CFFF
2023-05-11 02:06
El Stocko

Registered: Jul 2006
Posts: 16
Bank switching and C000 - CFFF

Apologies if this is basic knowledge, but this is something that's caught me out and from the info I've seen online, I don't properly understand why it happens..

Existing code that I've been referencing switches off all ROM banks..
LDA #$30
STA $01

Absolutely fine, but when I was replicating this code at C000, my code would crash every time. It took me a long time to figure out that switching off all ROMS seems to work anywhere in memory EXCEPT if your code is running at C000-CFFF. According to the Mode Table outlined at https://www.c64-wiki.com/wiki/Bank_Switching C000-CFFF is always RAM unless there's a cartridge, and the Bank Switching Zones section lists it as RAM or "unmapped", whatever that means.

Maybe I haven't Googled the right thing, but I haven't seen anything that says switching off ROMS should affect C000-CFFF. Can some genius explain this to me please? :)
 
... 5 posts hidden. Click here to view all posts....
 
2023-05-11 11:59
Martin Piper

Registered: Nov 2007
Posts: 649
In Vice monitor (alt-M) using "watch load fffa ffff" will definitely trigger if the code tries to use an IRQ/NMI/BRK.

If that triggers, you can use "chis 10" to show the last 10 instructions before it entered the IRQ/NMI/BRK.

The Tapecart isn't in ULTIMAX mode is it?
2023-05-11 12:11
chatGPZ

Registered: Dec 2001
Posts: 11164
Tapecart connects to the tape port.... :)
2023-05-11 13:29
Martin Piper

Registered: Nov 2007
Posts: 649
Quote: Tapecart connects to the tape port.... :)

Ah ha, the name is a very misleading thingy.
2023-05-11 14:21
El Stocko

Registered: Jul 2006
Posts: 16
Yeah, when is a cart not a cart? :)

I think I've sorted my problem, and the bank switching was a complete red herring. Sorry, it was late last night when I was looking at it and it was my messed up VICE test that prompted me to post. Turns out it came down to a BEQ instead of a BNE. Doh!

Thanks for the tip on IRQ though Martin, I'll keep it in mind for the future and I do need to make more use of chis
2023-05-11 17:17
oziphantom

Registered: Oct 2014
Posts: 480
BTW unmapped means "no internal chips will respond to the address"

so when you are in that mode, accessing C000 will not reference any internal chip, i.e it is "open bus", unless you have something one the expansion port that does react to the address.
2023-05-11 17:47
El Stocko

Registered: Jul 2006
Posts: 16
Quote: BTW unmapped means "no internal chips will respond to the address"

so when you are in that mode, accessing C000 will not reference any internal chip, i.e it is "open bus", unless you have something one the expansion port that does react to the address.


Thanks for clarifying. So is it possible for C000 to go into this unmapped state if there is no expansion present? I thought that's what I was seeing, but I might have dreamed it.
2023-05-12 03:56
Martin Piper

Registered: Nov 2007
Posts: 649
Quote: Thanks for clarifying. So is it possible for C000 to go into this unmapped state if there is no expansion present? I thought that's what I was seeing, but I might have dreamed it.

On real hardware?
Something would have to pull the _GAME signal on the expansion port low: https://codebase64.org/doku.php?id=base:memory_management#cart_..

That signal, along with _DMA and _EXROM, have weak pull-ups guarding against that.

That signal goes straight into the PLA, so it could be that the PLA is bad, or the signal has a bad joint.
2023-05-12 12:00
chatGPZ

Registered: Dec 2001
Posts: 11164
If you see a difference in behaviour of that area in emulator vs real hardware - then indeed its either a broken PLA, or broken RAM
2023-05-12 15:30
El Stocko

Registered: Jul 2006
Posts: 16
Quote: On real hardware?
Something would have to pull the _GAME signal on the expansion port low: https://codebase64.org/doku.php?id=base:memory_management#cart_..

That signal, along with _DMA and _EXROM, have weak pull-ups guarding against that.

That signal goes straight into the PLA, so it could be that the PLA is bad, or the signal has a bad joint.


No nothing bad here. My "test" where I thought I'd seen the behaviour was in VICE, with no cart. So it was just a hypothetical question in the end.. are we saying with nothing on the expansion port it's never possible to unmap C000? (that was always what I thought anyway)
2023-05-12 17:58
Martin Piper

Registered: Nov 2007
Posts: 649
Correct. It cannot be unmapped if there is nothing on the port.
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Fred/Channel 4
Dr. Doom/RAD
stephan-a
JEZ
Guests online: 73
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Aliens in Wonderland  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Dawnfall V1.1  (9.5)
8 Birth of a Flower  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Offence  (9.3)
Top Logo Graphicians
1 Sander  (9.9)
2 Facet  (9.5)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.041 sec.