[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coding for IIgs 2 - working on screen memory



"lyricalnanoha" <lyricalnanoha@usotsuki.hoshinet.org> wrote in message 
alpine.DEB.0.99.0812242231240.27952@andisteele.dosius.ath.cx">news:alpine.DEB.0.99.0812242231240.27952@andisteele.dosius.ath.cx...
> Ouch.  Got wedged trying to pull this off, perhaps I'm interpreting the 
> hardware wrong.  Looks like it's trying to write in bank 0 instead of bank 
> 1.  (I'm using the //e way to access bank 1, according to the docs I have, 
> rather than trying to go '816 and do it that way, as I don't yet 
> understand 65816 mode.)
>
> The way I *wrote* the code, I meant it to leave ][+ space readable while 
> making //e space writable.  (It doesn't seem to have done that.)  Whether 
> I .org this high or low, it still gets wedged.  (There's nothing 
> IIgs-dependent about the code beyond the C029 thing.)
>
> I'm trying to create a memory environment conducive to plotting pixels in 
> 320x200x16 mode.  The palette approximates EGA.
>
> -uso.
>
> setty:    lda       $C029
>           ora       #$80
>           sta       $C029
>           bit       $C005
>           ldy       #32
> @1:       lda       paltab-1, y
>           sta       $9E00, y
>           sta       $9E20, y
>           sta       $9E40, y
>           sta       $9E60, y
>           sta       $9E80, y
>           sta       $9EA0, y
>           sta       $9EC0, y
>           sta       $9EE0, y
>           sta       $9F00, y
>           sta       $9F20, y
>           sta       $9F40, y
>           sta       $9F60, y
>           sta       $9F80, y
>           sta       $9FA0, y
>           sta       $9FC0, y
>           sta       $9FE0, y
>           dey
>           bne       @1
>           lda       #$00
>           ldy       #$C7
> @2:       sta       $9D00, y
>           dey
>           bne       @2
>           bit       $C004
>           rts
>
> paltab:   .byte     $00, $00, $0C, $00, $C0, $00, $CC, $00
>           .byte     $00, $0C, $0C, $0C, $70, $0C, $CC, $0C
>           .byte     $77, $07, $0F, $00, $F0, $00, $FF, $00
>           .byte     $00, $0F, $0F, $0F, $F0, $0F, $FF, $0F

I've never done it that way but it looks like it should work.  Since it 
doesn't I would have to look at the bit opcode.  Somewhere in the back of my 
mind I think $C005 requires a write (someone else jump in if I'm wrong).

Another remote possibility:  Are you in emulation mode (65816 emulation bit 
set)?  If not and the data bank register is set to $00 maybe that over-rides 
the $C005 softswitch.  Again my memory cells aren't what they used to be and 
I might be way off base.

Charlie