modify an assembler routine to scroll the screen1

بواسطة gamecast

Expert (101)

صورة gamecast

11-08-2011, 23:25

Hello guys of MSX systems,

Yet we are always here, is not it? ^_^

I need to change this routine that scroll in all 4 directions on the screen, but it should not shake the first 2 lines, because they only reserved for the SCORE, and therefore should not scroll.

The change I would make and that I unfortunately can not do because I have the assembler with a donkey! ehh .. eh .. ^ _ ^

M What is required is that the screen only have to scroll down to the screen1 with the command A = USR (0). The rest of it does not serve rotutine should be removed to get more bytes free.

But now that it works is you have to scroll using these commands: A=USR0 (0) A=USR1(0) A=USR2(0) A=USR3(0) with the new routine that I need not serve more ... ...

A later and Good Evening to you all
And happy MSX ^ _ ^
Andrea

 

	.org $C000 - 7

	.db $fe
	.dw startProgram,endProgram,startProgram

startProgram:
  ld     hl,$c019   
  ld     ($f39a),hl 
  ld     hl,$c04b   
  ld     ($f39c),hl 
  ld     hl,$c07d   
  ld     ($f39e),hl 
  ld     hl,$c0bd   
  ld     ($f3a0),hl 
  ret               
  ld     hl,$1840   
  ld     de,$c0f4   
  ld     bc,$02c0   
  call   $0059      
  ld     hl,$c114   
  ld     de,$1840   
  ld     bc,$02a0   
  call   $005c      
  ld     hl,$c0f4   
  ld     (hl),$20   
  ld     de,$c0f5   
  ld     bc,$0020   
  ldir              
  ld     hl,$c0f4   
  ld     de,$1ae0   
  ld     bc,$0020   
  call   $005c      
  ret               
  ld     hl,$1840   
  ld     de,$c0f4   
  ld     bc,$02c0   
  call   $0059      
  ld     hl,$c0f4   
  ld     de,$1860   
  ld     bc,$02a0   
  call   $005c      
  ld     hl,$c0f4   
  ld     (hl),$20   
  ld     de,$c0f5   
  ld     bc,$0020   
  ldir              
  ld     hl,$c0f4   
  ld     de,$1840   
  ld     bc,$0020   
  call   $005c      
  ret               
  ld     hl,$1840   
  ld     ($c0f2),hl 
  ld     b,$17      
ROUTINE1:
  push   bc         
  ld     bc,$0020   
  ld     hl,($c0f2) 
  ld     de,$c0f4   
  call   $0059      
  ld     hl,$c0f5   
  ld     de,$c0f4   
  ld     bc,$001f   
  ldir              
  ld     hl,$c113   
  ld     (hl),$20   
  ld     hl,$c0f4   
  ld     de,($c0f2) 
  ld     bc,$0020   
  call   $005c      
  ld     hl,($c0f2) 
  ld     de,$0020   
  add    hl,de      
  ld     ($c0f2),hl 
  pop    bc         
  djnz   $c085     ; dec jump nz $C085 "ROUTINE1" 
  ret               
  ld     hl,$1840   
  ld     ($c0f2),hl 
  ld     b,$17      
ROUTINE2:
  push   bc         
  ld     bc,$0020   
  ld     hl,($c0f2) 
  ld     de,$c0f5   
  call   $0059      
  ld     hl,$c0f4   
  ld     (hl),$20   
  ld     hl,$c0f4   
  ld     de,($c0f2) 
  ld     bc,$0020   
  call   $005c      
  ld     hl,($c0f2) 
  ld     de,$0020   
  add    hl,de      
  ld     ($c0f2),hl 
  pop    bc         
  djnz   $c0c5  ; dec jump nz $C0C5 "ROUTINE2"    
  ret          
endProgram:

.end

Login أوregister لوضع تعليقاتك

بواسطة gamecast

Expert (101)

صورة gamecast

11-08-2011, 23:33

else:

I forgot to tell you that this routine is not done very well, indeed it is done really badly, because it was disassembled.
Because unfortunately I lost the original source, so I arranged.

We would have to correct all the addresses that start with: C0xxH
So that I can do. ORG to any address at my leisure, in fact, this routine should I put in an address to the lowest type: BE00H, but as is routinely done now is not possible, then I ask you to correct it.

A after .......
Andrea

بواسطة nanochess

Master (222)

صورة nanochess

25-08-2011, 22:16

I didn't have time to test it, but this should work. Cool
Compare it with previous code, you can learn something. Wink

	.org $C000 - 7

	.db $fe
	.dw startProgram,endProgram,startProgram

startProgram:
  ld     hl,scrollDown
  ld     ($f39a),hl 
  ret               
scrollDown:
  ld     hl,$1840  ; Point to line 2 
  ld     de,$c0f4   
  ld     bc,$02c0   ; 22 lines by 32 columns
  call   $0059      ; Copy VRAM to RAM
  ld     hl,$c0f4   
  ld     de,$1860  ; Point to line 3
  ld     bc,$02a0   ; 21 lines by 32 columns
  call   $005c      ; Copy RAM to VRAM
  ; In fact in this place we could fill C0F4-C113 with the new level data :)
  ld     hl,$c0f4   
  ld     (hl),$20   ; Fill line with spaces
  ld     de,$c0f5   
  ld     bc,$001f
  ldir              
  ld     hl,$c0f4   
  ld     de,$1840   
  ld     bc,$0020   
  call   $005c      ; Copy new line in top
  ret               
endProgram:

.end