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 > Detect C128 in C64-mode without exploiting 2mhz mode?
2020-04-03 08:04
JackAsser

Registered: Jun 2002
Posts: 1989
Detect C128 in C64-mode without exploiting 2mhz mode?

Reason: Easyflash emulation in 1541u2 doesn’t work in 2mhz mode.
2020-04-03 08:39
Count Zero

Registered: Jan 2003
Posts: 1821
No sure about $01 but instead of $37 it always reports $77 on a c128 in c64 mode after powerup. Thing is that other hardware may influence a stock c64 the same way I suppose.

http://unusedino.de/ec64/technical/aay/c64/zp01.htm

Bit 6 description is not clear here.
2020-04-03 08:41
JackAsser

Registered: Jun 2002
Posts: 1989
Quote: No sure about $01 but instead of $37 it always reports $77 on a c128 in c64 mode after powerup. Thing is that other hardware may influence a stock c64 the same way I suppose.

http://unusedino.de/ec64/technical/aay/c64/zp01.htm

Bit 6 description is not clear here.


Ahh very interesting!

Indeed the MOS8502 have P0-P6 defined whereas MOS6510 only have P0-P5.

Digging schematics now.
2020-04-03 08:49
JackAsser

Registered: Jun 2002
Posts: 1989
P6 is caps-lock. Since it's generally advised to have caps-lock unpressed during boot P6 will always be 1. Specifically it can never be 1 on a MOS6510.

So if it's P6=1 it's definitely a C128. If P6=0 it still can be a C128.
2020-04-03 09:15
Krill

Registered: Apr 2002
Posts: 2839
Define "exploiting 2 MHz mode". =)

Is it okay to read $D030 after reset?
Should be $FD (turbo mode off, line-skip off).

(Beware for Turbo Chameleon: it has $FE for turbo mode off but $FF for turbo mode on, which is the same value a C-64 reads there.)

Either way, only C-128 can have bit 1 (line-skip) set to 0.
2020-04-03 09:17
chatGPZ

Registered: Dec 2001
Posts: 11110
all port bits are there and they also work - see https://sourceforge.net/p/vice-emu/code/HEAD/tree/testprogs/CPU.. ... i dont think they can be used to detect c128 reliably

BUT... whats the problem with 2MHz? just put a small code snippet to RAM, bank out the EF, do what you need to do and switch back? if that still makes U2 freak out.... wtf, its broken.
2020-04-03 09:23
Krill

Registered: Apr 2002
Posts: 2839
Quote: Define "exploiting 2 MHz mode". =)

Is it okay to read $D030 after reset?
Should be $FD (turbo mode off, line-skip off).

(Beware for Turbo Chameleon: it has $FE for turbo mode off but $FF for turbo mode on, which is the same value a C-64 reads there.)

Either way, only C-128 can have bit 1 (line-skip) set to 0.


Whoops. Should be:

Is it okay to read $D030 after reset?
Should be $FC (turbo mode off, line-skip off).
2020-04-03 09:27
chatGPZ

Registered: Dec 2001
Posts: 11110
better: if its $ff, then its a c64
2020-04-03 09:39
Krill

Registered: Apr 2002
Posts: 2839
Quoting Groepaz
better: if its $ff, then its a c64
Or a Turbo Chameleon in turbo mode, no?
2020-04-03 09:49
JackAsser

Registered: Jun 2002
Posts: 1989
Quote: all port bits are there and they also work - see https://sourceforge.net/p/vice-emu/code/HEAD/tree/testprogs/CPU.. ... i dont think they can be used to detect c128 reliably

BUT... whats the problem with 2MHz? just put a small code snippet to RAM, bank out the EF, do what you need to do and switch back? if that still makes U2 freak out.... wtf, its broken.


Never even considered that! Stupid me! :D
2020-04-03 09:50
JackAsser

Registered: Jun 2002
Posts: 1989
Quote: Whoops. Should be:

Is it okay to read $D030 after reset?
Should be $FC (turbo mode off, line-skip off).


Yes, that's a good solution also!
 
... 40 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 | 5 - 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
commodore_freak
MAT64
Trazan
kbs/Pht/Lxt
Didi/Laxity
Apollyon/ALD
celticdesign/G★P/M..
Guests online: 146
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

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