GS SHGR - I'm messing up something here... [message #387278] |
Sun, 22 September 2019 22:25 |
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 |
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 #387282 is a reply to message #387278] |
Sun, 22 September 2019 23:24 |
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 |
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.
|
|
|
|
|
|