English Amiga Board


Go Back   English Amiga Board > Main > Retrogaming General Discussion

 
 
Thread Tools
Old 20 June 2018, 18:36   #1
mc68060
With MMU and FPU!

 
Join Date: Mar 2015
Location: On your mainboard
Posts: 93
Accidental source code in disk images

When examining disk 1 of the NTSC version of Gremlin's Utopia, you can see some of the source code on the disk, including comments and everything. Here is a copy & paste:

Code:
addq.w	#5,d0
	addq.w	#6,d1
	CoordsToOffsetWithBO			; find screen offset (dest)
	subq.w	#7,d3
	neg.w	d3				; actual bit # to start with
	movem.l	hiddenplanes,a1-a4
	add.l	d1,a1
	add.l	d1,a2
	add.l	d1,a3
	add.l	d1,a4				; ptr into map screen (dest)
	lea	disk_buffers,a0			; temp storage
	movem.l	a1,4(a0)
	movem.l	a2,12(a0)
	movem.l	a3,20(a0)
	movem.l	a4,28(a0)			; store dest ptrs
	move.w	d3,d5
; now find ptrs to source...
	movem.w	st     ?   (  ?   /®íDartx,d0-d1			; start coords of map box
	addq.w	#1,d0
	addq.w	#1,d1
	CoordsToOffsetWithBO			; find screen offset (source)
	subq.w	#7,d3
	neg.w	d3				; actual bit # to start with
	movem.l	hiddenplanes,a1-a4
	add.l	d1,a1
	add.l	d1,a2
	add.l	d1,a3
	add.l	d1,a4				; ptr into map screen (source)
	movem.l	a1,(a0)
	movem.l	a2,8(a0)
	movem.l	a3,16(a0)
	movem.l	a4,24(a0)			; store source ptrs
	move.w	d3,d4
	moveq	#4-1,d2				; do 4 planes
.plane	move.l	(a0)+,a3			; source plane     ?   )  ?   ü?Çr ptr
	move.l	(a0)+,a4			; dest plane ptr
	moveq	#32-1,d0			; do 32 lines
.line	moveq	#44-1,d1			; do 44 pixels
	move.w	d4,d6
	move.w	d5,d7				; bit ptrs
	move.l	a3,a1
	move.l	a4,a2
.pixel	btst	d6,(a1)				; test source
	beq.s	.1
	bset	d7,(a2)				; set dest
	bset	d7,LINE_SIZE(a2)
.1	subq.w	#1,d7
	bpl.s	.2
	moveq	#7,d7				; move to next byte
	addq.w	#1,a2
.2	btst	d6,(a1)				; test source
	beq.s	.11
	bset	d7,(a2)				; set dest
	bset	d7,LINE_SIZE(a2)
.11	subq.w	#1,d7
     ?   *  ?   T€?	bpl.s	.3
	moveq	#7,d7				; move to next byte
	addq.w	#1,a2
.3	subq.w	#1,d6
	bpl.s	.4
	moveq	#7,d6				; move to next byte
	addq.w	#1,a1
.4	dbf	d1,.pixel			; next pixel
	add.w	#LINE_SIZE,a3
	add.w	#2*LINE_SIZE,a4			; next screen line
	dbf	d0,.line
	dbf	d2,.plane
; finished, show it...
	jsr	FlipScreen
.releas	jsr	MouseScan			; wait for r button up
	btst	#RIGHT_BUTTON,control
	bne.s	.releas
	waitframe	.zz1
	bsr	EraseRequester			; clear zoom req
	bset	#IN_REQUESTER,con     ?   +  ?   /k?Ütrol		; must do this
	rts

mapbox_sprite	dc.w %1111111111111111
		dc.w %1000000000000001
		dc.w %1000000000000001
		dc.w %1000000000000001
		dc.w %1000000000000001
		dc.w %1000000000000001
		dc.w %1000000000000001
		dc.w %1111111111111111
		ds.w 8*4
zoom_req_node	dc.w 0,0,13,75		; for zoom window

map_mode	dc.b 0			; begin in Building mode.
mapgrid_bits	dc.b %00000001,%11111111	; bit 0
		dc.b %00000011,%11111110
		dc.b %00000111,%11111100
		dc.b %00001111,%11111000
     ?   ,   ?    …~??
		dc.b %00011111,%11110000
		dc.b %00111111,%11100000
		dc.b %01111111,%11000000
		dc.b %11111111,%10000000clr	d4,0(a4,d1.l)
	bset#1,a1
