Centering 24 columns - and 1702 monitors

Basic and Machine Language

Moderator: Moderators

Post Reply
vicassembly
Vic 20 Devotee
Posts: 253
Joined: Fri Mar 19, 2010 1:40 pm

Centering 24 columns - and 1702 monitors

Post by vicassembly »

I am writing a game that I would like to use 24 columns. I am able to get it to display very nicely on my emulator for the MAC (Power20). I also ran across the following code, from Herr Mike I believe, that does it even nicer.

POKE36864,PEEK(60900)-3
POKE36866,(PEEK(36866)AND128)+24 ..... (original was 25)

A few questions.

1. I am using a 1702 monitor and the edges seem to hang over on each side. This is AFTER I have centered the picture as much as possible with the nob. Has anyone else noticed this?
2. Can anyone explain the poke 36864 above? What is the peek into 60900 and then why is 3 subtracted?
3. On my emulator a peek of 36864 returns 12. A peek of the same location on a real VIC returns 5. What gives? Does this number vary from vic to vic? Both of mine returned 5.

I am guessing I may have to reduce to 23 columns to make it work with the 1702 monitor but I would like to avoid this.

Regards,

Jonathan
User avatar
Mike
Herr VC
Posts: 4842
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Centering 24 columns - and 1702 monitors

Post by Mike »

vicassembly wrote:I also ran across the following code, from Herr Mike I believe, that does it even nicer.
Just Mike. ;)

Code: Select all

POKE36864,PEEK(60900)-3 
POKE36866,(PEEK(36866)AND128)+24    .....  (original was 25)
The locations 60900 to 60915 are in ROM, and contain the default values of the VIC registers.
1. I am using a 1702 monitor and the edges seem to hang over on each side. This is AFTER I have centered the picture as much as possible with the nob. Has anyone else noticed this?
A little further down the thread it was established, that - on NTSC - 25 columns in most cases don't fit, and 24 columns are on the edge. PAL allows for more columns.
2. Can anyone explain the poke 36864 above? What is the peek into 60900 and then why is 3 subtracted?
36864 is the VIC register for horizontal positioning, and defines that in terms of half character widths. To center 3 extra columns, the POKE shifts the screen 3 half columns to the left, derived from the default value in 60900.
3. On my emulator a peek of 36864 returns 12.
That's because you were emulating a PAL VIC.
A peek of the same location on a real VIC returns 5. What gives? Does this number vary from vic to vic? Both of mine returned 5.
And that's because you are using two NTSC VIC's. NTSC 6560, and PAL 6561 require different values for the horizontal positioning, and that is reflected in ROM.

I'm using the ROM default values to make the screen positioning TV system neutral. The same method is used within MINIGRAFIK for its 160x192 graphics mode.
I am guessing I may have to reduce to 23 columns to make it work with the 1702 monitor but I would like to avoid this.
In that case, you'd use:

Code: Select all

POKE36864,PEEK(60900)-1 
POKE36866,(PEEK(36866)AND128)+23
Greetings,

Michael
vicassembly
Vic 20 Devotee
Posts: 253
Joined: Fri Mar 19, 2010 1:40 pm

Post by vicassembly »

Thanks, Mike. 23 columns is what I will have to go with for it to work globally.

Jonathan
Post Reply