Set sprite size through BIOS ?

بواسطة Metalion

Paragon (1433)

صورة Metalion

08-03-2021, 17:24

Hi everyone,

Am I mistaken, or is there no official BIOS procedure to set sprite size ?
It seems to me you have no other choice but access the VDP register to change the sprite size.
Strange ...

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

بواسطة theNestruo

Champion (313)

صورة theNestruo

08-03-2021, 19:36

The closest may be using the RG1SAV system variable:

; VDP: screen 2
	call	INIGRP
; screen ,2
	call	DISSCR
	ld	hl, RG1SAV ; (RG1SAV: equ $f3e0 ; Content of VDP(1) register (R#1))
	set	1, [hl] ; (first call to ENASCR will actually apply to the VDP)
; screen ,,0
	xor	a
	ld	[CLIKSW], a
; (...)
	call	ENASCR

Edit: It seems to be what MSX-BASIC's SCREEN instruction is actually doing (https://github.com/apoloval/msx-system/blob/master/base/1.0/...):

        call    C521C                   ; evaluate byte operand
        cp      004H
        jp      nc,C475A                ; illegal function call
        ld      a,(RG1SAV)
        and     0FCH
        or      e
        ld      (RG1SAV),a

بواسطة sd_snatcher

Prophet (3458)

صورة sd_snatcher

08-03-2021, 21:10

Why would the BIOS need a specific function for that, if WRTVDP is enough?

بواسطة Metalion

Paragon (1433)

صورة Metalion

09-03-2021, 12:07

sd_snatcher wrote:

Why would the BIOS need a specific function for that, if WRTVDP is enough?

Because the BIOS has a lot of small specific function just like that ...
For instance, you have GSPSIZ which gives you the sprite size, where a RDVDP would be enough ...

بواسطة sd_snatcher

Prophet (3458)

صورة sd_snatcher

09-03-2021, 21:28

Ok. This specific case is easy to understand: there are some BIOS functions that were required by the BASIC, whenever it wad needed to be reused multiple times, to save ROM space.

OTOH, there's only one place that sets the sprite size on BASIC: the SCREEN command. For that, WRTVDP was enough. A new routine to be used a single time would have been a waste of space, right?