Skip to content

Commit

Permalink
Amiga 0.0.6 Alpha
Browse files Browse the repository at this point in the history
* Interlace mode corrected for games like DarkSeed
* Folder names changed for Unix/Linux/Mac OS and to help with the uploader system
* Faster floppy access times using a larger buffer in the MPU core and caching.
  • Loading branch information
Mazamars312 committed Dec 10, 2022
1 parent 46b0fd3 commit b6a65b5
Show file tree
Hide file tree
Showing 30 changed files with 1,934 additions and 7,088 deletions.
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Analogue Pocket - Commodore Amiga 500 - 0.0.5 Alpha
# Analogue Pocket - Commodore Amiga 500 - 0.0.6 Alpha

The Commodore Amiga 500 was a personal computer that replaced the well-loved Commodore C64 in the Commodore product line. It also was one of the many 68K personal computers that showed that this CPU was a powerhouse when integrated with great hardware beside it.

Expand All @@ -15,9 +15,10 @@ This is based on the Mister Github of the Amiga Mist project (Also known as the
* It can only read ADF disk images (Floppy disks). Writes will come soon with Hard Drive access.

## How to setup
* Place your ADF floppy images in the \asset\amiga\common folder
* Place the kickstart BIOS rom in the \asset\amiga\common folder (I'm using the 1.2 for now, but any original 256/512/1024kbyte firmware rom will work - no encrypted BIOSes yet). Name it to kickstart.rom to autoload it
* Make sure that the \asset\amiga\Mazamars312.amiga\ Folder has the mpu.bin file - this is supplied and should already be there.
* PLEASE NOTE - Folder names have been changed to help with the updater - my mistake here.
* Place your ADF floppy images in the \Asset\amiga\common folder
* Place the kickstart BIOS rom in the \Asset\amiga\common folder (I'm using the 1.2 for now, but any original 256/512/1024kbyte firmware rom will work - no encrypted BIOSes yet). Name it to kickstart.rom to autoload it
* Make sure that the \Asset\amiga\Mazamars312.Amiga\ Folder has the mpu.bin file - this is supplied and should already be there.
* When changing system configurations, you must select the "CPU reset" in the menu to apply the config.

## Is the best way to play this using the dock?
Expand Down Expand Up @@ -50,11 +51,11 @@ This is based on the Mister Github of the Amiga Mist project (Also known as the

## Can we write to floppy disks at this moment?

* No, I have the code ready, but I want to check it before releasing it.
* No, I have the code ready, but due to a bug in the framework Im holding off on releasing it as it will damage files on the sdcard.

## When are writable disks and Harddrives going to be working?

* Now that the framework for the MPU has been built, this is a matter of getting the C++ code working with the MPU and APF interface.
* Now that the framework for the MPU has been built, this is a matter of getting the C++ code working with the MPU and APF interface. There is also the sram being connected and tested to see if we can use this as a buffer as well.

## Wait, you have another CPU in the FPGA???

Expand All @@ -65,28 +66,34 @@ Specs:
* Connected to the core via a 16bit HPS Bus
* Two timers - one for interrupts and the other for user timing.
* Currently, 32K of memory/ram for the MPU's program (Will be set to 16K for a smaller footprint)
* A 2Kbyte swap buffer for both the APF and MPU to do transfers
* A 8Kbyte swap buffer for both the APF and MPU to do transfers


## In the future:
* A separate GitHub for the MPU and the APF framework for other developers to use soon with documentation and how to build with it.
* This has been released for others to have a go with it now.

## I have selected a disk that is taking some time to load?
## How did you speed up load times

* So it could be due to the game loading still. That's what that excellent green indicator at the top left-hand side is for :-)
* Try only using one disk drive - I have found that some games don't like having more than one floppy drive unless those drive a operating too.
* I need to build double buffering in the code, as I will use the APF target bus commands to transfer DMA data while processing data to the core simultaneously. Right now, these are two concurrent processes so this does cause some slow down
* Through talking to the Analogue Techs, it is faster to buffer more data and have that ready for the core to use then smaller 512 chunks that the orginal code would do.

## Why are some of the resolutions not correct?

* I need to see the standard resolutions to ensure the scaler will work correctly - Interlacing is one thing I need to build up.
* I need to see the standard resolutions to ensure the scaler will work correctly
* Due to memory access, the RTG resolutions will not work on this right now.

## I have game X that does not work!!!

* From the testing I have been doing, there are multiple configurations, bios and even ADF Images that you need to try. Hopefully, once I get both writing to floppy and the Harddrive access working, this will help with this.
* The main goal of this project was getting an MPU Framework so external media can be accessed and help giving developers some tools to help create more cores on the Pocket.
* So I do expect that there is more to learn about the amiga and get many of these bugs resolved.
* for Multi disk games, also try putting disks on other drives. But please make sure you change the amount of installed drives to the amount needed. (Up to 4)

## Change since 0.0.5 to 0.0.6
* Interlace mode corrected for games like DarkSeed
* Folder names changed for Unix/Linux/Mac OS and to help with the uploader system
* Faster floppy access times using a larger buffer in the MPU core and caching.
* But what about the things below - I wanted to sort out these key issues out first and Im awaiting for a bugfix from Analogue to be released. This is due to files being corrupted when writting back.

## What will be the next update??

Expand Down
Empty file added dist/Assets/amiga/common/.keep
Empty file.
Binary file modified dist/Cores/Mazamars312.Amiga/bitstream.rbf_r
Binary file not shown.
6 changes: 3 additions & 3 deletions dist/Cores/Mazamars312.Amiga/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"platform_ids": [
"amiga"
],
"shortname": "amiga",
"shortname": "Amiga",
"description": "Amiga 500 Core",
"author": "Mazamars312",
"url": "https://github.com/Mazamars312/Analogue-Amiga",
"version": "0.0.5",
"date_release": "2022-12-6"
"version": "0.0.6",
"date_release": "2022-12-9"
},
"framework": {
"target_product": "Analogue Pocket",
Expand Down
42 changes: 37 additions & 5 deletions dist/Cores/Mazamars312.Amiga/video.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"width": 320,
"height": 512,
"height": 256,
"aspect_w": 4,
"aspect_h": 3,
"rotation": 0,
Expand All @@ -21,16 +21,48 @@
{
"width": 640,
"height": 256,
"aspect_w": 4,
"aspect_h": 3,
"aspect_w": 5,
"aspect_h": 2,
"rotation": 0,
"mirror": 0
},
{
"width": 640,
"height": 256,
"aspect_w": 5,
"aspect_h": 2,
"rotation": 0,
"mirror": 0
},
{
"width": 320,
"height": 512,
"aspect_w": 4,
"aspect_h": 3,
"aspect_w": 5,
"aspect_h": 4,
"rotation": 0,
"mirror": 0
},
{
"width": 320,
"height": 512,
"aspect_w": 5,
"aspect_h": 4,
"rotation": 0,
"mirror": 0
},
{
"width": 640,
"height": 512,
"aspect_w": 5,
"aspect_h": 4,
"rotation": 0,
"mirror": 0
},
{
"width": 640,
"height": 512,
"aspect_w": 5,
"aspect_h": 4,
"rotation": 0,
"mirror": 0
}
Expand Down
Binary file modified dist/assets/amiga/Mazamars312.amiga/mpu.bin
Binary file not shown.
4 changes: 2 additions & 2 deletions src/VexRiscv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ mpu-stripped.elf: Makefile mpu.elf
riscv32-unknown-elf-strip -o mpu-stripped.elf mpu.elf

mpu.elf: $(OBJECTS) Makefile mpu.ld
riscv32-unknown-elf-ld -o mpu.elf $(OBJECTS) -static --print-memory-usage -T mpu.ld -L$(LIBGCC_DIR) -Map firmware.map -L/opt/riscv/riscv32-unknown-elf/lib -lgcc
riscv32-unknown-elf-ld -o mpu.elf $(OBJECTS) -static --print-memory-usage -T mpu.ld -L$(LIBGCC_DIR) -Map firmware.map -L/opt/riscv/riscv32-unknown-elf/lib -L/opt/riscv32i/riscv32-unknown-elf/include/ -lgcc

startup.o: startup.S Makefile
riscv32-unknown-elf-g++ -c -o startup.o startup.S -march=rv32ic -mabi=ilp32
riscv32-unknown-elf-g++ -c -o startup.o startup.S -march=rv32ic -mabi=ilp32

%.o: %.cpp Makefile

Expand Down
71 changes: 47 additions & 24 deletions src/VexRiscv/apf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@

#define SSPI_ACK

bool dataslot_ready(){
int apf_codes = READ_TARGET_DATASLOT_CONTROL(0);
return(apf_codes & APF_DONE);
}

uint8_t dataslot_status(){
int apf_codes = READ_TARGET_DATASLOT_CONTROL(0);
return(apf_codes & 0x7);
}

// This is to search though the dataslot ram looking for the location of the data slot in it
uint32_t dataslot_search_id(uint16_t value)
{
Expand Down Expand Up @@ -97,6 +107,7 @@ uint32_t dataslot_read(uint16_t dataslot, uint32_t address, uint32_t offset, uin
}
// minimig_input_update();
} while (!(apf_codes & APF_DONE));
printf ("read complete %0.4x %0.4x %d\r\n", address, offset, length);
return(0);
}

Expand Down Expand Up @@ -127,40 +138,57 @@ uint32_t dataslot_write(uint16_t dataslot, uint32_t address, uint32_t offset, ui
// THis will set the pointers read to go on the APF regs
uint32_t dataslot_read_lba_set_fast(uint16_t dataslot, uint32_t address, uint32_t offset, uint32_t length)
{
READ_TARGET_DATASLOT_ID(0) = dataslot;
READ_TARGET_DATASLOT_BRIDGE_ADD(0) = APF_ADDRESS_OFFSET | address;
READ_TARGET_DATASLOT_OFFSET(0) = offset << 9;
READ_TARGET_DATASLOT_LENGTH(0) = length;
READ_TARGET_DATASLOT_CONTROL(0) = TARGET_DATASLOT_READ_REG;

return(0);
}
WRITE_TARGET_DATASLOT_ID(0) = dataslot;
WRITE_TARGET_DATASLOT_BRIDGE_ADD(0) = APF_ADDRESS_OFFSET | address;
WRITE_TARGET_DATASLOT_LENGTH(0) = length;
WRITE_TARGET_DATASLOT_OFFSET(0) = offset << 9;
WRITE_TARGET_DATASLOT_CONTROL(0) = TARGET_DATASLOT_READ_REG;

// This will read the data from where the file pointer is (This is set by dataslot_read_lba_set) and does the next batch of data
uint32_t dataslot_read_lba_fast(uint32_t address, uint32_t length)
{
int i = 0;
int apf_codes;
int i = 0;
do
{
{
apf_codes = READ_TARGET_DATASLOT_CONTROL(0);
if ((apf_codes & APF_ERROR) > 0)
{
printf("APF FAILD?\r\n", apf_codes & APF_DONE);
printf("APF FAILD? length %d\r\n", dataslot);
printf("APF FAILD? length %0.4x\r\n", address);
printf("APF FAILD? length %0.4x\r\n", offset);
printf("APF FAILD? length %d\r\n", length);
return (apf_codes & APF_ERROR);
}
i++;
} while (!(apf_codes & APF_ACK) | (i <= 1000));

do
{
apf_codes = READ_TARGET_DATASLOT_CONTROL(0);
if ((apf_codes & APF_ERROR) > 0)
{
printf("APF FAILD?\r\n", apf_codes & APF_DONE);
return (apf_codes & APF_ERROR);
}
i++;
} while (!(apf_codes & APF_ACK) | (i <= 1000));

// minimig_input_update();
} while (!(apf_codes & APF_DONE));
printf ("read complete %0.8x %0.8x %d\r\n", address, offset, length);
return(0);
}

// This will read the data from where the file pointer is (This is set by dataslot_read_lba_set) and does the next batch of data
uint32_t dataslot_read_lba_fast(uint32_t address, uint32_t length)
{
int apf_codes;
int i = 0;
READ_TARGET_DATASLOT_BRIDGE_ADD(0) = APF_ADDRESS_OFFSET | address;
READ_TARGET_DATASLOT_LENGTH(0) = length;
READ_TARGET_DATASLOT_CONTROL(0) = TARGET_DATASLOT_READ_REG;
// printf("READ_TARGET_DATASLOT_LENGTH Sent %.4x\r\n", WRITE_TARGET_DATASLOT_LENGTH(0));
do
{
apf_codes = READ_TARGET_DATASLOT_CONTROL(0);
} while (apf_codes & APF_ACK);
i++;
} while (!(apf_codes & APF_ACK) | (i <=10000));
int tmp = WRITE_TARGET_DATASLOT_OFFSET(0);
WRITE_TARGET_DATASLOT_OFFSET(0) = tmp + length;
return(0);
Expand All @@ -187,14 +215,9 @@ uint32_t dataslot_read_lba(uint32_t length)
do
{
apf_codes = READ_TARGET_DATASLOT_CONTROL(0);
if ((apf_codes & APF_ERROR) > 0)
{
printf("no act APF FAILD?\r\n", apf_codes & APF_DONE);
return (apf_codes & APF_ERROR);
}
i++;
} while (!(apf_codes & APF_ACK) | (i <=10000));

i++;
} while (!(apf_codes & APF_ACK) | (i <=100));
do
{
apf_codes = READ_TARGET_DATASLOT_CONTROL(0);
Expand Down
Loading

0 comments on commit b6a65b5

Please sign in to comment.