Attack UFO - Arcade game that uses the 6560

Other Computers and Game Systems

Moderator: Moderators

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

Re: Attack UFO - Arcade game that uses the 6560

Post by groepaz »

rotating everything would basically mean rewriting the game, i am certainly not attempting this :)

actually, even making it work on actual vic20 without the terrible hacks i have been using (eg i modified kernal) seems difficult without putting a lot of effort into it

but yes, controls work, it can be played.

the main problem i am facing right now to make this into something others can use is a combination of two things:

- the game uses $0200-$03ff for the screen (video ram)
- the game uses a weird subroutine call mechanism implemented via BRK handlers

these two things clash, i cant use a non patched kernal, because then it would require the IRQ/BRK vectors intact (at $031x). so either the video ram base address in the game must be changed (lots of work), or the BRK handler mechanism must be changed to not actually use BRK (lots of work).

i may or may not work further on this because... its not a great game to begin with :)

i suppose there is no way on the VIC20 to "bank out" the kernal like you can do it on the C64 (so i can hook into the hardware vectors)? (a way that would mean using a cartridge is fine)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
hasseapa
Vic 20 Devotee
Posts: 264
Joined: Thu Oct 12, 2006 4:09 am

Re: Attack UFO - Arcade game that uses the 6560

Post by hasseapa »

Very cool. Vertically oriented monitor requirement can be seen as a feature rather than a bug.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: Attack UFO - Arcade game that uses the 6560

Post by lance.ewing »

groepaz wrote:rotating everything would basically mean rewriting the game, i am certainly not attempting this :)
It was worth a try :D
groepaz wrote: actually, even making it work on actual vic20 without the terrible hacks i have been using (eg i modified kernal) seems difficult without putting a lot of effort into it

but yes, controls work, it can be played.
Great!
groepaz wrote: the main problem i am facing right now to make this into something others can use is a combination of two things:

- the game uses $0200-$03ff for the screen (video ram)
- the game uses a weird subroutine call mechanism implemented via BRK handlers

these two things clash, i cant use a non patched kernal, because then it would require the IRQ/BRK vectors intact (at $031x). so either the video ram base address in the game must be changed (lots of work)
I had assumed that that was what you had done already. So you've got it working without modifying the screen or character addresses?
groepaz wrote: or the BRK handler mechanism must be changed to not actually use BRK (lots of work).

i may or may not work further on this because... its not a great game to begin with :)
I obviously haven't played it yet, but the concept certainly isn't unique :). I'm just fascinated with the idea of the 6560 being used in an arcade machine.
groepaz wrote: i suppose there is no way on the VIC20 to "bank out" the kernal like you can do it on the C64 (so i can hook into the hardware vectors)? (a way that would mean using a cartridge is fine)
Why would changing the screen memory location be lots of work? Is it difficult to identify where in the code it is writing to screen memory?
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: Attack UFO - Arcade game that uses the 6560

Post by groepaz »

so far what i have done is hooking into a routine that gets called once per frame, and then i just copy the screen (and color ram) to some location that is suitable for vic20 :)

changing the addresses in the program is certainly possible too... but as said, a lot of work, since its not really obvious in the code where its writing to the screen, and where the respective addresses could be changed. following the program flow is quite painful too due to that weird BRK mechanism... it almost looks like a forth interpreter of some sort, some kind of stack machine at least. (and this would have to be done not only for the screen, but also for colors and characters)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: Attack UFO - Arcade game that uses the 6560

Post by lance.ewing »

What address is it using for colour RAM?

Edit: Think I've worked it out. Is it $0600?
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: Attack UFO - Arcade game that uses the 6560

Post by groepaz »

yep, and 1c00-1fff is used for dynamic characters, 2000-23ff contains static characters. the hardware also seems to be wired up in a way that upper and lower half of the character set are swapped (compared to what we know from vic20)
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
r.cade
Vic 20 Amateur
Posts: 63
Joined: Sun Mar 02, 2014 3:50 pm

Re: Attack UFO - Arcade game that uses the 6560

Post by r.cade »

Hi Groepaz,

I tried this years ago, and you got much further than I did. I was hoping it would be a quick hack also, but I found there was too much that would have to be patched... :)

I think it is compiled code from some other language also- no sane person would program in assembler that way...
--
Pete Rittwage
C64 Preservation Project
http://c64preservation.com
User avatar
highinfidelity
Vic 20 Nerd
Posts: 644
Joined: Thu Jul 28, 2011 2:34 am
Website: http://www.hirtel.it
Location: Torino, Italy.

Re: Attack UFO - Arcade game that uses the 6560

Post by highinfidelity »

groepaz wrote:rotating everything would basically mean rewriting the game, i am certainly not attempting this :)
OK... no longer promising... :cry:
GOD is REAL. Unless declared DOUBLE PRECISION.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: Attack UFO - Arcade game that uses the 6560

Post by lance.ewing »

groepaz wrote:yep, and 1c00-1fff is used for dynamic characters, 2000-23ff contains static characters.
I'm guessing that the colour RAM 2114 chip is mapped from $0400-$07FF but the game/machine is using only the top half, i.e. $0600-$07FF. That would make the chip selection cleaner because then every chip starts at a 1K boundary in the memory map and that 74154 compatible Mitsubishi chip would be using address lines A10-A13 to select the various chips.

This makes sense when you think about the video RAM as well. Two of the 2114 RAM chips would be providing the 1K of RAM from $0000 to $03FF. The lower part of that has its usual important usage, and the video RAM starts at $0200, i.e. halfway through that 1K RAM block. So when the VIC chip is fetching from video RAM, the colour is fetched at the same time as normal via those 4 special data bus lines dedicated to that purpose. With both the video RAM and colour RAM starting at the same position within their respective 2114 chips, then the A0-A9 address lines will have the same address on them during that fetch. So it does seem to make sense that the colour RAM chip starts at $0400 but is used only from $0600.

The addresses from $0800-$0FFF must be unconnected address space.

Address lines A14 and A15 are basically ignored. Although it isn't likely to be doing this, I suspect that if the game code in the ROMs were to read or write to memory locations above the first 16K, then they'd wrap around, i.e. $4000 would be addressing $0000. It probably relies on that behaviour for the reset vector to work. Since the ROM images are addressed between $2000 to $3FFF, the reset vector that is stored in the last ROM image is actually at memory address $3FFC, but as a consequence of A14 and A15 being unused, the reset vector is also fetch-able via its normal address at $FFFC.
groepaz wrote:the hardware also seems to be wired up in a way that upper and lower half of the character set are swapped (compared to what we know from vic20)
I'm not sure what you mean by this. Can you elaborate?
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: Attack UFO - Arcade game that uses the 6560

Post by lance.ewing »

tokra wrote:Is there an option in VICE to rotate the displpay? :wink:
I guess this is typical of the old 80s coin operated arcade games. They tended to have that 3:4 ratio rather than 4:3. From seeing this Attack UFO game, it makes me realise that a lot of arcade games may have worked in this way, i.e. with a deliberately rotated standard CRT screen.

A 6560 game like this that requires the screen to be rotated changes the nature of raster effects. What we would perceive as a horizontal line of characters is actually a vertical column of characters.
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: Attack UFO - Arcade game that uses the 6560

Post by groepaz »

I'm not sure what you mean by this. Can you elaborate?
yes: brainfart :) the game must be using 1c00-23ff for characters. with the actual letters and symbols in the 2000-23ff area, 1c00-1fff is used for the invader "sprites" etc

i got slightly further with running it without a patched kernal... but it crashes in the second attract screen :/
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: Attack UFO - Arcade game that uses the 6560

Post by lance.ewing »

groepaz wrote: i got slightly further with running it without a patched kernal... but it crashes in the second attract screen :/
I'm taking an alternative approach of modifying my jvic emulator to be an Attack UFO machine. The end result will be an emulator specifically for the arcade machine using the unmodified game ROMs and no KERNAL or BASIC ROMs or anything VIC 20 related that wouldn't have been in the original machine.

Modifying the game to make it work on a real VIC 20 is definitely cool though and I'd love to see it running like that.
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: Attack UFO - Arcade game that uses the 6560

Post by groepaz »

making a custom emulator will be fairly straightforward if you already have a a vic20 emulator... the differences are small, besides the memory mapping (already discussed here) you'll have to mask the whole memory access by $3fff (so the hardware vectors are at $3ffx, not $fffx) and perhaps tweak the initial register values of the VIC chip a bit (the game doesnt init all of them). oh and, you dont really have to emulate the PIA fully, just pull the portbits as described eg in the MAME source (the game only uses them as input and doesnt use any fancy modes).
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
lance.ewing
Vic 20 Afficionado
Posts: 413
Joined: Sat Nov 10, 2012 3:19 pm
Website: https://sites.google.com/site/mos6561vic/

Re: Attack UFO - Arcade game that uses the 6560

Post by lance.ewing »

groepaz wrote:making a custom emulator will be fairly straightforward if you already have a a vic20 emulator... the differences are small, besides the memory mapping (already discussed here) you'll have to mask the whole memory access by $3fff (so the hardware vectors are at $3ffx, not $fffx) and perhaps tweak the initial register values of the VIC chip a bit (the game doesnt init all of them). oh and, you dont really have to emulate the PIA fully, just pull the portbits as described eg in the MAME source (the game only uses them as input and doesnt use any fancy modes).
And the customisations to the 6560 chip itself. Obviously both the multi-colour mode and the reverse mode are not present in this custom 6560. The absence of the reverse mode suggests that the border colour might also support 16 colours, like in the 6562/6563 datasheet. So 16 foreground colours, 16 border colours, and 16 background colours. Without support for the multi-colour mode, the auxiliary colour becomes redundant. Perhaps the top four bits of CR-E were used for something else then. I wonder if it was something in the sound area that was enhanced with the absence of the need for the auxiliary colour.
groepaz
Vic 20 Scientist
Posts: 1180
Joined: Wed Aug 25, 2010 5:30 pm

Re: Attack UFO - Arcade game that uses the 6560

Post by groepaz »

the game does very few actual accesses to the VIC, so its almost useless to tell the differences by looking at the game code... one thing that is obvious though is that the defaults differ :)

meanwhile, i have it kinda working without a patched kernal.... the monkey patched screen copying stuff makes it kindof slow to play however...

https://nofile.io/f/8Y5P3Fj9esZ
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Post Reply