Lunar Jetman protection

reminisce about bbc micro & electron games like chuckie egg, repton, elite & exileRelated forum: adventures


User avatar
billcarr2005
Posts: 1278
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: Lunar Jetman protection

Post by billcarr2005 » Fri Feb 08, 2019 11:04 am

Nightshade UEF and CSW are here
viewtopic.php?t=5023#p86170

The code in Nightshade at &710A JMP &719C occurs if &240 isn't &22
&719C decrypts &900 (format code posted on previous page) and executes it.

Lunar Jetman has identical code at &6100, checking whether &240 isn't &47
&619C then decrypts &900 and executes it.

As stated earlier, the code is mostly the same, save for the odd change in values here and there... (and any typos!)

Code: Select all

NIGHTSHADE

F01 LDA #0F ; LDX #00 ; JSR FFF4
F08 JMP B09
F0B Protection (c) Kevin Edwards 1985 This protection system may not be copied in part or whole without written permission from the author.

B09 SEI
B0A LDX #FF ; TXS
B0D LDA #2A ; STA 204
B12 LDA #0C ; STA 205		C2A
B17 LDX #00
B19 LDA #49 ; STA &A00,X
B1E TXA
B1F STA &A01,X
B22 INX ; INX ; BNE B19

B26 LDA #40 ; STA FE4B ; STA FE6B
B2E LDA #7F ; STA FE4E ; STA FE6E
B36 LDA #E0 ; STA FE4E ; STA FE6E
B3E LDA #34 ; STA FE48 ; STA FE49 *DIFFERENCE*
B46 LDA #AC ; STA FE68 ; STA FE69 *DIFFERENCE*
B4E LDA #7B ; STA FE44 ; STA FE45 *DIFFERENCE*
B56 LDA #CD ; STA FE64 ; STA FE65 *DIFFERENCE*
B5E LDY #00 ; STY 70
B62 LDA #10 ; STA 71		1000
B66 LDA FE49 ; EOR FE68 ; EOR FE69 ; SEC ; SBC FE44 ; EOR FE48 ; EOR B00,Y; STA (70),Y
B7B INY ; BNE B66
B7E INC 71
B80 LDA 71 ; CMP #40 ; BCC B66
B86 LDX #00 ; LDY #00
B8A JMP D00

B8D SEI
B8E LDA #00 ; STA 70 ; STA 71
B94 TAY
B95 LDA 71 ; EOR E00,Y ; STA 71
B9C LDX #08
B9E LDA 71 ; ROL A ; BCC BAF
BA3 LDA 71 ; EOR #08 ; STA 71
BA9 LDA 70 ; EOR #10 ; STA 70
BAF ROL 70 ; ROL 71
BB3 DEX ; BNE B9E
BB6 INY ; CPY #20 ; BNE B95
BBB LDA 70 ; CMP EFE ; BNE BCC
BC2 LDA 71 ; CMP EFF ; BNE BCC
BC9 JMP E00				<-- DECRYPTED CODE

BCC LDA #C8 ; LDX #03 ; LDY #00 ; JSR FFF4	(SAVE LOOP!)
BD5 STA E00,Y ; INY ; JMP BD5
BDC Kevin!

BE2 SEI
BE3 LDA #05 ; STA FE10
BE8 LDA #03 ; STA FE08
BED RTS

BEE JSR BE2
BF1 LDX #00
BF3 STA E00,X ; STA C2A,X
BF9 INX ; BNE BF3
BFC LDA #07 ; JSR CB1D

C01 LDX #00
C03 LDA C14,X ; BEQ C0E
C08 JSR FFEE
C0B INX ; BNE C03
C0E JSR FFE7
C11 JMP C01

C14 LOAD ERROR! TRY AGAIN [00]

