• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BASIC compiler/interpreter for PIC32MX/MZ-80K (suspended)


Commit MetaInfo

Revision151 (tree)
Time2016-08-08 10:07:41
Authorkmorimatsu

Log Message

48K RAM in MZ-80 emulator, for PIC32MX170F128B.

Change Summary

Incremental Difference

--- applications/trunk/kmz80sd/pic32mx150f128b.h (revision 150)
+++ applications/trunk/kmz80sd/pic32mx150f128b.h (revision 151)
@@ -5,10 +5,8 @@
55 #ifndef KMZ80_PROFILE_H
66 #define KMZ80_PROFILE_H
77
8-#define PROGRAM_FLASH_END_ADRESS 0x9D01F7FF
8+#define KMZ80_RAMSIZE 0xC000 // 48 KB RAM
99
10-#define KMZ80_RAMSIZE 0x7000 // 28 KB RAM
11-
1210 // Config setting(s) specific to this chip
1311 #ifdef KMZ80_MAIN
1412 #pragma config ICESEL = ICS_PGx1
--- applications/trunk/kmz80sd/main.h (revision 150)
+++ applications/trunk/kmz80sd/main.h (revision 151)
@@ -21,7 +21,6 @@
2121 unsigned char RAM[KMZ80_RAMSIZE];
2222 volatile unsigned char VRAM[0x0400];
2323 volatile unsigned char read825x[0x10];
24- char g_use_ram_last20k=0;
2524 unsigned long g_ntscVisible;
2625 unsigned long g_Vsync;
2726 unsigned long g_timer1;
@@ -43,7 +42,6 @@
4342 extern unsigned char RAM[KMZ80_RAMSIZE];
4443 extern volatile unsigned char VRAM[0x0400];
4544 extern volatile unsigned char read825x[0x10];
46- extern char g_use_ram_last20k;
4745 extern unsigned long g_ntscVisible;
4846 extern unsigned long g_Vsync;
4947 extern unsigned long g_timer1;
--- applications/trunk/kmz80sd/peripheral.h (revision 150)
+++ applications/trunk/kmz80sd/peripheral.h (revision 151)
@@ -16,20 +16,15 @@
1616 ?(\
1717 monitor[(z80PC++)]\
1818 ):(\
19- (z80PC<(KMZ80_RAMSIZE+0x1000))\
19+ (z80PC<0xD000)\
2020 ?(\
2121 RAM[(z80PC++)-0x1000]\
2222 ):(\
23- (z80PC<0xD000)\
23+ (z80PC<0xE000)\
2424 ?(\
25- g_use_ram_last20k?RAM[(z80PC++)-0x6000]:0xC7\
25+ VRAM[(z80PC++)&0x03FF]\
2626 ):(\
27- (z80PC<0xE000)\
28- ?(\
29- VRAM[(z80PC++)&0x03FF]\
30- ):(\
31- 0xC7\
32- )\
27+ 0xC7\
3328 )\
3429 )\
3530 ))
@@ -42,8 +37,7 @@
4237 unsigned char readMemory(UINT16 addr){
4338 addr&=0xffff;
4439 if (addr<0x1000) return monitor[addr];
45- if (addr<(KMZ80_RAMSIZE+0x1000)) return RAM[addr-0x1000];
46- if (addr<0xD000) return g_use_ram_last20k?RAM[addr-0x6000]:0xC7;
40+ if (addr<0xD000) return RAM[addr-0x1000];
4741 if (addr<0xE000) return VRAM[addr & 0x03FF];
4842 if (addr<0xE004) {
4943 // 8255
@@ -72,14 +66,10 @@
7266 addr&=0xffff;
7367 data&=0xff;
7468 if (addr<0x1000) return; // ROM region cannot be written.
75- if (addr<(KMZ80_RAMSIZE+0x1000)) {
69+ if (addr<0xD000) {
7670 RAM[addr-0x1000] = data;
7771 return;
7872 }
79- if (addr<0xD000) {
80- if (g_use_ram_last20k) RAM[addr-0x6000] = data;
81- return;
82- }
8373 if (addr<0xE000) {
8474 VRAM[addr & 0x03FF] = data;
8575 return;
--- applications/trunk/kmz80sd/sd.c (revision 150)
+++ applications/trunk/kmz80sd/sd.c (revision 151)
@@ -102,29 +102,13 @@
102102 start<<=8;
103103 start|=RAM[0x0104];
104104 // Check format
105- if (start<0x1200 || 0x6DFF<size) {
105+ if (start<0x1000 || 0xBDFF<size) {
106106 g_error_str="FORMAT MZF";
107107 return;
108108 }
109- if (0x7FFF<start || 0x7FFF<start+size) {
110- // If program size is less than 20 KB, locate such program
111- // in any RAM address area between 0x1200 and 0xCFFF.
112- // Share the same physical RAM area as follows:
113- // 0x3000 - 0x7FFF (20 kb)
114- // 0x8000 - 0xCFFF (20 kb)
115- if (size<=0x5000 && start+size<=0xD000) {
116- g_use_ram_last20k=1;
117- } else {
118- g_error_str="FORMAT MZF";
119- return;
120- }
121- }//*/
122109 // Load body
123110 start-=0x1000;
124111 while (128<=size) {
125- while(0x7000<=start) {
126- start-=0x5000;
127- }
128112 res=pf_read(&RAM[start],128,&len);
129113 if (res || len<128) {
130114 g_error_str="LOAD MZF";
@@ -134,9 +118,6 @@
134118 start+=128;
135119 }
136120 if (0<size) {
137- while(0x7000<=start) {
138- start-=0x5000;
139- }
140121 res=pf_read(&RAM[start],size,&len);
141122 if (res || len<size) {
142123 g_error_str="LOAD MZF";
@@ -228,7 +209,7 @@
228209 start<<=8;
229210 start|=RAM[0x0104];
230211 // Check format
231- if (start<0x1000 || 0x7FFF<start || 0x7FFF<start+size) {
212+ if (start<0x1000 || 0xCFFF<start || 0xCFFF<start+size) {
232213 g_error_str="FORMAT MZ2";
233214 return 0;
234215 }