Jeff's VIC 20 Book

Discuss anything related to the VIC
User avatar
Mike
Herr VC
Posts: 4843
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Jeff's VIC 20 Book

Post by Mike »

Here's a suggestion for a somewhat more compact HEX <-> DEC table:

Code: Select all

HEX <-> DEC CONVERSION TABLE

+-------------------------------------------+
| #     $X...     $.X..     $..X.     $...X |
|                                           |
| 0         0         0         0         0 |
| 1      4096       256        16         1 |
| 2      8192       512        32         2 |
| 3     12288       768        48         3 |
| 4     16384      1024        64         4 |
| 5     20480      1280        80         5 |
| 6     24576      1536        96         6 |
| 7     28672      1792       112         7 |
| 8     32768      2048       128         8 |
| 9     36864      2304       144         9 |
| A     40960      2560       160        10 |
| B     45056      2816       176        11 |
| C     49152      3072       192        12 |
| D     53248      3328       208        13 |
| E     57344      3584       224        14 |
| F     61440      3840       240        15 |
+-------------------------------------------+
Example for use:

Code: Select all

HEX -> DEC:  $C0DE = 49152+208+14 = 49374

DEC -> HEX:  47710 - 45056 ($B...) = 2654
              2654 -  2560 ($.A..) =   94
                94 -    80 ($..5.) =   14
                14       =  $...E

          => 47710       =  $BA5E
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Re: Jeff's VIC 20 Book

Post by Jeff-20 »

Nice HEX to DEC solution! But I think I use this kind of chart exclusively to convert DEC to MSB quickly. :lol: Hex is seldom of use to me and added only based on feedback here.

I know I know. Almost everything in this book (from multiplying by 256 to screen positions) could be done with very simple math. I have found myself with a computer not present thinking of coding or explicating some old program I see in a manual.

Before you bark at me, remember: we are all using a 40 year old computer when modern technology is available in the palms of our hands. I'm not claiming any of this is logical! :wink:
High Scores, Links, and Jeff's Basic Games page.
User avatar
Mike
Herr VC
Posts: 4843
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Jeff's VIC 20 Book

Post by Mike »

No worries.
Jeff-20 wrote:[...] we are all using a 40 year old computer when modern technology is available in the palms of our hands. I'm not claiming any of this is logical! :wink:
Jeff, I am mostly reasoning about what is necessary when I take a VIC-20 to a demoparty *) and want to get along without the modern technology in direct access - because it's the VIC-20 I want to show to people. What is good to put into permanent documentation?

For example, the addresses of the joystick registers and the bits corresponding to the directions and fire either need to be written down or memorized. They're not self-evident from basic BASIC knowledge.

OTOH, screen codes can be found out by putting a char into the top-left corner and PEEKing address 7680. Likewise, PETSCII codes can be found out by doing a PRINT ASC("..."). That is already two huge tables which can be made redundant by simply asking the computer during coding! The "H+T technique" I'm using with VICMON is just a slightly more elaborate example.