C2A LDA FE4D ; BPL C7C
C2F AND #40 ; BNE C49
C33 SEC
C34 ROR FE64 ; DEC FE49 ; LDA FE48 ; ORA #01 ; TAX
C40 INC A00,X
C43 LDX FE44 ; LDA FC ; RTI
C49 LDA FE64 ; EOR FE68 ; ORA #01 ; STA FE48
C54 INC FE44 ; DEC FE69 ; LDA FE69 ; ORA #01 ; STA FE44
C62 EOR FE45 ; EOR #D4 ; ORA #01 ; STA FE49
C6C LDA FE48 ; ASL A ; STA 70
C72 LDA #0A ; STA 71
C76 LDA FE64
C79 JMP (0070)
C7C LDA FE6D ; AND #40 ; BEQ CB3
C83 LDA FE64 ; LDA FE68 ; EOR FE48 ; ORA #01 ; STA FE45
C91 TSX ; CPX #FE ; BCS CA3
C96 LDA 102,X ; EOR FE48 ; ORA #01 ; STA FE68 ; BNE CAD
CA3 LDA 02,X ; EOR FE49 ; ORA #01 ; STA FE69
CAD LDA FC ; DEC FE65 ; RTI
CB3 LDX FE44
CB6 LDA FE67 ; EOR FE49 ; EOR FE64 ; EOR #EE ; ORA #01 ; STA FE68
CC6 EOR FE46 ; INC FE49 ; ORA #01 ; STA FE69
CD1 LDA FC ; RTI
CD4 SEI
CD5 LDX #35
CD7 LDA D940,X ; STA 200,X ; DEX ; BPL CD7
CE0 LDA #2A ; STA 204
CE5 LDA #0C ; STA 205	C2A
CEA LDA #4C ; STA 287 ; LDA #87 ; STA 288 ; LDA #02 ; STA 289	287
CF9 LDA #03 ; STA 258
CFE CLI ; RTS

-----
D00 LDA D00		<--	LOW
D03 SEC
D04 ADC #CD 		<--
D06 EOR FE68 ; INC D05 ; DEC FE69 ; EOR FF00,Y ; EOR DC1C,X ; EOR FE64
D18 LDX FE69 ; CPX FE48 ; ROR FE49 ; EOR E00,Y ; INC D28
D27 EOR #D9		<--
D29 EOR FE65 ; SEC ; ROL FE48
D30 LDX FE44 ; EOR D9CD,X ; EOR B00,Y ; DEC FE48 *DIFFERENCE*
D3C NOP ; EOR FE47 ; EOR D00,Y ; DEC D48
D46 CLC
D47 SBC C00		<--	LOW
D4A E0R FE64 ; EOR FE46 ; EOR B01,X ; EOR FE66
D56 EOR 1900,Y		<--	HI
D59 EOR FE69
D5C SEI
D5D PHA
D5E LDA FE68 ; STA C66 ; EOR D05 ; EOR FE44 ; TAX
D6B PLA
D6C CLI
D6D EOR FE68
D70 EOR FE45 *DIFFERENCE*
D73 SEC ; SBC FE48 ; EOR D01,Y ; EOR FE68 ; EOR #FF
D7F PHA
D80 INC 1900,X		<--	HI
D83 EOR FE65 ; EOR FE64 ; EOR 900,Y
D8C LDX FE45 ; STX CC0
D92 EOR 1300,Y		<--	HI
D95 EOR B00,X		<--	LOW
D98 DEC D96
D9B EOR FE45 ; EOR 700,Y
DA1 LDX FE48 ; CPX FE44 ; SBC FE49
DAA EOR D000,Y		<--	HI
DAD STA E00,Y
DB0 INY ; BEQ DB6
DB3 JMP D00
DB6 INC D94 ; LDA D94 ; CMP #30 ; BCC DC5
DC0 LDA #10 ; STA D94
DC5 INC D58 ; LDA D58 ; CMP #40 ; BCC DD4
DCF LDA #10 ; STA D58
DD4 INC D82 ' LDA D82 ; CMP #40 ; BCC DE3
DDE LDA #10 ; STA D82
DE3 INC DAC ; LDA DAC ; CMP #E5 ; BCC DF2
DED LDA #C1 ; STA DAC
DF2 INC D01 ; BEQ DFD
DF7 JSR CD4
DFA JMP D00
DFD JMP B8D
------
DECRYPTED
---------
E00 LDX #0E ; STX FE00 *DIFF*
E05 LDA #3D ; STA FE01 *DIFF*
E0A INX ; STX FE00
E0E LDA #B4 ; STA FE01 *DIFF*
E13 INX ; STX FE00
E17 LDA #BB ; STA FE44 *DIFF*
E1C LDA #81 ; STA FE45 *DIFF*
E21 LDA #22 ; STA 240 *DIFF*
E26 LDX #E2 ; TXS ; PHA
E2A LDA #72 ; PHA ; PHA
E2E LDA #03 ; PHA
E31 LDX #00 ; TXA ; STA E00,X ; INX ; CPX #34 ; BNE E34
E3C LDA #7F ; STA FE4E ; STA FE6E
E44 LDX #00
E46 LDA 700,X ; EOR D9E9,X ; STA 700,X (EOR CHANGES)
E4F INX ; BNE E46
E52 JSR 700
E55 LDA #9D ; STA 204
E5A LDA #0E ; STA 205	E9D
E5F LDA #00 ; STA 75 ; STA 70 ; STA 71 ; STA 73
E69 LDA #11 ; STA 72
E6D LDA #47 ; STA 74
E71 JSR EE3
E74 BIT 75 ; BPL E74
E78 JSR BE2
E7B JSR 5738
E7E LDA #00 ; STA 75 ; STA 70 ; STA 71
E86 LDA #57 ; STA 72
E8A LDA #00 ; STA 73
E8E LDA #1E ; STA 74		1E00/5700
E92 JSR EE3
E95 BIT 75 ; BPL E95
E99 JSR BE2
E9C RTS

