Skip to content

Commit

Permalink
Bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
drmortalwombat committed Mar 5, 2023
1 parent 9bd7b5c commit e1606ab
Show file tree
Hide file tree
Showing 8 changed files with 534 additions and 9 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,30 @@ The compiler is command line driven, and creates an executable .prg file.
* -Oi: enable auto inline of small functions (part of O2/O3)
* -Oa: optimize inline assembler (part of O2/O3)
* -tf: target format, may be prg, crt or bin
* -tm : target machine
* -d64 : create a d64 disk image
* -f : add a binary file to the disk image
* -fz : add a compressed binary file to the disk image
* -xz : extended zero page usage, more zero page space, but no return to basic


A list of source files can be provided.

#### Supported target machines

* c64 : Commodore C64, (0x0800..0xa000)
* c128 : Commodore C128, memory range (0x1c00..0xfc00)
* c128b : Commodore C128, first 16KB only (0x1c00..0x4000)
* plus4 : Commodore PLUS4, (0x1000..0xfc00)
* vic20: Commodore VIC20, no extra memory (0x1000..0x1e00)
* vic20+3 : Commodore VIC20, 3K RAM expansion (0x0400..0x1e00)
* vic20+8 : Commodore VIC20, 8K RAM expansion (0x1200..0x4000)
* vic20+16 : Commodore VIC20, 16K RAM expansion (0x1200..0x6000)
* vic20+24 : Commodore VIC20, 24K RAM expansion (0x1200..0x8000)
* pet: Commodore PET, 8K RAM (0x0400..0x2000)
* pet16 : Commodore PET, 16K RAM (0x0400..0x4000)
* pet32 : Commodore PET, 32K RAM (0x0400..0x8000)
* nes : Nintendo entertainment system, NROM 32 K ROM

### Files generated

The main file generated by the compiler is a .prg, .crt or .bin with the code and constant data. Additional files are created to support debugging and analysis:
Expand Down
84 changes: 84 additions & 0 deletions include/c128/bank1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#include "bank1.h"
#include "mmu.h"
#include <string.h>

void bnk1_init(void)
{
mmu.cr = 0x3e;
memcpy((char *)0xfc00, (char *)0xf000, 0x0300);
xmmu.rcr |= 0x0c;
mmu.cr = 0x3f;
}

#pragma code(bnk1code)

char bnk1_readb(volatile char * p)
{
mmu.bank1 = 0;
char c = *p;
mmu.bank0 = 0;
return c;
}

unsigned bnk1_readw(volatile unsigned * p)
{
mmu.bank1 = 0;
unsigned w = *p;
mmu.bank0 = 1;
return w;
}

unsigned long bnk1_readl(volatile unsigned long * p)
{
mmu.bank1 = 0;
unsigned long l = *p;
mmu.bank0 = 3;
return l;
}

void bnk1_readm(char * dp, volatile char * sp, unsigned size)
{
while (size > 0)
{
mmu.bank1 = 0;
char c = * sp++;
mmu.bank0 = c;
*dp++ = c;
size--;
}
}

void bnk1_writeb(volatile char * p, char b)
{
mmu.bank1 = b;
*p = b;
mmu.bank0 = b;
}

void bnk1_writew(volatile unsigned * p, unsigned w)
{
mmu.bank1 = w;
*p = w;
mmu.bank0 = w;
}

void bnk1_writel(volatile unsigned long * p, unsigned long l)
{
mmu.bank1 = l;
*p = l;
mmu.bank0 = l;
}

void bnk1_writem(volatile char * dp, const char * sp, unsigned size)
{
while (size > 0)
{
char c = * sp++;
mmu.bank1 = c;
*dp++ = c;
mmu.bank0 = c;
size--;
}
}

#pragma code(code)
34 changes: 34 additions & 0 deletions include/c128/bank1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#ifndef C128_BANK1_H
#define C128_BANK1_H


#pragma section( bnk1code, 0)

#pragma region( bnk1code, 0xf000, 0xf300, , , {bnk1code}, 0xfc00 )

void bnk1_init(void);

#pragma code(bnk1code)

char bnk1_readb(volatile char * p);

unsigned bnk1_readw(volatile unsigned * p);

unsigned long bnk1_readl(volatile unsigned long * p);

void bnk1_readm(char * dp, volatile char * sp, unsigned size);


void bnk1_writeb(volatile char * p, char b);

void bnk1_writew(volatile unsigned * p, unsigned w);

void bnk1_writel(volatile unsigned long * p, unsigned long l);

void bnk1_writem(volatile char * dp, const char * sp, unsigned size);

#pragma code(code)

#pragma compile("bank1.c")

#endif
1 change: 1 addition & 0 deletions include/c128/mmu.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "mmu.h"
34 changes: 34 additions & 0 deletions include/c128/mmu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#ifndef C128_MMU_H
#define C128_MMU_H

#include <c64/types.h>

struct MMU
{
volatile byte cr;
volatile byte bank0;
volatile byte bank1;
volatile byte bank14;
volatile byte bankx;
};

struct XMMU
{
volatile byte cr;
volatile byte pcr[4];
volatile byte mcr;
volatile byte rcr;
volatile word page0;
volatile word page1;
volatile byte vr;
};

#define mmu (*((struct MMU *)0xff00))

#define xmmu (*((struct XMMU *)0xd500))


#pragma compile("mmu.c")

#endif

2 changes: 1 addition & 1 deletion oscar64/oscar64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int main2(int argc, const char** argv)

#else
strcpy(strProductName, "oscar64");
strcpy(strProductVersion, "1.16.187");
strcpy(strProductVersion, "1.17.188");

#ifdef __APPLE__
uint32_t length = sizeof(basePath);
Expand Down
8 changes: 4 additions & 4 deletions oscar64/oscar64.rc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,16,187,0
PRODUCTVERSION 1,16,187,0
FILEVERSION 1,17,188,0
PRODUCTVERSION 1,17,188,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -43,12 +43,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "oscar64"
VALUE "FileDescription", "oscar64 compiler"
VALUE "FileVersion", "1.16.187.0"
VALUE "FileVersion", "1.17.188.0"
VALUE "InternalName", "oscar64.exe"
VALUE "LegalCopyright", "Copyright (C) 2021"
VALUE "OriginalFilename", "oscar64.exe"
VALUE "ProductName", "oscar64"
VALUE "ProductVersion", "1.16.187.0"
VALUE "ProductVersion", "1.17.188.0"
END
END
BLOCK "VarFileInfo"
Expand Down
Loading

0 comments on commit e1606ab

Please sign in to comment.