add tms_copy_to_vram()

This commit is contained in:
nino-porcino 2021-12-22 18:40:56 +01:00
parent 57c481caa8
commit 22a672ffa3
2 changed files with 11 additions and 5 deletions

View File

@ -9,11 +9,8 @@ const word SCREEN1_SIZE = (32*24);
void screen1_load_font() {
byte *source = FONT;
// start writing into VRAM from space character (32..127)
tms_set_vram_write_addr(TMS_PATTERN_TABLE+(32*8));
for(word i=768;i!=0;i--) {
TMS_WRITE_DATA_PORT(*source++);
}
// copy normal FONT 32..127
tms_copy_to_vram(source, 768, TMS_PATTERN_TABLE+(32*8));
// reverse font (32..127)
source = FONT;

View File

@ -164,6 +164,15 @@ inline void tms_wait_end_of_frame() {
while(!FRAME_BIT(TMS_READ_CTRL_PORT));
}
// loads the font on the pattern table
void tms_copy_to_vram(byte *source, word size, word dest) {
// start writing into VRAM from space character (32..127)
tms_set_vram_write_addr(dest);
for(word i=size;i!=0;i--) {
TMS_WRITE_DATA_PORT(*source++);
}
}
#include "apple1.h"
#include "font8x8.h"
#include "sprites.h"