From 57ffa8794f9d12511e3f5d9f93f3c2e6e846fbb3 Mon Sep 17 00:00:00 2001 From: Lucas Scharenbroich Date: Mon, 27 Jun 2022 11:25:08 -0500 Subject: [PATCH] Add in some missed updates --- demos/shell/App.Main.s | 107 +++++++++++++++++++++++++--------- demos/shell/App.s | 25 +------- demos/shell/gen/App.TileSet.s | 2 +- demos/tool/App.Main.s | 2 +- 4 files changed, 85 insertions(+), 51 deletions(-) diff --git a/demos/shell/App.Main.s b/demos/shell/App.Main.s index ee941cb..5c2c196 100644 --- a/demos/shell/App.Main.s +++ b/demos/shell/App.Main.s @@ -9,11 +9,14 @@ use Tool222.Macs.s use Util.Macs.s use CORE.MACS.s - use ../../src/GTE.s + use GTE.Macs + use ../../src/Defs.s mx %00 +TSet EXT + ; Feature flags NO_INTERRUPTS equ 0 ; turn off for crossrunner debugging NO_MUSIC equ 1 ; turn music + tool loading off @@ -22,40 +25,39 @@ NO_MUSIC equ 1 ; turn music + tool loadi phk plb - jsl EngineStartUp + sta MyUserId ; GS/OS passes the memory manager user ID for the application into the program + _MTStartUp ; GTE requires the miscellaneous toolset to be running - lda #^MyPalette - ldx #MyPalette - ldy #0 - jsl SetPalette + jsr GTEStartUp ; Load and install the GTE User Tool - ldx #0 - jsl SetScreenMode +; Load a tileset + + pea #^TSet + pea #TSet + _GTELoadTileSet + + + pea $0000 + pea #^MyPalette + pea #MyPalette + _GTESetPalette + + pea $0000 + _GTESetScreenMode ; Set up our level data - jsr BG0SetUp - jsr BG1SetUp - jsr TileAnimInit + jsr BG0SetUp + jsr BG1SetUp + jsr TileAnimInit ; Allocate room to load data - jsl AllocBank ; Alloc 64KB for Load/Unpack - sta BankLoad ; Store "Bank Pointer" + jsl AllocBank ; Alloc 64KB for Load/Unpack + sta BankLoad ; Store "Bank Pointer" - jsr MovePlayerToOrigin ; Put the player at the beginning of the map - - jsr InitOverlay ; Initialize the status bar + jsr MovePlayerToOrigin ; Put the player at the beginning of the map + jsr InitOverlay ; Initialize the status bar - lda #DIRTY_BIT_BG0_REFRESH ; Redraw all of the tiles on the next Render - ora #DIRTY_BIT_BG1_REFRESH - tsb DirtyBits - - stz frameCount - ldal OneSecondCounter - sta oldOneSecondCounter - - lda #$FFFF - jsl Render EvtLoop jsl DoTimers jsl Render @@ -439,6 +441,59 @@ closeRec dw 1 ; pCount qtRec adrl $0000 da $00 + +; Load the GTE User Tool and install it +GTEStartUp + pea $0000 + _LoaderStatus + pla + + pea $0000 + pea $0000 + pea $0000 + pea $0000 + pea $0000 ; result space + + lda MyUserId + pha + + pea #^ToolPath + pea #ToolPath + pea $0001 ; do not load into special memory + _InitialLoad + bcc :ok1 + brk $01 + +:ok1 + ply + pla ; Address of the loaded tool + plx + ply + ply + + pea $8000 ; User toolset + pea $00A0 ; Set the tool set number + phx + pha ; Address of function pointer table + _SetTSPtr + bcc :ok2 + brk $02 + +:ok2 + clc ; Give GTE a page of direct page memory + tdc + adc #$0100 + pha + pea #ENGINE_MODE_DYN_TILES+ENGINE_MODE_TWO_LAYER ; Enable Dynamic Tiles and Two Layer + lda MyUserId ; Pass the userId for memory allocation + pha + _GTEStartUp + bcc :ok3 + brk $03 + +:ok3 + rts + PUT App.Msg.s PUT Actions.s PUT font.s diff --git a/demos/shell/App.s b/demos/shell/App.s index 419314c..aba9045 100644 --- a/demos/shell/App.s +++ b/demos/shell/App.s @@ -7,30 +7,9 @@ ; Segment #1 -- Main execution block ASM App.Main.s - DS 0 ; Number of bytes of 0's to add at the end of the Segment - KND #$1100 ; Type and Attributes ($11=Static+Bank Relative,$00=Code) - ALI None ; Boundary Alignment (None) SNA Main -; Segment #2 -- Core GTE Code - - ASM ..\..\src\Core.s - SNA Core - -; Segment #3 -- 64KB Tile Memory +; Segment #2 -- Tileset ASM gen\App.TileSet.s - DS 0 - KND #$1001 ; Type and Attributes ($11=Static+Bank Relative,$01=Data) -; ALI BANK - SNA Tiles - -; Segment #4 -- Rotation table data - - ASM ..\..\src\RotData.s - DS 0 - KND #$1001 ; Type and Attributes ($11=Static+Bank Relative,$01=Data) - ALI BANK - SNA RotData - - + SNA TSET \ No newline at end of file diff --git a/demos/shell/gen/App.TileSet.s b/demos/shell/gen/App.TileSet.s index e6c1692..98af67d 100644 --- a/demos/shell/gen/App.TileSet.s +++ b/demos/shell/gen/App.TileSet.s @@ -2,7 +2,7 @@ ; Palette: ; $0000,$0777,$0F31,$0E51,$00A0,$02E3,$0BF1,$0FA4,$0FD7,$0EE6,$0F59,$068F,$01CE,$09B9,$0EDA,$0EEE ; Converting to BG0 format... -tiledata ENT +TSet ENT ; Reserved space (tile 0 is special... ds 128 diff --git a/demos/tool/App.Main.s b/demos/tool/App.Main.s index f327395..9fd95f5 100644 --- a/demos/tool/App.Main.s +++ b/demos/tool/App.Main.s @@ -464,7 +464,7 @@ GTEStartUp tdc adc #$0100 pha - pea #ENGINE_MODE_DYN_TILES ; Enable Dynamic Tiles + pea #ENGINE_MODE_DYN_TILES+ENGINE_MODE_TWO_LAYER ; Enable Dynamic Tiles and Two Layer lda MyUserId ; Pass the userId for memory allocation pha _GTEStartUp