What sort of autostart is this?

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

What sort of autostart is this?

Post by Noizer »

Vic20-Ian wrote: Tue Jan 26, 2021 7:53 am This version above is the hacked version with extra life for every note.[...]
Are there any tape / tap to prg experts that can extract the unhacked prg from the tap file?
ops wrote: Tue Jan 26, 2021 11:35 am This version is extracted from a tape with real VIC.
perils-of-willy.zip
Vic20-Ian wrote: Tue Jan 26, 2021 9:47 am I just loaded this and it seems correct with no extra lifespan for collecting a note. [...]Pow.rar
I haven't done that much research, but I realized that the same "feature" of live gifts occurs by simply extracting the main code from tap ($ 1200-5FFF), skipping all other code @029F and headers @033C.
Then starting with SYS12269 = executes like a "hacked version".
Vic20-Ian confirmed this behavior.
Then OPS wrote ... (congratulations, you posted faster your result)
ops wrote: Tue Jan 26, 2021 11:35 am This version is extracted from tape with real VIC.perils-of-willy.zip
So I had to look at the loading code for the tap extraction from "The Perils of Willy" to find out why the "allegedly" hacked version donates extra live for every note catched, but the original does not.
I only saw 2 byte differences @029F. Sure, there are minor differences in the main code, but they don't affect any code segment.
Original version versus hacked one.png
I still don't know why the program is doing this, but I've found that changing the two bytes @ 029F back to BF 00, packing and running the header code @ 02D3 changes the "hacked version" back to normal behavior, no extra life on notes!
So far, so good. My report. IMO, both versions out there could be such cracked ones. One bad, one good.
One question remains, however: "How does this autostart work?"
The first tape header is only loaded on $ 02FF without touching $ 0302 and $ 0303 (basic warm start vectors), and these addresses are not changed later.
The IRQ vectors are touched, but only after the entire code 02A1 - 02FF is autostarted.
See tap layout screenshot and extracted code below (Vice). BR
Tap_Layout.png
Tap_Layout.png (3.36 KiB) Viewed 656 times

Code: Select all


(C:$03fc) m 033c 03fb
>C:033c  03 9f 02 00  03 4d 49 4e   .....MIN
>C:0344  45 52 20 0d  4c 4f 41 44   ER .LOAD
>C:034c  49 4e 47 05  00 20 20 20   ING..
>C:0354  20 20 20 20  20 20 20 20
>C:035c  20 20 20 20  20 20 20 20
>C:0364  20 20 20 20  20 20 20 20
>C:036c  20 20 20 20  20 20 20 20
>C:0374  20 20 20 20  20 20 20 20
>C:037c  20 20 20 20  20 20 20 20
>C:0384  20 20 20 20  20 20 20 20
>C:038c  20 20 20 20  20 20 20 20
>C:0394  20 20 20 20  20 20 20 20
>C:039c  20 20 20 20  20 20 20 20
>C:03a4  20 20 20 20  20 20 20 20
>C:03ac  20 20 20 20  20 20 20 20
>C:03b4  20 20 20 20  20 20 20 20
>C:03bc  20 20 20 20  20 20 20 20
>C:03c4  20 20 20 20  20 20 20 20
>C:03cc  20 20 20 20  20 20 20 20
>C:03d4  20 20 20 20  20 20 20 20
>C:03dc  20 20 20 20  20 20 20 20
>C:03e4  20 20 20 20  20 20 20 20
>C:03ec  20 20 20 20  20 20 20 20
>C:03f4  20 20 20 20  20 20 20 20


.C:029f  BF 00	"original version"

.C:029f  A1 02	"hacked version"
      
