Compare commits

..

No commits in common. "cf68a42152db2f78288bea0bb397fb5d2f582ef2" and "8622e2776a4647c6614e3ef7098ca21768adab25" have entirely different histories.

8 changed files with 62 additions and 69 deletions

View File

@ -1,7 +1,5 @@
cflags = -O --cpu 6502 -t apple2
.PHONY: clean all copy
all: bin/GWRAM.po bin/GWRAM.dbg.po
obj:
@ -62,9 +60,6 @@ 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/

Binary file not shown.

Binary file not shown.

4
bnc.sh Executable file
View File

@ -0,0 +1,4 @@
make clean
make
cp bin/GWRAM.po /Volumes/FLOPPYEMU/GWRAM.po
diskutil unmount /Volumes/FLOPPYEMU/

View File

@ -8,7 +8,6 @@
#include "util.h"
#include "gwconio.h"
#include "ram2e_hal.h"
#include "ram2e_save.h"
static void menu()
{

View File

@ -1,5 +1,5 @@
#ifndef RAM2E_HAL_H
#define RAM2E_HAL_H
#ifndef RAM2GS_HAL_H
#define RAM2GS_HAL_H
#include <ctype.h>
#include <stdint.h>
@ -15,4 +15,58 @@ 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

View File

@ -1,58 +0,0 @@
#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

View File

@ -49,7 +49,7 @@ static void loading_screen()
int ram2gs_main(void)
{
char type;
uint8_t bankcount;
uint16_t bankcount;
char en8meg = true;
char hasled = true;
char enled = false;
@ -89,7 +89,6 @@ int ram2gs_main(void)
// Detect and print current capacity
bankcount = ram2gs_getsize();
en8meg = bankcount >= 128;
menu_size(bankcount);
// Detect and print LED menu