Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #87

Re: Need example of IIgs code to set BRK vector

From "Anton Treuenfels" <teamtempest@yahoo.com>
Newsgroups comp.sys.apple2.programmer
References <6875625a-f276-4d22-8cf3-895f9cceb506@k28g2000yqn.googlegroups.com>
Subject Re: Need example of IIgs code to set BRK vector
Date 2012-01-03 20:17 -0600
Message-ID <beKdnS9LjPpBK57SnZ2dnUVZ_vydnZ2d@earthlink.com> (permalink)

Show all headers | View raw


"datawiz" <rich.martin@gmail.com> wrote in message 
news:6875625a-f276-4d22-8cf3-895f9cceb506@k28g2000yqn.googlegroups.com...
> Can anyone offer a snippet of assembly code to properly set the BRK
> vector on the IIgs?
>
> I'm working on fixing a couple more Apple II games that don't work on
> the IIgs, and I've noticed a trend of BRK causing problems. In the
> latest case, the Apple II BRK vector at FFFE/FFFF is set to point to
> user space code and it's used extensively as a method of code
> obfuscation by the copy protector.

I'm not an Apple guy at all, so I can't help you with that, but I'm 
wondering a little about this assertion. Are you sure? You may be right, but 
software BRKs skip a byte when returning. It's possible, and occasionally 
done, to use that behavior to implement "extra" instructions by setting that 
skipped byte to a particular value and examining it from within BRK handler.

For example, one way to implement an OS for a 65xx-series processor would be 
to have all OS calls be made as BRKs followed by a "signature" byte. That 
way the OS could be re-written at will (ie., routine entry points changed) 
without user software being any the wiser. Something like an x86's software 
interrupt approach to BIOS and OS calls, actually.

So without having seen that code, I'd say it's possible that the BRK handler 
is actually doing something important to the game itself. Even if it is 
completely copy protection it might be setting flags that other parts of the 
game want to see.

- Anton Treuenfels 

Back to comp.sys.apple2.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Need example of IIgs code to set BRK vector datawiz <rich.martin@gmail.com> - 2012-01-02 17:55 -0800
  Re: Need example of IIgs code to set BRK vector Charlie <charlieDOTd@verEYEzon.net> - 2012-01-02 22:32 -0500
    Re: Need example of IIgs code to set BRK vector datawiz <rich.martin@gmail.com> - 2012-01-02 20:01 -0800
      Re: Need example of IIgs code to set BRK vector Charlie <charlieDOTd@verEYEzon.net> - 2012-01-03 00:21 -0500
        Re: Need example of IIgs code to set BRK vector datawiz <rich.martin@gmail.com> - 2012-01-02 21:46 -0800
          Re: Need example of IIgs code to set BRK vector Charlie <charlieDOTd@verEYEzon.net> - 2012-01-03 15:10 -0500
            Re: Need example of IIgs code to set BRK vector datawiz <rich.martin@gmail.com> - 2012-01-03 13:56 -0800
  Re: Need example of IIgs code to set BRK vector "Anton Treuenfels" <teamtempest@yahoo.com> - 2012-01-03 20:17 -0600
    Re: Need example of IIgs code to set BRK vector datawiz <rich.martin@gmail.com> - 2012-01-04 06:55 -0800
      Re: Need example of IIgs code to set BRK vector datawiz <rich.martin@gmail.com> - 2012-01-04 07:10 -0800
        Re: Need example of IIgs code to set BRK vector magnusfalkirk <dean.phares@gmail.com> - 2012-01-04 09:05 -0800

csiph-web