Exploit mmap module to bank memory.

This commit is contained in:
giomba 2024-12-14 19:36:21 +01:00
parent d270985dba
commit 66d5a6187e
3 changed files with 8 additions and 8 deletions

View File

@ -14,6 +14,7 @@ SRC = \
src/printf.c \ src/printf.c \
src/lfsr.c \ src/lfsr.c \
src/matrix.c \ src/matrix.c \
src/mmap.c \
src/flipflap.c \ src/flipflap.c \
\ \

View File

@ -6,6 +6,7 @@
#include "io.h" #include "io.h"
#include "lfsr.h" #include "lfsr.h"
#include "matrix.h" #include "matrix.h"
#include "mmap.h"
#include "printf.h" #include "printf.h"
#include "video.h" #include "video.h"
@ -44,7 +45,7 @@ const uint8_t FVB[15 * 8] = {
}; };
int main(void) { int main(void) {
io_out(0x81, io_in(0x81) & ~0x01); mmap_set(MMAP_MODE_CEDA_VIDEO);
for (;;) { for (;;) {
cursor_enable(false); cursor_enable(false);
@ -96,7 +97,4 @@ int main(void) {
crt_waitFrames(250); crt_waitFrames(250);
} }
io_out(0x81, io_in(0x81) | 0x01);
return 0;
} }

View File

@ -1,6 +1,7 @@
#include "video.h" #include "video.h"
#include "io.h" #include "io.h"
#include "mmap.h"
#include <stdint.h> #include <stdint.h>
@ -29,9 +30,9 @@ void video_putchar(char c) {
} }
if (hstretch) { if (hstretch) {
io_out(0x81, io_in(0x81) | 0x80); mmap_set(MMAP_MODE_CEDA_ATTR);
*(VIDEO_MEMORY + offset) |= 0x08; *(VIDEO_MEMORY + offset) |= 0x08;
io_out(0x81, io_in(0x81) & ~0x80); mmap_set(MMAP_MODE_CEDA_VIDEO);
} }
if (c == '\t') { if (c == '\t') {
@ -44,12 +45,12 @@ void video_putchar(char c) {
if (vstretch) { if (vstretch) {
*(VIDEO_MEMORY + offset + 80) = c; *(VIDEO_MEMORY + offset + 80) = c;
io_out(0x81, io_in(0x81) | 0x80); mmap_set(MMAP_MODE_CEDA_ATTR);
*(VIDEO_MEMORY + offset) |= 0x60; *(VIDEO_MEMORY + offset) |= 0x60;
*(VIDEO_MEMORY + offset + 80) |= 0x70; *(VIDEO_MEMORY + offset + 80) |= 0x70;
if (hstretch) if (hstretch)
*(VIDEO_MEMORY + offset + 80) |= 0x08; *(VIDEO_MEMORY + offset + 80) |= 0x08;
io_out(0x81, io_in(0x81) & ~0x80); mmap_set(MMAP_MODE_CEDA_VIDEO);
} }
++offset; ++offset;