play a dump of NTSC cartridge on a PAL Vic-20

Discuss anything related to the VIC
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

play a dump of NTSC cartridge on a PAL Vic-20

Post by nbla000 »

A lot of cartridges use the joystick or the arrows to center screen
and to allow to play games in PAL machines but some cartriges has NOT this feature, it's possible to play dump of NTSC cartridge on PAL Vic-20 using some POKE before the SYS64820?

My dump load program for 1 Part Dump is:

1 ONAGOTO10
2 A=1:LOAD"DUMPCARTA0",8,1
10 POKE????????
20 SYS64802

My dump load program for 2 Part Dump is:

1 ONAGOTO5,10
2 A=1:LOAD"DUMPCART60OR20",8,1
5 A=2:LOAD"DUMPCARTA0",8,1
10 POKE????????
20 SYS64802


Dumps to load are:
Alien Blitz
Congo Bongo
Creepy Corridors
Motocross racer
Polaris
Princess and Frog
Spike's Peak
Q-Bert
Threshold
Tooth Invaders
Buck Rogers (2 Parts)
Lunar Leeper (2 Parts)
Seafox (2 Parts)
Last edited by nbla000 on Fri Apr 14, 2006 4:19 am, edited 1 time in total.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

No. Those cartridges have the screen coordinates hard-coded, often the default NTSC positioning but reading from cartridge ROM instead of Kernel ROM. You could hack some NTSC-centered cartridges to run with PAL values or no positional change, but if the game moves the screen around, you have to compensate for that. Some games rely on raster beam and won't work in PAL nonetheless.
Anders Carlsson

Image Image Image Image Image
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

You would need a different poke for every cartridge image, but that could work unless the games depends on the raster beam for timing (changing colors in the middle of the screen etc), and I think some on your list do.... But as I found out when we explored the game "Quackers", some of these timings still work if you leave the y position for the screen intact and only change the x position.

Oh, and it's 64802!

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Ok, i want to try to fix them, there are documents?
Last edited by nbla000 on Fri Apr 14, 2006 4:20 am, edited 1 time in total.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

If you want to fix it, attach a machine code monitor (or use VICE) and load the image. Then go into the monitor, search for the byte sequence 00 90 ($9000) and for every occurence, disassemble the memory area to determine if you get code like this:

xxx0 LDX #$05
xxx2 LDA $yyyy,X
xxx5 STA $9000,X
xxx8 DEX
xxx9 BNE $xxx2

The memory area at $yyyy would then contain the hard-coded coordinates. If you're loading the program to RAM, you can of course POKE those values with different values or rewrite the code above to read from $EDE4 instead of $yyyy.

In some cases, the code may be explicit POKEs:

xxx0 LDA #$04
xxx2 STA $9000
xxx5 LDA #$20
xxx7 STA $9001 etc

So okay, it is doable - even in a somewhat flexible manner, but I don't know of any simple solution other than disassembling parts of the code. I wonder if it would be worth to upload a number of "fixed" versions to Zimmers?
Anders Carlsson

Image Image Image Image Image
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

64802 is the reset sys. I don't know what 64820 does but I thought you just made a mistake and ment 64802
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

ok i've tried with some cartridges, this is my work for Polaris but no any occurrences founds:

start Vice Vic Settings 8k in bank 5

LOAD "POLARISA0",8,1

on vice File => Monitor

