mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2025-01-12 12:29:53 +00:00
Change GTESetScreenMode to use bytes for the width
This commit is contained in:
parent
68b8ca5856
commit
5a0e0e447e
@ -75,8 +75,8 @@ SpriteCount equ 50
|
||||
|
||||
; Initialize the graphics screen playfield
|
||||
|
||||
pea #320
|
||||
pea #200
|
||||
pea #160 ; width in bytes
|
||||
pea #200 ; height in lines
|
||||
_GTESetScreenMode
|
||||
|
||||
; Load a tileset
|
||||
|
@ -20,6 +20,7 @@ SHR_SCREEN equ $E12000
|
||||
SHR_SCB equ $E19D00
|
||||
SHR_PALETTES equ $E19E00
|
||||
SHR_LINE_WIDTH equ 160
|
||||
SHR_SCREEN_HEIGHT equ 200
|
||||
|
||||
; Direct page locations used by the engine
|
||||
ScreenHeight equ 0 ; Height of the playfield in scan lines
|
||||
|
@ -40,7 +40,7 @@ InitGraphics
|
||||
; 9. Agony (Amiga) : 36 x 24 288 x 192 (27,648 bytes ( 86.4%))
|
||||
; 10. Atari Lynx : 20 x 13 160 x 102 (8,160 bytes ( 25.5%))
|
||||
;
|
||||
; X = mode number OR width in pixels (must be multiple of 2)
|
||||
; X = mode number OR width in bytes
|
||||
; Y = height in pixels (if X > 8)
|
||||
_SetScreenMode
|
||||
cpx #11
|
||||
@ -54,25 +54,23 @@ _SetScreenMode
|
||||
lda ScreenModeWidth,x
|
||||
tax
|
||||
|
||||
:direct cpy #201
|
||||
:direct cpy #SHR_SCREEN_HEIGHT+1
|
||||
bcs :exit
|
||||
|
||||
cpx #321
|
||||
cpx #SHR_LINE_WIDTH+1
|
||||
bcs :exit
|
||||
|
||||
txa
|
||||
lsr
|
||||
pha ; Save X (width / 2) and Y (height)
|
||||
phx ; Save X (width) and Y (height)
|
||||
phy
|
||||
|
||||
lda #160 ; Center the screen
|
||||
lda #SHR_LINE_WIDTH ; Center the screen
|
||||
sec
|
||||
sbc 3,s
|
||||
lsr
|
||||
xba
|
||||
pha ; Save half the origin coordinate
|
||||
|
||||
lda #200
|
||||
lda #SHR_SCREEN_HEIGHT
|
||||
sec
|
||||
sbc 3,s ; This is now Y because of the PHA above
|
||||
lsr
|
||||
|
@ -412,7 +412,7 @@ DefaultPalette ENT
|
||||
; 9. Agony (Amiga) : 36 x 24 288 x 192 (27,648 bytes ( 86.4%))
|
||||
; 10. Atari Lynx : 20 x 13 160 x 102 (8,160 bytes ( 25.5%))
|
||||
ScreenModeWidth ENT
|
||||
dw 320,272,256,256,280,256,240,288,160,288,160,320
|
||||
dw 160,136,128,128,140,128,120,144,80,144,80,160
|
||||
ScreenModeHeight ENT
|
||||
dw 200,192,200,176,160,160,160,128,144,192,102,1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user