diff --git a/demos/kfest-2022/demo-5/App.Main.s b/demos/kfest-2022/demo-5/App.Main.s index 3704b8a..2a68015 100644 --- a/demos/kfest-2022/demo-5/App.Main.s +++ b/demos/kfest-2022/demo-5/App.Main.s @@ -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 diff --git a/src/Defs.s b/src/Defs.s index 5188195..48f8d37 100644 --- a/src/Defs.s +++ b/src/Defs.s @@ -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 diff --git a/src/Graphics.s b/src/Graphics.s index e9feb27..41e88ea 100644 --- a/src/Graphics.s +++ b/src/Graphics.s @@ -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 diff --git a/src/static/TileStore.s b/src/static/TileStore.s index 772cb04..6783380 100644 --- a/src/static/TileStore.s +++ b/src/static/TileStore.s @@ -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