Skip to content

Commit

Permalink
Document some hard-coded values
Browse files Browse the repository at this point in the history
  • Loading branch information
picosonic committed Oct 23, 2023
1 parent acdc09f commit 644f963
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions beeb/consts.asm
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ BYTESPERLINE = (MAXX*2)
MODE8BASE = &5000

; Sideways RAM banks
SWR_SLOTS = 16
SWR_PAGE = &1100
SWR_ROOMDATA = &11FF
SWR_MOREDATA = &11FE
ROM_SIZE16KB = 16*1024
SWR_CACHE = ROMSBASE-ROM_SIZE16KB

MACRO PAGE_ROOMDATA
SEI:LDA SWR_ROOMDATA:STA ROMSEL:STA ROMSEL_CACHE:CLI
Expand Down
8 changes: 4 additions & 4 deletions beeb/loader2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ALIGN &100
CPY #&FD:BEQ swrdone ; Stop if we've found 2 SWR
.noswryet
INX:CPX #16:BNE findswr ; Keep looking until we get to slot 16
INX:CPX #SWR_SLOTS:BNE findswr ; Keep looking until we get to slot 16

; Re-select ROM (likely BASIC)
.swrdone
Expand All @@ -54,7 +54,7 @@ ALIGN &100
LDX #&00
.swrcpyloop
; Copy a page of data
LDA &4000, X:STA ROMSBASE, X
LDA SWR_CACHE, X:STA ROMSBASE, X
INX
CPX #&00:BNE swrcpyloop

Expand All @@ -63,13 +63,13 @@ ALIGN &100

; See if src has got to the end
LDA swrcpyloop+2
CMP #&80:BNE swrcpyloop
CMP #hi(ROMSBASE):BNE swrcpyloop

; Re-select ROM (likely BASIC)
LDY ROMSEL_CACHE:STY ROMSEL

; Put back source/dest incase further copies are done
LDA #&40:STA swrcpyloop+2
LDA #hi(SWR_CACHE):STA swrcpyloop+2
LDA #hi(ROMSBASE):STA swrcpyloop+5

CLI
Expand Down

0 comments on commit 644f963

Please sign in to comment.