E9D TYA ; PHA
E9F LDA FE08 ; BPL ED8
EA4 TAY ; AND #01 ; BEQ ED8
EA9 TYA ; AND #70 ; BEQ EB5
EAE BIT 70 ; BPL ED8
EB2 JMP BEE
EB5 LDA FE09 ; BIT 70 ; BMI EC4
EBC CMP #BC ; BNE ED8
EC0 STA 70 ; BEQ ED8
EC4 LDY #00 ; STA (71),Y
EC8 INC 71 ; BNE ECE
ECC INC 72
ECE LDA 73 ; BNE ED6
ED2 DEC 74 ; BMI EDD
ED6 DEC 73
ED8 PLA ; TAY
EDA LDA FC ; RTI
EDD LDA #FF ; STA 75 ; BMI ED8
EE3 LDA #03 ; STA FE08
EE8 LDA #05 ; STA FE10
EED LDX #00 ; DEX ; BNE EEF
EF2 LDA #85 ; STA FE10
EF7 LDA #D5 ; STA FE08
EFC CLI
EFD RTS
EFE [FF]
EFF [BD]
F00 [00]

REPLAY CHECK, IDENTICAL TO JETMAN
---------------------------------
700  PLA ; PHA ; TAY
703 LDA #93 ; STA E4A
708 LDA #0C ; STA E4B
70D SEI
70E LDA #01 ; STA FE82
713 JSR 743
716 LDA #00 ; STA FE82
71B JSR 743
71E LDA #35 ; STA FE80
723 JSR 743
726 LDA #0D ; STA FE81
72B JSR 743
72E LDA #01 ; STA FE81
733 JSR 743
736 STA FE81
739 JSR 743
73C STA FE81
73F JMP 749
742 RTS

743 LDX #14 ; DEX ; BNE 745 ; RTS

749 LDX #49 ; TXA ; STA 700,X ; DEX ; BPL 74C