Monitor log:
** Monitor 000 002
(C:$e5e8) hunt $a000 $bfff $9000 <=== search only in bank 5
ae1d <=== address occurrence
b6ad <=== address occurrence
b743 <=== address occurrence
b8c1 <=== address occurrence
(C:$aefb) d ae1d <=== Disassemble this address
.C:ae1d 00 BRK
.C:ae1e 90 CA BCC $ADEA
.C:ae20 10 F7 BPL $AE19
.C:ae22 A9 0C LDA #$0C
.C:ae24 8D 18 03 STA $0318
.C:ae27 A9 A0 LDA #$A0
.C:ae29 8D 19 03 STA $0319
.C:ae2c 60 RTS
.C:ae2d 07 19 SLO $19
.C:ae2f 94 17 STY $17,X
.C:ae31 00 BRK
.C:ae32 FC 00 00 NOOP $0000,X
.C:ae35 00 BRK
.C:ae36 00 BRK
.C:ae37 00 BRK
.C:ae38 00 BRK
.C:ae39 00 BRK
.C:ae3a 00 BRK
.C:ae3b FF 38 40 ISB $4038,X
.C:ae3e A9 10 LDA #$10
.C:ae40 85 15 STA $15
.C:ae42 A0 00 LDY #$00
.C:ae44 84 14 STY $14
(C:$ae46) d b6ad
.C:b6ad 00 BRK
.C:b6ae 90 24 BCC $B6D4
.C:b6b0 50 4A BVC $B6FC
.C:b6b2 24 88 BIT $88
.C:b6b4 03 07 SLO ($07,X)
.C:b6b6 15 00 ORA $00,X
.C:b6b8 11 2A ORA ($2A),Y
.C:b6ba 08 PHP
.C:b6bb A4 51 LDY $51
.C:b6bd 04 00 NOOP $00
.C:b6bf 24 49 BIT $49
.C:b6c1 A4 51 LDY $51
.C:b6c3 2A ROL A
.C:b6c4 C8 INY
.C:b6c5 00 BRK
.C:b6c6 00 BRK
.C:b6c7 00 BRK
.C:b6c8 00 BRK
.C:b6c9 00 BRK
.C:b6ca 00 BRK
.C:b6cb 00 BRK
.C:b6cc 00 BRK
.C:b6cd 08 PHP
.C:b6ce 15 04 ORA $04,X
.C:b6d0 52 JAM
.C:b6d1 28 PLP
.C:b6d2 02 JAM
.C:b6d3 00 BRK
.C:b6d4 92 JAM
.C:b6d5 24 52 BIT $52
(C:$b6d7) d b743
.C:b743 00 BRK
.C:b744 90 24 BCC $B76A
.C:b746 90 44 BCC $B78C
.C:b748 A8 TAY
.C:b749 20 00 00 JSR $0000
.C:b74c 00 BRK
.C:b74d 00 BRK
.C:b74e 01 00 ORA ($00,X)
.C:b750 00 BRK
.C:b751 00 BRK
.C:b752 22 JAM
.C:b753 54 11 NOOP $11,X
.C:b755 48 PHA
.C:b756 A2 09 LDX #$09
.C:b758 00 BRK
.C:b759 48 PHA
.C:b75a 92 JAM
.C:b75b 48 PHA
.C:b75c A2 54 LDX #$54
.C:b75e 90 03 BCC $B763
.C:b760 07 15 SLO $15
.C:b762 00 BRK
.C:b763 0A ASL A
.C:b764 08 PHP
.C:b765 02 JAM
.C:b766 04 11 NOOP $11
.C:b768 04 00 NOOP $00
.C:b76a 10 80 BPL $B6EC
(C:$b76c) d b8c1
.C:b8c1 00 BRK
.C:b8c2 90 90 BCC $B854
.C:b8c4 D0 B0 BNE $B876
.C:b8c6 90 90 BCC $B858
.C:b8c8 90 00 BCC $B8CA
.C:b8ca 07 08 SLO $08
.C:b8cc 00 BRK
.C:b8cd 0E 04 04 ASL $0404
.C:b8d0 04 04 NOOP $04
.C:b8d2 04 04 NOOP $04
.C:b8d4 00 BRK
.C:b8d5 AE A8 A8 LDX $A8A8
.C:b8d8 EC A8 A8 CPX $A8A8
.C:b8db AE 00 07 LDX $0700
.C:b8de 04 04 NOOP $04
.C:b8e0 06 04 ASL $04
.C:b8e2 04 07 NOOP $07
.C:b8e4 00 BRK
.C:b8e5 47 44 SRE $44
.C:b8e7 44 46 NOOP $46
.C:b8e9 44 44 NOOP $44
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

You probably should disassemble a few bytes prior to the 00 90 occurrence. In the case of Polaris, the routine you're looking for starts at $AE17:

