Have you found the 2nd 6502 program?

Topics covering the 6502 emulator in Ranger Citadel: tutorials, specs, source code and share your work!

Moderator: Ranger Team Alpha

Post Reply
User avatar
Joby
Developer
Posts: 129
Joined: February 23rd, 2012, 9:21 am
Location: Ground Zero - inXile
Contact:

Have you found the 2nd 6502 program?

Post by Joby » September 23rd, 2014, 1:48 pm

Hidden in the game is another computer that runs a second 6502 program. Have you found it? I'll post full source code here when someone does.

Hint: you have to type a secret keyword into the computer to have it pop up the computer HUD and run the program. I'm not going to say what that keyword is, nor which computer you type it into... but maybe someone can figure it out. :twisted:
- Joby
inXile's ruthless Leader of Scripters

UncleSporky
Scholar
Posts: 144
Joined: April 25th, 2012, 4:21 pm

Re: Have you found the 2nd 6502 program?

Post by UncleSporky » September 27th, 2014, 7:06 pm

Looks like somebody found it:

viewtopic.php?f=10&t=9083&p=124704

Man, I thought for sure it would be in California so we could code programs in the second part of the game too!

This one doesn't look like it would be user-editable, since it has actual in-game ramifications?

Also there's a small bug/weirdness with it, dialogue with the computer stays open so everything you type gets typed into the dialogue prompt. I guess that's not really a big deal, I just thought it was odd.

User avatar
Joby
Developer
Posts: 129
Joined: February 23rd, 2012, 9:21 am
Location: Ground Zero - inXile
Contact:

Re: Have you found the 2nd 6502 program?

Post by Joby » September 29th, 2014, 5:23 pm

Nice! :mrgreen:

Yes, it's not a fully programmable computer like in Ranger Citadel. There's no way to adjust the code or replace it with your own program. However, it was really fun to create and some pretty neat techniques used to make an unbeatable tic-tac-toe game that is a whopping 2k! Of all the possible moves, there are three ways to tie, but no ways to actually win. Here's how I made it:

X moves first...
http://xkcd.com/832/

It's a state-based decision tree based on an optimal game of tic-tac-toe. Basically, there's the code itself to display the text and game board and draw the moves, then there's a block of resource data that represents the logic and possible moves.

X moves first (option 7, upper-left corner) then the player chooses a move. Based on their move, the computer makes a move, repeat.

The logic is structured as a table of the computer's move and 9 pointers for the player's possible moves. There is the move the computer makes, then 9 words of addresses to jump to for the computer's next move for each of the player's possible 9 moves. If the pointer address is 0 then the move is not possible (that space already has an 'X' or 'O'). This gives you a very simple way to create a state-based decision tree between a player and the computer. No analyzing moves and board and determining the best move... no actual AI. Just a map of what it's moves should be based upon a player's moves as outline by xkcd.

