Skip to content

Commit

Permalink
Merge pull request #1150 from six809/opt-dragon-mooh
Browse files Browse the repository at this point in the history
dragon-mooh: minor optimisations
  • Loading branch information
EtchedPixels authored Feb 4, 2025
2 parents 2780def + c6323d2 commit 881f98a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions Kernel/platform/platform-dragon-mooh/mem-mooh.s
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,13 @@ smash@ leau -14,u
pshs dp,d,x,y
cmpu #0x8002+42+7 ; end of copy? (leave space for interrupt) - bottom of SRC
bne smash@ ; no repeat
ldx save_sp ; put stack back
exg x,s ; and data DEST ptr to X now
leau -7,u
safe@ ldd ,--u ; move last 44 bytes with a normal stack
std ,--x ; 4 bytes per loop
ldd ,--u
std ,--x
cmpx #0xA000 ; reached bottom of DEST?
leax -7,u ; pick up SRC in X
ldu save_sp ; restore stack...
exg u,s ; ... and DEST now in U
safe@ ldy ,--x ; move last 44 bytes with a normal stack
ldd ,--x ; 4 bytes per loop
pshu d,y
cmpx #0x8000 ; reached bottom of SRC?
bne safe@
puls x
stx 0xFFA4 ; restore MMU regs
Expand Down
4 changes: 2 additions & 2 deletions Kernel/platform/platform-dragon-mooh/tricks.s
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@ _dofork:

; now the copy operation is complete we can get rid of the stuff
; _switchin will be expecting from our copy of the stack.
puls x
leas 2,s

ldx #_udata
pshs x
ldx fork_proc_ptr
jsr _makeproc
puls x
leas 2,s

; any calls to map process will now map the childs memory

Expand Down

0 comments on commit 881f98a

Please sign in to comment.