.4	dbf	d1,.pixel			; next pixel
	add.w	#LINE_SIZE,a3
	add.w	#2*LINE_SIZE,a4			; next screen line
	dbf	d0,.line
	dbf	d2,.plane
; finished, show it...
	jsr	FlipScreen
.releas	jsr	MouseScan			; wait for r button up
	btst	#RIGHT_BUTTON,control
	bne.s	.releas
	waitframe	.zz1
	bsr	EraseRequester			; clear zoom req
	bset	#IN_REQUESTER,con 
	or.b	d4,2*((XMAP/8)+2)+1(a5)		; line+2
	or.b	d2,-3*((XMAP/8)+2)-1(a5)
	or.b	d3,-3*((XMAP/8)+2)(a5)
	or.b	d4,-3*((XMAP/8)+2)+1(a5)	; line-3
	or.b	d2,3*((XMAP/8)+2)-1(a5)
	or.b	d3,3*((XMAP/8)+2)(a5)
	or.b	d4,3*((XMAP/8)+2)+1(a5)		; line+3
	or.b	d2,-4*((XMAP/8)+2)-1(a5)
	or.b	d3,-4*((XMAP/8)+2)(a5)
	or.b	d4,-4*((XMAP/8)+2)+1(a5)	; line-4
	or.b	d2,4*((XMAP/8)+2)-1(a5)
	or.b	d3,4*((XMAP/8)+2)(a5)
	or.b	d4,4*((XMAP/8)+2)+1(a5)		; line+4
	or.b	d2,-5*((XMAP/8)+2)-1(a5)
     ?     ?   
®:??
	or.b	d3,-5*((XMAP/8)+2)(a5)
	or.b	d4,-5*((XMAP/8)+2)+1(a5)	; line-5
	or.b	d2,5*((XMAP/8)+2)-1(a5)
	or.b	d3,5*((XMAP/8)+2)(a5)
	or.b	d4,5*((XMAP/8)+2)+1(a5)		; line+5
	or.b	d2,-6*((XMAP/8)+2)-1(a5)
	or.b	d3,-6*((XMAP/8)+2)(a5)
	or.b	d4,-6*((XMAP/8)+2)+1(a5)	; line-6
	or.b	d2,6*((XMAP/8)+2)-1(a5)
	or.b	d3,6*((XMAP/8)+2)(a5)
	or.b	d4,6*((XMAP/8)+2)+1(a5)		; line+6
	or.b	d2,-7*((XMAP/8)+2)-1(a5)
	or.b	d3,-7*((XMAP/8)+2)(a5)
	or.b	d4,-7*((XMAP/8)+2)+1(a5)	; line-7
	or.b	d2     ?     ?   ë‡m,7*((XMAP/8)+2)-1(a5)
	or.b	d3,7*((XMAP/8)+2)(a5)
	or.b	d4,7*((XMAP/8)+2)+1(a5)		; line+7
.nxt	addq.w	#2,a0				; next map word
	dbf	d6,.byte			; next bit in byte
	addq.w	#1,a5
	dbf	d0,.line1			; next byte on line
	addq.w	#2,a5				; skip byte at either side
	dbf	d1,.line
	pop_all
	rts

MapMode10:
;[Machine_specific]
; fuel mode...
	bsr	GetBuildingGrid
	lea	disk_buffers+(8*((XMAP/8)+2)),a5
.line	move.w	#XMAP/8-1,d0			; do 8 tiles at a time
.line1	st	d2				; assume bac     ?     ?   í‹Vkground..
	moveq	#0,d3				; ..color 8
	moveq	#0,d4
	moveq	#0,d5
	moveq	#8-1,d6				; bits within the byte
.byte	move.b	(a0),d7				; get map word hi byte
	btst	#FUEL_BIT,d7			; any fuel?
	beq.s	.b1
	btst	d6,(a5)				; in range of a building?
	beq.s	.b1
	bclr	d6,d2
	bset	d6,d3				; orange
	bra.s	.nxt