.C:02a1  AD 9F 02    LDA $029F
.C:02a4  C9 A1       CMP #$A1
.C:02a6  F0 03       BEQ $02AB
.C:02a8  4C BF EA    JMP $EABF
.C:02ab  2C 24 91    BIT $9124
.C:02ae  68         PLA
.C:02af  68          PLA
.C:02b0  68          PLA
.C:02b1  68          PLA
.C:02b2  68          PLA
.C:02b3  68          PLA
.C:02b4  4C C4 02    JMP $02C4
.C:02b7  78          SEI
.C:02b8  A9 A1       LDA #$A1
.C:02ba  8D 14 03    STA $0314
.C:02bd  A9 02       LDA #$02
.C:02bf  8D 15 03    STA $0315
.C:02c2  58          CLI
.C:02c3  60          RTS
.C:02c4  78          SEI
.C:02c5  A9 BF       LDA #$BF
.C:02c7  8D 14 03    STA $0314
.C:02ca  A9 EA       LDA #$EA
.C:02cc  8D 15 03    STA $0315
.C:02cf  58          CLI
.C:02d0  4C F0 02    JMP $02F0
.C:02d3  A9 00       LDA #$00
.C:02d5  8D 70 03    STA $0370
.C:02d8  8D 71 03    STA $0371
.C:02db  8D 72 03    STA $0372
.C:02de  8D 73 03    STA $0373
.C:02e1  8D 74 03    STA $0374
.C:02e4  8D 75 03    STA $0375
.C:02e7  A9 01       LDA #$01
.C:02e9  85 CC       STA $CC
.C:02eb  20 ED 2F    JSR $2FED
.C:02ee  00          BRK
.C:02ef  00          BRK
.C:02f0  A9 01       LDA #$01
.C:02f2  85 B9       STA $B9
.C:02f4  85 BA       STA $BA
.C:02f6  A9 00       LDA #$00
.C:02f8  85 B7       STA $B7
.C:02fa  20 46 F5    JSR $F546
.C:02fd  4C D3 02    JMP $02D3
.C:0300  3A          NOOP
.C:0301  C4 83       CPY $83
.C:0303  C4 7C       CPY $7C
.C:0305  C5 1A       CMP $1A
.C:0307  C7 E4       DCP $E4
.C:0309  C7 86       DCP $86
.C:030b  CE 00 00    DEC $0000


