How to run cartridge dumps in PRG format

Discuss anything related to the VIC
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

SYS57809

Post by Mike »

RobertK wrote:Here's the loader for Donkey Kong:

Code: Select all

1 ONAGOTO20,30
10 A=1:FORI=0TO5:POKE7680+I,PEEK(45+I):NEXT
15 LOAD"DONK2000",8,1
20 A=2:FORI=0TO5:POKE45+I,PEEK(7680+I):NEXT
25 LOAD"DONKA000",8,1
30 SYS64802
Time to pop out SYS57809 off the hat...

Code: Select all

10 POKE55,0:POKE56,32:CLR
20 READN$:IFN$=""THENSYS64802
30 POKE147,0:SYS57809(N$),8,1:POKE780,0:SYS65493:GOTO20
40 DATA"DONK2000","DONKA000",""
Greetings,

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

Post by carlsson »

Ah. Disturbingly elegant. :wink: Some explanations:

POKE 147,0 = Load (not verify)
SYS 57809 = Get parameters for LOAD/SAVE
POKE 780,0 = Load accumulator with 0
SYS 65493 = Kernel jump to routine Load (0) RAM from device

It makes me wonder, is the first POKE 147 neccessary, as the Kernel call will set it anyway? Or has it to do with the "get parameters" subfunction?
Anders Carlsson

Image Image Image Image Image
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

carlsson wrote:Thus, I assume POKE 37166,0 will not do anything at all? I wonder which of the seven interrupts really is the magic one for Pole Position.
True. It does nothing.

Code: Select all

?PEEK(37166)
 192
192 (=$c0)
Only one enabled, which is bit 6, timer 1 timeout. (MSB is the global enable bit)
This is the 60Hz jiffy IRQ of the kernal. (0314/0315)
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

carlsson wrote:I've always wondered how much work it takes to rewrite a cartridge game to run elsewhere. All the absolute references should be fairly easy to fix, but more tricky code getting high and low bytes from a table etc may be a tricky thing to solve. Some day I'll get some 8K image, preferrably one that doesn't use a lot of RAM, and see if I have the skills to turn into to a loadable program.
Actually this is kind of tempting... So, hypothetically, if someone would do this, which game would he/she choose? I guess it should be one that does not exist for anything else than cartridge yet, and it should be a decent game.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Omega Race? It is the only cartridge game I have tape copies of, but never got to run in the old days, probably due to I didn't have the "right" memory expansion. The mentioned Pole Position would also be interesting to see if one can make 16K game out of.

On the other hand, it seems more and more of the dedicated VIC users who have any kind of memory expansion either have or modify it to be switchable in order to play ROM images. Maybe re-addressing cartridges would only be good for the experience how to do it.

As a reverse thought, one should use a Basic compiler onto Ultima: Escape from Mt Drash, Sword of Fargoal etc and make them into ROM images.
Anders Carlsson

Image Image Image Image Image
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

carlsson wrote:Omega Race? It is the only cartridge game I have tape copies of, but never got to run in the old days, probably due to I didn't have the "right" memory expansion. The mentioned Pole Position would also be interesting to see if one can make 16K game out of.
Does Omega Race only exist in an NTSC cartridge version? The only one on "zimmers" is NTSC. I guess that Omega Race-orig.prg is a ROM dump of this.
carlsson wrote:On the other hand, it seems more and more of the dedicated VIC users who have any kind of memory expansion either have or modify it to be switchable in order to play ROM images. Maybe re-addressing cartridges would only be good for the experience how to do it.
Or just for pure showoff. 8)
As a reverse thought, one should use a Basic compiler onto Ultima: Escape from Mt Drash, Sword of Fargoal etc and make them into ROM images.
I don't know how big they are, but can't you just make the basic interpreter read the basic code from ROM instead?
Duplicate the relevant parts of the reset routine, and change the start of basic. Variable storage could prove difficult though. I think the basic expects it to be above the basic code at all times.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

The Basic pointers probably can be altered, but EMD is a few hundred of bytes above 8K, and SoF is a 16K+ game.

NTSC or not, I think it runs without problems on both systems, maybe a little more flicker on PAL?
Anders Carlsson

Image Image Image Image Image
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

carlsson wrote:The Basic pointers probably can be altered, but EMD is a few hundred of bytes above 8K, and SoF is a 16K+ game.
ah...
carlsson wrote:NTSC or not, I think it runs without problems on both systems, maybe a little more flicker on PAL?
And the screen is way off to the left on PAL. But it doesn't matter, I fixed it now.
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

tlr wrote:
carlsson wrote:Omega Race? It is the only cartridge game I have tape copies of, but never got to run in the old days, probably due to I didn't have the "right" memory expansion. The mentioned Pole Position would also be interesting to see if one can make 16K game out of.
Does Omega Race only exist in an NTSC cartridge version? The only one on "zimmers" is NTSC. I guess that Omega Race-orig.prg is a ROM dump of this.
It is done! 8)
http://sleepingelephant.com/ipw-web/bul ... php?p=3590
Post Reply