Using FAT-40 to circumvent LIST protections

Basic and Machine Language

Moderator: Moderators

Post Reply
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Using FAT-40 to circumvent LIST protections

Post by Forbidden64 »

There is another truly bizarre thing I observed today. Once again on my adventure of converting a huge number of UK programs over to NTSC...the game DOTMAN does something in basic(among many astonishing things) that is truly off the charts weird for cursor control. I am wondering what other things to which this can be applied. I am documenting the process of converting these games in real time as I do them. They are quite fun to go back to for a wealth of information learned. Anyway:

On line 2100 of the secondary loader, as a way to thwart people like me messing with their code, the game creators shoved control characters in between line numbers! In this case, it was a line:

2100 if peek(645)<>34 then sys64802:rem

followed by a ton of delete keys '$14' shoved into the program afterward. The effect is that the line is invisible! So if you run the basic program, and the initial loader before that wasn't in there, then it resets the machine. VERY CLEVER! They also have the only VIC program I know of that will auto-load from a LOAD command without typing RUN. I stole the code for that too.

I only found this because I loaded my 40 column editor to examine the code more easily to see why it kept breaking into the monitor even when i removed all the machine code execution...and since the 40 column text printer prints much slower than the normal vic, I watched the line print out, and then disappear like disappearing ink before my eyes! I was like, "HOW ON EARTH?!!? witchcraft. definitely witchcraft."

Anyway, i wonder if you could put control characters after a rem statement into your program to do something useful with screen manipulation? Worth some exploration to be sure.
User avatar
tokra
Vic 20 Scientist
Posts: 1123
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: Using FAT-40 to circumvent LIST protections

Post by tokra »

Has this been released? I'm always interested in 40-column-editors. The ones out there all have some problem or another (either they do too little or too much).
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Re: Using FAT-40 to circumvent LIST protections

Post by Forbidden64 »