0x7600 : [#7][0x7610][0x7620][0x7630][...][...][...][0][...][...] //initial move, X in '7' spot, top-left corner
0x7610 : [#9][0][...][...][...][...][...][0][...][0] //player chose '1', computer moves '9'
0x7620 : [#5][...][0][...][...][0][...][0][...][...] //player chose '2', computer moves '5'
0x7630 : [#9][...][...][0][...][...][...][0][...][0] //player chose '3', computer moves '9'
... etc

Initial logic pointer is at 0x7600. The value is '7'. The computer puts an 'X' in spot 7. If player chooses '2', the value at 0x7602 is looked at, which is not 0, so it's a legal move, player puts an 'O' in spot 2, and then the logic pointer is set to that value, 0x7620. The value there is '5' so the computer puts an 'X' in spot 5. The player now has 6 possible remaining moves (spots 2, 5 and 7 have already been taken). Play continues until the player ties or loses.

It's a little more complicated because addresses take up 2 bytes in low-hi format, so it's not quite as elegant as the above, but the functionality is the same. Basically, it's a tic-tac-toe choose your own adventure game. (and yes, I have the Tic Tac Tome... it's awesome! And what I would have duplicated if I had more time to create a full game of it... stupid Wasteland 2 needing to ship.) :D

Here's the game code:

Code: Select all

* = $7000

  jsr welcome
  start_over
  jsr initboard
  jsr initgame
  jsr loop


welcome
  jsr introtext
  jsr waitforkey
  rts


introtext
  jsr initcursor
  lda $ff02
  
  lda #$28
  sta $0e
  lda #<word_greetings
  sta $0c
  lda #>word_greetings
  sta $0d
  jsr printstring
  
  jsr spinWheels
  jsr spinWheels
  jsr spinWheels
  
  lda #$78
  sta $0e
  lda #<word_shall
  sta $0c
  lda #>word_shall
  sta $0d
  jsr printstring
  
  rts
  
  
initboard
  jsr initcursor
  lda $ff02
  
  clc
  ldx #8
  lda #$80
  set_L_slash
  dex
  sta $f400,x
  lsr a
  cpx #0
  bne set_L_slash
  
  clc
  ldx #8
  lda #$01
  set_R_slash
  dex
  sta $f408,x
  asl a
  cpx #0
  bne set_R_slash
  
  lda #$3c
  sta $f410
  sta $f411
  sta $f412
  sta $f413
  sta $f414
  sta $f415
  sta $f416
  sta $f417
  sta $f420
  sta $f421
  sta $f426
  sta $f427
  
  lda #$ff
  sta $f41a
  sta $f41b
  sta $f41c
  sta $f41d
  sta $f422
  sta $f423
  sta $f424
  sta $f425
  
  
  lda #$82
  sta $0243
  sta $0257
  sta $026b
  sta $027f
  sta $02a7
  sta $02bb
  sta $02cf
  sta $02e3
  sta $030b
  sta $031f
  sta $0333
  sta $0347
  
  sta $0248
  sta $025c
  sta $0270
  sta $0284
  sta $02ac
  sta $02c0
  sta $02d4
  sta $02e8
  sta $0310
  sta $0324
  sta $0338
  sta $034c
  
  lda #$83
  sta $028f
  sta $0290
  sta $0291
  sta $0292
  sta $0294
  sta $0295
  sta $0296
  sta $0297
  sta $0299
  sta $029a
  sta $029b
  sta $029c
  
  sta $02f3
  sta $02f4
  sta $02f5
  sta $02f6
  sta $02f8
  sta $02f9
  sta $02fa
  sta $02fb
  sta $02fd
  sta $02fe
  sta $02ff
  sta $0300
  
  lda #$84
  sta $0298
  sta $02fc
  sta $02f7
  sta $0293
  
  sec
  lda #$39
  sta $0272
  sbc #1
  sta $026d
  sbc #1
  sta $0268
  sbc #1
  sta $02d6
  sbc #1
  sta $02d1
  sbc #1
  sta $02cc
  sbc #1
  sta $033a
  sbc #1
  sta $0335
  sbc #1
  sta $0330
  
  lda #255
  jsr spinloop
  lda #255
  jsr spinloop
  lda #255
  jsr spinloop
  lda #255
  jsr spinloop
  
  rts
  
initgame

  lda #0
  ldx #$f
 clearmem 
  sta $00,x
  dex
  bne clearmem

  lda #<gamelogic
  sta $0c
  lda #>gamelogic
  sta $0d
  
  lda #$03
  sta $11
  sta $13
  sta $15
  lda #$02
  sta $17
  sta $19
  sta $1b
  sta $1d
  sta $1f
  sta $21
  
  clc
  lda #$07
  sta $10
  adc #5
  sta $12
  adc #5
  sta $14
  
  lda #$a3
  sta $16
  adc #5
  sta $18
  adc #5
  sta $1a
  
  lda #$3f
  sta $1c
  adc #5
  sta $1e
  adc #5
  sta $20
  
  rts
  
loop
  jsr computerMoves
  jsr checkGame
  jsr playerMoves
  jsr checkGame
  jmp loop
  
  
  
computerMoves
  ldy #0
  lda ($0c),y
  sta $00
  lda #1
  sta $01
  jsr scoreMove
  
  sec
  lda $00
  sbc #1
  asl a
  tax
  lda $10,x
  sta $00
  lda $11,x
  sta $01
  
  ldx #4
  lda #0
  sta $02
  
  clc
drawbar1
  tay
  lda #$81
  sta ($00),y
  lda #$15
  adc $02
  sta $02
  pha
  lda #64
  jsr spinloop
  pla
  clc
  dex
  bne drawbar1
  
  sec
  ldx #4
  lda $02
  sbc #$18
  sta $02
  
drawbar2
  tay
  lda #$80
  sta ($00),y
  lda $02
  sbc #$13
  sta $02
  pha
  lda #64
  jsr spinloop
  pla
  sec
  dex
  bne drawbar2
  
  rts
  
  
  
playerMoves
  lda $fff0
  cmp #0
  beq waitforplayerkey
  
  cmp #$31
  beq playermademove
  cmp #$32
  beq playermademove
  cmp #$33
  beq playermademove
  cmp #$34
  beq playermademove
  cmp #$35
  beq playermademove
  cmp #$36
  beq playermademove
  cmp #$37
  beq playermademove
  cmp #$38
  beq playermademove
  cmp #$39
  beq playermademove
invalidmove  
  lda #0
  sta $fff0
waitforplayerkey
  lda #255
  jsr spinloop
  clv
  bvc playerMoves
  
playermademove
  sec
  sbc #$30
  sta $00
  asl a
  tay
  iny
  lda ($0c),y
  cmp #0
  beq invalidmove
  sta $0f
  dey
  lda ($0c),y
  sta $0e
  lda $0f
  sta $0d
  lda $0e
  sta $0c
  
  lda #4
  sta $01
  jsr scoreMove

drawO
  sec
  lda $00
  sbc #1
  asl a
  tax
  lda $10,x
  sta $00
  lda $11,x
  sta $01
  
  ldy #$29
  lda #$20
  sta ($00),y
  
  ldx #2
  lda #2
  sta $02
  
  clc
drawbarO1
  tay
  lda #$81
  sta ($00),y
  lda #$15
  adc $02
  sta $02
  pha
  lda #64
  jsr spinloop
  pla
  clc
  dex
  bne drawbarO1
  
  ldx #2
  dec $02
  lda $02
  
  clc
drawbarO2
  tay
  lda #$80
  sta ($00),y
  lda #$13
  adc $02
  sta $02
  pha
  lda #64
  jsr spinloop
  pla
  clc
  dex
  bne drawbarO2
  
  sec
  ldx #2
  lda $02
  sbc #$14
  sta $02
  
drawbarO3
  tay
  lda #$81
  sta ($00),y
  lda $02
  sbc #$15
  sta $02
  pha
  lda #64
  jsr spinloop
  pla
  sec
  dex
  bne drawbarO3
  
  clc
  ldx #2
  inc $02
  lda $02
  sec
  
drawbarO4
  tay
  lda #$80
  sta ($00),y
  lda $02
  sbc #$13
  sta $02
  pha
  lda #64
  jsr spinloop
  pla
  sec
  dex
  bne drawbarO4
  
  rts

  
  
  
scoreMove
  clc
  
  lda $0b
  adc #1
  sta $0b
  
  lda $00
  cmp #1
  beq picked1
  cmp #2
  beq picked2
  cmp #3
  beq picked3
  cmp #4
  beq picked4
  
  jmp pickedother
  
  picked1
  clc
  lda $01
  adc $05
  sta $05
  lda $01
  adc $06
  sta $06
  lda $01
  adc $0a
  sta $0a
  rts
  
  picked2
  clc
  lda $01
  adc $05
  sta $05
  lda $01
  adc $07
  sta $07
  rts
  
  picked3
  clc
  lda $01
  adc $05
  sta $05
  lda $01
  adc $08
  sta $08
  lda $01
  adc $09
  sta $09
  rts
  
  picked4
  clc
  lda $01
  adc $04
  sta $04
  lda $01
  adc $06
  sta $06
  rts
  
  pickedother
  cmp #5
  beq picked5
  cmp #6
  beq picked6
  cmp #7
  beq picked7
  cmp #8
  beq picked8
  
  picked9
  clc
  lda $01
  adc $03
  sta $03
  lda $01
  adc $08
  sta $08
  lda $01
  adc $0a
  sta $0a
  rts
  
  picked5
  clc
  lda $01
  adc $04
  sta $04
  lda $01
  adc $07
  sta $07
  lda $01
  adc $09
  sta $09
  lda $01
  adc $0a
  sta $0a
  rts
  
  picked6
  clc
  lda $01
  adc $04
  sta $04
  lda $01
  adc $08
  sta $08
  rts
  
  picked7
  clc
  lda $01
  adc $03
  sta $03
  lda $01
  adc $06
  sta $06
  lda $01
  adc $09
  sta $09
  rts
  
  picked8
  clc
  lda $01
  adc $03
  sta $03
  lda $01
  adc $07
  sta $07
  
  rts
  

checkGame
  lda #3
  ldx #8
checkgameloop
  cmp $02,x
  beq gamewon
  dex
  bne checkgameloop
  lda #9
  cmp $0b
  beq gametied
  rts
gamewon
  jmp computerWon
gametied
  jmp humanTied
  
  
  
waitforkey
  lda $fff0
  cmp #0
  beq waitfornewkey
  cmp #$79
  beq yKey
  cmp #$6e
  beq nKey
  lda #0
  sta $fff0
waitfornewkey
  lda #255
  jsr spinloop
  clv
  bvc waitforkey
nKey
  jmp sadFace
yKey
  lda #0
  sta $fff0
  rts
  
  
  
computerWon
  jsr initcursor
  lda #$18
  sta $0e
  lda #<word_youlose
  sta $0c
  lda #>word_youlose
  sta $0d
  jsr printstring
play_again
  lda #$68
  sta $0e
  lda #$03
  sta $0f
  lda #<word_again
  sta $0c
  lda #>word_again
  sta $0d
  jsr printstring
  jsr waitforkey
  jmp start_over



humanTied
  jsr initcursor
  lda #$1a
  sta $0e
  lda #<word_wetied
  sta $0c
  lda #>word_wetied
  sta $0d
  jsr printstring
  jmp play_again



sadFace
  jsr initcursor
  lda $ff02
  
  lda #$b4
  sta $0e
  lda #<word_winning
  sta $0c
  lda #>word_winning
  sta $0d
  jsr printstring
  
  jmp theend
  
  
  
spinWheels
  sec
  lda #127
spinloop
  nop
  nop
  sbc #1
  bne spinloop
  rts
  
  
  
  initcursor
  lda #$02
  sta $0f
  lda #0
  sta $0e
  rts


printstring
 ldy #0
 ldx #0
ps_next
 pha
 jsr spinWheels
 pla
 lda ($0c),y
 beq ps_done
 sta ($0e,X)
 inc $0e
 bne ps_y
 inc $0f
ps_y 
 iny
 bne ps_next
ps_done
 rts
 

word_greetings
C_GR = $5247
.word C_GR
C_EE = $4545
.word C_EE
C_TI = $4954
.word C_TI
C_NG = $474e
.word C_NG
C_S_ = $2053
.word C_S_
C_PR = $5250
.word C_PR
C_OF = $464f
.word C_OF
C_ES = $5345
.word C_ES
C_SO = $4f53
.word C_SO
C_R_ = $2052
.word C_R_
C_FA = $4146
.word C_FA
C_LK = $4b4c
.word C_LK
C_EN = $4e45
.word C_EN
C_xx = $2e
.word C_xx

word_shall
C_SH = $4853
.word C_SH
C_AL = $4c41
.word C_AL
C_L_ = $204c
.word C_L_
C_WE = $4557
.word C_WE
C__P = $5020
.word C__P
C_LA = $414c
.word C_LA
C_Y_ = $2059
.word C_Y_
C_A_ = $2041
.word C_A_
C___ = $2020
.word C___
.word C___
C_GA = $4147
.word C_GA
C_ME = $454d
.word C_ME
C__ll = $5b20
.word C__ll
C_Yss = $2f59
.word C_Yss
C_Nrr = $5d4e
.word C_Nrr
C_qq = $3f
.word C_qq

word_youlose
C_YO = $4f59
.word C_YO
C_U_ = $2055
.word C_U_
C_LO = $4f4c
.word C_LO
C_SE = $4553
.word C_SE
C_xx_ = $202e
.word C_xx_
C_ccD = $443a
.word C_ccD
.byte $0

word_wetied
.word C_WE
C__T = $5420
.word C__T
C_IE = $4549
.word C_IE
C_Dxx = $2e44
.word C_Dxx
.byte $0

word_again
.word C_SH
.word C_AL
.word C_L_
.word C_WE
.word C__P
.word C_LA
.word C_Y_
C_AG = $4741
.word C_AG
C_AI = $4941
.word C_AI
C_Nqq = $3f4e
.word C_Nqq
.byte $0

word_winning
C_TH = $4854
.word C_TH
C_E_ = $2045
.word C_E_
C_ON = $4e4f
.word C_ON
C_LY = $594c
.word C_LY
C__W = $5720
.word C__W
C_IN = $4e49
.word C_IN
C_NI = $494e
.word C_NI
.word C_NG
.word C___
.word C___
C_MO = $4f4d
.word C_MO
C_VE = $4556
.word C_VE
C__I = $4920
.word C__I
.word C_S_
C_NO = $4f4e
.word C_NO
C_T_ = $2054
.word C_T_
C_TO = $4f54
.word C_TO
.word C__P
.word C_LA
C_Yxx = $2e59
.word C_Yxx
.byte $0

theend

.word $0 ;preset final moves, if logic points to one of these the game is done
.word $1
.word $2
.word $3
.word $4
.word $5
.word $6
.word $7
.word $8
.word $9

gamelogic
.END
I created a Ruby script to define and generate the logic block that was appended:

Code: Select all

addr = 0x75E8

$opcodes = [0,1,2,3,4,5,6,7,8,9] #presets
$counter = 9
$labels = {}

$opcodes.each{|i|
	$labels['&'+i.to_s] = i
}

xmoves = [
	7,
	{
	1 => [9, 
		{
		1 => nil,
		2 => [8,{}],
		3 => [8,{}],
		4 => [8,{}],
		5 => [8,{}],
		6 => [8,{}],
		7 => nil,
		8 => [3, 
			{
			1 => nil,
			2 => [6,{}],
			3 => nil,
			4 => [6,{}],
			5 => [6,{}],
			6 => [5,{}],
			7 => nil,
			8 => nil,
			9 => nil,
			}
			],
		9 => nil
		}
		], 
	2 => [5, 
		{
		1 => [3,{}],
		2 => nil,
		3 => [1,
			{
			1 => nil,
			2 => nil,
			3 => nil,
			4 => [9,{}],
			5 => nil,
			6 => [4,{}],
			7 => nil,
			8 => [4,{}],
			9 => [4,{}],
			}
			],
		4 => [3,{}],
		5 => nil,
		6 => [3,{}],
		7 => nil,
		8 => [3,{}],
		9 => [3,{}]
		}
		], 
	3 => [9, 
		{
		1 => [8,{}],
		2 => [8,{}],
		3 => nil,
		4 => [8,{}],
		5 => [8,{}],
		6 => [8,{}],
		7 => nil,
		8 => [1,
			{
			1 => nil,
			2 => [4,{}],
			3 => nil,
			4 => [5,{}],
			5 => [4,{}],
			6 => [4,{}],
			7 => nil,
			8 => nil,
			9 => nil,
			}
			],
		9 => nil
		}
		], 
	4 => [5, 
		{
		1 => [3,{}],
		2 => [3,{}],
		3 => [9,
			{
			1 => [8,{}],
			2 => [8,{}],
			3 => nil,
			4 => nil,
			5 => nil,
			6 => [8,{}],
			7 => nil,
			8 => [1,{}],
			9 => nil,
			}
			],
		4 => nil,
		5 => nil,
		6 => [3,{}],
		7 => nil,
		8 => [3,{}],
		9 => [3,{}]
		}
		], 
	5 => [3, 
		{
		1 => [9,
			{
			1 => nil,
			2 => [6,{}],
			3 => nil,
			4 => [8,{}],
			5 => nil,
			6 => [8,{}],
			7 => nil,
			8 => [6,{}],
			9 => nil,
			}
			],
		2 => [8,
			{
			1 => [9,{}],
			2 => nil,
			3 => nil,
			4 => [9,{}],
			5 => nil,
			6 => [9,{}],
			7 => nil,
			8 => nil,
			9 => [1,
				{
				1 => nil,
				2 => nil,
				3 => nil,
				4 => [6,{}], #tie
				5 => nil,
				6 => [4,{}],
				7 => nil,
				8 => nil,
				9 => nil,
				}
				],
			}
			],
		3 => nil,
		4 => [6,
			{
			1 => [6,{}],
			2 => [6,{}],
			3 => nil,
			4 => nil,
			5 => nil,
			6 => nil,
			7 => nil,
			8 => [6,{}],
			9 => [1,
				{
				1 => nil,
				2 => [8,{}], #tie
				3 => nil,
				4 => nil,
				5 => nil,
				6 => nil,
				7 => nil,
				8 => [2,{}],
				9 => nil,
				}
				],
			}
			],
		5 => nil,
		6 => [4,
			{
			1 => [9,
				{
				1 => nil,
				2 => [8,{}],
				3 => nil,
				4 => nil,
				5 => nil,
				6 => nil,
				7 => nil,
				8 => [2,{}], #tie
				9 => nil,
				}
				],
			2 => [1,{}],
			3 => nil,
			4 => nil,
			5 => nil,
			6 => nil,
			7 => nil,
			8 => [1,{}],
			9 => [1,{}],
			}
		],
		7 => nil,
		8 => [2,
			{
			1 => [9,
				{
				1 => nil,
				2 => nil,
				3 => nil,
				4 => [6,{}],
				5 => nil,
				6 => [4,{}],
				7 => nil,
				8 => nil,
				9 => nil,
				}
				],
			2 => nil,
			3 => nil,
			4 => [2,{}],
			5 => nil,
			6 => [2,{}],
			7 => nil,
			8 => nil,
			9 => [2,{}],
			}
			],
		9 => [1,
			{
			1 => nil,
			2 => [4,{}],
			3 => nil,
			4 => [2,{}],
			5 => nil,
			6 => [2,{}],
			7 => nil,
			8 => [4,{}],
			9 => nil,
			}
			]
		}
		], 
	6 => [5, 
		{
		1 => [3,{}],
		2 => [3,{}],
		3 => [9,
			{
			1 => [8,{}],
			2 => [8,{}],
			3 => nil,
			4 => [8,{}],
			5 => nil,
			6 => nil,
			7 => nil,
			8 => [1,{}],
			9 => nil,
			}
		],
		4 => [3,{}],
		5 => nil,
		6 => nil,
		7 => nil,
		8 => [3,{}],
		9 => [3,{}]
		}
		], 
	7 => nil, 
	8 => [5, 
		{
		1 => [3,{}],
		2 => [3,{}],
		3 => [1,
			{
			1 => nil,
			2 => [4,{}],
			3 => nil,
			4 => [9,{}],
			5 => nil,
			6 => [4,{}],
			7 => nil,
			8 => nil,
			9 => [4,{}],
			}
			],
		4 => [3,{}],
		5 => nil,
		6 => [3,{}],
		7 => nil,
		8 => nil,
		9 => [3,{}]
		}
		], 
	9 => [1, 
		{
		1 => nil,
		2 => [4,{}],
		3 => [4,{}],
		4 => [3,
			{
			1 => nil,
			2 => [5,{}],
			3 => nil,
			4 => nil,
			5 => [2,{}],
			6 => [2,{}],
			7 => nil,
			8 => [2,{}],
			9 => nil,
			}
			],
		5 => [4,{}],
		6 => [4,{}],
		7 => nil,
		8 => [4,{}],
		9 => nil
		}
		]
	}
]

def probe(moves, label)
	move, options = moves
	$labels[label] = $opcodes.size unless label.nil?
	if options.nil? or options.empty? then
		$opcodes << '&'+move.to_s
	else
		$opcodes << move
		buffers = []
		1.upto(9){|i|
			if options[i].nil? then
				$opcodes << 0
			elsif options[i][1].empty?
				$opcodes << '&'+options[i][0].to_s
			else
				buffer = '&'+($counter = $counter.next).to_s
				$opcodes << buffer
				buffers << buffer
			end
		}
		1.upto(9){|i|
			if not options[i].nil? and not options[i][1].empty? then
				probe(options[i], buffers.shift)
			end
		}
	end
 end

probe(xmoves, nil)

$counter = 0
$opcodes = $opcodes[10..-1] #remove prefix
$opcodes.each{|codes|
	if codes.is_a?(Numeric) then
		print " 0x0#{codes}, 0x00,"
	else
		hex = ($labels[codes]*2)+addr
		print " 0x#{hex.to_s(16)[2..3]}, 0x#{hex.to_s(16)[0..1]},"
	end
	$counter = $counter + 2
	puts if $counter % 16 == 0
}
puts
Just defining the states for X starting in the upper-left was time consuming enough. If I had more time I would have allowed the player to go first, but that would have been 8-9 times longer to define. I had the game to work on, so this was good enough. ;)

Here's the raw hex if you want to just copy it into your own Diskette:

Code: Select all

20 0C 70 20 47 70 20 8E 71 20 F0 71 20 13 70 20
9E 74 60 20 32 75 AD 02 FF A9 28 8D 0E 00 A9 58
8D 0C 00 A9 75 8D 0D 00 20 3D 75 20 28 75 20 28
75 20 28 75 A9 78 8D 0E 00 A9 74 8D 0C 00 A9 75
8D 0D 00 20 3D 75 60 20 32 75 AD 02 FF 18 A2 08
A9 80 CA 9D 00 F4 4A E0 00 D0 F7 18 A2 08 A9 01
CA 9D 08 F4 0A E0 00 D0 F7 A9 3C 8D 10 F4 8D 11
F4 8D 12 F4 8D 13 F4 8D 14 F4 8D 15 F4 8D 16 F4
8D 17 F4 8D 20 F4 8D 21 F4 8D 26 F4 8D 27 F4 A9
FF 8D 1A F4 8D 1B F4 8D 1C F4 8D 1D F4 8D 22 F4
8D 23 F4 8D 24 F4 8D 25 F4 A9 82 8D 43 02 8D 57
02 8D 6B 02 8D 7F 02 8D A7 02 8D BB 02 8D CF 02
8D E3 02 8D 0B 03 8D 1F 03 8D 33 03 8D 47 03 8D
48 02 8D 5C 02 8D 70 02 8D 84 02 8D AC 02 8D C0
02 8D D4 02 8D E8 02 8D 10 03 8D 24 03 8D 38 03
8D 4C 03 A9 83 8D 8F 02 8D 90 02 8D 91 02 8D 92
02 8D 94 02 8D 95 02 8D 96 02 8D 97 02 8D 99 02
8D 9A 02 8D 9B 02 8D 9C 02 8D F3 02 8D F4 02 8D
F5 02 8D F6 02 8D F8 02 8D F9 02 8D FA 02 8D FB
02 8D FD 02 8D FE 02 8D FF 02 8D 00 03 A9 84 8D
98 02 8D FC 02 8D F7 02 8D 93 02 38 A9 39 8D 72
02 E9 01 8D 6D 02 E9 01 8D 68 02 E9 01 8D D6 02
E9 01 8D D1 02 E9 01 8D CC 02 E9 01 8D 3A 03 E9
01 8D 35 03 E9 01 8D 30 03 A9 FF 20 2B 75 A9 FF
20 2B 75 A9 FF 20 2B 75 A9 FF 20 2B 75 60 A9 00
A2 0F 9D 00 00 CA D0 FA A9 FC 8D 0C 00 A9 75 8D
0D 00 A9 03 8D 11 00 8D 13 00 8D 15 00 A9 02 8D
17 00 8D 19 00 8D 1B 00 8D 1D 00 8D 1F 00 8D 21
00 18 A9 07 8D 10 00 69 05 8D 12 00 69 05 8D 14
00 A9 A3 8D 16 00 69 05 8D 18 00 69 05 8D 1A 00
A9 3F 8D 1C 00 69 05 8D 1E 00 69 05 8D 20 00 60
20 FF 71 20 84 74 20 66 72 20 84 74 4C F0 71 A0
00 B1 0C 8D 00 00 A9 01 8D 01 00 20 6B 73 38 AD
00 00 E9 01 0A AA BD 10 00 8D 00 00 BD 11 00 8D
01 00 A2 04 A9 00 8D 02 00 18 A8 A9 81 91 00 A9
15 6D 02 00 8D 02 00 48 A9 40 20 2B 75 68 18 CA
D0 E8 38 A2 04 AD 02 00 E9 18 8D 02 00 A8 A9 80
91 00 AD 02 00 E9 13 8D 02 00 48 A9 40 20 2B 75
68 38 CA D0 E8 60 AD F0 FF C9 00 F0 29 C9 31 F0
2D C9 32 F0 29 C9 33 F0 25 C9 34 F0 21 C9 35 F0
1D C9 36 F0 19 C9 37 F0 15 C9 38 F0 11 C9 39 F0
0D A9 00 8D F0 FF A9 FF 20 2B 75 B8 50 C8 38 E9
30 8D 00 00 0A A8 C8 B1 0C C9 00 F0 E4 8D 0F 00
88 B1 0C 8D 0E 00 AD 0F 00 8D 0D 00 AD 0E 00 8D
0C 00 A9 04 8D 01 00 20 6B 73 38 AD 00 00 E9 01
0A AA BD 10 00 8D 00 00 BD 11 00 8D 01 00 A0 29
A9 20 91 00 A2 02 A9 02 8D 02 00 18 A8 A9 81 91
00 A9 15 6D 02 00 8D 02 00 48 A9 40 20 2B 75 68
18 CA D0 E8 A2 02 CE 02 00 AD 02 00 18 A8 A9 80
91 00 A9 13 6D 02 00 8D 02 00 48 A9 40 20 2B 75
68 18 CA D0 E8 38 A2 02 AD 02 00 E9 14 8D 02 00
A8 A9 81 91 00 AD 02 00 E9 15 8D 02 00 48 A9 40
20 2B 75 68 38 CA D0 E8 18 A2 02 EE 02 00 AD 02
00 38 A8 A9 80 91 00 AD 02 00 E9 13 8D 02 00 48
A9 40 20 2B 75 68 38 CA D0 E8 60 18 AD 0B 00 69
01 8D 0B 00 AD 00 00 C9 01 F0 0F C9 02 F0 28 C9
03 F0 38 C9 04 F0 51 4C EC 73 18 AD 01 00 6D 05
00 8D 05 00 AD 01 00 6D 06 00 8D 06 00 AD 01 00
6D 0A 00 8D 0A 00 60 18 AD 01 00 6D 05 00 8D 05
00 AD 01 00 6D 07 00 8D 07 00 60 18 AD 01 00 6D
05 00 8D 05 00 AD 01 00 6D 08 00 8D 08 00 AD 01
00 6D 09 00 8D 09 00 60 18 AD 01 00 6D 04 00 8D
04 00 AD 01 00 6D 06 00 8D 06 00 60 C9 05 F0 29
C9 06 F0 4B C9 07 F0 5B C9 08 F0 74 18 AD 01 00
6D 03 00 8D 03 00 AD 01 00 6D 08 00 8D 08 00 AD
01 00 6D 0A 00 8D 0A 00 60 18 AD 01 00 6D 04 00
8D 04 00 AD 01 00 6D 07 00 8D 07 00 AD 01 00 6D
09 00 8D 09 00 AD 01 00 6D 0A 00 8D 0A 00 60 18
AD 01 00 6D 04 00 8D 04 00 AD 01 00 6D 08 00 8D
08 00 60 18 AD 01 00 6D 03 00 8D 03 00 AD 01 00
6D 06 00 8D 06 00 AD 01 00 6D 09 00 8D 09 00 60
18 AD 01 00 6D 03 00 8D 03 00 AD 01 00 6D 07 00
8D 07 00 60 A9 03 A2 08 DD 02 00 F0 0B CA D0 F8
A9 09 CD 0B 00 F0 04 60 4C C3 74 4C F5 74 AD F0
FF C9 00 F0 0D C9 79 F0 14 C9 6E F0 0D A9 00 8D
F0 FF A9 FF 20 2B 75 B8 50 E4 4C 0D 75 A9 00 8D
F0 FF 60 20 32 75 A9 18 8D 0E 00 A9 94 8D 0C 00
A9 75 8D 0D 00 20 3D 75 A9 68 8D 0E 00 A9 03 8D
0F 00 A9 AA 8D 0C 00 A9 75 8D 0D 00 20 3D 75 20
9E 74 4C 03 70 20 32 75 A9 1A 8D 0E 00 A9 A1 8D
0C 00 A9 75 8D 0D 00 20 3D 75 4C D8 74 20 32 75
AD 02 FF A9 B4 8D 0E 00 A9 BF 8D 0C 00 A9 75 8D
0D 00 20 3D 75 4C E8 75 38 A9 7F EA EA E9 01 D0
FA 60 A9 02 8D 0F 00 A9 00 8D 0E 00 60 A0 00 A2
00 48 20 28 75 68 B1 0C F0 0D 81 0E EE 0E 00 D0
03 EE 0F 00 C8 D0 EA 60 47 52 45 45 54 49 4E 47
53 20 50 52 4F 46 45 53 53 4F 52 20 46 41 4C 4B
45 4E 2E 00 53 48 41 4C 4C 20 57 45 20 50 4C 41
59 20 41 20 20 20 20 20 47 41 4D 45 20 5B 59 2F
4E 5D 3F 00 59 4F 55 20 4C 4F 53 45 2E 20 3A 44
00 57 45 20 54 49 45 44 2E 00 53 48 41 4C 4C 20
57 45 20 50 4C 41 59 20 41 47 41 49 4E 3F 00 54
48 45 20 4F 4E 4C 59 20 57 49 4E 4E 49 4E 47 20
20 20 20 4D 4F 56 45 20 49 53 20 4E 4F 54 20 54
4F 20 50 4C 41 59 2E 00 00 00 01 00 02 00 03 00
04 00 05 00 06 00 07 00 08 00 09 00 07 00 10 76  //actual logic starts here
38 76 60 76 88 76 B0 76 8C 77 00 00 B4 77 DC 77
09 00 00 00 F8 75 F8 75 F8 75 F8 75 F8 75 00 00
24 76 00 00 03 00 00 00 F4 75 00 00 F4 75 F4 75
F2 75 00 00 00 00 00 00 05 00 EE 75 00 00 4C 76
EE 75 00 00 EE 75 00 00 EE 75 EE 75 01 00 00 00
00 00 00 00 FA 75 00 00 F0 75 00 00 F0 75 F0 75
09 00 F8 75 F8 75 00 00 F8 75 F8 75 F8 75 00 00
74 76 00 00 01 00 00 00 F0 75 00 00 F2 75 F0 75
F0 75 00 00 00 00 00 00 05 00 EE 75 EE 75 9C 76
00 00 00 00 EE 75 00 00 EE 75 EE 75 09 00 F8 75
F8 75 00 00 00 00 00 00 F8 75 00 00 EA 75 00 00
03 00 C4 76 D8 76 00 00 00 77 00 00 28 77 00 00
50 77 78 77 09 00 00 00 F4 75 00 00 F8 75 00 00
F8 75 00 00 F4 75 00 00 08 00 FA 75 00 00 00 00
FA 75 00 00 FA 75 00 00 00 00 EC 76 01 00 00 00
00 00 00 00 F4 75 00 00 F0 75 00 00 00 00 00 00
06 00 F4 75 F4 75 00 00 00 00 00 00 00 00 00 00
F4 75 14 77 01 00 00 00 F8 75 00 00 00 00 00 00
00 00 00 00 EC 75 00 00 04 00 3C 77 EA 75 00 00
00 00 00 00 00 00 00 00 EA 75 EA 75 09 00 00 00
F8 75 00 00 00 00 00 00 00 00 00 00 EC 75 00 00
02 00 64 77 00 00 00 00 EC 75 00 00 EC 75 00 00
00 00 EC 75 09 00 00 00 00 00 00 00 F4 75 00 00
F0 75 00 00 00 00 00 00 01 00 00 00 F0 75 00 00
EC 75 00 00 EC 75 00 00 F0 75 00 00 05 00 EE 75
EE 75 A0 77 EE 75 00 00 00 00 00 00 EE 75 EE 75
09 00 F8 75 F8 75 00 00 F8 75 00 00 00 00 00 00
EA 75 00 00 05 00 EE 75 EE 75 C8 77 EE 75 00 00
EE 75 00 00 00 00 EE 75 01 00 00 00 F0 75 00 00
FA 75 00 00 F0 75 00 00 00 00 F0 75 01 00 00 00
F0 75 F0 75 F0 77 F0 75 F0 75 00 00 F0 75 00 00
03 00 00 00 F2 75 00 00 00 00 EC 75 EC 75 00 00
EC 75 00 00
- Joby
inXile's ruthless Leader of Scripters

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest