Terminator, MOS 6502 and Ion Maiden

You can talk about almost anything that you want to on this board.

Moderator: Moderators

Post Reply
User avatar
aa-dav
Posts: 56
Joined: Tue Apr 14, 2020 9:45 pm
Location: Russia

Terminator, MOS 6502 and Ion Maiden

Post by aa-dav » Mon Jun 08, 2020 11:48 pm

Ion Maiden is the excellent retroshooter built on the Duke3D engine (port).
And after a while after its release I found some interesting easter egg in youtube stream of it:
Image

It's obvious reference to Terminator movie and vision from eyes of cyborg-killer-from-future:
Image

It's assembler code for MOS 6502 (NES CPU) and there is detailed explanation of sources of this code:
https://youtu.be/YRnnjoiSV-U
In short: it were sources for Apple II from magazine "Nibble" (august and september of 1984). Code above is fragment of RAM-disk "NEWRAM".

...MOVE DATA FOR VTOC... is clearly reference...
But something is wrong. It's far from just copy. This code is changed in many ways...
This is fragment from movie:

Code: Select all

LDA #<VTOC
STA A1
LDA #>VTOC
STA A1+1
This code loads high and low address bytes of symbol VTOC and saves them to label A1.
But the code in the Ion Maiden game looks different:

Code: Select all

LDA #!PROC
STA $314
LDA #!PROC
STA $315
It's nonsense. First of all as far as I could find - operator ! is nonsense here (xor or maybe decimal system sign). Second - MOS 6502 programmer would not waste bytes in such way.
Also I doubt that .dword keyword can be met in sources of that time.

So I am curious - why they changed it or is it real program from another time? :)
Last edited by aa-dav on Tue Jun 09, 2020 5:34 am, edited 1 time in total.

User avatar
Gilbert
Posts: 378
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Terminator, MOS 6502 and Ion Maiden

Post by Gilbert » Tue Jun 09, 2020 2:18 am

I don't know. Maybe this is ripped from a 65816 programme listing instead?

User avatar
Memblers
Site Admin
Posts: 3833
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Terminator, MOS 6502 and Ion Maiden

Post by Memblers » Tue Jun 09, 2020 2:54 am

Neat find. I noticed that JMP $EA31 looked out of place (no label?), and Googling "$EA31" shows that it's an entry point for C64 Kernal ROM's interrupt handler. Furthermore, the $D4xx addresses are the C64's SID chip registers.

User avatar
aa-dav
Posts: 56
Joined: Tue Apr 14, 2020 9:45 pm
Location: Russia

Re: Terminator, MOS 6502 and Ion Maiden

Post by aa-dav » Tue Jun 09, 2020 5:58 am

Memblers wrote:
Tue Jun 09, 2020 2:54 am
Neat find. I noticed that JMP $EA31 looked out of place (no label?), and Googling "$EA31" shows that it's an entry point for C64 Kernal ROM's interrupt handler. Furthermore, the $D4xx addresses are the C64's SID chip registers.
Damn! This really looks like sound driver playing displayed DATA!
Hmmmm... Interesting... Maybe this fragment is self-sufficient to recreate music...
Damn... I bet they could do this!
I google "Ion Maiden hidden music commodore 64", but google founds nothing.

User avatar
aa-dav
Posts: 56
Joined: Tue Apr 14, 2020 9:45 pm
Location: Russia

Re: Terminator, MOS 6502 and Ion Maiden

Post by aa-dav » Tue Jun 09, 2020 6:41 am

Found it: https://csdb.dk/release/?id=182055
Yes, it was discovered in 2019. Cool... Looks like it's music from Duke3D.

User avatar
aa-dav
Posts: 56
Joined: Tue Apr 14, 2020 9:45 pm
Location: Russia

Re: Terminator, MOS 6502 and Ion Maiden

Post by aa-dav » Tue Jun 09, 2020 7:44 pm

Finally I download image created by Mr.Mouse/Xentax from https://csdb.dk/release/?id=182055 and load it in Commodore 64 emulator:

Here you can see and listen to result: https://www.youtube.com/watch?v=CxfSa2LexHE

It's amazing triple x3 super easter egg! xD It's tribute to Terminator, Commodore 64 and Duke 3D and assembler and MOS 6502 and you must have real skills to recover it. Amazing. :)
After some google I discovered also that $0314-0315 is address of interrupt service routine in Commodore Basic, so as you can see this music doesn't interrupt Basic interpreter from working - SETUP routine just return control to basic.
I still don't know why operator ! is used to save address of PROC and how and where is it supposed to work, but in implemetation of Mr.Mouse it is replaced by < and > as it is supposed to be. Also .dword-s are replaces by .byte, but all other things seem to be identical.
Damn, I even wrote about this screen a lot of time ago (in russian), but didn't know all the truth: http://hype.retroscene.org/blog/977.html

P.S.
Also, I want to mention that last (short) part of code including saving of INDEX and label END is placed in the right-bottom corner of in-game screen, so program is complete really.
Last edited by aa-dav on Tue Jun 09, 2020 11:00 pm, edited 1 time in total.

User avatar
Gilbert
Posts: 378
Joined: Sun Dec 12, 2010 10:27 pm
Location: Hong Kong
Contact:

Re: Terminator, MOS 6502 and Ion Maiden

Post by Gilbert » Tue Jun 09, 2020 10:40 pm

I don't know whether there are assemblers that accept an ! like this.
Maybe it was an intentional troll move (or a Genius Bonus) to offer the code listing with something off, that people couldn't get it to work directly unless they figured out they need to fix something first?

turboxray
Posts: 75
Joined: Thu Oct 31, 2019 12:56 am

Re: Terminator, MOS 6502 and Ion Maiden

Post by turboxray » Wed Jun 10, 2020 12:53 pm

Gilbert wrote:
Tue Jun 09, 2020 10:40 pm
I don't know whether there are assemblers that accept an ! like this.
Maybe it was an intentional troll move (or a Genius Bonus) to offer the code listing with something off, that people couldn't get it to work directly unless they figured out they need to fix something first?
There are a LOT of 65x assemblers out there.

Post Reply