.b1	and.b	#%10100,d7			; passable?
	cmp.b	#%10000,d7			; must be non-passable & NOT a building
	bne.s	.nxt
	bclr	d6,d2				; change to rough terrain...
	bset	d6,d3				; ..col     ?      ?   Ó[®‰or 7
	bset	d6,d4
	bset	d6,d5
.nxt	addq.w	#2,a0
	dbf	d6,.byte			; next bit in byte
	addq.w	#1,a5
	move.b	d5,(a1)+
	move.b	d4,(a2)+
	move.b	d3,(a3)+
	move.b	d2,(a4)+			; store 8 pixels
	dbf	d0,.line1			; next byte on line
	moveq	#15,d0
	add.w	d0,a1
	add.w	d0,a2
	add.w	d0,a3
	add.w	d0,a4				; start of next line
	addq.w	#2,a5
	dbf	d1,.line
	rts

MapMode2:
;[Machine_specific]
; mobiles mode...
	bsr	MapDefault			; do default map scan
	movem.l	hiddenplanes,a1-a4
; d     ?   !  ?   @‚o our land forces
	lea	sprite_nodes-SPRITE_NODE_SIZE,a0
	move.w	num_sprites,d2
	bra.s	.dec
.loop	add.w	#SPRITE_NODE_SIZE,a0
	tst.b	S_TYPE(a0)			; noide in use?
	beq.s	.loop
	moveq	#0,d1
	move.b	S_MAPY(a0),d1			; y coord
	moveq	#0,d0
	move.b	S_MAPX(a0),d0
	addq.w	#8,d0
	addq.w	#8,d1
	CoordsToOffsetWithBO
	moveq	#7,d4
	sub.w	d3,d4				; bit #
	bclr	d4,0(a4,d1.l)
	bset	d4,0(a1,d1.l)			; our forces in white
.dec	dbf	d2,.loop
; do our air forces
	lea	air_sprite_nodes-SP     ?   "  ?   ®j?vRITE_NODE_SIZE,a0
	move.w	num_air_sprites,d2
	bra.s	.deca
.loopa	add.w	#SPRITE_NODE_SIZE,a0
	tst.b	S_TYPE(a0)			; node in use?
	beq.s	.loopa
	moveq	#0,d1
	move.b	S_MAPY(a0),d1			; y coord
	moveq	#0,d0
	move.b	S_MAPX(a0),d0
	addq.w	#8,d0
	addq.w	#8,d1
	CoordsToOffsetWithBO
	moveq	#7,d4
	sub.w	d3,d4				; bit #
	bclr	d4,0(a4,d1.l)
	bset	d4,0(a3,d1.l)			; air forces in green
	bset	d4,0(a2,d1.l)
.deca	dbf	d2,.loopa
	rts

MapMode8:
;[Machine_specific]
; land mines mo     ?   #  ?   ¸?€de...
.line	move.w	#XMAP/8-1,d0			; do 8 tiles at a time
.line1	st	d2				; assume background..
	moveq	#0,d3				; ..color 8
	moveq	#0,d4
	moveq	#0,d5
	moveq	#8-1,d6				; bits within the byte
.byte	move.b	(a0),d7				; get map word hi byte
	and.b	#%10100,d7			; passable?
	cmp.b	#%10000,d7			; must be non-passable & NOT a building
	bne.s	.b1
	bclr	d6,d2				; change to rough terrain...
	bset	d6,d3				; ..color 7
	bset	d6,d4
	bset	d6,d5
	bra.s	.nxt
.b1	move.w	(a0),d7				; m     ?   $  ?   ?jŽap word
	btst	#10,d7				; a building?
	beq.s	.nxt
	and.w	#TILE_NO_MASK,d7		; building ID
	cmp.w	#LAND_MINE,d7
	bne.s	.b2
	bclr	d6,d2
	bset	d6,d3
	bclr	d6,d4
	bset	d6,d5
	bra.s	.nxt	
.b2	cmp.w	#FLUXPOD,d7
	bne.s	.nxt
	bclr	d6,d2
	bset	d6,d4				; flux pod
.nxt	addq.w	#2,a0
	dbf	d6,.byte			; next bit in byte
	move.b	d5,(a1)+
	move.b	d4,(a2)+
	move.b	d3,(a3)+
	move.b	d2,(a4)+			; store 8 pixels
	dbf	d0,.line1			; next byte on line
	moveq	#15,d0
	add.w	d0,a1
	add.w     ?   %  ?   7™´W	d0,a2
	add.w	d0,a3
	add.w	d0,a4				; start of next line
	dbf	d1,.line
	rts

MapBox:
; IN:   d0.w/d1.w = desired map coords to start box at
	tst.w	d0
	bpl.s	.1
	moveq	#0,d0
.1	cmp.w	#XMAP-XWIN,d0
	bmi.s	.2
	move.w	#XMAP-XWIN,d0
.2	tst.w	d1
	bpl.s	.3
	moveq	#0,d1
.3	cmp.w	#YMAP-YWIN,d1
	bmi.s	.4
	move.w	#YMAP-YWIN,d1
.4	movem.w	d0-d1,startx			; store coords
	addq.w	#8,d0
	addq.w	#8,d1
	lea	mapbox_sprite,a0
	move.l	a0,a2				; mask
	lea	hiddenplanes,a1
	moveq	#     ?   &  ?   ÚP?<YWIN-1,d2			; ht-1
	moveq	#LINE_SIZE,d7			; no mirroring
	jsr	Sprite16			; draw box
	rts

MapZoom:
;[Machine_specific]
	move.w	#170,d2
	moveq	#28,d3				; assume zoom req in top right
	movem.w	startx,d0-d1
	cmp.w	#160-32,d0
	bmi.s	.zoom1
	cmp.w	#100+18,d1
	bpl.s	.zoom1
	moveq	#20,d2				; zoom req in top left
.zoom1	lea	zoom_req_node,a0
	movem.w	d2-d3,(a0)			; fill in start coords
	bsr	RenderRequester			; draw zoom req
; fill in the zoom req...
	movem.w	zoom_req_node
How could this happen? Did they turn a disk that previously contained the source codes into the master disk and didn't even bother to properly format the disk?

Are there other games that contain some development data that the developers forgot to erase? IIRC the CD32 version of Zool and Zool 2 had all debug symbols still in the executable or something...
mc68060 is offline  
AdSense AdSense  
Old 20 June 2018, 19:14   #2
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,909
Disk 1 of the original retail release of Xenon 2 has Copylock source code and docs.
Galahad/FLT is offline  
Old 20 June 2018, 19:16   #3
gazj82
Registered User

gazj82's Avatar
 
Join Date: Jan 2014
Location: Cambs / UK
Posts: 310
Quote:
Originally Posted by Galahad/FLT View Post
Disk 1 of the original retail release of Xenon 2 has Copylock source code and docs.
Ha ha, that's brilliant.
gazj82 is offline  
Old 20 June 2018, 19:46   #4
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 5,900
"Hidden" source code is quite common. Treasure Island Dizzy contains the source for the bootloader including the fully commented "Protec" protection source. Technological Death/Mad Elks has parts of the track loader source and there are many more examples.
StingRay is online now  
Old 20 June 2018, 21:26   #5
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 46
Posts: 2,245
James Pond disk contains a "guppy" file with disk loading routine bits.

For Xenon 2, the explanation is simple: Rob Northen formatted the special track and delivered it to the game makers with the doc & code how to use on the disk (probably to save a floppy...). The game makers had to delete the files before sending it to duplication.

most of the time, the game took all disk so the files were overwritten, but not in the case of Xenon 2, where the disk remained readable because sector 880 (dir root) was not modified.
jotd is offline  
Old 20 June 2018, 21:57   #6
mcgeezer
Registered User

 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 343
Quote:
Originally Posted by jotd View Post
James Pond disk contains a "guppy" file with disk loading routine bits.

For Xenon 2, the explanation is simple: Rob Northen formatted the special track and delivered it to the game makers with the doc & code how to use on the disk (probably to save a floppy...). The game makers had to delete the files before sending it to duplication.

most of the time, the game took all disk so the files were overwritten, but not in the case of Xenon 2, where the disk remained readable because sector 880 (dir root) was not modified.
I wonder if someone got sacked for that.
mcgeezer is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Old source code? anotheramigafan Amiga scene 9 29 June 2018 16:33
My old source code gemanix Coders. General 36 09 July 2017 13:33
New source for Amiga Disk Images hot trout Amiga scene 50 28 July 2011 23:39
Source Code camelord support.Games 2 06 August 2010 17:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:16.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06216 seconds with 13 queries