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

Forums > C64 Coding > Breakpoints/Freezepoints and the 128
2019-08-17 15:07

Registered: Oct 2014
Posts: 409
Breakpoints/Freezepoints and the 128

Does anybody know of any cart or program that provides AR5/6 level FreezePoints on the 128. Just something that automatically patches the code for you when and then enters the monitor.
... 5 posts hidden. Click here to view all posts....
2019-08-19 08:59

Registered: Oct 2014
Posts: 409
The 128 is a very different beast, to think it is just a 64 with an extra bank tacked on will lead down a garden path.

Problem 1. The Z80 boots first and it only ever sees the internal Z80 portion of the internal ROM and can not be made to see an external ROM.

Problem 2. The 128 has no ultimax mode, to the point it even slightly cripples the 64 modes ultimax mode, this is why the Turbo Chameleon won't work on the 128. I think it also impacts flashing of carts such as the GMOD2.

Problem 3. The 128 ignores EXROM and GAME Lines, in fact you can set them to be outputs on the 128 and use them as extra control signals.

Problem 4. The KERNAL strictly sets FF00 to 0 upon its entry points forcing the code to hit and stay on the built in ROMs. So while you can during the boot sequence make it boot to your external ROMs, ( the 128 has 2 16K ROMS for external use, which are like the 16K on a 64, just its 2x16K not 2x8K thus giving you a full 32K ROM set ), you then must keep it always in your external roms, and can't let the KERNAL/BASIC/Editor/Monitor ROM run internally or it will switch it back to the internal ROM set and you will have to find a vector to hook in order to switch the MMU back to external function rom mode.

So you can not take over the 128, you can only let it yield to you on its terms and when you directly instruct it to. You could say install a custom NMI handler and modify the vector at boot, and then your cart will fire an NMI event to which it then jumps to a custom code routine in the lower shared 4K, which then invokes your external cart for a freeze, but there is nothing to stop somebody changing the NMI vector and or trashing your "bootstrap" and the machine must have the KERNAL banked in.
2019-08-19 09:40

Registered: Apr 2002
Posts: 4609
will replacing the ROM's to freeze friendly code do the trick then? I dont know why ultimax is needed for freeze.

maybe a custom ROM NMI handler ? :)
2019-08-19 10:16

Registered: Oct 2014
Posts: 409
okay, if you don't replace the KERNAL and take over vectors, how do you freeze? I assumed that the AR carts pull into Ultimax mode, and then put their ROM at E000 so it can trap Vector pulls and hence hook into their own code?

replacing the internal KERNAL ROM would let you freeze if you have the KERNAL enabled.. if I bank it out, then it can't help, because I will control the vectors..
2019-08-19 11:05

Registered: Apr 2002
Posts: 4609
so the problem is that a freezer cart cant bank in its own ROM ?
2019-08-19 12:12

Registered: Oct 2014
Posts: 409
you can bank in external ROM, just you have to ask the MMU to do it. To do so you have to have control of the CPU, so you need a way from pressing a button to get the CPU under your control. Once you have the CPU under your control, you can set the banks, ZP, stack as you please.
2019-08-19 13:21

Registered: Dec 2001
Posts: 985
So couldn't you make a Z80 based freezer cartridge for C128 mode?
2019-08-19 14:18

Registered: Oct 2014
Posts: 409
The Z80 code only runs at reset/boot and it won't use an external ROM, it will only execute the internal ROM. If you want to "freeze" by resetting you might be able to hijack the Monitor boot sequence somehow.. or if you have a "looks like CP/M disk", you could perhaps hijack it with one of them, but at this point you are doing a reset

for the monitor entry let me look at the code to see what it does...
2019-08-19 14:36

Registered: Apr 2002
Posts: 4609
so replace z80 rom ? I understood not possible VIA software, but what would be the least invasive modification to do it ?
2019-08-19 14:46

Registered: Oct 2014
Posts: 409
the Z80 ROM is D000-E000 in the "Upper ROM" so you would need to replace one of the ROMs, some 128s have each ROM in a chip and then some have the merged into 1 bigger ROM.
2019-08-19 15:03

Registered: Oct 2014
Posts: 409
The monitor entry is deep into the KERNAL reset routine and happens after any auto boot external/internal ROMS are checked. So an external function ROM would be better than the Monitor entry as it will have a lot less trashed, although at this point the KERNAL will have installed its custom lda/sta/cmp/jsr FAR routines, soft reset vector and looks like it will have intited the IO chips and installed default VECTORS.
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
Users Online
Guests online: 89
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.6)
3 Coma Light 13  (9.6)
4 Memento Mori  (9.6)
5 Comaland 100%  (9.6)
6 The Shores of Reflec..  (9.6)
7 Unboxed  (9.6)
8 Lunatico  (9.6)
9 Remains  (9.5)
10 C=Bit 18  (9.5)
Top onefile Demos
1 Dawnfall V1.1  (9.5)
2 Gumbo Revised  (9.5)
3 Smile to the Sky  (9.5)
4 Daah, Those Acid Pil..  (9.5)
5 Bad Boy  (9.5)
6 Crystal Gazer  (9.5)
7 Cuarentenauta  (9.5)
8 Instinct  (9.5)
9 The Tuneful Eight [u..  (9.5)
10 The Night It Snowed  (9.5)
Top Groups
1 PriorArt  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Fossil  (9.4)
5 Performers  (9.3)
Top Musicians
1 Rob Hubbard  (9.8)
2 Jeroen Tel  (9.6)
3 LMan  (9.6)
4 Linus  (9.5)
5 Drax  (9.5)

Home - Disclaimer
Copyright © No Name 2001-2020
Page generated in: 0.064 sec.