Scram 20

History and Preservation Issues

Moderator: Moderators

Post Reply
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Scram 20

Post by e5frog »

I tried to find a cartridge version of Scram 20 to be able to squeeze a scramble clone into my multicart...

I found a few, none of them seemed to work and were missing the start screen, one wasn't padded to 4kB.

I got hold of a .tap image (well several but they looked as if the were the same file - same sizes and so on) but it was cracked and had some graphics altered.

I sat tonight and worked my way through the code and made a .d64-file of it all. No missing pieces as far as I can tell and no strange graphics with signatures...

Uploaded it here if someone likes to get it:
http://www.megafileupload.com/en/file/5 ... 0-d64.html

Now I'm about to make a cartridge version... it shouldn't take as long. ;-)


Does anyone know of any other scramble like game not more than 8kB?
My other interest: http://channelf.se
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Post by e5frog »

It's done.

Download this 4kB wonder cart here:
http://www.2shared.com/file/3047625/348 ... ram20.html

No crunching used...


Not that it's a very neat game, it's very jerky, and difficult...



The difference between my version and other cart versions I have seen is that the intro screen is there and the game is working! Just hold F1 to start.





Here's the code I used to compile it:

Code: Select all

;           Fredric Blåholtz
;     4kB autostarting cartridge
;       version from .tap-file
;                 of 
;              SCRAM 20
;
;       Assembled in March 2008
;
; dasm game.asm -f3 -ogame.bin  to compile


	processor 6502


dest = $1001	; destination adress

	org	$a000

; ==============================================================
; Startup code for autostart
; ==============================================================
	.word	inits		; Entry point for power up
	.word	restore	; Entry point for warm start (RESTORE)
  
	.byte "A0"		; 'A0CBM' autoboot string
	.byte $C3,$C2,$CD

inits:
	;Kernel Init
	jsr	$FD8D		; RAMTAS - Initialise System Constants
	jsr	$FD52		; Restore Kernal Vectors (at 0314)
	jsr	$FDF9		; Init I/O
	jsr	$E518		; Init I/O 

	;BASIC Init (Partial)
	lda	#8		; Set screen colors
	sta	$900F		; black+black
	jsr	$E45B		; Init Vectors  
	jsr	$E3A4		; Init BASIC RAM
	jsr	$E404		; write start text


	; show intro screen

draw_scram:

	ldx	#$00
print1:
	lda	plot_scram,x
	beq	print1.end		; branch when data is 0
	jsr	$ffd2
	inx
	jmp	print1

print1.end:

	ldx	#$00
print2:
	lda	plot_rest,x
	beq	print2.end		; branch when data is 0
	jsr	$ffd2
	inx
	jmp	print2

print2.end:

	; delay for approximately 5 s

	lda	#0
	ldx	#0
	ldy	#0
	jsr	$ffdb
wait:
	lda	$a1
	beq	wait


	; copy data to $0000

copy_0000:

	if 0
; ===================================
; VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

	ldx	#$ff
copyloop:
	inx
	lda	start_0000,x
	sta	$00,x
	cpx	#$8f
	bne	copyloop	

; AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
; ===================================
	endif

	; set irq

	lda	#$c2
	sta	$0314
	lda	#$03
	sta	$911e	


	; load game

copy_game:

	if 0
; ===================================
; VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

	;Write initial data:
	lda	#0
	sta	$1001
	sta	$1002
	lda	#$50
	sta	$1003
	
	ldx	#26
ea_loop:
	lda	#$EA
	sta	$1004,x
	dex
	bne	ea_loop

; AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
; ===================================
	endif

	; actual program data

	ldx	#14			; number of 256 byte pages to copy
	lda	#<start_game	; lower byte of address
	sta	$FB			; store in $00FB
	lda	#>start_game	; upper byte of address
	sta	$FC			; store in $00FC
	lda	#$1F			; lower byte of address
	sta	$FD			; store in $00FD

	jsr	rest_of_copy


	; game loaded, set correct fast page data 

copy_0000_2:

	ldx	#$ff
copyloop_2:
	inx
	lda	start_0000,x
	sta	$00,x
	cpx	#$8f
	bne	copyloop_2


	;write 43 zeroes, start on $8F

	ldx	#44
zeroloop:
	lda	#0
	sta	$4D,x
	dex
	bne	zeroloop
	

	; start game!

	jmp	$101F


; ==============================================================
;   Copy data, parameters already set
; ==============================================================

copy_data:

	lda	#<dest	; lower byte of address
	sta	$FD		; store in $00FD
rest_of_copy:
	lda	#>dest	; upper byte of address
	sta	$FE		; store in $FE

loop2:
	ldy	#$00		; Y = 0
