mirror of
https://github.com/garrettsworkshop/GWRAM.SYSTEM.git
synced 2024-06-12 21:29:29 +00:00
Compare commits
2 Commits
8622e2776a
...
745358d37b
Author | SHA1 | Date | |
---|---|---|---|
|
745358d37b | ||
|
e8399af9da |
7
Makefile
7
Makefile
|
@ -1,5 +1,7 @@
|
|||
cflags = -O --cpu 6502 -t apple2
|
||||
|
||||
.PHONY: clean all copy
|
||||
|
||||
all: bin/GWRAM.po bin/GWRAM.dbg.po
|
||||
|
||||
obj:
|
||||
|
@ -60,6 +62,9 @@ bin/GWRAM.dbg.po: bin/main.dbg.sys
|
|||
cp prodos140.po bin/GWRAM.dbg.po
|
||||
cat bin/main.dbg.sys | java -jar ./ac-1.6.0.jar -p $@ gwram.system sys 0x2000
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -fr bin obj
|
||||
|
||||
copy: bin/GWRAM.po
|
||||
cp bin/GWRAM.po /Volumes/FLOPPYEMU/GWRAM.po
|
||||
diskutil unmount /Volumes/FLOPPYEMU/
|
||||
|
|
BIN
bin/GWRAM.dbg.po
BIN
bin/GWRAM.dbg.po
Binary file not shown.
BIN
bin/GWRAM.po
BIN
bin/GWRAM.po
Binary file not shown.
4
bnc.sh
4
bnc.sh
|
@ -1,4 +0,0 @@
|
|||
make clean
|
||||
make
|
||||
cp bin/GWRAM.po /Volumes/FLOPPYEMU/GWRAM.po
|
||||
diskutil unmount /Volumes/FLOPPYEMU/
|
1
ram2e.c
1
ram2e.c
|
@ -8,6 +8,7 @@
|
|||
#include "util.h"
|
||||
#include "gwconio.h"
|
||||
#include "ram2e_hal.h"
|
||||
#include "ram2e_save.h"
|
||||
|
||||
static void menu()
|
||||
{
|
||||
|
|
58
ram2e_hal.h
58
ram2e_hal.h
|
@ -1,5 +1,5 @@
|
|||
#ifndef RAM2GS_HAL_H
|
||||
#define RAM2GS_HAL_H
|
||||
#ifndef RAM2E_HAL_H
|
||||
#define RAM2E_HAL_H
|
||||
#include <ctype.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -15,58 +15,4 @@ void ram2e_erase();
|
|||
void ram2e_save_start(char mask, char enled);
|
||||
void ram2e_save_end(char mask, char enled);
|
||||
|
||||
static char _rwsave[256];
|
||||
static char _rwsave0_1;
|
||||
static char _rwsave0_2;
|
||||
static char _rwsave0_3;
|
||||
static void ramworks_save() {
|
||||
__asm__("sta $C009"); // Store in ALTZP
|
||||
|
||||
// Save address 0x0000 in every bank
|
||||
__asm__("ldx #0");
|
||||
saveloop:
|
||||
__asm__("stx $C073");
|
||||
__asm__("lda $00,X");
|
||||
__asm__("sta %v,X", _rwsave);
|
||||
__asm__("inx");
|
||||
__asm__("bne %g", saveloop);
|
||||
|
||||
// Save addresses 0x0001-3 in bank 0
|
||||
__asm__("ldx #0");
|
||||
__asm__("stx $C073");
|
||||
__asm__("lda $01");
|
||||
__asm__("sta %v", _rwsave0_1);
|
||||
__asm__("lda $02");
|
||||
__asm__("sta %v", _rwsave0_2);
|
||||
__asm__("lda $03");
|
||||
__asm__("sta %v", _rwsave0_3);
|
||||
|
||||
__asm__("sta $C008"); // Don't store in ALTZP
|
||||
}
|
||||
|
||||
static void ramworks_restore() {
|
||||
__asm__("sta $C009"); // Store in ALTZP
|
||||
|
||||
// Restore address 0x0000 in every bank
|
||||
__asm__("ldx #0");
|
||||
restoreloop:
|
||||
__asm__("stx $C073");
|
||||
__asm__("lda %v,X", _rwsave);
|
||||
__asm__("sta $00,X");
|
||||
__asm__("inx");
|
||||
__asm__("bne %g", restoreloop);
|
||||
|
||||
// Restore addresses 0x0001-3 in bank 0
|
||||
__asm__("ldx #0");
|
||||
__asm__("stx $C073");
|
||||
__asm__("lda %v", _rwsave0_1);
|
||||
__asm__("sta $01");
|
||||
__asm__("lda %v", _rwsave0_2);
|
||||
__asm__("sta $02");
|
||||
__asm__("lda %v", _rwsave0_3);
|
||||
__asm__("sta $03");
|
||||
|
||||
__asm__("sta $C008"); // Don't store in ALTZP
|
||||
}
|
||||
|
||||
#endif
|
58
ram2e_save.h
Normal file
58
ram2e_save.h
Normal file
|
@ -0,0 +1,58 @@
|
|||
#ifndef RAM2E_SAVE_H
|
||||
#define RAM2E_SAVE_H
|
||||
|
||||
static char _rwsave[256];
|
||||
static char _rwsave0_1;
|
||||
static char _rwsave0_2;
|
||||
static char _rwsave0_3;
|
||||
static void ramworks_save() {
|
||||
__asm__("sta $C009"); // Store in ALTZP
|
||||
|
||||
// Save address 0x0000 in every bank
|
||||
__asm__("ldx #0");
|
||||
saveloop:
|
||||
__asm__("stx $C073");
|
||||
__asm__("lda $00,X");
|
||||
__asm__("sta %v,X", _rwsave);
|
||||
__asm__("inx");
|
||||
__asm__("bne %g", saveloop);
|
||||
|
||||
// Save addresses 0x0001-3 in bank 0
|
||||
__asm__("ldx #0");
|
||||
__asm__("stx $C073");
|
||||
__asm__("lda $01");
|
||||
__asm__("sta %v", _rwsave0_1);
|
||||
__asm__("lda $02");
|
||||
__asm__("sta %v", _rwsave0_2);
|
||||
__asm__("lda $03");
|
||||
__asm__("sta %v", _rwsave0_3);
|
||||
|
||||
__asm__("sta $C008"); // Don't store in ALTZP
|
||||
}
|
||||
|
||||
static void ramworks_restore() {
|
||||
__asm__("sta $C009"); // Store in ALTZP
|
||||
|
||||
// Restore address 0x0000 in every bank
|
||||
__asm__("ldx #0");
|
||||
restoreloop:
|
||||
__asm__("stx $C073");
|
||||
__asm__("lda %v,X", _rwsave);
|
||||
__asm__("sta $00,X");
|
||||
__asm__("inx");
|
||||
__asm__("bne %g", restoreloop);
|
||||
|
||||
// Restore addresses 0x0001-3 in bank 0
|
||||
__asm__("ldx #0");
|
||||
__asm__("stx $C073");
|
||||
__asm__("lda %v", _rwsave0_1);
|
||||
__asm__("sta $01");
|
||||
__asm__("lda %v", _rwsave0_2);
|
||||
__asm__("sta $02");
|
||||
__asm__("lda %v", _rwsave0_3);
|
||||
__asm__("sta $03");
|
||||
|
||||
__asm__("sta $C008"); // Don't store in ALTZP
|
||||
}
|
||||
|
||||
#endif
|
3
ram2gs.c
3
ram2gs.c
|
@ -49,7 +49,7 @@ static void loading_screen()
|
|||
int ram2gs_main(void)
|
||||
{
|
||||
char type;
|
||||
uint16_t bankcount;
|
||||
uint8_t bankcount;
|
||||
char en8meg = true;
|
||||
char hasled = true;
|
||||
char enled = false;
|
||||
|
@ -89,6 +89,7 @@ int ram2gs_main(void)
|
|||
|
||||
// Detect and print current capacity
|
||||
bankcount = ram2gs_getsize();
|
||||
en8meg = bankcount >= 128;
|
||||
menu_size(bankcount);
|
||||
|
||||
// Detect and print LED menu
|
||||
|
|
Loading…
Reference in New Issue
Block a user