mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2024-06-12 13:29:30 +00:00
Thank to Kelvin Sherlock for pointing out that the source files were not setting the register state directive
This commit is contained in:
parent
9692277677
commit
1f9f2aee0c
|
@ -12,10 +12,14 @@ _GTEStartUp MAC
|
||||||
UserTool $02A0
|
UserTool $02A0
|
||||||
<<<
|
<<<
|
||||||
|
|
||||||
|
mx %00
|
||||||
|
|
||||||
; Typical init
|
; Typical init
|
||||||
phk
|
phk
|
||||||
plb
|
plb
|
||||||
|
|
||||||
|
sta UserId ; GS/OS passed the memory manager user ID for the aoplication into the program
|
||||||
|
|
||||||
jsr ToolStartUp ; Start up the basic tools: Locator, Memory Manager, Misc
|
jsr ToolStartUp ; Start up the basic tools: Locator, Memory Manager, Misc
|
||||||
jsr GTEStartUp
|
jsr GTEStartUp
|
||||||
|
|
||||||
|
@ -27,19 +31,23 @@ qtRec adrl $0000
|
||||||
da $00
|
da $00
|
||||||
|
|
||||||
ToolStartUp
|
ToolStartUp
|
||||||
_TLStartUp ; normal tool initialization
|
; _TLStartUp ; normal tool initialization
|
||||||
pha
|
; pha
|
||||||
_MMStartUp
|
; _MMStartUp
|
||||||
pla
|
; pla
|
||||||
sta MasterId ; our master handle references the memory allocated to us
|
; sta MasterId ; our master handle references the memory allocated to us
|
||||||
ora #$0100 ; set auxID = $01 (valid values $01-0f)
|
; ora #$0100 ; set auxID = $01 (valid values $01-0f)
|
||||||
sta UserId ; any memory we request must use our own id
|
; sta UserId ; any memory we request must use our own id
|
||||||
|
|
||||||
_MTStartUp
|
_MTStartUp ; just start up the miscellaneous tools
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; Load the GTE User Tool and register it
|
; Load the GTE User Tool and register it
|
||||||
GTEStartUp
|
GTEStartUp
|
||||||
|
pea $0000
|
||||||
|
_LoaderStatus
|
||||||
|
pla
|
||||||
|
|
||||||
pea $0000
|
pea $0000
|
||||||
pea $0000
|
pea $0000
|
||||||
pea $0000
|
pea $0000
|
||||||
|
@ -52,9 +60,13 @@ GTEStartUp
|
||||||
pea #^ToolPath
|
pea #^ToolPath
|
||||||
pea #ToolPath
|
pea #ToolPath
|
||||||
pea $0001 ; do not load into special memory
|
pea $0001 ; do not load into special memory
|
||||||
pea $0001 ; GS/OS string for the argument
|
; pea $0001 ; GS/OS string for the argument
|
||||||
_InitialLoad2
|
_InitialLoad
|
||||||
|
bcc :ok1
|
||||||
|
brk $01
|
||||||
|
|
||||||
|
|
||||||
|
:ok1
|
||||||
ply
|
ply
|
||||||
pla ; Address of the loaded tool
|
pla ; Address of the loaded tool
|
||||||
plx
|
plx
|
||||||
|
@ -66,7 +78,10 @@ GTEStartUp
|
||||||
phx
|
phx
|
||||||
pha ; Address of function pointer table
|
pha ; Address of function pointer table
|
||||||
_SetTSPtr
|
_SetTSPtr
|
||||||
|
bcc :ok2
|
||||||
|
brk $02
|
||||||
|
|
||||||
|
:ok2
|
||||||
clc ; Give GTE a page of direct page memory
|
clc ; Give GTE a page of direct page memory
|
||||||
tdc
|
tdc
|
||||||
adc #$0100
|
adc #$0100
|
||||||
|
@ -74,10 +89,12 @@ GTEStartUp
|
||||||
lda UserId
|
lda UserId
|
||||||
pha
|
pha
|
||||||
_GTEStartUp
|
_GTEStartUp
|
||||||
|
bcc :ok3
|
||||||
|
brk $03
|
||||||
|
|
||||||
|
:ok3
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
MasterId ds 2
|
MasterId ds 2
|
||||||
UserId ds 2
|
UserId ds 2
|
||||||
ToolPath strl '9:GTETool'
|
ToolPath str '1/GTETool'
|
|
@ -88,10 +88,7 @@ Overlay EXT
|
||||||
; A = memory manager userId
|
; A = memory manager userId
|
||||||
; X = tool number
|
; X = tool number
|
||||||
_CoreStartUp
|
_CoreStartUp
|
||||||
sta UserId ; This is the first thing to do
|
jsr IntStartUp ; Enable certain interrupts
|
||||||
stx ToolNum
|
|
||||||
|
|
||||||
jsr IntStartUp ; Enable certain iterrupts
|
|
||||||
|
|
||||||
jsr InitMemory ; Allocate and initialize memory for the engine
|
jsr InitMemory ; Allocate and initialize memory for the engine
|
||||||
jsr EngineReset ; All of the resources are allocated, put the engine in a known state
|
jsr EngineReset ; All of the resources are allocated, put the engine in a known state
|
||||||
|
|
39
src/Tool.s
39
src/Tool.s
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
ToStrip equ $E10184
|
ToStrip equ $E10184
|
||||||
|
|
||||||
|
mx %00
|
||||||
|
|
||||||
_CallTable
|
_CallTable
|
||||||
adrl {_CTEnd-_CallTable}/4
|
adrl {_CTEnd-_CallTable}/4
|
||||||
adrl _TSBootInit-1
|
adrl _TSBootInit-1
|
||||||
|
@ -42,38 +44,35 @@ _TSBootInit
|
||||||
; StartUp(dPageAddr, userId)
|
; StartUp(dPageAddr, userId)
|
||||||
_TSStartUp
|
_TSStartUp
|
||||||
|
|
||||||
rtll = 1
|
|
||||||
rtl2 = rtl1+3
|
|
||||||
userId = 7
|
userId = 7
|
||||||
zpToUse = userId+2
|
zpToUse = userId+2
|
||||||
|
|
||||||
|
lda zpToUse,s ; Get the direct page address
|
||||||
|
phd ; Save the current direct page
|
||||||
|
tcd ; Set to our working direct page space
|
||||||
|
|
||||||
txa
|
txa
|
||||||
and #$00FF ; Get just the tool number
|
and #$00FF ; Get just the tool number
|
||||||
tax
|
sta ToolNum
|
||||||
|
|
||||||
lda userId,s ; Get the userId for memory allocations
|
lda userId+2,s ; Get the userId for memory allocations
|
||||||
tay
|
sta UserId
|
||||||
lda zpToUse,s ; Get the direct page address
|
|
||||||
|
|
||||||
phd ; Save the current direct page
|
jsr _CoreStartUp ; Initialize the library
|
||||||
tcd ; Set to our working direct page space
|
|
||||||
|
|
||||||
tya ; A = memory manager user Id, X = tool number
|
|
||||||
jsr _CoreStartUp ; Initialize the library
|
|
||||||
|
|
||||||
; SetWAP(userOrSystem, tsNum, waptPtr)
|
; SetWAP(userOrSystem, tsNum, waptPtr)
|
||||||
|
|
||||||
pea #$8000 ; $8000 = user tool set
|
pea #$8000 ; $8000 = user tool set
|
||||||
pei ToolNum ; Push the tool number from the direct page
|
pei ToolNum ; Push the tool number from the direct page
|
||||||
pea $0000 ; High word of WAP is zero (bank 0)
|
pea $0000 ; High word of WAP is zero (bank 0)
|
||||||
phd ; Low word of WAP is the direct page
|
phd ; Low word of WAP is the direct page
|
||||||
_SetWAP
|
_SetWAP
|
||||||
|
|
||||||
pld ; Restore the caller's direct page
|
pld ; Restore the caller's direct page
|
||||||
|
|
||||||
lda #0
|
ldx #0 ; No error
|
||||||
clc
|
ldy #4 ; Remove the 4 input bytes
|
||||||
rtl
|
jml ToStrip
|
||||||
|
|
||||||
_TSShutDown
|
_TSShutDown
|
||||||
cmp #0 ; Acc is low word of the WAP (direct page)
|
cmp #0 ; Acc is low word of the WAP (direct page)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
; sprite stamp pixel data
|
; sprite stamp pixel data
|
||||||
spritedata ENT
|
spritedata ENT
|
||||||
ds 65535
|
; ds 65535
|
||||||
|
ds 65536
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
; sprite stamp masks
|
; sprite stamp masks
|
||||||
spritemask ENT
|
spritemask ENT
|
||||||
ds 65535
|
; ds 65535
|
||||||
|
ds 65536
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
; Bank of memory that holds the 8x8 tile data
|
; Bank of memory that holds the 8x8 tile data
|
||||||
tiledata ENT
|
tiledata ENT
|
||||||
ds 65535
|
; ds 65535
|
||||||
|
ds 65536
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
; Bank of memory that holds the core sprite and tile store data structures
|
; Bank of memory that holds the core sprite and tile store data structures
|
||||||
TileStore ENT
|
TileStore ENT
|
||||||
ds 65535
|
; ds 65535
|
||||||
|
ds 65536
|
||||||
|
|
Loading…
Reference in New Issue
Block a user