New! Dark mode!

Browsing Pinside at night? Getting tired of all the white? Switch to dark mode using the button in the top right (or CTRL-B)!

(Topic ID: 54979)

AC/DC, X-Men : Program modification - Proof of concept


By oga83

7 years ago



Topic Stats

  • 65 posts
  • 35 Pinsiders participating
  • Latest reply 5 years ago by oga83
  • Topic is favorited by 17 Pinsiders

You

Linked Games

Topic Gallery

One image has been uploaded to this topic. (View topic image gallery).

tennis102.txt

There are 65 posts in this topic. You are on page 1 of 2.
#1 7 years ago

I used the Pinball-Browser to add a "Tennis game" on my pinball (http://pinside.com/pinball/forum/topic/acdc-display-and-modify-dot-matrix-images).

For the Breakout game, see http://pinside.com/pinball/forum/topic/acdc-breakout-game#post-982139

See the video :

It is a very small program (around 100 lines) and is not meant to be perfect...
It is just a "proof of concept" to show that code modification on a pinball is possible and not so complicated.
It has been tested on AC/DC and X-MEN, but it should work on some other games (MTLE, ...).

Warning : I have not tested the following code with the latest firmwares or latest Pinball Browser version.

How to compile :
Download and install the gnu arm toolchain

And use the following commands :

arm-elf-gcc -mcpu=arm7tdmi -mlong-calls -O2 -g -c tennis.c
arm-elf-ld --script tennis.linkerscript -o tennis.elf tennis.o
arm-elf-objcopy --strip-all --output-target=srec tennis.elf tennis.hex

How to install :
Use Pinball Browser to load the tennis.hex file :
- Load a stock firmware;
- In the "Advanced" tab, click on "Bind patch to service menu Util/Help";
- Click on "Load Patch" and select the tennis.hex file;
If you get any errors at this stage, that means that the game will not work on your pinball.
The patch has to be applied before any other modification (image, message, ...) made on an original firmware.
- Save your modified firmware and upgrade your pinball machine with it.

To start the tennis game, enter the Service menu, and go to Util/Help, as shown in the video

The linker script (tennis.linkerscript) :

SECTIONS
{
    .text 0x410ce00 : { *(.text) }
    .data : { *(.data) }
    .bss : { *(.bss) }
}

The source code is here (tennis.c) :

// --------------------------------------------------
// Tennis Game v1.02
// --------------------------------------------------

// Pinball functions
void (*VectorTableStart)()=(void *)0xC0FEBABE;
int (*SoundRequest)(int)=(void *)1;
int (*GetSwitchState)(int)=(void *)2;
void (*DisplayTextPrintf)(char *, unsigned, int, int, int, int, int, ...)=(void *)3;
void (*ProcessSleep)(int)=(void *)4;
void (*DisplayShowBuffer)()=(void *)5;
void (*DisplayClearBuffer)()=(void *)6;
enum { KEY_BACK=1, KEY_MINUS=2, KEY_PLUS=3, KEY_SELECT=4 };
volatile struct { unsigned Duration; unsigned Duration2; unsigned u1; unsigned u2; } *ptrKeyPressedTable=(void *)7;
unsigned *ptrCurrentBuffer=(void *)8;
unsigned GameNameId=0xffffff00;
void (*VectorTableEnd)()=(void *)0xBABEC0FE;

// --------------------------------------------------
// Entry point
// --------------------------------------------------

// The entry vector table must be defined before any other function
asm("b TennisGame\n" // Service Menu
    "OldMenuHandler: .int 0\n" // Space for old handler (patched by Pinball Browser)
    ".int 0\n" // Knocker
    "OldKnockerHandler: .int 0\n" // Space for old knocker handler (patched by Pinball Browser)
    ".int 0\n" // Space for future use
    ".int 0\n"
    ".int 0\n"
    ".int 0\n"
    ".int 0\n"
    ".int 0\n"
    );

// --------------------------------------------------
// Utilities
// --------------------------------------------------

int IsKeyPressed(int iKey)
{
    // Asked for a specific key ?
    if (iKey>0) return (ptrKeyPressedTable[iKey-1].Duration!=0) ? iKey:0;

    // Look if any key is pressed
    int i;
    for (i=0; i<4; i++)
        if (ptrKeyPressedTable[i].Duration) return i+1;
    return 0;
}

void WaitForKeyRelease(void)
{
    do
    {
        // Acknowledge all keys
        int i;
        for (i=0; i<4; i++)
            ptrKeyPressedTable[i].Duration=0;
        // Wait
        ProcessSleep(10);
    } while (IsKeyPressed(0));
}

// --------------------------------------------------
// Tennis game main routine
// --------------------------------------------------

void TennisGame(void)
{
    // Play a song on some games
    if (GameNameId==0x442f4341)
        SoundRequest(217); // AC/DC : Play Whole lotta rosie
    else if (GameNameId=0x4154454d)
        SoundRequest(79); // Metallica : ?

    // Splash screen
    int xText=64;
    while (!IsKeyPressed(0))
    {
        if (++xText>128) xText=0;
        DisplayClearBuffer();
        DisplayTextPrintf("- TENNIS GAME V1.02 -", *ptrCurrentBuffer, 10, 2, 64, 10, 0);
        DisplayTextPrintf("PRESS ANY KEY !", *ptrCurrentBuffer, 10, 2, xText, 28, 0);
        DisplayShowBuffer();
        ProcessSleep(2);
    }
    WaitForKeyRelease();

    // Play tennis
    int Key, xRacket=64, xBall=64, yBall=0, dxBall=1, dyBall=1, iCount=0, iMissedTimer=0;
    while (!IsKeyPressed(KEY_SELECT) && !IsKeyPressed(KEY_BACK))
    {
        DisplayClearBuffer();

        // Handle racket
        if (GetSwitchState(137) && --xRacket<0) xRacket=0;
        if (GetSwitchState(141) && (xRacket-=2)<0) xRacket=0;
        if (GetSwitchState(139) && ++xRacket>128) xRacket=128;
        if (GetSwitchState(143) && (xRacket+=2)>128) xRacket=128;
        DisplayTextPrintf("--", *ptrCurrentBuffer, 10, 2, xRacket, 34, 0);

        // Handle ball
        int iSound=0;
        xBall+=dxBall;
        if (xBall<3) { xBall=3; dxBall=1; iSound=0xf; }
        if (xBall>125) { xBall=125; dxBall=-1; iSound=0xf; }
        // Is ball on racket ?
        yBall+=dyBall;
        if (yBall<6) { yBall=6; dyBall=1; iSound=0xf; }
        if (yBall>30)
        {
            yBall=30; dyBall=-1;
            int bOnRacket=(((xBall-xRacket>=0) ? (xBall-xRacket):(xRacket-xBall)) <= 7),
            bFailed=0;
            if (bOnRacket)
            {
                iSound=0xc;
            }
            else
            {
                xBall=64; yBall=0; dyBall=1; iMissedTimer=10;
                iSound=0x12;
            }
        }
        DisplayTextPrintf("O", *ptrCurrentBuffer, 10, 2, xBall, yBall, 0);

        // Display "Missed message"
        if (iMissedTimer)
        {
            iMissedTimer--;
            DisplayTextPrintf("YOU MISSED !", *ptrCurrentBuffer, 10, 2, 64, 15, 0);
        }

        // Display initial message
        if (iCount++<50)
            DisplayTextPrintf("PRESS START TO EXIT", *ptrCurrentBuffer, 10, 2, 64, 10, 0);

        // Bounce Sound ?
        if (iSound) SoundRequest(iSound);

        DisplayShowBuffer();
        ProcessSleep(2);
    }
}

#2 7 years ago

it's a brave new world.

Something tells me "open season" on Stern roms will be ending soon, or at least all upcoming releases.

#3 7 years ago

Great stuff! This is a very cool. Is it possible to modify existing game code (rules) in ACDC if a modification like the one you did can be done?

#4 7 years ago
Quoted from PanzerFreak:

Great stuff! This is a very cool. Is it possible to modify existing game code (rules) in ACDC if a modification like the one you did can be done?

Very complicated, but everything is possible... it's just a question of time.

#5 7 years ago

Yeah, viewing ROMs is one thing but changing code might get stern's attention (bad way)? Then again you're not in the US so maybe could skirt all that. Not a lawyer but, if there is any copyright circumvention going on the DMCA covers tools for copyright circumvention here in the states.

I just know people are pretty cagey about the existence of modified ROMs for the Williams games that simply fix led ghosting. Sure there is history there?

This all being said, pretty cool

#6 7 years ago

Sweet! Now add Shoot To Thrill to the song list

#7 7 years ago

DMCA is an American law.... but it won't be a law that stops the party, it will be Stern encrypting their roms.

#8 7 years ago
Quoted from oga83:

Very complicated, but everything is possible... it's just a question of time. That's why I will publish the source code so that others that have the skills can do it.

This is very exciting. Great work!

#9 7 years ago

Yeah. Well I guess even if they encrypted going forward, leaves a lot of legacy machines out there.

#10 7 years ago
Quoted from sd_tom:

Yeah, viewing ROMs is one thing but changing code might get stern's attention (bad way)? Then again you're not in the US so maybe could skirt all that. Not a lawyer but, if there is any copyright circumvention going on the DMCA covers tools for copyright circumvention here in the states.
I just know people are pretty cagey about the existence of modified ROMs for the Williams games that simply fix led ghosting. Sure there is history there?
This all being said, pretty cool

No part of the original firmware is distributed. The hex file has only code that I wrote.
However, I don't want Stern to be upset about this... If there is any potential issue with this, I will stop it and not publish anything

#11 7 years ago

Absolutely amazing. Well done! Can;t wait to see whats next, holy smokes!!!

As for Stern. Why should they care what I do with my game? If I brick the board, its on me. I can always revert to the stock code and all is well again. I don't think anyone wants to use this tool for malice, just personalization for our HOME GAMES.

Go oga GO!

#12 7 years ago

I would think if you are not selling the licensed AC/DC software that you modify, you can do whatever you want with it.

You bought the game for your personal use, you should be able to use it for your personal use.

#13 7 years ago
Quoted from RTS:

I would think if you are not selling the licensed AC/DC software that you modify, you can do whatever you want with it.

You bought the game for your personal use, you should be able to use it for your personal use.

That would be common sense wouldn't it? But US law says otherwise. We 'license' most software and hold no ownership of it.

#14 7 years ago
Quoted from DrStarkweather:

That would be common sense wouldn't it? But US law says otherwise. We 'license' most software and hold no ownership of it.

I'm not sure I get the distinction.

Isn't the problem be when one attempts to sell a licensed product? The bin files are freely available on Stern's site, so there is no theft involved like with napster.

#15 7 years ago

I guess we'll see if Stern cares at all. Obviously we're modding our pins, jacking into power lines, etc, so this is another mod. But I suspect they might be more prickly about this.

#16 7 years ago

Now that's funny. To bad I am not smart enough to do something like that.
Hey, look at it this way Stern can lock, encrypt their machine anyway they see fit. Trust me someone out there is smarter and will always break it. Just ask Washington!

#17 7 years ago
Quoted from Concretehardt:

Sweet! Now add Shoot To Thrill to the song list

Already done.
Changing songs is very easy.

#18 7 years ago
Quoted from frolic:

I guess we'll see if Stern cares at all. Obviously we're modding our pins, jacking into power lines, etc, so this is another mod. But I suspect they might be more prickly about this.

They may decide to care in the future. But even if they do, the genie is already out of the bottle with this 1.65 code. We will always have a version to mess with from now on.
I have already downloaded the latest versions of most Stern Machines just in case they decide to get crazy about this.

#19 7 years ago
Quoted from Arcade:

Already done.
Changing songs is very easy.

If that is the case can I buy a revised song list for my Metallica when it arrives next week?

#20 7 years ago

I think their technical concern might be that if a patch got out there that damaged games (held coils on too long) then people would come to them. As we've seen with aux board issues, there are some duty cycles on the coils and things that they know to honor but patchers may not.

#21 7 years ago

this is pretty darn cool oga...... so when will super breakout v1.01 be released

#22 7 years ago

Pissing off Lyman is probably the last thing the collector community wants to do...

#23 7 years ago

What language are they using? What we need is a disassembler program along with a text editor then an assembler where we can take the op codes and translate those into terms such as jmp, cmp, jfz, etc. with tools such as these several of us with programming experience could easily home modify our code to our liking.

#25 7 years ago
Quoted from Duff:

If that is the case can I buy a revised song list for my Metallica when it arrives next week?

I'm positive selling it would be illegal.
However I'm sure I or many others would be happy to do it for free.

#26 7 years ago

Another step. Amazing!

#27 7 years ago
Quoted from frolic:

it's a brave new world.
Something tells me "open season" on Stern roms will be ending soon, or at least all upcoming releases.

and the sky is falling and the end is near etc etc

Quoted from sd_tom:

I think their technical concern might be that if a patch got out there that damaged games (held coils on too long) then people would come to them. As we've seen with aux board issues, there are some duty cycles on the coils and things that they know to honor but patchers may not.

don't the machines have like a 30 day warranty anyway? anyway I am pretty sure that flashing non-factory firmware would be considered violating the warranty

Quoted from sk8ball:

Pissing off Lyman is probably the last thing the collector community wants to do...

I don't know him but unless he is really full of himself (which I doubt, seems like a cool dude) I don't see why it should...

people modify machines all the time, this just lets us modify parts of the machine that were never before able to be modified

I never understood why they didn't just release all the old game sources (who is going to steal them?). I would love to fix the bugs in my TotAN for example... but without any source that is very difficult... which is why this pinball browser app is that much more impressive to me at least, modifying without source

#28 7 years ago
Quoted from Arcade:

I'm positive selling it would be illegal.
However I'm sure I or many others would be happy to do it for free.

Understood, it was a feeble attempt at humor. Although there are some songs it baffles me why they arent in the game. Like it was mentioned earlier, angering Lyman is too high of a price to pay.

Alan

#29 7 years ago

PONG LIVES !!!!
Actually pretty cool and a 1st step for thinking outside the box mods.

Any patched or modded factory code should carry a "Home USE" logo to know its been modded and you are on your ow n if something bad happens.

#30 7 years ago

Keep going! Don't get discouraged by stupid laws/beliefs that say the big piece of furniture you paid thousands for can't be modified however you damn well please.

13
#31 7 years ago

Why does someone have to come and ruin every cool technical discussion with talks about copyright? Has the MPAA ad RIAA brainwashed all of you? Are you really worried that the police are going to bust down your door and take you because you used a hex patch on your pinball game?

There is nothing legal about writing code and distributing it. There is no distribution of illegal code in this hex patch. There is no bypassing of copyright or encryption in this code. There is nothing illegal here.

Whether or not stern likes it or not is irrelevant. I don't like some of the things stern does. Does that mean the police should be busting down the doors at Stern? Come on people try a little bit to use some common sense.

Lets please try to keep the copyright "distraction" out of this cool discussion that has a lot of awesome potential.

Quoted from oga83:

I used the Pinball-Browser to add a "Tennis game" in my AC/DC pinball (http://pinside.com/pinball/forum/topic/acdc-display-and-modify-dot-matrix-images).
It is a very small program (around 100 lines) and is not meant to be perfect...
It is just a "proof of concept" to show that code modification on a pinball is possible and not so complicated.

This is actuall really sweet. I assume you did it all in assembly? There isn't any sort of tool chain that lets one write, compile, inject, and run code right?

#32 7 years ago

I doubt everyone's been brainwashed, but they're certainly leery of the fact the MPAA/RIAA have vast governmental support and unchecked power for their devastating lawsuits and overreaching international copyright enforcement. Some kid just had his $650,000 judgement upheld for pirating 40 or so songs. Ridiculous.

#33 7 years ago

Alright let's start disassembling and noting the code, will go a lot faster if we split this up in sections

10
#34 7 years ago

Thanks to all of you who support my work

However, I have to say that I was not prepared for some of the comments saying things that 'it's not legal", 'it's not good for the community' or things like that...
So, let me clarify some points :
- Pinball and programming are 2 of my hobbies. I found a way to combine both of them by writing the Pinball browser; I'm not doing this for money and I don't get any benefits with this.
- Replacing images, sounds and even code seems like any other mod to me. When you change the layout of your playfield, you also change general artwork on which there is a copyright.
- Correct me if I'm wrong, but I don't think there is any software license included in the box at delivery, and we don't have to agree with such a license before using our pinballs.
- There is nothing malicious in all of this.
- I'm not revealing any secrets; Should I find some, I will not publish them.
- I don't really see why Stern should be upset about this : I really thing that this makes their games more attractive and it's all good for them. They did a great work on their pinballs and I really enjoy my AC/DC. If they are upset about this for any reason, they just have to us let know on the forum and I'll do my best to adjust the software to make them happy.

Of course, I might be wrong and if the community thinks that it's not good, I will stop; I could do this on my own, for me and a few friends only, without sharing anything.

#35 7 years ago

oga83..............Worry about nothing, you are completely in the clear. There is absolutely nothing illegal about what you are doing. There is "Zero" Stern can do about changing the images or music on a pinball machine....................No different than they can't stop me from spray painting the side of the cabinet if I want to or putting LEDs on a game. Some of these morons on this sight crack me up. If anything this program makes the value of Sterns machines go up and creates more demand for them. If you were selling hacked files with different content is where you would get slapped.............

Either way, you have managed to create the greatest mod in pinball history and you gave it to us for free. We owe you, we owe you big time brother!

#36 7 years ago

I'm sorry if I was part of those comments with my early one. I think this is an awesome "mod". Congrats.

#37 7 years ago

I have updated both the .hex file and Pinball-Browser.
This .hex should now work on some other games like MTLE, X-Men, ...

#38 7 years ago
Quoted from thedarkknight77:

oga83..............Worry about nothing, you are completely in the clear. There is absolutely nothing illegal about what you are doing. There is "Zero" Stern can do about changing the images or music on a pinball machine....................No different than they can't stop me from spray painting the side of the cabinet if I want to or putting LEDs on a game. Some of these morons on this sight crack me up. If anything this program makes the value of Sterns machines go up and creates more demand for them. If you were selling hacked files with different content is where you would get slapped.............
Either way, you have managed to create the greatest mod in pinball history and you gave it to us for free. We owe you, we owe you big time brother!

Quoted from frolic:

I'm sorry if I was part of those comments with my early one. I think this is an awesome "mod". Congrats.

Thank you for your message !

#39 7 years ago
Quoted from Arcade:

Already done.
Changing songs is very easy.

what song did you replace? i am thinking of replacing hells bells because of the length with STT

#40 7 years ago

I'm thinking of replacing all of the songs in my AC/DC with Metallica songs! It'll be like two games in one!

#41 7 years ago

Great work, and I'm with markmon and others. What you are doing is perfectly fine.

The worst thing Stern could do is actively try and stop this, and I have a feeling they won't.

#42 7 years ago
Quoted from Wolfmarsh:

The worst thing Stern could do is actively try and stop this, and I have a feeling they won't.

In term of marketing, I think it's good for them, so I also believe they won't.

#43 7 years ago
Quoted from maddog14:

what song did you replace? i am thinking of replacing hells bells because of the length with STT

The length of song worked out pretty good for these song changes.

War Machine is now Girls Got Rhythm.
Let there be Rock is now Shoot to Thrill.
Hell ain't a Bad Place to be is now Dirty Deeds

We also changed the Live Encore song to the studio version of "It's a Long way to the Top".
Seems rather fitting as long as it takes to reach Encore.

#44 7 years ago

I think this could be a huge opportunity for stern. For example lego was almost bankrupt in 2003. When "hackers" opened up the software to legos most innovating robot sales kicked off. Lego is now one of the biggest toy factories in the world. Of course pinball machines and lego robotics are different products however i think this could be a huge opportunity for stern.

http://osswatch.jiscinvolve.org/wp/2010/04/28/open-innovation-builds-success-at-lego/

#45 7 years ago
Quoted from Arcade:

The length of song worked out pretty good for these song changes.War Machine is now Girls Got Rhythm.Let there be Rock is now Shoot to Thrill.Hell ain't a Bad Place to be is now Dirty DeedsWe also changed the Live Encore song to the studio version of "It's a Long way to the Top".Seems rather fitting as long as it takes to reach Encore.

Hey arcade what line # is the encore song? I wanna change mine to the same song. Thanks for the help.

#46 7 years ago
Quoted from Kcpinballfan:

Hey arcade what line # is the encore song? I wanna change mine to the same song. Thanks for the help.

The location is Request #340
It is 17:41 in length. So it will require you to start your song over quite a few times to match the time frame. I had to start "It's a long way to the top", 4 times, to get the 5 min. song, to stretch to 17:41.

#47 7 years ago
Quoted from Arcade:

The location is Request #340It is 17:41 in length. So it will require you to start your song over quite a few times to match the time frame. I had to start "It's a long way to the top", 4 times, to get the 5 min. song, to stretch to 17:41.

Wow that's crazy. Thanks for the help. The sad thing is I may never hear the encore song lol.

#48 7 years ago
Quoted from Kcpinballfan:

Wow that's crazy. Thanks for the help. The sad thing is I may never hear the encore song lol.

It will play on the Jukebox mode when you change it out.
Not exactly Encore, but at least you can play it. lol

#49 7 years ago
Quoted from Arcade:

It will play on the Jukebox mode when you change it out.Not exactly Encore, but at least you can play it. lol

Yeah definitely.

#50 7 years ago

The tennis game is confirmed to work on X-Men.
Many thanks to DugFreez for his tests !

Promoted items from the Pinside Marketplace
From: $ 42.00
Cabinet - Shooter Rods
ModFather Pinball Mods
$ 90.00
Lighting - Under Cabinet
Rock Custom Pinball
$ 15.00
Playfield - Protection
Pin Mods
5,775
Machine - For Sale
London, EN
From: $ 42.00
Cabinet - Shooter Rods
ModFather Pinball Mods
There are 65 posts in this topic. You are on page 1 of 2.

Hey there! Got a moment?

Great to see you're enjoying Pinside! Did you know Pinside is able to run thanks to donations from our visitors? Please donate to Pinside, support the site and get anext to your username to show for it! Donate to Pinside