752 LDX #0F ; STX FE30
757 LDA 8000 ; CMP #B7 ; BNE 768
75E LDA 8009 ; CMP #52 ; BNE 768
765 JMP 7B7
768 LDA 9FFC ; CMP #CD ; BNE 776
76F LDA 9FFD ; CMP #D9 ; BEQ 765
776 LDA 9FFA ; CMP #AA ; BNE 784
77D LDA 9FFB ; CMP #FF ; BEQ 765
784 LDA 9F0F ; CMP #20 ; BNE 799
78B LDA 9F10 ; CMP #51 ; BNE 799
792 LDA 9F11 ; CMP #FF ; BEQ 765
799 DEX ; BPL 754
79C LDA #F1 ; STA E00,Y
7A1 DEY
7A2 LDA #B5 ; STA E00,Y
7A7 DEY
7A8 LDA #4C ; STA E00,Y
7AD LDX #AD
7AF TXA ; STA 700,X ; DEX ; BNE 7B0
7B6 RTS
7B7 LDX #B7
7B9 TXA ; STA 700,X ; DEX ; BNE 7BA
7C0 LDA #07 ; JSR CB1D
7C5 LDX #00 ; LDA 7D8,X ; BEQ 7D2
7CC JSR FFEE ; INX ; BNE 7C7
7D2 JSR FFE7
7D5 JMP 7C5
7D8 Remove REPLAY and try again![00]Kevin[20 20 20 20 20 20]

-----
5700 E0 60 60 60 60 60 62 FE
5708 38 6C C6 C6 C6 C6 6C 38
5710 0C 1C 2E 66 46 CE DB 66
5718 60 70 68 6C 66 66 66 FC
5720 7C 18 18 18 18 18 18 7C
5728 CC D6 D6 E6 E4 C4 C8 DE
5730 0E 30 60 C6 CE F6 66 1C

5738 LDA #88 ; STA FE20
573D LDY #37
573F LDA 5700,Y ; STA 7FC8,Y
5745 DEY ; BPL 573F
5748 LDY #0D
574A LDA 5762,Y
574D STY FE00 ; STA FE01
5753 DEY ; BPL 574A
5756 LDY #0F
5758 LDA 5770,Y ; STA FE21
575E DEY ; BPL 5758
5761 RTS
5762 3F,07,21,24,26,00,01,16,01,07,20,08,0F,F9
5770 07,17,27,37,47,57,67,77,81,91,A1,B1,C1,D1,E1,F1

(RTS FROM E9C!)
7204 LDA #00 ; STA 7500
7209 LDA #7F ; STA FE4E ; STA FE6E
7211 LDA #E0 ; STA FE4E ; STA FE6E
7219 LDA #40 ; STA FE6B
721E LDA #43 ; STA FE68 ; STA FE69 *DIFFERENCE*
7226 LDA 00 ; STA FE64
722B LDA 01 ; STA FE65
7230 LDX #00 ; LDY #00 ; JMP 7300

7237 TSX
7238 LDY 101,X ; LDA 102,X ; EOR 1FF ; STA 00
7243 LDA 70 ; EOR 100,Y ; EOR 1100, Y ; STA 01
724D RTS
724E [20]A big hi to...BTW,DM,Andy,PP,Sparrow man,MG,CJ and all members of the VIA hate society [40 x 90]

------ SAME AS JETMAN, JUST 7300 INSTEAD OF 6300
7300 LDA 7300 ; INC 731F ; EOR FE68 ; SEC ; ROL FE68 ; TAY
730E LDA 731F ; EOR FE68 ; STA 731A
7317 TYA ; CLC ; ADC #F6	<-- CHANGED
731B DEC FE69 ; EOR #38		<-- CHANGED
7320 EOR FE68 ; EOR FF00, ; INC 731F
7329 EOR 7000,X ; DEC FE64 ; EOR D940,X ; DEC FE69
7335 EOR 7300,X ; EOR 7400,X ; EOR FE64 ; SEC ; ADC 7301
7342 LDY FE68 ; STY FE69
7348 EOR FE65 ; EOR D9CD,X ; EOR FE66 ; EOR FE68
7354 CLC ; ADC 7401,X ; INC 731A
735B TAY
735C LDA 731A ; EOR FE68 ; STA 731A
7365 TYA
7366 EOR FE69 ; EOR FE68 ; STA 7400,X
736F INX ; BNE 7300