Most of this boils down to declarative vs. procedural knowledge. Setting background and border colour by POKEing 36879,... is declarative knowledge, finding out a position in the middle of the screen with PRINT7680+22*11+10 is (mostly) procedural knowledge (you'd still need to memorize the screen start address corresponding to your RAM setup, 22 chars per row and 23 rows counted 0..22).

Greetings,

Michael

*) sadly enough, Revision 2020 in its original form was cancelled and instead done as streaming event, because of you-know-what-reason. And the installation of 2021 will face a similar fate. :(
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Re: Jeff's VIC 20 Book

Post by Jeff-20 »

Ok, after two rather vulgar drafts, I'm uploading a more thought-out revision: draft 3. I had time to really sit down and spend my time on it today. I included most of the input in this thread as well as some elements from our wiki. I also decreased the size by figuring out how I would actually use the book.

I'm still feel very unsure of the ML stuff, but I'm including it if I need it someday. I'm wondering if any of you find use in a binary-coded decimal conversion chart. Or other charts I may have overlooked.

Remember, it makes more sense if you look at it in a side-by-side layout as if the book were laid flat.
Link removed for new draft
High Scores, Links, and Jeff's Basic Games page.
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: Jeff's VIC 20 Book

Post by Kweepa »

This is a lovely little reference book!

Erratum: The example on page 3 is under the wrong table.
Vic20-Ian
Vic 20 Scientist
Posts: 1214
Joined: Sun Aug 24, 2008 1:58 pm

Re: Jeff's VIC 20 Book

Post by Vic20-Ian »

Getting better and better Jeff.

One thing that would be useful would be some tips on tools and techniques to preserve old tapes, disks and cartridges.

e.g.

Stopping auto load

Saving blocks of memory - Mike's thread

viewtopic.php?t=676&start=6
Vic20-Ian

The best things in life are Vic-20

Upgrade all new gadgets and mobiles to 3583 Bytes Free today! Ready
User avatar
necronom
Vic 20 Dabbler
Posts: 91
Joined: Mon Jul 19, 2010 11:41 am
Location: Middlesbrough, UK
Occupation: IT Support

Re: Jeff's VIC 20 Book

Post by necronom »

I've used draft 2 quite a few times over the last few weeks when making my easier version of The Mysterious Island, so thanks for making it available.
User avatar
srowe
Vic 20 Scientist
Posts: 1341
Joined: Mon Jun 16, 2014 3:19 pm

Re: Jeff's VIC 20 Book

Post by srowe »

Pages 20 and 21 seem to have quite a bit of duplicated content.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Re: Jeff's VIC 20 Book

Post by Jeff-20 »

Kweepa wrote: Tue Jan 26, 2021 11:25 am Erratum: The example on page 3 is under the wrong table.
Do you mean under the wrong column? It's a reminder of how to use the addition method of decoding hex. I think the chart above wouldn't need an example.
srowe wrote: Tue Jan 26, 2021 2:18 pm Pages 20 and 21 seem to have quite a bit of duplicated content.
You're right. It's leftover from draft 2. I'll continue to simplify.

Ian, that would be great information, but maybe outside the scope of a quick reference booklet. I'm also not confident I know how to communicate that stuff in an efficient way. Is there a minimal chart you might need to reference often in those tasks?
High Scores, Links, and Jeff's Basic Games page.
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: Jeff's VIC 20 Book

Post by Kweepa »

Jeff-20 wrote: Wed Jan 27, 2021 5:26 pm
Kweepa wrote: Tue Jan 26, 2021 11:25 am Erratum: The example on page 3 is under the wrong table.
Do you mean under the wrong column? It's a reminder of how to use the addition method of decoding hex. I think the chart above wouldn't need an example.
Ah, I understand now.
I misunderstood because the example was two digit like the upper table.
Carry on!
User avatar
vicist
Vic 20 Afficionado
Posts: 352
Joined: Tue Oct 09, 2012 5:26 am
Location: Sheffield, UK

Re: Jeff's VIC 20 Book

Post by vicist »

Page 8 - needs an 8

Screen horizontal origin:
POKE 36864, PEEK(36B64) AND 128 OR X

Brilliant reference material. :D
User avatar
mathom
Vic 20 Dabbler
Posts: 80
Joined: Wed Aug 07, 2019 11:37 am
Location: Centennial, Colorado
Occupation: Software Engineer

Re: Jeff's VIC 20 Book

Post by mathom »

In the table on page four, shouldn't the first column heading be "Row" or "Line" instead of "Column"?

I love how this is coming together. I'm finding it very useful.

...mathom...
...mathom...
User avatar
srowe
Vic 20 Scientist
Posts: 1341
Joined: Mon Jun 16, 2014 3:19 pm

Re: Jeff's VIC 20 Book

Post by srowe »

Page 23 short cut for THEN should be T shift H
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Re: Jeff's VIC 20 Book

Post by Jeff-20 »

I had some time this week to work on a fourth draft (EDIT: link removed. See new version several posts below).

Incorporated a lot of your ideas, but I may have overlooked some yet. Still scanning for typos.

1. page 26- 33 useful to machine programmers?
2. pages 2-8 Does the lay-flat screen map work on two pages or would you prefer one page to save space? Should the $1000
3. Is the font large enough in the places needed to quickly scan?

I know this is dragging on forever, but I've only been able to revisit it for short moments, and I see major room for improvements every time! I had a few print on demand services in mind if anyone else wanted a hardcopy. Otherwise, I hope it's just PDF friendly if a newbie wants a quick guide.
High Scores, Links, and Jeff's Basic Games page.
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: Jeff's VIC 20 Book

Post by chysn »

Jeff-20 wrote: Tue Jun 08, 2021 1:09 pm 1. page 26- 33 useful to machine programmers?
The charts on pages 26-27 and the one on page 30 are kind of redundant. I'd probably rather have these combined. One of them leaves out one-byte instructions, which seems like it would become an unwelcome feature. You can put the instruction size in the header with the addressing mode rather than in the opcode box, and it'll look less cluttered.

The information I mostly need to look up is cycles and register behavior. I hardly ever need to look up opcodes, and I never need to look up instruction size. Unfortunately, cycles and register behavior don't fit well on the same chart because you need to know addressing mode for cycles, but not for register behavior. The practical impact of this is that my favorite kind of 6502 chart is the big alphabetical chart-with-everything.

I have many old dead-tree 6502 books, and the 6502 chart in the VIC-20 Programmer's Reference Guide is about as good as these things get. First runner-up is Scanlon's 6502 Software Design. The downside of the P.R.G. is that Commodore crammed too many pages into a too-small comb binding, so it always feels like it's about to blow apart in my hands.

This means that for simple stuff like color codes and PETSCII and character codes, I'm turning to the regular user manual often. Its spiral binding makes it easy to use, and keep open on my desk. But your charts are laid out way better, with actual bit patterns and hex. These things--and the memory map--are going to be way more valuable than the 6502 stuff, even if I hardly ever touch BASIC. The addition of 6502 instructions on your PETSCII chart is inspired. I don't know what I'm going to use that for yet, but it just feels insanely great.
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
Post Reply