Megalextoria
Retro computing and gaming, sci-fi books, tv and movies and other geeky stuff.

Home » Digital Archaeology » Computer Arcana » Apple » Apple II » GS SHGR - I'm messing up something here...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
GS SHGR - I'm messing up something here... [message #387278] Sun, 22 September 2019 22:25 Go to next message
Steve Nickolas is currently offline  Steve Nickolas
Messages: 2036
Registered: October 2012
Karma: 0
Senior Member
I know something's not working quite right, since testing in gsport isn't
giving me the blank screen it should be, let alone to try drawing in it.

There is no 65816 code in this, it's pure 6502.

-uso.

; ============================================================ ================
; Work in progress IIgs video framework
; ============================================================ ================

.org $0800

; Make sure we're running on an Apple IIgs, first and foremost.
; If not, exit gracefully in a way that should work on any Apple ][-compatible

entry: lda $FBB3 ; //e detect (GS always passes)
cmp #$06
bne fail
sec ; GS detect
jsr $FE1F
bcc pass
clc
fail: ldy #$00
@1: lda failmsg, y
beq @2
eor #$80
jsr $FDED
iny
bne @1
@2: jmp $03D0 ; exit to BASIC
failmsg: .byte 13, "APPLE IIGS REQUIRED", 7, 13, 0

; A CGA-style palette

pal: .word $000, $00C, $0C0, $0CC, $C00, $C0C, $C70, $CCC
.word $333, $00F, $0F0, $0FF, $F00, $F0F, $FF0, $FFF

; Set up the display

pass: lda $C035 ; allow SHGR memory to be addressed from
ora #$08 ; emulation mode
sta $C035

lda $C026 ; force CPU into turbo mode
ora #$80
sta $C026

jsr $FE84 ; reset console
jsr $FE89
jsr $FE93
jsr $FB2F
jsr $FC58 ; clear screen

lda #$F0 ; set text color to white on black
sta $C022
lda $C034 ; set border to black
and #$0F
sta $C034

sta $C005 ; write to AUX
ldy #$00 ; completely blank SHGR display
sty $04 ; (this also initializes the screen mode
lda #$20 ; to 320x200/one palette/no IRQs/no fill)
sta $05 ; (Zero fill AUX:2000-9FFF)
tya
@1: sta ($04), y
iny
bne @1
inc $05
ldx $05
cpx #$A0 ; are we there yet?
bcc @1
sta $C004 ; write to MAIN

lda $C029 ; enter SHGR mode
ora #$C0
sta $C029

ldy #$00 ; set up CGA colors
@2: lda pal, y
sta $9E00, y
iny
cpy #$40
bcc @2

rts
GS SHGR - I'm messing up something here... [message #387279 is a reply to message #387278] Sun, 22 September 2019 22:49 Go to previous messageGo to next message
gids.rs is currently offline  gids.rs
Messages: 1395
Registered: October 2012
Karma: 0
Senior Member
There are certain times the GSPort doesn’t display the super hires screen properly, but I know my SHR screen display program works properly every time, but haven’t gone through the code yet to see why it always works and other ways don’t.

But I believe I had it also store zeroes in the scanline memory from $9D00.9DFF which should force it to use palette #0.

Also try storing the palette values first before clearing the actual screen..
Re: GS SHGR - I'm messing up something here... [message #387280 is a reply to message #387279] Sun, 22 September 2019 22:54 Go to previous messageGo to next message
Steve Nickolas is currently offline  Steve Nickolas
Messages: 2036
Registered: October 2012
Karma: 0
Senior Member
On Sun, 22 Sep 2019, I am Rob wrote:

> But I believe I had it also store zeroes in the scanline memory from
> $9D00.9DFF which should force it to use palette #0.

My code completely zaps 2000-9FFF in order.

-uso.
Re: GS SHGR - I'm messing up something here... [message #387282 is a reply to message #387278] Sun, 22 September 2019 23:24 Go to previous messageGo to next message
Charlie is currently offline  Charlie
Messages: 255
Registered: November 2012
Karma: 0
Senior Member
On 9/22/2019 10:25 PM, Steve Nickolas wrote:
> I know something's not working quite right, since testing in gsport
> isn't giving me the blank screen it should be, let alone to try drawing
> in it.
>
> There is no 65816 code in this, it's pure 6502.
>
> -uso.
>
> ;
> ============================================================ ================
>
> ; Work in progress IIgs video framework
> ;
> ============================================================ ================
>
>
>           .org      $0800
>
> ; Make sure we're running on an Apple IIgs, first and foremost.
> ; If not, exit gracefully in a way that should work on any Apple
> ][-compatible
>
> entry:    lda       $FBB3     ; //e detect (GS always passes)
>           cmp       #$06
>           bne       fail
>           sec                 ; GS detect
>           jsr       $FE1F
>           bcc       pass
>           clc
> fail:     ldy       #$00
> @1:       lda       failmsg, y
>           beq       @2
>           eor       #$80
>           jsr       $FDED
>           iny
>           bne       @1
> @2:       jmp       $03D0     ; exit to BASIC
> failmsg:  .byte     13, "APPLE IIGS REQUIRED", 7, 13, 0
>
> ; A CGA-style palette
>
> pal:      .word     $000, $00C, $0C0, $0CC, $C00, $C0C, $C70, $CCC
>           .word     $333, $00F, $0F0, $0FF, $F00, $F0F, $FF0, $FFF
>
> ; Set up the display
>
> pass:     lda       $C035     ; allow SHGR memory to be addressed from
>           ora       #$08      ; emulation mode

I believe this is telling the IIgs to inhibit shadowing of SHR (Super
High Resolution) graphics and shadow DHR (Double High Resolution)
graphics instead.
Do you really want to do that?

Charlie

>           sta       $C035
>
>           lda       $C026     ; force CPU into turbo mode
>           ora       #$80
>           sta       $C026
>
>           jsr       $FE84     ; reset console
>           jsr       $FE89
>           jsr       $FE93
>           jsr       $FB2F
>           jsr       $FC58     ; clear screen
>
>           lda       #$F0      ; set text color to white on black
>           sta       $C022
>           lda       $C034     ; set border to black
>           and       #$0F
>           sta       $C034
>
>           sta       $C005     ; write to AUX
>           ldy       #$00      ; completely blank SHGR display
>           sty       $04       ; (this also initializes the screen mode
>           lda       #$20      ;  to 320x200/one palette/no IRQs/no fill)
>           sta       $05       ; (Zero fill AUX:2000-9FFF)
>           tya
> @1:       sta       ($04), y
>           iny
>           bne       @1
>           inc       $05
>           ldx       $05
>           cpx       #$A0      ; are we there yet?
>           bcc       @1
>           sta       $C004     ; write to MAIN
>
>           lda       $C029     ; enter SHGR mode
>           ora       #$C0
>           sta       $C029
>
>           ldy       #$00      ; set up CGA colors
> @2:       lda       pal, y
>           sta       $9E00, y
>           iny
>           cpy       #$40
>           bcc       @2
>
>           rts
>
Re: GS SHGR - I'm messing up something here... [message #387283 is a reply to message #387282] Sun, 22 September 2019 23:43 Go to previous messageGo to next message
Steve Nickolas is currently offline  Steve Nickolas
Messages: 2036
Registered: October 2012
Karma: 0
Senior Member
On Sun, 22 Sep 2019, Charlie wrote:

> I believe this is telling the IIgs to inhibit shadowing of SHR (Super High
> Resolution) graphics and shadow DHR (Double High Resolution) graphics
> instead.
> Do you really want to do that?

I'm trying to get SHGR memory to appear on the same memory bank as DHGR,
so I can write to it from //e mode.

(Maybe I misinterpreted the information I found while googling.)

-uso.
Re: GS SHGR - I'm messing up something here... [message #387288 is a reply to message #387283] Mon, 23 September 2019 06:41 Go to previous messageGo to next message
Steve Nickolas is currently offline  Steve Nickolas
Messages: 2036
Registered: October 2012
Karma: 0
Senior Member
Replacing "ora #$08" with "and #$7F" seems to have done the job.

-uso.
Re: GS SHGR - I'm messing up something here... [message #387291 is a reply to message #387288] Mon, 23 September 2019 09:11 Go to previous messageGo to next message
Antoine Vignau is currently offline  Antoine Vignau
Messages: 1860
Registered: October 2012
Karma: 0
Senior Member
Hum... $C026... no... $C036... yes :-)

If you know you are on a IIgs, TSB/TRB are your friends.

av
Re: GS SHGR - I'm messing up something here... [message #387300 is a reply to message #387280] Mon, 23 September 2019 16:25 Go to previous message
gids.rs is currently offline  gids.rs
Messages: 1395
Registered: October 2012
Karma: 0
Senior Member
Didn’t finish my sentence.

When first using super hi-res in GSPort you have to store the palette and scan line values in bank $E1 first.

Now your program should work properly clearing the screen in shadowed memory.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Total Replay v2 & GSPort
Next Topic: Killer Apps (for //e)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Mar 29 01:31:45 EDT 2024

Total time taken to generate the page: 0.03489 seconds