I need of modify a routine assembly thah work well in SCREEN2

By gamecast

Expert (101)

gamecast's picture

06-12-2011, 16:00

Hello Dears Guys,

I need of modify a routine assembly thah work well in SCREEN2
Because I must use the graphics multicolor for define characters

For now, this routine work only in SCREEN1, but I need
that work for SCREEN2 in multicolor.

I look forward to your positive response
Best Regards
^_^
Andrea

 
; 2011.11.05 KdL
; ---------------------------------------------------------------
; MSX1 from 8.7 V-Editor pages (8 pages 32x22 + 14 lines)
; ------------------------------------------------- --------------
;
; BLOAD "V1EDITOR.BIN", R
;
; USR7 (n) <n> from 0 to 8, page number to SAVE TXT VRAM
; USR8 (n) <n> from 0 to 8, page number for LOAD TXT VRAM
; USR9 (y) from 0 to 168 to scroll vertically
;
; BSAVA "DATA.VRM", 8256.14335, S -> save all the free VRAM
; BLOAD "DATA.VRM" S -> load the VRAM
;
; Warning! Use the last page with caution:
; The last 7 lines are used to display sprites.
;
; ---------------------------------------------------------------


  .org 0e000h-7

  .byte 254
  .word start
  .word end
  .word init

start:

init:
  ld hl,tobuf
  ld (0f3a8h),hl
  ld hl,frombuf
  ld (0f3aah),hl
  ld hl,frombufy
  ld (0f3ach),hl
  ret

getpar:
  ld a,(0f663h)
  cp 2
  jr nz,gpret
  ld hl,(0f7f8h)
  ret
gpret:
  pop af
  ret

frombufy:
  call getpar
  add hl,hl
  add hl,hl
  add hl,hl
  add hl,hl
  add hl,hl
  jr fbhop

frombuf:
  call getpar
  add hl,hl
  add hl,hl
  add hl,hl
  add hl,hl
  add hl,hl
  ld (buffer),hl
  ld b,21
x22_floop:
  ld de,(buffer)
  add hl,de
  djnz x22_floop
  
fbhop:
  ld de,8192+64             ; CT Base + CT Width (CT=Color Table)
  add hl,de
  ld (readadr),hl
  ld hl,6144+64
  ld (writeadr),hl

copyfrom:
  ld bc,22*256+152
  di
floopy:
  push bc
  ld hl,(readadr)
  call setvramread
  ld de,32
  add hl,de
  ld (readadr),hl
  ld hl,buffer
  ld b,32
finloop:
  ini
  jr nz,finloop
  ld hl,(writeadr)
  call setvramwrite
  ld de,32
  add hl,de
  ld (writeadr),hl
  ld hl,buffer
  ld b,32
foutloop:
  outi
  jr nz,foutloop
  pop bc
  djnz floopy
  ei
  ret

tobuf:
  call getpar
  add hl,hl
  add hl,hl
  add hl,hl
  add hl,hl
  add hl,hl
  ld (buffer),hl
  ld b,21
x22_tloop:
  ld de,(buffer)
  add hl,de
  djnz x22_tloop
  ld de,8192+64             ; CT Base + CT Width (CT=Color Table)
  add hl,de
  ld (writeadr),hl
  ld hl,6144+64
  ld (readadr),hl

copyto:
  ld bc,22*256+152
  di
tloopy:
  push bc
  ld hl,(readadr)
  call setvramread
  ld de,32
  add hl,de
  ld (readadr),hl
  ld hl,buffer
  ld b,32
tinloop:
  ini
  jr nz,tinloop
  ld hl,(writeadr)
  call setvramwrite
  ld de,32
  add hl,de
  ld (writeadr),hl
  ld hl,buffer
  ld b,32
toutloop:
  outi
  jr nz,toutloop
  pop bc
  djnz tloopy
  ei
  ret

setvramread:
  ld a,l
  out (99h),a
  ld a,h
  and 63
  out (99h),a
  ret

setvramwrite:
  ld a,l
  out (99h),a
  ld a,h
  or 64
  and 127
  out (99h),a
  ret

readadr:
  .word 0
writeadr:
  .word 0
buffer:
  .ds 32

end:

.end
Login or register to post comments

By retrocanada76

Champion (460)

retrocanada76's picture

06-12-2011, 17:06

Hey Gamecast, why don't you start learning assembly ?

Is not that hard. Why don't you try ? If you have an assembly doubt, a question people will help you, but you're sending assembler code and expecting people to do it for you.

By Jipe

Paragon (1366)

Jipe's picture

06-12-2011, 18:32

is not possible

on screen 1
table of name 768
table of color 32
table of form 2048
total of video memory use : 2848 bytes

on screen 2
table of name 768
table of color 6144
table of form 6144
total of video memory use : 13056 bytes

the plain VRAM for a MSX1 is 16384

stop making games with a lot of patchwork routine

By PingPong

Prophet (3413)

PingPong's picture

06-12-2011, 18:38


stop making games with a lot of patchwork routine

stop 'making' games at all

By anonymous

incognito ergo sum (109)

anonymous's picture

06-12-2011, 19:44

stop 'making' games at all

Don't say that. Though this kind of posts are really annoying, I'd like to think that it is only because of the language barrier.

But I agree with some other comments, Andrea. Learn some assembly, the basics are not so difficult and there are tons of docs available. And try to figure what are doing the pieces of code you use. And also, that's crucial to program games, read some docs about how the screen modes work and how the VRAM is organized.

Start with some simple examples. I remember some very nice examples in the asMSX package. I started with them and they were very useful to me when I started.

By ARTRAG

Enlighted (6229)

ARTRAG's picture

06-12-2011, 20:47

@MrSpock
you should rely and trust more those who do not suffer any language barrier....

By anonymous

incognito ergo sum (109)

anonymous's picture

06-12-2011, 21:38

@ARTRAG
Actually I do, but there's always place for hope ;-)

By PingPong

Prophet (3413)

PingPong's picture

06-12-2011, 22:54

Don't say that. Though this kind of posts are really annoying, I'd like to think that it is only because of the language barrier.


The language barrier is not the real problem.
It's a way to think.
It's an approach to get somewhere a piece of code,then asking someone to modify this. stop.
this is the Andrea's approach. He never asked about having clarifications about the workings of the code he post.
he simply ask "i need this, modify this code to get the result". That's the real problem.

By ARTRAG

Enlighted (6229)

ARTRAG's picture

06-12-2011, 23:28

But also the results count, do not forget that without AG software/gamecast/whatever the scene would have missed all the precious msx pearls we have seen these years.