tokra wrote:Has this been released? I'm always interested in 40-column-editors. The ones out there all have some problem or another (either they do too little or too much).
Actually, I am not sure where I got it. A few years ago, called 'FAT-40 4609.prg'. I modified it for use with NTSC televisions, installed a basic loader etc. Before that I kept wishing I would find one, and never did. As far as I am aware, it is the only partially basic compatible 40 column editor that works on NTSC computers(aside from the data-20 cartridges). Apparently, it was made in 1983. Same year I was born :D. Since I was the one who modded it, and I have never formally released the mod (didn't seem like something a bunch of euros wanted anyway) it is very likely that few to no one else has one. Although, i did put a link to it in another thread regarding tools. A lot of these recent newcomers to the forum are on my side of the pond. A 40 column NTSC editor is just what they might want.

Summary of it:
has standard 40 columns.
Allows direct commands in basic.
Allows standard line numbering and screen editing like normal.
Sometimes you can even run some line numbers(like register mods) but mostly good for editing.
Its readable.

Quite frankly, aside from being fully basic compatible, this is everything I ever wanted from a 40 column program for the vic.
Leaves 4.4KB free on an 8k expansion

Leaves 12.6KB free on a 16k expansion.

No weird stuff.
User avatar
tokra
Vic 20 Scientist
Posts: 1123
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: Using FAT-40 to circumvent LIST protections

Post by tokra »

Interesting. This seems to be FAT-40 from Zimmers.net:

http://www.zimmers.net/anonftp/pub/cbm/ ... index.html

Apparantly someone had fixed this for PAL and the version you have is back-fixed to NTSC.

The original however was always NTSC. It was called VIC-40 and is from Ahoy Magazine October 1984, you can find a PDF here:
https://archive.org/details/ahoy-magazine-10/page/n43

I could not find the original VIC-40-program yet, maybe someone needs to type this in to get the original. By the demo-program it is clear however that FAT-40 was originally called VIC-40.

Either way, a "modern" 40 column-program for the VIC should just work on NTSC and PAL. It is not hard to do, you just need to offset the screen from the ROM-values.
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Re: Using FAT-40 to circumvent LIST protections

Post by Forbidden64 »

tokra wrote:Interesting. This seems to be FAT-40 from Zimmers.net:

http://www.zimmers.net/anonftp/pub/cbm/ ... index.html

Apparantly someone had fixed this for PAL and the version you have is back-fixed to NTSC.

The original however was always NTSC. It was called VIC-40 and is from Ahoy Magazine October 1984, you can find a PDF here:
https://archive.org/details/ahoy-magazine-10/page/n43

I could not find the original VIC-40-program yet, maybe someone needs to type this in to get the original. By the demo-program it is clear however that FAT-40 was originally called VIC-40.

Either way, a "modern" 40 column-program for the VIC should just work on NTSC and PAL. It is not hard to do, you just need to offset the screen from the ROM-values.

WEll, this one actually predates that magazine. In fact, its release date is in the title. 6/13/83. It is the same one I have alright. However, as usual the NTSC version listed doesn't do anything(just resets basic), and appears to be a broken basic program of some sort. In fact, it appears to have no relation to the FAT-40 program listed directly above that it claims to be related to. That's all I did btw was change the registers. The way he made it was that first a small basic program loader goes, then changes basic location, then runs another smaller program which changes the registers after the load. So, that said it was very difficult to find a reference to $9000, $9001(there is neither one anywhere in memory, nor is there a decimal equivilant in basic on load). Anyway, there are a half a dozen PAL 40 column editors floating around. Like I said, I couldn't find a single one adapted or written for NTSC. Apparently, you knew all along!! Ahoy magazine?! How did they get it and compute gazette didn't???
User avatar
tokra
Vic 20 Scientist
Posts: 1123
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: Using FAT-40 to circumvent LIST protections

Post by tokra »

To the two programs on Zimmers: First you load and run "Fat 40.prg" then you can load and run "Fat40 Demo.Prg" which demonstrates the program.

I actually found the Ahoy-magazine-disk-archive on my harddisk. Must have downloaded this somewhere at some point. Anyway I extracted the VIC-40-program and uploaded it to my site:

http://www.tokra.de/vic/vic40.d64

This works as is on NTSC.

Compute's Gazette had its own 40-column-program much later called "Screen-40" in issue 06-1985.

Difference between 40-column programs is some use 40x25 (by using a 160x176 resolution with 7 pixel height), some use 40x24 with 8 pixel-height. The latter have the advantage of being able to use each color-RAM-block for 4 characters on screen, while the 40x25 ones have the color-RAM-blocks overlap the chars.
Forbidden64
Vic 20 Hobbyist
Posts: 146
Joined: Sun Feb 28, 2016 9:59 pm
Location: CA USA

Re: Using FAT-40 to circumvent LIST protections

Post by Forbidden64 »

Ah, I see. Well, you certainly know your 40 column editors! While I am at it, do you know of any 40 column word processor type things for the NTSC VIC? One that can save SEQ files?
desiv
Vic 20 Newbie
Posts: 10
Joined: Sat Feb 22, 2020 4:52 pm
Location: Oregon
Occupation: IT Manager

Re: Using FAT-40 to circumvent LIST protections

Post by desiv »

tokra wrote: Sat Apr 06, 2019 2:49 am Anyway I extracted the VIC-40-program and uploaded it to my site:
Thanx!
Just getting back into the Vic-20 and part of my new collection were 2 Avalon Hill tapes with PET versions of the games.
I got Nukewar running on my Vic (once I got the RAM expansion, as it needed 16k), but quickly realized that it really needs a 40 column display for the game to work. It's kind of a battleship game with the two column/row sections (yours and the enemies) side by side.
So I started looking and found this great article/video information on 40 columns on the Vic, and he mentioned Vic-40.
But I couldn't find an NTSC version anywhere.
I almost resorted to typing it in myself (although my eyes aren't as young as they used to be, so not sure I would have had the same fun doing that as I did back in the day).
I did find 2 other programs that let me play the game in the Vic-20; Screen40 and PET Loader. Both seem to work.
But the article really pumped up the Vic/Fat40 program, so I kept looking. ;-)

Thanx again tokra!

desiv
groepaz
Vic 20 Scientist
Posts: 1187
Joined: Wed Aug 25, 2010 5:30 pm

Re: Using FAT-40 to circumvent LIST protections

Post by groepaz »

BTW, petcat from VICE can also be really helpful with analyzing that type of BASIC programs... especially if you want to modify them too, it will be a lot easier with petcat :)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Using FAT-40 to circumvent LIST protections

Post by chysn »

groepaz wrote: Sun Feb 23, 2020 7:36 pm BTW, petcat from VICE can also be really helpful with analyzing that type of BASIC programs... especially if you want to modify them too, it will be a lot easier with petcat :)
Petcat is amazing, cross-platform development would be a terrible slog without it.

I used to love those crazy REM LIST tricks. My go-to trick was based on

1 REM {shift+L}

which caused the listing to stop with a syntax error. However, that was too easy to get around because my little brother would just delete the line number. So I escalated the war with

1 REM"{DEL}"{shift+INST six times}{DEL six times}"GO AWAY!{shift+L}

On the screen, this looks like

1 REM"TTTTTT"GO AWAY!L

And the DELs obfuscated the line number during the LIST. And my little brother could still defeat my scheme with 1 {ENTER}

This is what passed for computer security when I was 12.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
User avatar
Victragic
Frogger '07
Posts: 605
Joined: Tue Nov 14, 2006 5:56 pm
Location: South Australia

Re: Using FAT-40 to circumvent LIST protections

Post by Victragic »

Encountered the same thing recently when trying to convert a text game 'Oasis of Shalimar' from C64 to Vic.

In that instance, the author repeatedly put the 'CLR' code in a REM statement through the listing, followed by his initials.

Annoying? Yep. Effective? Nope. But it might just have been to stop people 'cheating' rather than copy protection.
3^4 is 81.0000001
Post Reply