7372 LDA #03 ; STA 258
7377 LDA #40 ; STA D00
737C LDA #4C ; STA 287 ; LDA #87 ; STA 288 ; LDA #02 ; STA 289
738B LDY #35
738D LDA D940,Y ; STA 200,Y ; DEY ; BPL 738D
7396 LDA 731F ; EOR FE68 ; STA 731F
739F INC 731F ; INC 7301 ; BEQ 73AA
73A7 JMP 7300

73AA LDA #00 ; STA 70 ; STA 71
73B0 TAY
73B1 LDA 71 ; EOR 7400,Y ; STA 71
73B8 LDX #08
73BA LDA 71 ; ROL A ; BCC 73CB
73BF LDA 71 ; EOR #08 ; STA 71
73C5 LDA 70 ; EOR #10 ; STA 70
73CB ROL 70 ; ROL 71 ; DEX ; BNE 73BA
73D2 INY ; CPY #20 ; BNE 73B1
73D7 LDA 70 ; CMP 74FE ; BNE 73E5
73DE LDA 71 ; CMP 74FF ; BEQ 7400
73E5 LDA #C8 ; LDX #03 ; LDY #00 ; JSR FFF4
73EE STA 7400, Y ; INY ; JMP 73EE
73F5 Kevin[20 20 20 20 20 20]
---
7400 LDA 3B2 ; CMP #4E ; BNE 73EE
7407 LDA #6F ; PHA
740A LDA #FF ; PHA	7000
74-D LDA #B2 ; PHA
7410 LDA #44 ; PHA
7413 JMP 742C
7416 (c) Kevin Edwards 1985
742C LDX #00
742E TXA ; STA 7400,X ; INX ; CPX #2F ; BNE 742F
7437 LDX #0F ; STX FE30
743C LDY #05
743E LDA 8009,Y ; CMP 7451,Y ; BNE 744C
7446 DEY ; BPL 743E
7449 JMP 73EE
744C DEX ; BPL 7439 ; BMI 7457
7451 Replay
7457 LDA #FC ; STA FE64
745C LDA #34 ; STA FE65
7461 PLA ; STA FE68
7465 PLA ; STA FE69
7469 LDX #69 ; TXA ; STA 7400,X ; DEX ; BNE 746C
7472 LDY #00
7474 RTS (TO 7000 ON STACK)

