Set sprite size through BIOS ?

By Metalion

Paragon (1343)

Metalion's picture

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 or register to post comments

By theNestruo

Champion (275)

theNestruo's picture

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

By sd_snatcher

Prophet (3436)

sd_snatcher's picture

08-03-2021, 21:10

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

By Metalion

Paragon (1343)

Metalion's picture

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 ...

By sd_snatcher

Prophet (3436)

sd_snatcher's picture

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?