Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user RadMan/TSM ! (Registered 2021-04-12) You are not logged in 
CSDb User Forums


Forums > C64 Coding > "Colour bug" on old c64 not emulated in Vice?
2012-01-22 20:14
Zyron

Registered: Jan 2002
Posts: 2298
"Colour bug" on old c64 not emulated in Vice?

I remember that doing something like this
lda #col
sta $0286
jsr $e544
will work on a new c64, but on the old model $d800- would get the same colour as $d021 so no chars will be visible.
I've tried this in Vice v2.3 but no matter what setup I choose I can't reproduce the bug.
I've tested with Super Music since I remember clearly that it did not display any text on my old c64.
2012-01-22 20:28
Groepaz

Registered: Dec 2001
Posts: 9779
you have to use an old kernal rom to get that bug (vice uses the latest)
2012-01-22 20:55
iAN CooG

Registered: May 2002
Posts: 2857
use -kernalrev 0 from cmdline and the rom will be patched, you'll see the bug. (I wonder why only rev 0 is supported and not 1 or 2 but ok, for those exact revisions you'll just have to provide the roms)
2012-01-22 21:00
Zyron

Registered: Jan 2002
Posts: 2298
Thx Ian!
2012-01-22 21:27
Skate

Registered: Jul 2003
Posts: 477
I tried "-kernalrev 0" command line option and nothing seems to change for me. it always acts like a new ROM. missing rom files? any ideas? (platform: windows, vice v2.3).
2012-01-22 21:37
iAN CooG

Registered: May 2002
Posts: 2857
dunno, works here, vice.log shows even the addresses patched

Loading system file `C:\C64\VICE\C64\kernal'.
C64MEM: Kernal rev #3.
Installing ROM patch for revision #0:
E42D (3 bytes)
E477 (54 bytes)
E4C8 (21 bytes)
E535 (1 byte)
E57C (30 bytes)
E5EF (1 byte)
E5F4 (2 bytes)
E622 (2 bytes)
EA07 (12 bytes)
ECD9 (14 bytes)
EF94 (3 bytes)
F0D8 (15 bytes)
F387 (1 byte)
F4B7 (1 byte)
F5F9 (1 byte)
F81F (1 byte)
F82C (1 byte)
FF80 (1 byte)
FFF8 (2 bytes)
Patch installed.


you can also try from vice.ini

KernalName="kernal"
BasicName="basic"
KernalRev="0"
2012-01-22 21:40
Groepaz

Registered: Dec 2001
Posts: 9779
ah, i almost forgot about that redundant option.... dont rely on it being there =P

skate: it only works if the kernal currently used is the rev3 one that comes with vice, if its a different one the patches wont get applied.
2012-01-23 02:17
Skate

Registered: Jul 2003
Posts: 477
@iAN CooG: it's really weird because i can see the same lines at the log file and vice.ini automatically changes by command line (-kernalrev seems to make the change permanantly, not temporary) but result is the same at my side. I check the given addresses E42D, E477, E4C8, E535 etc. and nothing seems to be different between rev0 and rev3. I don't know why it doesn't work even the log file shows the changed addresses and says "Patch installed".

@Groepaz: My vice version is downloaded from viceteam.org and files are completely untouched. Also log file says;

Loading system file `G:\Scene\C64\WinVICE\C64\kernal'.
C64MEM: Kernal rev #3.
Installing ROM patch for revision #0:
E42D (3 bytes)
E477 (54 bytes)
...


I tried to find if any extra settings are causing this problem like some cartridge, REU, C64 model, ROM settings etc. but everything seems to be at the default settings. I'll try the same thing at work tomorrow to see if it is specific to my computer setup at home or am I the one who fucks up at some point. :)

Btw, other than examining the memory from the monitor, I of course tried the code piece at the first post and it always changed the cursor color like the new models.
2012-01-23 06:37
Zyron

Registered: Jan 2002
Posts: 2298
Quote:
I of course tried the code piece at the first post and it always changed the cursor color like the new models.

Yes, it does change the cursor colour. To see the actual bug you need to extend the code to something like this:
1000:
lda #$07
sta $0286
jsr $e544
ldx #$00
loop
lda $1000,x
sta $0400,x
inx
bne loop
rts
2012-01-23 07:59
Skate

Registered: Jul 2003
Posts: 477
@Zyron: Thanks. Now I got it, finally. :)

But still one thing remains. Why don't i see the patched areas given in the vice.log file when I check from monitor? For example 3 bytes at $e42d looks like

