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


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

Re: Dual 65C816/65C02 programs

From Egan Ford <datajerk@gmail.com>
Newsgroups comp.sys.apple2.programmer
Subject Re: Dual 65C816/65C02 programs
Date 2013-07-19 10:55 -0600
Organization XMission http://xmission.com/
Message-ID <ksbr2i$82p$1@news.xmission.com> (permalink)
References <dog_cow-1373769303@macgui.com> <krvn55$d6t$1@news.xmission.com> <dog_cow-1373924063@macgui.com> <572174e5-72a2-4750-8512-a8aa6e6099c8@googlegroups.com> <df594e1e-9fff-4500-a727-bb19c4d89758@googlegroups.com>

Show all headers | View raw


On 7/19/13 8:49 AM, Dagen Brock wrote:
> I've done this for a few programs that ran under ProDOS 8.  Generally the programs are simple, so no extra banks were needed.  The main reason I've used it is to detect if I'm on a IIgs, and if so, to set the text/border colors appropriately, or maybe use some 16-bit code to speed something up.
>
> It's certainly doable, but not without its limits.
>
> Oh yes, that reminds me...  *shuffles off to the internets*  Jordan Mechner used this to change some artwork for POP.
>
> https://github.com/jmechner/Prince-of-Persia-Apple-II/blob/master/01%20POP%20Source/Source/MASTER.S#L891
>
>      lda IIGS
>      bne SuperEpilog ;super hi-res ending if IIGS
>
>
> Here's the machine check code he used.
> https://github.com/jmechner/Prince-of-Persia-Apple-II/blob/c690818226e37a81d5d2dcb6568cf15aa0fb522f/01%20POP%20Source/Source/GRAFIX.S#L2004
>
> I think there's a technote or one of the official manuals that tells you what the values are.
>

So far all the aforementioned examples assume the 65816 is in emulation 
mode (6502 mode) and therefore it is safe to write 6502 code to detect 
and launch 65816 code.  But what about the other way around?  What if 
the binary were launched from a 16-bit native mode shell or GUI? 
ProDOS-8 does not have this problem (starts in 8-bit mode); unsure about 
GS/OS or ProDOS-16.  I'd think for various reasons the designers of 
65816 systems with a desire to support 6502 code would always launch in 
emulation mode (8-bit) and expect the programmer to switch to native 
16-bit mode.

While the 65816 and 6502 share many opcode values the # of operands can 
vary (8 vs. 16 bit).  Assuming the 6502 would interpret XCE & SEP as 
NOP, then it should be possible to force 8-bit mode to start with.

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


Thread

Dual 65C816/65C02 programs D Finnigan <dog_cow@macgui.com> - 2013-07-14 02:35 +0000
  Re: Dual 65C816/65C02 programs Egan Ford <datajerk@gmail.com> - 2013-07-14 21:35 -0500
    Re: Dual 65C816/65C02 programs D Finnigan <dog_cow@macgui.com> - 2013-07-15 21:34 +0000
      Re: Dual 65C816/65C02 programs Charlie <charlieDOTd@verEYEzon.net> - 2013-07-15 20:47 -0400
      Re: Dual 65C816/65C02 programs gbody4@bigpond.com - 2013-07-15 18:52 -0700
        Re: Dual 65C816/65C02 programs Dagen Brock <DagenBrock@gmail.com> - 2013-07-19 07:49 -0700
          Re: Dual 65C816/65C02 programs Egan Ford <datajerk@gmail.com> - 2013-07-19 10:55 -0600
            Re: Dual 65C816/65C02 programs Dagen Brock <DagenBrock@gmail.com> - 2013-07-19 13:21 -0700
              Re: Dual 65C816/65C02 programs Egan Ford <datajerk@gmail.com> - 2013-07-20 11:52 -0600
                Re: Dual 65C816/65C02 programs D Finnigan <dog_cow@macgui.com> - 2013-07-20 22:47 +0000
                Re: Dual 65C816/65C02 programs Egan Ford <datajerk@gmail.com> - 2013-07-21 11:19 -0600
                Re: Dual 65C816/65C02 programs D Finnigan <dog_cow@macgui.com> - 2013-07-21 17:35 +0000
                Re: Dual 65C816/65C02 programs gids.rs@sasktel.net - 2013-07-25 08:25 -0700
                Re: Dual 65C816/65C02 programs Egan Ford <datajerk@gmail.com> - 2013-07-27 15:04 -0600

csiph-web