loop1: 
	lda	($FB),Y	; A = contents of $00FB plus offset Y
	sta	($FD),Y	; $00DF + offset Y = A
	iny			; increase Y
	bne	loop1		; Branch on Result not Zero to L1
	inc	$FC		; increase value at $00FC (upper byte of start address)
	inc	$FE		; increase value at $00FE (upper byte of dest. address)
	dex			; X = X - 1 (decrease pages left to copy)
	bne	loop2		; Branch on Result not Zero to L2
	rts

; ==============================================================
; Handle the RESTORE key  
; ==============================================================
restore:
	jmp	$FEC7   ; Continue as if no cartridge installed

; ==============================================================
;   Game data
; ==============================================================

	if 0
; ==============================================================
; VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV

start_intro:
	incbin	"games/Scram20/Scram20-intro.bin"
end_intro:

; AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
; ==============================================================
	endif


start_game:
	incbin	"games/Scram20/Scram20-game.bin"
end_game:

start_0000:
	incbin	"games/Scram20/Scram 20 at $0000.bin"
end_0000:


; ==============================================================
; Define some common PETSCII codes 
; http://sta.c64.org/cbm64petkey.html
; ==============================================================

CLRHOME	= $93
clr		= $93
RVSON		= $12
rvon		= $12
RVSOFF	= $92
rvof		= $92
CR		= $0D
cr		= $0D
WHITE		= $05
wht		= $05
GREEN		= $1E
grn		= $1E
BLUE		= $1F
blu		= $1F
YELLOW	= $9E
yel		= $9E
CYAN		= $9F
cyn		= $9F
RIGHT		= 29
right		= 29
RED		= 28
red		= 28
PURPLE	= 156
pur		= 156
blk		= 144
TRILEFT	= 169
TRIRIGHT	= 127

; ==============================================================
; Menu screen
; ==============================================================



plot_scram:
	.byte	clr,wht,cr,cr,right
	.byte rvon,"   ", right, red, "   ",right,pur,"  ",127, right
	.byte GREEN,"   ",right,blu,127,right,right,169,cr, wht

	.byte rvon,right," ",rvof,"   ",rvon,red," ",rvof,pur,"   ",rvon," ",right," "
	.byte right,grn," ",right," ",blu,right," ",127,169," ",cr, wht, right,rvon

	.byte "   ", right, red," ",rvof,"   ",rvon,pur,"  ",127,right,grn,"   "
	.byte right,blu," ",rvof,127,169,rvon," ",cr,wht,right

	.byte "  ",rvon," ",right,red," ",rvof,"   ",pur,rvon," ",right," ",right
	.byte grn," ",right," ",right,blu," ",right,right," ",cr,wht,right,rvon

	.byte "   ",right,red,"   ",right,pur," ",right," ",right,grn," ",right," "
	.byte blu,right," ",right,right," "
	.byte 0

plot_rest:
	.byte cr,cr,cr,rvof
	.byte	"     ",rvon,yel,"     ",right,"     ",cr
	.byte	"         ",rvon," ",right," ",right,right,right," ",cr
	.byte	"     ",rvon,"     ",right," ",right,right,right," ",cr
	.byte	"     ",rvon," ",rvof,"     ",rvon," ",rvof,"   ",rvon," ",cr
	.byte	"     ",rvon,"     ",right,"     ",cr

	.byte	cr,cr,"    ",rvon,grn,"COPYRIGHT 1983",cr,cr
	.byte "     ",rvon,cyn,"NALIN SHARMA"
	.byte 0

	.byte "Cart by e5frog "

;	jmp	copy_0000_2
;	jmp	copy_0000

My other interest: http://channelf.se
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

take a look here:
http://one.xthost.info/nbla000/vic20/prg2cart/

they are my old conversion for first MegaCart tests that you may use for your home-made multicart or for any hacked vic-cart for BLK5....

actually on MegaCart i use prg files without modifies and use a general loader with some parameter stored into rom to move files from eproms directly to ram so no more BLK5 simulation for this work....
Mega-Cart: the cartridge you plug in once and for all.
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Post by e5frog »

That's what I do to - copy down to RAM and execute.


What's BLK5 simulation?
My other interest: http://channelf.se
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

I believe he means mapping RAM into BLK5, enabling an 4K or 8K block from the EPROM into this RAM space, and then execute the "cartridge" that will copy itself to unexpanded RAM.
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 »

Mega-Cart: the cartridge you plug in once and for all.
User avatar
e5frog
Vic 20 Nerd
Posts: 551
Joined: Sat Feb 17, 2007 5:46 pm
Website: http://channelf.se
Location: Sweden
Occupation: Service Engineer

Post by e5frog »

Oh, nice... I should have looked there when I hacked mine.
My other interest: http://channelf.se
Post Reply