20 1e ab

for both rev0 and rev3 kernals.

Is there any chance that i see rev3 from monitor even if it's patched at the background (doesn't make sense to me actually)? That was the main reason i got confused, since both ROMs looked similar at certain points from monitor.
2012-01-23 19:36
Digger

Registered: Mar 2005
Posts: 374
Yeah, I remember one demo that was calling all the coders not to use $E544 to clear/fill the screen, even had a physical ROM (rev. 0) that had it.
2012-01-23 20:00
Zyron

Registered: Jan 2002
Posts: 2298
I remember we had a loader part in Lunacy 6 - The Lost Sequel where we told coders to instead do it this way:
lda #col
sta $d021
jsr $e536
which works. Or at least that's what it was supposed to say but I think Depeh messed it up in some way. :)
2012-01-23 20:09
iAN CooG

Registered: May 2002
Posts: 2857
Quote: @Zyron: Thanks. Now I got it, finally. :)

But still one thing remains. Why don't i see the patched areas given in the vice.log file when I check from monitor? For example 3 bytes at $e42d looks like

20 1e ab

for both rev0 and rev3 kernals.

Is there any chance that i see rev3 from monitor even if it's patched at the background (doesn't make sense to me actually)? That was the main reason i got confused, since both ROMs looked similar at certain points from monitor.


these 3 bytes are infact patched for nothing when you patch from rev3 to rev0 but they change when you use other revisions for example -kernalrev 4064
The relevant code for the $0286 bug is
rev0
(C:$e458) d e4d2
.C:e4d2  AA         TAX
.C:e4d3  AA         TAX
.C:e4d4  AA         TAX
.C:e4d5  AA         TAX
.C:e4d6  AA         TAX
.C:e4d7  AA         TAX
.C:e4d8  AA         TAX
.C:e4d9  AA         TAX
.C:e4da  AD 21 D0   LDA $D021 <- uses screen color
.C:e4dd  91 F3      STA ($F3),Y
rev3
.C:e4d2  AA         TAX
.C:e4d3  85 A9      STA $A9
.C:e4d5  A9 01      LDA #$01
.C:e4d7  85 AB      STA $AB
.C:e4d9  60         RTS
.C:e4da  AD 86 02   LDA $0286 <- proper cursor color
.C:e4dd  91 F3      STA ($F3),Y

these dumps are taken from vice monitor after launching x64 with -kernalrev 0 and 3 (or nothing because 3 it's the default rom)
2012-01-23 20:15
Groepaz

Registered: Dec 2001
Posts: 9779
Quote:
@Groepaz: My vice version is downloaded from viceteam.org and files are completely untouched.

you might want to get the latest one from http://vice-emu.sourceforge.net/ :=)
and what i wanted to say is: this option might disappear, as it is redundant.
2012-01-23 20:40
Ninja

Registered: Jan 2002
Posts: 395
That's what I collected back then:

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

Dunno where I got the revision numbering, though.
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
AlexC
eryngi
hedning/G★P
map
theK/ATL
youtH/Heatwave
Frida Katarina
GH/dSr/Focus/MSL/Too..
Krill/Plush
tNG/FairLight
Britelite/Dekadence
Guests online: 87
Top Demos
1 Edge of Disgrace  (9.6)
2 Coma Light 13  (9.6)
3 Uncensored  (9.6)
4 Unboxed  (9.6)
5 Comaland 100%  (9.6)
6 Lunatico  (9.6)
7 Memento Mori  (9.6)
8 Christmas Megademo  (9.5)
9 We Love to Party  (9.5)
10 The Shores of Reflec..  (9.5)
Top onefile Demos
1 Copper Booze  (9.8)
2 To Norah  (9.7)
3 Lovecats  (9.6)
4 Square Booze  (9.5)
5 Daah, Those Acid Pil..  (9.5)
6 Elite Code Mechanics  (9.5)
7 Dawnfall V1.1  (9.5)
8 Pikku Kuusnelonen  (9.4)
9 No Mercy for the Tro..  (9.4)
10 Quadrants  (9.4)
Top Groups
1 Booze Design  (9.4)
2 Fossil  (9.4)
3 Censor Design  (9.3)
4 Oxyron  (9.3)
5 PriorArt  (9.3)
Top Webmasters
1 Morpheus  (9.8)
2 Slaygon  (9.7)
3 Perff  (9.6)
4 Sabbi  (9.4)
5 CreaMD  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2021
Page generated in: 0.058 sec.