![]() |
Routines |
| Prev: 659B | Up: Map | Next: 664E |
|
Scrolls the play area horizontally by shifting pixel data left using
RLD instructions.
|
||||
| ScrollPlayarea_Left | 659C | LD HL,($7817) | HL=*Current_ScreenPosition. | |
| 659F | LD D,H | Copy the screen position pointer into DE. | ||
| 65A0 | LD E,L | |||
| 65A1 | LD A,($7819) | A=*ScrollPhase_Counter. | ||
| 65A4 | LD C,A | Copy the scroll phase counter into C. | ||
| 65A5 | INC A | Increment the scroll phase counter by one. | ||
| 65A6 | AND %00000111 | Ensure the counter is limited to being a number between 00-07. | ||
| 65A8 | LD ($7819),A | Write the scroll phase counter back to *ScrollPhase_Counter. | ||
| 65AB | JR NZ,ScrollPlayarea_UpdateColumnPointer | Jump to ScrollPlayarea_UpdateColumnPointer if A is not zero. | ||
| 65AD | INC L | Increment L by one. | ||
| 65AE | JR NZ,ScrollPlayarea_StorePointer | Jump to ScrollPlayarea_StorePointer if L is not zero. | ||
| 65B0 | LD A,H | H+=05. | ||
| 65B1 | ADD A,$05 | |||
| 65B3 | LD H,A | |||
| ScrollPlayarea_StorePointer | 65B4 | LD ($7817),HL | Write HL to *Current_ScreenPosition. | |
|
Set up the column data pointer for new graphics data.
|
||||
| ScrollPlayarea_UpdateColumnPointer | 65B7 | LD A,E | E+=08. | |
| 65B8 | ADD A,$08 | |||
| 65BA | LD E,A | |||
| 65BB | JR NC,ScrollPlayarea_SetupScroll | Jump to ScrollPlayarea_SetupScroll if {} is higher. | ||
| 65BD | LD A,D | D+=05. | ||
| 65BE | ADD A,$05 | |||
| 65C0 | LD D,A | |||
| ScrollPlayarea_SetupScroll | 65C1 | LD A,C | Load the original scroll phase counter value into A. | |
| 65C2 | LD B,$01 | Set a counter in B for 01 column to process. | ||
| 65C4 | CALL PrepareScrollData | Call PrepareScrollData. | ||
|
Start of screen buffer.
|
||||
| 65C7 | LD HL,$401F | HL=401F (screen buffer location). | ||
| 65CA | LD D,H | Copy the screen position pointer into DE. | ||
| 65CB | LD E,L | |||
| 65CC | EXX | Switch to the shadow registers. | ||
| ScrollPlayarea_ProcessRows | 65CD | LD A,(DE) | A=*DE. | |
| 65CE | INC E | Increment E by one. | ||
| 65CF | LD L,A | L=A. | ||
| 65D0 | LD H,$1F | H=1F. | ||
| 65D2 | ADD HL,HL | Multiply HL by 04. | ||
| 65D3 | ADD HL,HL | |||
| 65D4 | EXX | Switch to the shadow registers. | ||
|
Scroll one character row (20 characters) left by 01 pixel using
RLD.
|
||||
| 65D5 | LD B,$04 | B=04. | ||
| ScrollCharacterRow_Left | 65D7 | EXX | Switch to the shadow registers. | |
| 65D8 | LD A,(HL) | A=*HL. | ||
| 65D9 | INC L | Increment L by one. | ||
| 65DA | EXX | Switch to the shadow registers. | ||
| 65DB | RLD | RLD. | ||
| 65DD | DEC L | Decrease L by one. | ||
| 65DE | RLD | RLD. | ||
| 65E0 | DEC L | Decrease L by one. | ||
| 65E1 | RLD | RLD. | ||
| 65E3 | DEC L | Decrease L by one. | ||
| 65E4 | RLD | RLD. | ||
| 65E6 | DEC L | Decrease L by one. | ||
| 65E7 | RLD | RLD. | ||
| 65E9 | DEC L | Decrease L by one. | ||
| 65EA | RLD | RLD. | ||
| 65EC | DEC L | Decrease L by one. | ||
| 65ED | RLD | RLD. | ||
| 65EF | DEC L | Decrease L by one. | ||
| 65F0 | RLD | RLD. | ||
| 65F2 | DEC L | Decrease L by one. | ||
| 65F3 | RLD | RLD. | ||
| 65F5 | DEC L | Decrease L by one. | ||
| 65F6 | RLD | RLD. | ||
| 65F8 | DEC L | Decrease L by one. | ||
| 65F9 | RLD | RLD. | ||
| 65FB | DEC L | Decrease L by one. | ||
| 65FC | RLD | RLD. | ||
| 65FE | DEC L | Decrease L by one. | ||
| 65FF | RLD | RLD. | ||
| 6601 | DEC L | Decrease L by one. | ||
| 6602 | RLD | RLD. | ||
| 6604 | DEC L | Decrease L by one. | ||
| 6605 | RLD | RLD. | ||
| 6607 | DEC L | Decrease L by one. | ||
| 6608 | RLD | RLD. | ||
| 660A | DEC L | Decrease L by one. | ||
| 660B | RLD | RLD. | ||
| 660D | DEC L | Decrease L by one. | ||
| 660E | RLD | RLD. | ||
| 6610 | DEC L | Decrease L by one. | ||
| 6611 | RLD | RLD. | ||
| 6613 | DEC L | Decrease L by one. | ||
| 6614 | RLD | RLD. | ||
| 6616 | DEC L | Decrease L by one. | ||
| 6617 | RLD | RLD. | ||
| 6619 | DEC L | Decrease L by one. | ||
| 661A | RLD | RLD. | ||
| 661C | DEC L | Decrease L by one. | ||
| 661D | RLD | RLD. | ||
| 661F | DEC L | Decrease L by one. | ||
| 6620 | RLD | RLD. | ||
| 6622 | DEC L | Decrease L by one. | ||
| 6623 | RLD | RLD. | ||
| 6625 | DEC L | Decrease L by one. | ||
| 6626 | RLD | RLD. | ||
| 6628 | DEC L | Decrease L by one. | ||
| 6629 | RLD | RLD. | ||
| 662B | DEC L | Decrease L by one. | ||
| 662C | RLD | RLD. | ||
| 662E | DEC L | Decrease L by one. | ||
| 662F | RLD | RLD. | ||
| 6631 | DEC L | Decrease L by one. | ||
| 6632 | RLD | RLD. | ||
| 6634 | DEC L | Decrease L by one. | ||
| 6635 | RLD | RLD. | ||
| 6637 | DEC L | Decrease L by one. | ||
| 6638 | RLD | RLD. | ||
| 663A | LD L,E | L=E. | ||
| 663B | INC H | Increment H by two. | ||
| 663C | INC H | |||
| 663D | DJNZ ScrollCharacterRow_Left | Decrease counter by one and loop back to ScrollCharacterRow_Left until counter is zero. | ||
| 663F | LD A,$20 | Move down one character row. | ||
| 6641 | ADD A,E | |||
| 6642 | LD E,A | |||
| 6643 | LD L,A | Update the screen pointer. | ||
| 6644 | JR NC,ScrollPlayarea_NextRow | Jump to ScrollPlayarea_NextRow if {} is higher. | ||
| 6646 | LD D,$48 | D=48. | ||
| ScrollPlayarea_NextRow | 6648 | LD H,D | Update the screen pointer. | |
| 6649 | EXX | Switch to the shadow registers. | ||
| 664A | DJNZ ScrollPlayarea_ProcessRows | Decrease counter by one and loop back to ScrollPlayarea_ProcessRows until counter is zero. | ||
| 664C | EXX | Switch back to the normal registers. | ||
| 664D | RET | Return. | ||
| Prev: 659B | Up: Map | Next: 664E |