AE17 LDX #$0F
AE19 LDA $AE2D,X
AE1C STA $9000,X
AE1F DEX
AE20 BPL $AE19

AE2D: 07 19 94 17 00 FC 00 00 00 00 00 00 00 FF 38 40

In this case, it means a 20x11 display using 8x16 pixels, positioned at NTSC horizontal 7, vertical 25. The vertical positioning is the default, but the screen is shifted slightly to the right to center it due to fewer columns.

PAL adjustment: POKE 44589,14:POKE 44590,38:POKE 44633,86

The third POKE comes from the raster effect that splits the screen into two colours. Without it, the game is still playable but it is not possible for the submarine to reach the surface. There will be a bit of raster creeping anyway, since the timing is not 100% identical between NTSC and PAL. I'm not sure if that can be fixed without a lot of fixes.

Edit: We're not done yet. In the raster effect routine on $AE72 there is a CMP $20, which means that the raster effect will end depending on which value that zero page location contains. It is set in at least three places (different levels):

A31A LDA #$69
A31C STA $20
..
AC8A LDA #$04
AC8C STA $20
..
AEAF LDA #$04
AEB1 STA $20

And that is excluding all other addressing modes one could use to store a value into memory!

Using a bit of sixth sense, we try POKE 41755,118 and see that it appears to work. Wow, already four POKEs to convert NTSC to PAL, and we can exhale for now.

As you see, there are a lot of things to consider. Some games not dealing with raster effects will be easier to convert than others - some are almost impossible if they are really tightly coded.
Anders Carlsson

Image Image Image Image Image
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Polaris is overall a good game (maybe we should split this thread to Games now) with a lot of smooth movement, scrolling and raster effects as mentioned. I'm not sure about the last effect though, changing the score line from blue to cyan in the scrolling sequence. It only "costs" 12 bytes through the game, but appears more to show off what the programmers were capable of than adding to the gameplay.
Anders Carlsson

Image Image Image Image Image
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

very nice, it's incredible!!!!!

now i've fixed Q-Bert:

LOAD"Q-BERTA0",8,1
POKE41190,14
POKE41191,38
SYS64802

stay tuned....
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Now it's time for.....

Motocross Racer (C) 1983 by Xonox

here the basic program to load:

1 ONAGOTO5
2 DR=PEEK(186)
3 A=1:LOAD"MOTOCROSSA0",DR,1
5 POKE46865,14:POKE46866,38:SYS64802


Work with any drive number
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

and now....

Spike's Peak (C) 1983 by Xonox

the POKE are:
POKE48136,14
POKE48137,38

the game is playable but unfortunately is in NTSC-M so wobble.

There is a way to fix this problem?
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

incredible!?!?

now it's time for....

Seafox (C) 1983 by Broderbund Software

This is the basic program for the 2 Parts game:

1 ONAGOTO4,5
2 DR=PEEK(186)
3 A=1:LOAD"SEAFOX60",DR,1
4 A=2:LOAD"SEAFOXA0",DR,1
5 POKE40969,12:POKE40970,38:SYS64802

Why i must use POKE40969,14 instead of POKE40969,12? 12 seems the correct value or is my mistake?
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

And the winner is.....

Lunar Leeper (C) 1981 by Sierra On-Line inc.

This is the basic program for the 2 Parts game:

1 ONAGOTO4,5
2 DR=PEEK(186)
3 A=1:LOAD"LUNARLEEPER20",DR,1
4 A=2:LOAD"LUNARLEEPERA0",DR,1
5 POKE8200,12:POKE8201,38:SYS64802
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

the legend continues.....

Buck Rogers (C) 1983 by Sega Enterprises inc.

This is the basic program for the 2 Parts game:

1 ONAGOTO4,5
2 DR=PEEK(186)
3 A=1:LOAD"BUCKROGERS60",DR,1
4 A=2:LOAD"BUCKROGERSA0",DR,1
5 POKE27317,10:POKE27318,28:SYS64802


on VICE 1.19 if you set full 32k blocks 1/2/3/5 the title screen is white, just press button, when you set only blocks 3/5 the title screen is OK (anyone may test on a real Vic-20?)
Post Reply