------
7000 LDA 7000 ; EOR FE68 ; INC FE69 ; EOR FE69
700C LDX FE64 ; EOR FE67 ; EOR D9CD,X ; DEC FE69 ; DEC 701C
701B EOR #DD			<-- CHANGED
701D LDX FE68 ; EOR FF00,Y ; PHA
7024 LDA FE69 ; EOR FE64 ; INC FE69 ; EOR FE68
7030 CLC ; ADC FE65 ; STA FE69
7037 PLA ; EOR 7000,X ; DEC FE65 ; STX 604D
7041 EOR 7101,Y ; SEC ; ROL FE69 ; EOR FE68 ; CLC
704C ADC #FE			<-- CHANGED
704E INC FE65 ; EOR FE67 ; EOR FE64 ; EOR 900,Y
705A SEC ; ROR FE68 ; EOR DC1C,X
7061 LDX FE69 ; STX 7079
7067 EOR FE66 ; SEC ; SBC 7001
706E LDX FE68 ; EOR 7100,Y ; INC FE68 ; CLC
7078 ADC #FF			<-- CHANGED
707A EOR D940,X ; EOR FE64 ; EOR #92 ; STA 7100,Y
7085 LDA #40 ; STA D00 ; DEY ; BNE 7090
708D JMP 7000
7090 LDA #03 ; STA 258
7095 LDA #4C ; STA 287 ; LDA #87 ; STA 288 ; LDA #02 ; STA 289
70A4 LDY #35 ; LDA D940,Y ; STA 200,Y ; DEY ; BPL 70A6
70AF INY ; INC 7001 ; BNE 708D
70B5 LDA #00 ; STA 70 ; STA 71
70BB TAY ; LDA 71 ; STA 7100,Y ; STA 71
70C3 LDX #08 ; LDA 71 ; ROL A ; BCC 70D6
70CA LDA 71 ; EOR #08 ; STA 71
70D0 LDA 70 ; EOR #10 ; STA 70
70D6 ROL 70 ; ROL 71
70DA DEX ; BNE 70C5
70DD INY ; CPY #20 ; BNE 70BC
70E2 LDA 70 ; CMP 71FE ; BNE 70F0
70E9 LDA 71 ; CMP 71FF ; BEQ 7100
70F0 LDA #C8 ; LDX #03 ; LDY #00 ; JSR FFF4
70F9 STA 7100,Y ; INY ; JMP 70F9
---
7100 LDA 240 ; CMP #22 ; BEQ 710D
7107 STY 7104
710A JMP 719C
710D LDA #0E ; STA FE00
7112 LDA FE01 ; CMP #3D ; BNE 710A
7119 LDA #0F ; STA FE00
711E LDA FE01 ; CMP #B4 ; BNE 710A
7125 LDA #6C ; PHA
7128 LDA #AB ; PHA	6CAC
712B STY 7126 ; STY 7129
7131 LDA FE46 ; PHA
7135 LDA FE47 ; PHA
7139 LDY #00 ; TYA ; STA 7100,Y ; INY ; CPY #3C ; BCC 713C
7144 LDY #00
7146 LDA 71D3,Y ; CMP #05 ; BEQ 7158
714D STA 210,Y
7150 LDA #00 ; STA 71D3,Y
7155 INY ; BNE 7146
7158 STA 714D ; STA 714E ; STA 714F
7161 LDY #00 ; TYA ; STA 719C,Y ; STA 8000,Y ; INY ; BNE 7164
716D PLA ; STE FE68
7171 PLA ; STA FE69
7175 LDY #00
7177 LDA 1100,Y ; EOR FE68 ; EOR FE69 ; STA 1100,Y
7183 INY ; BNE 7177
7186 INC 7179 ; INC 7182
718C LDA 7179 ; CMP #71 ; BCC 7177
7193 LDY #93 ; STA 7100,Y ; DEY ; BNE 7195
719B RTS (TO 6CAC FROM STACK AT 7125)

719C LDY #00 ; TYA ; STA 7100,Y ; INY ; CPY #9C ; BNE 719F
71A7 LDX #00 ; STA E00,X ; INX ; BNE 71A9
71AF INC 71AB
71B2 LDA 71AB ; CMP #70 ; BCC 71A9
71B9 LDA 900,X ; EOR D9D8,X ; STA 900,X
71C2 INX ; BNE 71B9
71C5 LDA #00 ; STA 71BC ; STA 71BD ; STA 71BE
71D0 JMP 900
71D3 LDX #0F ; STX FE30
71D8 LDA 8000 ; CMP #B7 ; BEQ 71E3
71DF DEX ; BPL 71D5
71E2 RTS
71E3 LDA #03 ; STA 71
71E7 LDY #FF ; TYA ; INY ; STY 70
71ED STA (70),Y
71EF INY ; BNE 71ED
71F2 INC 71
71F4 SEC ; BCS 71ED
71F7 05 2A 2A 2A 2A 2A 2A 79 DE 00
7201 JSR 7237

------ (RTS FROM 719B)
6CAC 
Last edited by billcarr2005 on Fri Feb 08, 2019 11:05 am, edited 1 time in total.

User avatar
billcarr2005
Posts: 1278
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: Lunar Jetman protection

Post by billcarr2005 » Fri Feb 08, 2019 11:31 am

On BeebEM 4.14...
If Lunar Jetman is falling at the final hurdle, the final decryption is to push FE61 and FE6A to the stack, pull them from the stack a little while later and store in FE68 and FE69 and then EOR the code, from &1800 until &6100 with FE68 and FE69

Nightshade is doing similar, but pushing FE46 and FE47 to the stack instead, pulling them from the stack, EORing the code from 1100 to 7100.

