Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user shad0wfax ! (Registered 2025-06-17) 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: 2038
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: 1990
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: 2038
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: 2038
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: 3083
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: 11510
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: 3083
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: 11510
better: if its $ff, then its a c64
2020-04-03 09:39
Krill

Registered: Apr 2002
Posts: 3083
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: 2038
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: 2038
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
bugjam
Alakran_64
manganoid/Hokuto Force
McMeatLoaf
Didi/Laxity
Guests online: 240
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Uncensored  (9.5)
9 Wonderland XIV  (9.5)
10 No Bounds  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Acidchild  (9.7)
4 Cash  (9.6)
5 Violator  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.141 sec.