Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXB_RAM restore secondary slot(#75) #103

Merged
merged 4 commits into from Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file removed docs/img/gsg/Partitions2And4Active.PNG
Binary file not shown.
64 changes: 60 additions & 4 deletions source/kernel/bank1/mapinit.mac
Expand Up @@ -754,14 +754,28 @@ EXB_NEX:
;
exx
ex af,af'
ld hl,EXB_RAM

ld de,($SECBUF##)
push de

ld hl,EXB_RAM
ld bc,EXB_RAM_END-EXB_RAM
ldir

ld hl, +(EXB_SLOT_RESTORE+1)-EXB_RAM_END
add hl, de
ex de, hl

ld hl, +(EXB_SLOT_BACKUP+1)-(EXB_SLOT_RESTORE+1)
add hl, de
ld (hl), e
inc hl
ld (hl), d

ex af,af'
exx
ld ix,($SECBUF##)
jp (ix)

ret

;--- From here is copied to RAM
EXB_RAM:
Expand All @@ -787,8 +801,28 @@ EXB_LOOP:
push bc
push de
push hl
ld a,(ix)

ld a,(ix)
ld d,a
and 80h
jr z,EXB_SLOT_BACKUP

ld a,d
and 3
ld e,a
ld hl,SLTTBL
add a,l
ld l,a
ld a,(hl)
and 0Ch
or e
or 80h

EXB_SLOT_BACKUP:
ld (EXB_SLOT_RESTORE+1),a
ld a,d
and 10001111b

ld h,40h
call ENASLT
ld hl,DV_EXTBIO##
Expand All @@ -802,6 +836,28 @@ EXB_LOOP:
pop af
call CALDRV##

push af

EXB_SLOT_RESTORE:
ld a,00h
or a
jr z,EXB_SKIP_RESTORE

push bc
push de
push hl

ld h,40h
call ENASLT

pop hl
pop de
pop bc

EXB_SKIP_RESTORE:

pop af

pop iy
pop ix
exx
Expand Down