So is there a difference between how the System VIA and User VIA are emulated in BeebEM? :?
Unless the code is getting incorrectly decrypted earlier...

LUNAR JETMAN

Code: Select all

6131 LDA FE61 ; PHA
6135 LDA FE6A ; PHA
6139 LDY #00 ; TYA ; STA 6100,Y ; INY ; CPY #3C ; BCC 613C
6144 LDY #00
6146 LDA 61D3,Y ; CMP #05 ; BEQ 6158
614D STA 210,Y
6150 LDA #00 ; STA 61D3,Y
6155 INY ; BNE 6146
6158 STA 614D ; STA 614E ; STA 614F
6161 LDY #00 ; TYA ; STA 619C,Y ; STA 8000,Y ; INY ; BNE 6164
616D PLA ; STA FE68
6171 PLA ; STA FE69
6175 LDY #00
6177 LDA 1800,Y ; EOR FE68 ; EOR FE69 ; STA 1800,Y
6183 INY ; BNE 6177
6186 INC 6179 ; INC 6182
618C LDA 6179 ; CMP #61 ; BCC 6177
NIGHTSHADE

Code: Select all

7131 LDA FE46 ; PHA
7135 LDA FE47 ; PHA
7139 LDY #00 ; TYA ; STA 7100,Y ; INY ; CPY #3C ; BCC 713C
7144 LDY #00
7146 LDA 71D3,Y ; CMP #05 ; BEQ 7158
714D STA 210,Y
7150 LDA #00 ; STA 71D3,Y
7155 INY ; BNE 7146
7158 STA 714D ; STA 714E ; STA 714F
7161 LDY #00 ; TYA ; STA 719C,Y ; STA 8000,Y ; INY ; BNE 7164
716D PLA ; STE FE68
7171 PLA ; STA FE69
7175 LDY #00
7177 LDA 1100,Y ; EOR FE68 ; EOR FE69 ; STA 1100,Y
7183 INY ; BNE 7177
7186 INC 7179 ; INC 7182
718C LDA 7179 ; CMP #71 ; BCC 7177
Last edited by billcarr2005 on Fri Feb 08, 2019 11:32 am, edited 1 time in total.

Diminished
Posts: 121
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Lunar Jetman protection

Post by Diminished » Fri Feb 08, 2019 11:58 am

billcarr2005 wrote:
Fri Feb 08, 2019 11:04 am
Lunar Jetman has identical code at &6100, checking whether &240 isn't &47
&619C then decrypts &900 and executes it.
Ah, that's why I failed to trap it -- it isn't decrypted until it's about to be executed. I should have bothered to read the code I posted myself. [-X

Kevin outwitted me again.

Thanks Bill.
Last edited by Diminished on Fri Feb 08, 2019 11:59 am, edited 2 times in total.

User avatar
billcarr2005
Posts: 1278
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: Lunar Jetman protection

Post by billcarr2005 » Fri Feb 08, 2019 2:08 pm

I've discovered why BeebEM 4.14 is failing.

Code: Select all

6131 LDA FE61 ; PHA	results in &FF on stack (&126), should be &69 (as on B-em v2.2)
6135 LDA FE6A ; PHA	results in &FF on stack (&125), should be &D4 (as on B-em v2.2)
By setting a breakpoint at &6161,

Code: Select all

B 6161
C 1A5 D4 69
the code will then decrypt fine, can be seen with another breakpoint at &5C00... however, something else prevents it from working further on :?
Last edited by billcarr2005 on Fri Feb 08, 2019 2:09 pm, edited 1 time in total.

Kevin Edwards
Posts: 115
Joined: Tue Mar 14, 2006 9:16 pm
Contact:

Re: Lunar Jetman protection

Post by Kevin Edwards » Fri Feb 08, 2019 7:51 pm

It's quite amazing how I still remember most of this code from over 33 years ago - written when i was only 19. I wish my memory was as good now as it was then!

So BeebEM appears to have some issues with its 6522 TIMER emulation? I guess it's based on a very different code-base than b-em?

Kevin.

Post Reply