(C:$031f) m 033c 03fb
>C:033c  03 00 12 00  60 4d 41 4e   ....`MAN
>C:0344  49 43 20 4d  49 4e 45 52   IC MINER
>C:034c  00 00 00 00  00 00 00 00   ........
>C:0354  05 00 00 00  00 00 01 00   ........
>C:035c  00 00 00 00  00 00 00 00   ........
>C:0364  00 00 00 00  00 00 00 00   ........
>C:036c  00 00 00 00  00 00 00 00   ........
>C:0374  00 00 00 00  00 00 00 00   ........
>C:037c  00 00 00 00  00 00 00 00   ........
>C:0384  00 53 20 48  45 41 52 4e   .S HEARN
>C:038c  44 45 4e 20  41 4e 44 20   DEN AND
>C:0394  49 20 4c 4f  4d 41 53 00   I LOMAS.
>C:039c  00 00 00 00  00 00 00 00   ........
>C:03a4  00 00 00 00  00 00 00 00   ........
>C:03ac  00 00 00 00  00 00 00 00   ........
>C:03b4  00 00 00 00  00 00 00 00   ........
>C:03bc  00 00 00 00  00 00 00 00   ........
>C:03c4  00 00 00 00  00 00 00 00   ........
>C:03cc  00 00 00 00  00 00 00 00   ........
>C:03d4  00 00 00 00  00 00 00 00   ........
>C:03dc  00 00 00 00  00 00 00 00   ........
>C:03e4  00 00 00 00  00 00 00 00   ........
>C:03ec  00 00 00 00  00 00 00 00   ........
>C:03f4  00 00 00 00  00 00 00 00   ........

follows main code 1200-5FFF
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: What sort of autostart is this?

Post by Noizer »

Oh, I forgot the files ->
files_fromTap.zip
(9.72 KiB) Downloaded 41 times
and the references viewtopic.php?f=1&t=10012 "Trying to copy PRG from TAP to D64"
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
User avatar
orion70
VICtalian
Posts: 4341
Joined: Thu Feb 02, 2006 4:45 am
Location: Piacenza, Italy
Occupation: Biologist

Re: What sort of autostart is this?

Post by orion70 »

[MOD] Please some admin, move this thread in the Programming section. I don't have enough superpowers to do that myself :)

(mod: done)
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Re: What sort of autostart is this?

Post by tlr »

Noizer wrote: Wed Jan 27, 2021 11:31 am The IRQ vectors are touched, but only after the entire code 02A1 - 02FF is autostarted.
See tap layout screenshot and extracted code below (Vice). BR
$029f/$02a0 is the temporary storage for the IRQ vector during tape loading. It gets swapped back when loading ends, unless $02a0 is $00.
If it contains $02a1, you'll eventually get an IRQ there. If it contains $00bf I guess it will just keep the tape IRQ set up and leave $00bf in $029f/$02a0.
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: What sort of autostart is this?

Post by Noizer »

tlr wrote: Tue Feb 02, 2021 2:04 am
Noizer wrote: Wed Jan 27, 2021 11:31 am The IRQ vectors are touched, but only after the entire code 02A1 - 02FF is autostarted.
See tap layout screenshot and extracted code below (Vice). BR
$029f/$02a0 is the temporary storage for the IRQ vector during tape loading. It gets swapped back when loading ends, unless $02a0 is $00.
If it contains $02a1, you'll eventually get an IRQ there. If it contains $00bf I guess it will just keep the tape IRQ set up and leave $00bf in $029f/$02a0.
Yes, I thought that too, but I'm afraid that neither of us sees how it can even auto start.
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Re: What sort of autostart is this?

Post by tlr »

Noizer wrote: Sat Feb 06, 2021 5:23 am
tlr wrote: Tue Feb 02, 2021 2:04 am
Noizer wrote: Wed Jan 27, 2021 11:31 am The IRQ vectors are touched, but only after the entire code 02A1 - 02FF is autostarted.
See tap layout screenshot and extracted code below (Vice). BR
$029f/$02a0 is the temporary storage for the IRQ vector during tape loading. It gets swapped back when loading ends, unless $02a0 is $00.
If it contains $02a1, you'll eventually get an IRQ there. If it contains $00bf I guess it will just keep the tape IRQ set up and leave $00bf in $029f/$02a0.
Yes, I thought that too, but I'm afraid that neither of us sees how it can even auto start.
Is the original "mysterious" .tap available somewhere to analyze?
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: What sort of autostart is this?

Post by Noizer »

See here for „cracked“ version
Perils of Willy Tapes.zip
(683.4 KiB) Downloaded 39 times
See in the original post for „original“
BR
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Re: What sort of autostart is this?

Post by tlr »

Noizer wrote: Sun Feb 07, 2021 6:00 am See here for „cracked“ version
Perils of Willy Tapes.zip
See in the original post for „original“
BR
The .tap in "Pow.rar" here: viewtopic.php?f=1&t=10012 loads up $02a1 into $029f/$02a0, but in this thread it is claimed the original version loads up $00bf, which is which?
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: What sort of autostart is this?

Post by Noizer »

tlr wrote: Sun Feb 07, 2021 8:21 am
Noizer wrote: Sun Feb 07, 2021 6:00 am See here for „cracked“ version
Perils of Willy Tapes.zip
See in the original post for „original“
BR
The .tap in "Pow.rar" here: viewtopic.php?f=1&t=10012 loads up $02a1 into $029f/$02a0, but in this thread it is claimed the original version loads up $00bf, which is which?
As already stated, the only difference are the first two bytes @029F, $BF00 versus $A102. $029F is always the loading address.
To check which version you are dealing with, you have to ... play!
At game start go left, then jump until you get first note. If the life display increments by one, it's an allegedly "cracked" version.
BR
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Re: What sort of autostart is this?

Post by tlr »

Noizer wrote: Wed Feb 10, 2021 6:35 amAs already stated, the only difference are the first two bytes @029F, $BF00 versus $A102. $029F is always the loading address.
To check which version you are dealing with, you have to ... play!
At game start go left, then jump until you get first note. If the life display increments by one, it's an allegedly "cracked" version.
BR
It is stated, yes. But not obvious on examination, which is which?
I found these .tap files in the two threads (from Pow.rar and Perils of Willy Tapes.zip) and loaded them up using xvic and some breakpoints.

Code: Select all

-rw-rw-r-- 1 tlr tlr 886492 Dec 24  1996  Pow.tap
-rw-rw-r-- 1 tlr tlr 888302 Dec 24  1996 'Perils of Willy, The (1984)(Software Projects LTD).tap'
-rw-rw-r-- 1 tlr tlr 886492 Jan 23 18:07  PERWILLY.tap
These all seem to autostart from $02a1 by loading $a1/$02 -> $029f so I'm a bit confused as to which file you are referring to?
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: What sort of autostart is this?

Post by Noizer »

tlr wrote: Thu Feb 11, 2021 2:07 am
Noizer wrote: Wed Feb 10, 2021 6:35 amAs already stated, the only difference are the first two bytes @029F, $BF00 versus $A102. $029F is always the loading address.
To check which version you are dealing with, you have to ... play!
At game start go left, then jump until you get first note. If the life display increments by one, it's an allegedly "cracked" version.
BR
It is stated, yes. But not obvious on examination, which is which?
I found these .tap files in the two threads (from Pow.rar and Perils of Willy Tapes.zip) and loaded them up using xvic and some breakpoints.

Code: Select all

-rw-rw-r-- 1 tlr tlr 886492 Dec 24  1996  Pow.tap
-rw-rw-r-- 1 tlr tlr 888302 Dec 24  1996 'Perils of Willy, The (1984)(Software Projects LTD).tap'
-rw-rw-r-- 1 tlr tlr 886492 Jan 23 18:07  PERWILLY.tap
These all seem to autostart from $02a1 by loading $a1/$02 -> $029f so I'm a bit confused as to which file you are referring to?
1=no extra life on note, normal behavoir
2=Extra life on note
3=Extra life on note
BR
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
Post Reply