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

Add many missing VDP commands. #10

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Add many missing VDP commands. #10

merged 2 commits into from
Mar 11, 2024

Conversation

robogeek42
Copy link
Contributor

Add commands for many missing VDP commands including those for buffered commands.

@robogeek42
Copy link
Contributor Author

These are the additional commands:

vdp_write_at_text_cursor( void )
vdp_write_at_graphics_cursor( void )
vdp_enable_screen( void )
vdp_page_mode_on( void )
vdp_page_mode_off( void )                                                                                                                                                           vdp_reset_graphics( void )
vdp_disable_screen( void )                                                                                                                                                          vdp_set_graphics_colour( int mode, int colour )
#define vdp_gcol( M, C ) vdp_set_graphics_colour( M, C )
vdp_define_colour (int logical, int red, int green, int blue )
vdp_swap( void )
vdp_redefine_character( int chnum, uint8_t b0, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6, uint8_t b7 )
vdp_scroll_screen_extent( int extent, int direction, int speed )
vdp_scroll_screen(int direction, int speed)
vdp_reset_viewports( void )                                                                                                                                                         vdp_set_graphics_viewport( int left, int bottom, int right, int top )
vdp_set_text_viewport( int left, int bottom, int right, int top )
vdp_filled_rect( int x, int y )                                                                                                                                                     vdp_solid_bitmap( int width, int height, int r, int g, int b, int a )
vdp_clear_sprite( void )                                                                                                                                                            vdp_add_sprite_bitmap( int n )
vdp_adv_write_block(int bufferID, int length)
vdp_adv_clear_buffer(int bufferID)                                                                                                                                                  vdp_adv_create(int bufferID, int length)
vdp_adv_stream(int bufferID)
vdp_adv_adjust(int bufferID, int operation, int offset)
vdp_adv_consolidate(int bufferID)                                                                                                                                                   vdp_adv_select_bitmap(int bufferId)
vdp_adv_bitmap_from_buffer(int width, int height, int format)     

Includes a convenience #define for vdp_gcol as it strays from the usual naming style, but it is easier to type!

Note, there is also a critical style/usage fix for vdp_cursor_tab()
Which was "row, col" - that is (Y,X)

This differs from how it is used in BASIC - you would expect to do PRINT TAN(X,Y)

cheers

Copy link
Collaborator

@astralaster astralaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, but please check the call a buffer function.

/* Advanced buffered commands (selected) */

static VDU_ADV_CMD_ui16 vdu_adv_write_block = { 23, 0, 0xA0, 0xFA00, 0, 0};
//static VDU_ADV_CMD vdu_adv_call_buffer = { 23, 0, 0xA0, 0xFA00, 1};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a mistake and should be included?

Copy link
Contributor Author

@robogeek42 robogeek42 Mar 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did start to add it, but I had no way of testing it as I don't really get the "commands in a VDP buffer" thing.
So, I thought it best I leave it out.
Certainly, I could just add it verbatim from the docs and hope it is correct.

(Would have been better to remove the commented code entirely I guess)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks correct. Please add it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the head of my main to remove the commented code.
I think probably I would need to create a new PR with all the related "command buffer" VDP commands (1, and 6 though 13) so that they can be used together properly.

That way, this request just adds the graphics advanced buffer commands.

VDP_PUTS(vdu_adv_write_block);
}

/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the declaration.

to create the buffer commands are not included yet.
Copy link
Collaborator

@astralaster astralaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats also a solution. :)

@astralaster astralaster merged commit 7abe3b5 into pcawte:main Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants