Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swap instances of vpd to vdp #40

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Agon-HW.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ Data packet sent from VDP (4 bytes):

```
; Keyboard Data
; Received after a keypress event in the VPD
; Received after a keypress event in the VDP
;
vdp_protocol_KEY:
         LD A, (_vdp_protocol_data + 0) ; ASCII key code
Expand Down
4 changes: 2 additions & 2 deletions src/agon/vdp_vdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ void vdp_get_scr_dims( bool wait )
{
if ( !sys_vars ) vdp_vdu_init();

if ( wait ) sys_vars->vpd_pflags = 0;
if ( wait ) sys_vars->vdp_pflags = 0;

VDP_PUTS( vdu_get_scr_dims );

// wait for results of mode change to be reflected in SYSVARs
if ( wait ) while ( !(sys_vars->vpd_pflags & vdp_pflag_mode) );
if ( wait ) while ( !(sys_vars->vdp_pflags & vdp_pflag_mode) );
}

void vdp_logical_scr_dims( bool flag )
Expand Down
6 changes: 3 additions & 3 deletions src/libc/include/mos_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ typedef enum {
#define sysvar_mouseXDelta 0x2F // 2: Mouse X delta
#define sysvar_mouseYDelta 0x31 // 2: Mouse Y delta

// Flags for the VPD protocol - sysvar_vpd_pflags
// Flags for the VDP protocol - sysvar_vdp_pflags
#define vdp_pflag_cursor 0x01
#define vdp_pflag_scrchar 0x02
#define vdp_pflag_point 0x04
Expand Down Expand Up @@ -131,7 +131,7 @@ typedef union {

typedef struct {
uint32_t time;
uint8_t vpd_pflags;
uint8_t vdp_pflags;
uint8_t keyascii;
uint8_t keymods;
uint8_t cursorX;
Expand Down Expand Up @@ -237,7 +237,7 @@ extern void mos_puts(char * buffer, uint24_t size, char delimiter);

// Get system variables
extern uint32_t getsysvar_time();
extern uint8_t getsysvar_vpd_pflags();
extern uint8_t getsysvar_vdp_pflags();
extern uint8_t getsysvar_keyascii();
extern uint8_t getsysvar_keymods();
extern uint8_t getsysvar_cursorX();
Expand Down
6 changes: 3 additions & 3 deletions src/libc/mos_api.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
; Modinfo:
; 05/08/2022: Added mos_feof
; 09/08/2022: Added system variables: cursorX, cursorY
; 18/08/2022: Added system variables: scrchar, scrpixel, audioChannel, audioSuccess, vpd_pflags
; 18/08/2022: Added system variables: scrchar, scrpixel, audioChannel, audioSuccess, vdp_pflags
; 05/09/2022: Added mos_ren, vdp_pflag_mode
; 24/09/2022: Added mos_getError, mos_mkdir
; 13/10/2022: Added mos_oscli
Expand Down Expand Up @@ -139,7 +139,7 @@ fa_open_append := 030h
; Index into _sysvars in globals.asm
;
sysvar_time := 000h ; 4: Clock timer in centiseconds (incremented by 2 every VBLANK)
sysvar_vpd_pflags := 004h ; 1: Flags to indicate completion of VDP commands
sysvar_vdp_pflags := 004h ; 1: Flags to indicate completion of VDP commands
sysvar_keyascii := 005h ; 1: ASCII keycode, or 0 if no key is pressed
sysvar_keymods := 006h ; 1: Keycode modifiers
sysvar_cursorX := 007h ; 1: Cursor X position
Expand All @@ -162,7 +162,7 @@ sysvar_keydelay := 022h ; 2: Keyboard repeat delay
sysvar_keyrate := 024h ; 2: Keyboard repeat reat
sysvar_keyled := 026h ; 1: Keyboard LED status

; Flags for the VPD protocol
; Flags for the VDP protocol
;
vdp_pflag_cursor := 00000001b
vdp_pflag_scrchar := 00000010b
Expand Down
6 changes: 3 additions & 3 deletions src/libc/mos_api.src
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
public _mos_i2c_open

public _getsysvar_time
public _getsysvar_vpd_pflags
public _getsysvar_vdp_pflags
public _getsysvar_keyascii
public _getsysvar_keymods
public _getsysvar_cursorX
Expand Down Expand Up @@ -149,11 +149,11 @@ _getsysvar_time:
pop ix
ret

_getsysvar_vpd_pflags:
_getsysvar_vdp_pflags:
push ix
ld a, mos_sysvars
rst.lil 08h
ld a, (ix+sysvar_vpd_pflags)
ld a, (ix+sysvar_vdp_pflags)
pop ix
ret

Expand Down
4 changes: 2 additions & 2 deletions tests/big-bitmap/src/vdp_vdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ void vdp_get_scr_dims( bool wait )
{
if ( !sv ) vdp_vdu_init();

if ( wait ) sv->vpd_pflags = 0;
if ( wait ) sv->vdp_pflags = 0;

mos_puts( (char *)&_vdp_get_scr_dims, sizeof(_vdp_get_scr_dims), 0 );

// wait for results of mode change to be reflected in SYSVARs
if ( wait ) while ( !(sv->vpd_pflags & vdp_pflag_mode) );
if ( wait ) while ( !(sv->vdp_pflags & vdp_pflag_mode) );
}

static struct { uint8_t vdu_23; uint8_t vdu_23_0; uint8_t vdu_23_0_0xC0; uint8_t flag; }
Expand Down
4 changes: 2 additions & 2 deletions tests/vdu/src/vdp_vdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ void vdp_get_scr_dims( bool wait )
{
if ( !sv ) vdp_vdu_init();

if ( wait ) sv->vpd_pflags = 0;
if ( wait ) sv->vdp_pflags = 0;

mos_puts( (char *)&_vdp_get_scr_dims, sizeof(_vdp_get_scr_dims), 0 );

// wait for results of mode change to be reflected in SYSVARs
if ( wait ) while ( !(sv->vpd_pflags & vdp_pflag_mode) );
if ( wait ) while ( !(sv->vdp_pflags & vdp_pflag_mode) );
}

static struct { uint8_t vdu_23; uint8_t vdu_23_0; uint8_t vdu_23_0_0xC0; uint8_t flag; }
Expand Down