View Full Version : Commodore 64 - MOBs in the borders

May 21st, 2009, 01:45 AM
Another question (sorry) :mrgreen: some time ago (mid 80's in fact) I read an article describing how to put MOBs (sprites) in the upper and lower borders on the Commie. It described a routine to clear the garbage from the memory area and in some way override the blanking interrupts to "uncloak" MOBs outside of the standard screen area. This is apparently a bug in the C64's OS and some software (such as Taito's Super Space Invaders) exploits this.

However, I've not been able to find this information since and none of the official literature documents this.

Could I be cheeky and ask anyone who knows how to do this for help in pointing me in the right direction?


May 21st, 2009, 02:19 AM
Yes, you need to remove borders. The upper and lower borders are rather simple to remove, the left and right borders are more tricky I think.

This little program - written for a cross-compiler - will open the top and bottom borders, however the background (at least in WinVICE) is black.

start: SEI
LDA #<irq
STA $0314
LDA #>irq
STA $0315
irq: LDA #$00
chk1: LDA $D012
BNE chk2
LDA #$00
STA $D011
chk2: LDA $D012
CMP #$00
BNE chk1
LDA #$1B
STA $D011
LDA #$22

Or as a Basic loader:

10 data 120,169,13,141,20,3,169,32,141
20 data 21,3,88,96,169,0,141,5,220,173
30 data 18,208,201,250,208,5,169,0,141
40 data 17,208,173,18,208,201,0,208,237
50 data 169,27,141,17,208,169,34,141,5
60 data 220,76,49,234,-1
70 i=8192
80 read a:if a<>-1 then poke i,a:i=i+1:goto 80
90 sys 8192

Good luck with your further findings.

May 25th, 2009, 07:05 PM
Thanks very much, that's brilliant. To be honest I've had no luck running my software in WinVICE or CCS64 - the display interrupts don't seem to work (I'm using an inner and outer border for visual effect, a bit like widescreen TV) - although the mouse driver appears to work, albeit in joystick mode as I don't have a working interface for the mouse because my PC doesn't like the CatWeasel. The program crashes when I try to log on (goes to the error message screen - which is in the default display memory - I'll have to check if the logon screen is also using this as it's ages since I worked on it!)

I don't think these emulators properly support screen memory relocation. I moved it so I had more room for character sets and MOBs (and to make it a bit harder to hack into!).


May 25th, 2009, 10:09 PM
Oh yes, at least VICE supports all that and much more. I don't have a precise figure, but I would say the C64 emulation is 95%+ or greater. Since you live in England, I suppose your programs are written for PAL C64 which is the default setup. It is easy to toggle to NTSC though. If you really have software that runs flawless on a real C64 but very poorly on emulators, I suggest you submit those to emulator developers. Of course you should ensure you're using the most recent version, so you're not stuck with a 3-4 year old version of the emulator in question.