diff --git a/include/c64/charwin.c b/include/c64/charwin.c index 7e8e1bd..1b0d3d2 100644 --- a/include/c64/charwin.c +++ b/include/c64/charwin.c @@ -135,6 +135,18 @@ bool cwin_cursor_down(CharWin * win) return false; } +bool cwin_cursor_newline(CharWin * win) +{ + win->cx = 0; + if (win->cy + 1 < win->wy) + { + win->cy++; + return true; + } + + return false; +} + bool cwin_cursor_forward(CharWin * win) { if (win->cx + 1 < win->wx) diff --git a/include/c64/charwin.h b/include/c64/charwin.h index 4bf4cfb..f554d7c 100644 --- a/include/c64/charwin.h +++ b/include/c64/charwin.h @@ -41,6 +41,7 @@ bool cwin_cursor_up(CharWin * win); bool cwin_cursor_down(CharWin * win); bool cwin_cursor_forward(CharWin * win); bool cwin_cursor_backward(CharWin * win); +bool cwin_cursor_newline(CharWin * win); // Read the full window into a string // @@ -62,7 +63,6 @@ void cwin_put_chars(CharWin * win, const char * chars, char num, char color); // char cwin_put_string(CharWin * win, const char * str, char color); - // Put a single raw char at the cursor location and advance the cursor // void cwin_put_char_raw(CharWin * win, char ch, char color); diff --git a/include/c64/cia.c b/include/c64/cia.c new file mode 100644 index 0000000..9fc0804 --- /dev/null +++ b/include/c64/cia.c @@ -0,0 +1,19 @@ +#include "cia.h" + +void cia_init(void) +{ + cia1.icr = 0x7f; + cia2.icr = 0x7f; + cia1.pra = 0x7f; + cia1.cra = 0x08; + cia1.crb = 0x08; + cia2.cra = 0x08; + cia2.crb = 0x08; + + cia1.ddrb = 0x00; + cia2.ddrb = 0x00; + cia1.ddra = 0xff; + + cia2.prb = 0x07; + cia2.ddra = 0x3f; +} diff --git a/include/c64/cia.h b/include/c64/cia.h index 3a49280..c1a2a75 100644 --- a/include/c64/cia.h +++ b/include/c64/cia.h @@ -17,6 +17,10 @@ struct CIA #define cia1 (*((struct CIA *)0xdc00)) #define cia2 (*((struct CIA *)0xdd00)) +void cia_init(void); + +#pragma compile("cia.c") + #endif diff --git a/include/c64/easyflash.h b/include/c64/easyflash.h new file mode 100644 index 0000000..5055f73 --- /dev/null +++ b/include/c64/easyflash.h @@ -0,0 +1,23 @@ +#ifndef C64_EASYFLASH_H +#define C64_EASYFLASH_H + +#include "types.h" + +struct EasyFlash +{ + byte bank; + byte pad1; + byte control; +}; + +#define EFCTRL_GAME 0x01 +#define EFCTRL_EXROM 0x02 +#define EFCTRL_MODE 0x04 +#define EFCTRL_LED 0x80 + + +#define eflash (*(EasyFlash *)0xde00) + + +#endif + diff --git a/include/c64/sid.c b/include/c64/sid.c new file mode 100644 index 0000000..d672a1e --- /dev/null +++ b/include/c64/sid.c @@ -0,0 +1,2 @@ +#include "sid.h" + diff --git a/include/c64/sid.h b/include/c64/sid.h new file mode 100644 index 0000000..90b3a58 --- /dev/null +++ b/include/c64/sid.h @@ -0,0 +1,107 @@ +#ifndef C64_SID_H +#define C64_SID_H + +#include "types.h" + +#define SID_ATK_2 0x00 +#define SID_ATK_8 0x10 +#define SID_ATK_16 0x20 +#define SID_ATK_24 0x30 +#define SID_ATK_38 0x40 +#define SID_ATK_56 0x50 +#define SID_ATK_68 0x60 +#define SID_ATK_80 0x70 +#define SID_ATK_100 0x80 +#define SID_ATK_250 0x90 +#define SID_ATK_500 0xa0 +#define SID_ATK_800 0xb0 +#define SID_ATK_1000 0xc0 +#define SID_ATK_3000 0xd0 +#define SID_ATK_5000 0xe0 +#define SID_ATK_8000 0xf0 + +#define SID_DKY_6 0x00 +#define SID_DKY_24 0x01 +#define SID_DKY_48 0x02 +#define SID_DKY_72 0x03 +#define SID_DKY_114 0x04 +#define SID_DKY_168 0x05 +#define SID_DKY_204 0x06 +#define SID_DKY_240 0x07 +#define SID_DKY_300 0x08 +#define SID_DKY_750 0x09 +#define SID_DKY_1500 0x0a +#define SID_DKY_2400 0x0b +#define SID_DKY_3000 0x0c +#define SID_DKY_9000 0x0d +#define SID_DKY_15000 0x0e +#define SID_DKY_24000 0x0f + +#define SID_CTRL_GATE 0x01 +#define SID_CTRL_SYNC 0x02 +#define SID_CTRL_RING 0x04 +#define SID_CTRL_TEST 0x08 +#define SID_CTRL_TRI 0x10 +#define SID_CTRL_SAW 0x20 +#define SID_CTRL_RECT 0x40 +#define SID_CTRL_NOISE 0x80 + +#define SID_FILTER_1 0x01 +#define SID_FILTER_2 0x02 +#define SID_FILTER_3 0x04 +#define SID_FILTER_X 0x08 + +#define SID_FMODE_LP 0x10 +#define SID_FMODE_BP 0x20 +#define SID_FMODE_HP 0x40 +#define SID_FMODE_3_OFF 0x80 + +#define SID_CLOCK_PAL 985248 +#define SID_CLOCK_NTSC 1022727 + +#define SID_CLKSCALE_PAL 1115974UL +#define SID_CLKSCALE_NTSC 1075078UL + +#define SID_FREQ_PAL(f) ((unsigned)(((unsigned long)(f) * SID_CLKSCALE_PAL) >> 16)) +#define SID_FREQ_NTSC(f) ((unsigned)(((unsigned long)(f) * SID_CLKSCALE_NTSC) >> 16)) + +struct SID +{ + struct Voice + { + volatile unsigned freq; + volatile unsigned pwm; + volatile byte ctrl; + volatile byte attdec; + volatile byte susrel; + } voices[3]; + + volatile unsigned ffreq; + volatile byte resfilt; + volatile byte fmodevol; + + volatile byte potx; + volatile byte poty; + volatile byte random; + volatile byte env3; +}; + +#define NOTE_C(o) (16744U >> (10 - (o))) +#define NOTE_CS(o) (17740U >> (10 - (o))) +#define NOTE_D(o) (18794U >> (10 - (o))) +#define NOTE_DS(o) (19912U >> (10 - (o))) +#define NOTE_E(o) (21906U >> (10 - (o))) +#define NOTE_F(o) (22351U >> (10 - (o))) +#define NOTE_FS(o) (23680U >> (10 - (o))) +#define NOTE_G(o) (25087U >> (10 - (o))) +#define NOTE_GS(o) (26580U >> (10 - (o))) +#define NOTE_A(o) (28160U >> (10 - (o))) +#define NOTE_AS(o) (29834U >> (10 - (o))) +#define NOTE_B(o) (31068U >> (10 - (o))) + +// reference to the SID chip +#define sid (*((struct SID *)0xd400)) + +#pragma compile("sid.c") + +#endif diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index 34f7ab1..b381c70 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -6901,7 +6901,7 @@ void InterCodeBasicBlock::SingleBlockLoopOptimisation(const NumberSet& aliasedPa { mVisited = true; - if (mLoopHead && mNumEntries == 2 && (mTrueJump == this || mFalseJump == this)) + if (mLoopHead && mNumEntries == 2 && mFalseJump && (mTrueJump == this || mFalseJump == this)) { bool hasCall = false; for (int i = 0; i < mInstructions.Size(); i++) diff --git a/oscar64/oscar64.cpp b/oscar64/oscar64.cpp index 319134c..b60bc74 100644 --- a/oscar64/oscar64.cpp +++ b/oscar64/oscar64.cpp @@ -73,7 +73,7 @@ int main(int argc, const char** argv) #else strcpy(strProductName, "oscar64"); - strcpy(strProductVersion, "1.2.62"); + strcpy(strProductVersion, "1.2.63"); #ifdef __APPLE__ uint32_t length = sizeof(basePath); diff --git a/oscar64/oscar64.rc b/oscar64/oscar64.rc index dbd665f..553a43f 100644 --- a/oscar64/oscar64.rc +++ b/oscar64/oscar64.rc @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,62,0 - PRODUCTVERSION 1,2,62,0 + FILEVERSION 1,2,63,0 + PRODUCTVERSION 1,2,63,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -43,12 +43,12 @@ BEGIN BEGIN VALUE "CompanyName", "oscar64" VALUE "FileDescription", "oscar64 compiler" - VALUE "FileVersion", "1.2.62.0" + VALUE "FileVersion", "1.2.63.0" VALUE "InternalName", "oscar64.exe" VALUE "LegalCopyright", "Copyright (C) 2021" VALUE "OriginalFilename", "oscar64.exe" VALUE "ProductName", "oscar64" - VALUE "ProductVersion", "1.2.62.0" + VALUE "ProductVersion", "1.2.63.0" END END BLOCK "VarFileInfo" diff --git a/oscar64setup/oscar64setup.vdproj b/oscar64setup/oscar64setup.vdproj index 3b196a3..179140d 100644 --- a/oscar64setup/oscar64setup.vdproj +++ b/oscar64setup/oscar64setup.vdproj @@ -34,6 +34,12 @@ } "Entry" { + "MsmKey" = "8:_03D7013B0D39A89CEA9D267005ADCE39" + "OwnerKey" = "8:_FB2E467BC172457785F4279BB0BFE8B6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_05BBBE09BC7047B6AB2F10A2E9032E37" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -124,12 +130,30 @@ } "Entry" { + "MsmKey" = "8:_326B44043E3720E0A341FB5627DA8873" + "OwnerKey" = "8:_FB2E467BC172457785F4279BB0BFE8B6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_343F58F80DF84D40AE23457288C5D7D5" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" } "Entry" { + "MsmKey" = "8:_36B4A1247BFCE001E1BAE7560E9CFEEA" + "OwnerKey" = "8:_FB2E467BC172457785F4279BB0BFE8B6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_379EE3C17FEC4C5EA79D07668CD05FC4" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_37F135A207264D5984B4B81EC44A4337" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -154,6 +178,12 @@ } "Entry" { + "MsmKey" = "8:_3C29D5D111D24946BEF556FBAB178506" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_3FFD08277B804985BDF072C0C1877287" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -190,6 +220,12 @@ } "Entry" { + "MsmKey" = "8:_458189403F0009BC49371204B74F3BD3" + "OwnerKey" = "8:_FB2E467BC172457785F4279BB0BFE8B6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_47A877D439EE429BAB64C52FEF69EDA4" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -256,6 +292,12 @@ } "Entry" { + "MsmKey" = "8:_749A2BA18335F50EB53CCE7029861FBC" + "OwnerKey" = "8:_FB2E467BC172457785F4279BB0BFE8B6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_79985361F09A43299E258E1A8E5ED934" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -298,6 +340,12 @@ } "Entry" { + "MsmKey" = "8:_8667075410229C38BF63AC1CC776055E" + "OwnerKey" = "8:_FB2E467BC172457785F4279BB0BFE8B6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_89C3C9640CD142CCB3192AF3B15FC771" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -334,6 +382,12 @@ } "Entry" { + "MsmKey" = "8:_9893C97816744FFC9EC442940C79E58B" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_98968728BFD9473FBCFD4E6A3B113A1F" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -346,6 +400,12 @@ } "Entry" { + "MsmKey" = "8:_9D5C03E361EC4766AF0204219047B6C8" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_9EF4DA2EABDB4E3B864CCDEC851B7037" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -478,6 +538,12 @@ } "Entry" { + "MsmKey" = "8:_CCB9E57C55E9405DA3EBBF4E6131004A" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_CD97BB2D0A3349FD86EE0058561FB8A7" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -520,6 +586,12 @@ } "Entry" { + "MsmKey" = "8:_DD5A4DD822437085CD584319732F2D4D" + "OwnerKey" = "8:_FB2E467BC172457785F4279BB0BFE8B6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_E218D776D9014F99BE2B046AEF2D6E8B" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -574,6 +646,12 @@ } "Entry" { + "MsmKey" = "8:_EA3C0BCB01F2639DFA2E37EC8436E5F6" + "OwnerKey" = "8:_FB2E467BC172457785F4279BB0BFE8B6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_ED872D39D58443D590B7C80604BC0FF4" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -598,6 +676,12 @@ } "Entry" { + "MsmKey" = "8:_F20F5618C7576D758C01D89C87469AF8" + "OwnerKey" = "8:_FB2E467BC172457785F4279BB0BFE8B6" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { "MsmKey" = "8:_F35970F9D8FA46B09F36D7E9DE5532CA" "OwnerKey" = "8:_UNDEFINED" "MsmSig" = "8:_UNDEFINED" @@ -773,6 +857,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_03D7013B0D39A89CEA9D267005ADCE39" + { + "SourcePath" = "8:VCRUNTIME140.dll" + "TargetName" = "8:VCRUNTIME140.dll" + "Tag" = "8:" + "Folder" = "8:_607E75AF0E2A4CB9908C4C39DF8FE6E4" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_05BBBE09BC7047B6AB2F10A2E9032E37" { "SourcePath" = "8:..\\samples\\kernalio\\hiresread.c" @@ -1073,6 +1177,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_326B44043E3720E0A341FB5627DA8873" + { + "SourcePath" = "8:api-ms-win-crt-stdio-l1-1-0.dll" + "TargetName" = "8:api-ms-win-crt-stdio-l1-1-0.dll" + "Tag" = "8:" + "Folder" = "8:_607E75AF0E2A4CB9908C4C39DF8FE6E4" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_343F58F80DF84D40AE23457288C5D7D5" { "SourcePath" = "8:..\\include\\c64\\keyboard.c" @@ -1093,6 +1217,46 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_36B4A1247BFCE001E1BAE7560E9CFEEA" + { + "SourcePath" = "8:api-ms-win-crt-math-l1-1-0.dll" + "TargetName" = "8:api-ms-win-crt-math-l1-1-0.dll" + "Tag" = "8:" + "Folder" = "8:_607E75AF0E2A4CB9908C4C39DF8FE6E4" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_379EE3C17FEC4C5EA79D07668CD05FC4" + { + "SourcePath" = "8:..\\samples\\memmap\\easyflash.c" + "TargetName" = "8:easyflash.c" + "Tag" = "8:" + "Folder" = "8:_A62A71A6A08941C5964B90112D87731F" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_37F135A207264D5984B4B81EC44A4337" { "SourcePath" = "8:..\\samples\\hiresmc\\make.bat" @@ -1173,6 +1337,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_3C29D5D111D24946BEF556FBAB178506" + { + "SourcePath" = "8:..\\include\\c64\\cia.c" + "TargetName" = "8:cia.c" + "Tag" = "8:" + "Folder" = "8:_247D4CAD3CB843B3A8A4DC2D90F47C28" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_3FFD08277B804985BDF072C0C1877287" { "SourcePath" = "8:..\\include\\assert.c" @@ -1293,6 +1477,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_458189403F0009BC49371204B74F3BD3" + { + "SourcePath" = "8:api-ms-win-crt-string-l1-1-0.dll" + "TargetName" = "8:api-ms-win-crt-string-l1-1-0.dll" + "Tag" = "8:" + "Folder" = "8:_607E75AF0E2A4CB9908C4C39DF8FE6E4" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_47A877D439EE429BAB64C52FEF69EDA4" { "SourcePath" = "8:..\\samples\\memmap\\largemem.c" @@ -1513,6 +1717,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_749A2BA18335F50EB53CCE7029861FBC" + { + "SourcePath" = "8:api-ms-win-crt-runtime-l1-1-0.dll" + "TargetName" = "8:api-ms-win-crt-runtime-l1-1-0.dll" + "Tag" = "8:" + "Folder" = "8:_607E75AF0E2A4CB9908C4C39DF8FE6E4" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_79985361F09A43299E258E1A8E5ED934" { "SourcePath" = "8:..\\include\\gfx\\mcbitmap.c" @@ -1653,6 +1877,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_8667075410229C38BF63AC1CC776055E" + { + "SourcePath" = "8:api-ms-win-crt-filesystem-l1-1-0.dll" + "TargetName" = "8:api-ms-win-crt-filesystem-l1-1-0.dll" + "Tag" = "8:" + "Folder" = "8:_607E75AF0E2A4CB9908C4C39DF8FE6E4" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_89C3C9640CD142CCB3192AF3B15FC771" { "SourcePath" = "8:..\\samples\\kernalio\\make.bat" @@ -1773,6 +2017,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9893C97816744FFC9EC442940C79E58B" + { + "SourcePath" = "8:..\\include\\c64\\easyflash.h" + "TargetName" = "8:easyflash.h" + "Tag" = "8:" + "Folder" = "8:_247D4CAD3CB843B3A8A4DC2D90F47C28" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_98968728BFD9473FBCFD4E6A3B113A1F" { "SourcePath" = "8:..\\samples\\fractals\\mbhires.c" @@ -1813,6 +2077,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9D5C03E361EC4766AF0204219047B6C8" + { + "SourcePath" = "8:..\\include\\c64\\sid.c" + "TargetName" = "8:sid.c" + "Tag" = "8:" + "Folder" = "8:_247D4CAD3CB843B3A8A4DC2D90F47C28" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9EF4DA2EABDB4E3B864CCDEC851B7037" { "SourcePath" = "8:..\\include\\c64\\cia.h" @@ -2253,6 +2537,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CCB9E57C55E9405DA3EBBF4E6131004A" + { + "SourcePath" = "8:..\\include\\c64\\sid.h" + "TargetName" = "8:sid.h" + "Tag" = "8:" + "Folder" = "8:_247D4CAD3CB843B3A8A4DC2D90F47C28" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_CD97BB2D0A3349FD86EE0058561FB8A7" { "SourcePath" = "8:..\\include\\c64\\charwin.c" @@ -2393,6 +2697,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_DD5A4DD822437085CD584319732F2D4D" + { + "SourcePath" = "8:api-ms-win-crt-heap-l1-1-0.dll" + "TargetName" = "8:api-ms-win-crt-heap-l1-1-0.dll" + "Tag" = "8:" + "Folder" = "8:_607E75AF0E2A4CB9908C4C39DF8FE6E4" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_E218D776D9014F99BE2B046AEF2D6E8B" { "SourcePath" = "8:..\\include\\stdlib.c" @@ -2573,6 +2897,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_EA3C0BCB01F2639DFA2E37EC8436E5F6" + { + "SourcePath" = "8:VERSION.dll" + "TargetName" = "8:VERSION.dll" + "Tag" = "8:" + "Folder" = "8:_607E75AF0E2A4CB9908C4C39DF8FE6E4" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_ED872D39D58443D590B7C80604BC0FF4" { "SourcePath" = "8:..\\samples\\kernalio\\fileread.c" @@ -2653,6 +2997,26 @@ "IsDependency" = "11:FALSE" "IsolateTo" = "8:" } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F20F5618C7576D758C01D89C87469AF8" + { + "SourcePath" = "8:api-ms-win-crt-locale-l1-1-0.dll" + "TargetName" = "8:api-ms-win-crt-locale-l1-1-0.dll" + "Tag" = "8:" + "Folder" = "8:_607E75AF0E2A4CB9908C4C39DF8FE6E4" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:TRUE" + "IsolateTo" = "8:" + } "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F35970F9D8FA46B09F36D7E9DE5532CA" { "SourcePath" = "8:..\\include\\c64\\charwin.h" @@ -2987,15 +3351,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:oscar64" - "ProductCode" = "8:{B0D25385-A6F7-4134-8C6B-8CEFA1F244B1}" - "PackageCode" = "8:{00172C8A-7F93-49AC-B3A4-A451DD1544E4}" + "ProductCode" = "8:{EB9870E9-BC61-4218-8C98-A107F7A56458}" + "PackageCode" = "8:{D6A2DECC-DBEF-487B-8DC2-3FD3E7A8771F}" "UpgradeCode" = "8:{9AB61EFF-ACAC-4079-9950-8D96615CD4EF}" "AspNetVersion" = "8:2.0.50727.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:1.2.62" + "ProductVersion" = "8:1.2.63" "Manufacturer" = "8:oscar64" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" diff --git a/samples/memmap/build.sh b/samples/memmap/build.sh index 5698ca1..53813b1 100644 --- a/samples/memmap/build.sh +++ b/samples/memmap/build.sh @@ -4,3 +4,4 @@ ../../bin/oscar64 charsetlo.c ../../bin/oscar64 charsethi.c ../../bin/oscar64 charsetcopy.c +../../bin/oscar64 easyflash.c -n -tf=crt diff --git a/samples/memmap/easyflash.c b/samples/memmap/easyflash.c new file mode 100644 index 0000000..e66c721 --- /dev/null +++ b/samples/memmap/easyflash.c @@ -0,0 +1,153 @@ +#include +#include +#include +#include +#include + +// Shared code/data region, copied from easyflash bank 0 to ram during startup + +#pragma region( main, 0x0900, 0x8000, , , { code, data, bss, heap, stack } ) + +// Section and region for first easyflash bank + +#pragma section( bcode1, 0 ) +#pragma section( bdata1, 0 ) +#pragma region(bank1, 0x8000, 0xc000, , 1, { bcode1, bdata1 } ) + +// Section and region for second easyflash bank + +#pragma section( bcode2, 0 ) +#pragma section( bdata2, 0 ) +#pragma region(bank2, 0x8000, 0xc000, , 2, { bcode2, bdata2 } ) + +#pragma section( bcode3, 0 ) +#pragma section( bdata3, 0 ) +#pragma region(bank3, 0x8000, 0xc000, , 3, { bcode3, bdata3 } ) + +#pragma section( bcode4, 0 ) +#pragma section( bdata4, 0 ) +#pragma region(bank4, 0x8000, 0xc000, , 4, { bcode4, bdata4 } ) + +#pragma section( bcode5, 0 ) +#pragma section( bdata5, 0 ) +#pragma region(bank5, 0x8000, 0xc000, , 5, { bcode5, bdata5 } ) + +#pragma section( bcode6, 0 ) +#pragma section( bdata6, 0 ) +#pragma region(bank6, 0x8000, 0xc000, , 6, { bcode6, bdata6 } ) + +// Charwin in shared memory section + +CharWin cw; + +// Now switch code generation to bank 1 + +#pragma code ( bcode1 ) +#pragma data ( bdata1 ) + +// Print into shared charwin + +void print1(void) +{ + cwin_put_string(&cw, p"This is first bank", 7); + cwin_cursor_newline(&cw); +} + +// Now switch code generation to bank 2 + +#pragma code ( bcode2 ) +#pragma data ( bdata2 ) + +void print2(void) +{ + cwin_put_string(&cw, p"This is second bank", 7); + cwin_cursor_newline(&cw); +} + +#pragma code ( bcode3 ) +#pragma data ( bdata3 ) + +void print3(void) +{ + cwin_put_string(&cw, p"This is third bank", 7); + cwin_cursor_newline(&cw); +} + +#pragma code ( bcode4 ) +#pragma data ( bdata4 ) + +void print4(void) +{ + cwin_put_string(&cw, p"This is fourth bank", 7); + cwin_cursor_newline(&cw); +} + +#pragma code ( bcode5 ) +#pragma data ( bdata5 ) + +void print5(void) +{ + cwin_put_string(&cw, p"This is fifth bank", 7); + cwin_cursor_newline(&cw); +} + +#pragma code ( bcode6 ) +#pragma data ( bdata6 ) + +void print6(void) +{ + cwin_put_string(&cw, p"This is sixth bank", 7); + cwin_cursor_newline(&cw); +} + +// Switching code generation back to shared section + +#pragma code ( code ) +#pragma data ( data ) + + +int main(void) +{ + // Enable ROM + mmap_set(MMAP_ROM); + + // Init CIAs (no kernal rom was executed so far) + cia_init(); + + // Init VIC + vic_setmode(VICM_TEXT, (char *)0x0400, (char *)0x1800); + + // Prepare output window + cwin_init(&cw, (char *)0x0400, 0, 0, 40, 25); + cwin_clear(&cw); + + // Switch easyflash ROM region to bank 1 + eflash.bank = 1; + + // Call function in bank 1 + print1(); + + // Switch easyflash ROM region to bank 2 + eflash.bank = 2; + + // Call function in bank 2 + print2(); + + eflash.bank = 3; + print3(); + + eflash.bank = 4; + print4(); + + eflash.bank = 5; + print5(); + + eflash.bank = 6; + print6(); + + // Loop forever + while (true) + ; + + return 0; +} diff --git a/samples/memmap/easyflash.crt b/samples/memmap/easyflash.crt new file mode 100644 index 0000000..9d6299c Binary files /dev/null and b/samples/memmap/easyflash.crt differ diff --git a/samples/memmap/make.bat b/samples/memmap/make.bat index ed5c546..0fc7b41 100644 --- a/samples/memmap/make.bat +++ b/samples/memmap/make.bat @@ -3,3 +3,4 @@ call ..\..\bin\oscar64 allmem.c call ..\..\bin\oscar64 charsetlo.c call ..\..\bin\oscar64 charsethi.c call ..\..\bin\oscar64 charsetcopy.c +call ..\..\bin\oscar64 easyflash.c -n -tf=crt