Set sprite size through BIOS ?

Por Metalion

Paragon (1353)

Imagen del 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 sesión o register para postear comentarios

Por theNestruo

Champion (276)

Imagen del 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

Por sd_snatcher

Prophet (3443)

Imagen del sd_snatcher

08-03-2021, 21:10

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

Por Metalion

Paragon (1353)

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

Por sd_snatcher

Prophet (3443)

Imagen del 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?