Raycaster needs to reserve memory for its tables. Also, fixed to properly display mem mgr debug info when loading fixups and modules into aux mem.

This commit is contained in:
Martin Haye 2015-05-31 08:45:23 -07:00
parent 994205c842
commit cccb136726
2 changed files with 16 additions and 3 deletions

View File

@ -620,6 +620,7 @@ reset: !zone
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
outOfMemErr: !zone outOfMemErr: !zone
!if DEBUG { jsr main_debug }
ldx #<+ ldx #<+
ldy #>+ ldy #>+
jmp fatalError jmp fatalError
@ -1006,9 +1007,10 @@ shared_queueLoad:
jsr .notMod ; queue the main memory part of the module jsr .notMod ; queue the main memory part of the module
stx .modRet+1 ; save address of main load for eventual return stx .modRet+1 ; save address of main load for eventual return
sty .modRet+3 ; yes, self-modifying sty .modRet+3 ; yes, self-modifying
lda #QUEUE_LOAD
ldx #RES_TYPE_BYTECODE ldx #RES_TYPE_BYTECODE
ldy resNum ldy resNum
jsr aux_queueLoad ; load the aux mem part (the bytecode) jsr aux_dispatch ; load the aux mem part (the bytecode)
; try to pick a location for the fixups that we can free without fragmenting everything. ; try to pick a location for the fixups that we can free without fragmenting everything.
ldx fixupHint ldx fixupHint
ldy fixupHint+1 ldy fixupHint+1
@ -1020,9 +1022,10 @@ shared_queueLoad:
sta targetAddr sta targetAddr
lda fixupHint+1 lda fixupHint+1
sta targetAddr+1 sta targetAddr+1
.frag ldx #RES_TYPE_FIXUP ; queue loading of the fixup resource .frag lda #QUEUE_LOAD
ldx #RES_TYPE_FIXUP ; queue loading of the fixup resource
ldy resNum ldy resNum
jsr aux_queueLoad jsr aux_dispatch
lda fixupHint ; advance hint for next fixup by the size of this fixup lda fixupHint ; advance hint for next fixup by the size of this fixup
clc clc
adc reqLen adc reqLen
@ -1194,6 +1197,7 @@ disk_queueLoad: !zone
lda (pTmp),y ; and hi byte lda (pTmp),y ; and hi byte
+ stx reqLen ; save the uncompressed length + stx reqLen ; save the uncompressed length
sta reqLen+1 ; both bytes sta reqLen+1 ; both bytes
!if DEBUG { +prStr : !text "uclen=",0 : +prWord reqLen : +crout }
jsr shared_alloc ; reserve memory for this resource (main or aux as appropriate) jsr shared_alloc ; reserve memory for this resource (main or aux as appropriate)
stx tmp ; save lo part of addr temporarily stx tmp ; save lo part of addr temporarily
ldx segNum ; get the segment number back ldx segNum ; get the segment number back

View File

@ -2018,6 +2018,15 @@ pl_initMap: !zone
jsr pl_setDir jsr pl_setDir
inx inx
jsr pl_setPos jsr pl_setPos
; Reserve memory for all our tables.
lda #SET_MEM_TARGET
ldx #<tableStart
ldy #>tableStart
jsr mainLoader
lda #REQUEST_MEMORY
ldx #<(tableEnd-tableStart)
ldy #>(tableEnd-tableStart)
jsr mainLoader
; Proceed with loading ; Proceed with loading
jsr loadTextures jsr loadTextures
jsr copyScreen jsr copyScreen