MadMockers / BareBonesOS

ROM / Firmware for DCPU
9 stars 2 forks source link

Don't let WRITE_CHAR write outside VRAM #8

Closed interfect closed 8 years ago

interfect commented 8 years ago

This subtraction was backwards, leading to the cursor advancing out of VRAM with lots of calls to writechar(char, 1).

Should writechar ever scroll the screen?

It seems like the behavior you would want would be that you can write characters right up to the end of VRAM, and then on the next writechar call, if vram is full, it would scroll the screen. However, to implement this, it seems like a provision would need to be made for the cursor to be able to be past the end of the screen (to denote that the next character to be printed would require scrolling before printing). If the cursor was at the last position on the screen, the character would just be printed in the bottom right corner.

MadMockers commented 8 years ago

I didn't intend for write char to scroll screen. To me it seemed more of a function for putting a character at a specific spot on screen. This can change if it's deemed useful enough.