]> git.sesse.net Git - pistorm/commitdiff
tidy up headers, remove extraneous duplicate decls
authorjust nine <nine@aphlor.org>
Fri, 5 Mar 2021 17:43:13 +0000 (17:43 +0000)
committerjust nine <nine@aphlor.org>
Fri, 5 Mar 2021 17:43:13 +0000 (17:43 +0000)
28 files changed:
Makefile
buptest.c
config_file/config_file.c
config_file/config_file.h
emulator.c
emulator.h [moved from main.h with 81% similarity]
gpio/gpio_old.c
gpio/ps_protocol.c
input/input.c
m68kconf.h
platforms/amiga/Gayle.c
platforms/amiga/amiga-autoconf.c
platforms/amiga/amiga-autoconf.h
platforms/amiga/amiga-platform.c
platforms/amiga/amiga-registers.c
platforms/amiga/cdtv-dmac.c
platforms/amiga/gayle-ide/ide.c
platforms/amiga/hunk-reloc.h
platforms/amiga/net/net_driver_amiga/pi-net-amiga.c
platforms/amiga/net/pi-net.c
platforms/amiga/piscsi/piscsi.c
platforms/amiga/piscsi/piscsi.h
platforms/amiga/rtg/rtg-gfx.c
platforms/amiga/rtg/rtg-output.c
platforms/amiga/rtg/rtg.c
platforms/dummy/dummy-platform.c
platforms/platforms.h
softfloat/softfloat.c

index fedac27587156ea70bcba581496371e414661a5b..1ccd7e86f735f789f38d61f43d6218a2bb03962e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,7 @@ EXEPATH = ./
 
 CC        = gcc
 WARNINGS  = -Wall -Wextra -pedantic
-CFLAGS    = $(WARNINGS) -march=armv8-a -mfloat-abi=hard -mfpu=neon-fp-armv8 -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+CFLAGS    = $(WARNINGS) -I. -march=armv8-a -mfloat-abi=hard -mfpu=neon-fp-armv8 -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
 LFLAGS    = $(WARNINGS) `sdl2-config --libs`
 
 TARGET = $(EXENAME)$(EXE)
index bbba2ed7693a47caa34eb750a36f1e3d635fa94a..6538736beda9f3dc922190aef8fbccc5c07ed3ac 100644 (file)
--- a/buptest.c
+++ b/buptest.c
@@ -15,7 +15,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <sys/ioctl.h>
-#include "main.h"
+#include "emulator.h"
 #include "gpio/gpio.h"
 #include "platforms/amiga/gayle-ide/ide.h"
 
index 772c6ba39699d5800035b8c1b885f773f09887f7..67a69a5761d780e84f8e31917ce31e324c262e55 100644 (file)
@@ -1,4 +1,4 @@
-#include "../platforms/platforms.h"
+#include "platforms/platforms.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -278,7 +278,7 @@ struct emulator_config *load_config_file(char *filename) {
       goto skip_line;
 
     trim_whitespace(parse_line);
-    
+
     get_next_string(parse_line, cur_cmd, &str_pos, ' ');
 
     switch (get_config_item_type(cur_cmd)) {
@@ -391,7 +391,7 @@ struct emulator_config *load_config_file(char *filename) {
         printf("Unknown config item %s on line %d.\n", cur_cmd, cur_line);
         break;
     }
-    
+
     skip_line:;
     cur_line++;
   }
index b19d80972f8227c52514cc4d30a7e50a9310d5d4..6880f0fcada497f7912ca1f9c3b62ee06dc2013a 100644 (file)
@@ -1,4 +1,9 @@
-#include "../m68k.h"
+#ifndef _CONFIG_FILE_H
+#define _CONFIG_FILE_H
+
+#include "m68k.h"
+
+#include <unistd.h>
 
 #define MAX_NUM_MAPPED_ITEMS 8
 #define SIZE_KILO 1024
@@ -93,3 +98,5 @@ int handle_mapped_write(struct emulator_config *cfg, unsigned int addr, unsigned
 int get_named_mapped_item(struct emulator_config *cfg, char *name);
 int get_mapped_item_by_address(struct emulator_config *cfg, uint32_t address);
 unsigned int get_int(char *str);
+
+#endif /* _CONFIG_FILE_H */
index 290b6c051a3f2dd195c981c1f590359ff9d6da5e..78de6e2f266a2e69684057e83362bbfcbc0ec9a5 100644 (file)
@@ -1,3 +1,19 @@
+#include "m68k.h"
+#include "emulator.h"
+#include "platforms/platforms.h"
+#include "input/input.h"
+
+#include "platforms/amiga/Gayle.h"
+#include "platforms/amiga/gayle-ide/ide.h"
+#include "platforms/amiga/amiga-registers.h"
+#include "platforms/amiga/rtg/rtg.h"
+#include "platforms/amiga/hunk-reloc.h"
+#include "platforms/amiga/piscsi/piscsi.h"
+#include "platforms/amiga/piscsi/piscsi-enums.h"
+#include "platforms/amiga/net/pi-net.h"
+#include "platforms/amiga/net/pi-net-enums.h"
+#include "gpio/ps_protocol.h"
+
 #include <assert.h>
 #include <dirent.h>
 #include <endian.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/ioctl.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
-#include <sys/ioctl.h>
-#include "m68k.h"
-#include "main.h"
-#include "platforms/platforms.h"
-#include "input/input.h"
 
-#include "platforms/amiga/Gayle.h"
-#include "platforms/amiga/gayle-ide/ide.h"
-#include "platforms/amiga/amiga-registers.h"
-#include "platforms/amiga/rtg/rtg.h"
-#include "platforms/amiga/hunk-reloc.h"
-#include "platforms/amiga/piscsi/piscsi.h"
-#include "platforms/amiga/piscsi/piscsi-enums.h"
-#include "platforms/amiga/net/pi-net.h"
-#include "platforms/amiga/net/pi-net-enums.h"
-#include "gpio/ps_protocol.h"
 
 unsigned char read_ranges;
 unsigned int read_addr[8];
@@ -508,7 +510,7 @@ void cpu_pulse_reset(void) {
   if (cfg->platform->handle_reset)
     cfg->platform->handle_reset(cfg);
 
-  
+
   m68k_write_memory_16(INTENA, 0x7FFF);
   ovl = 1;
   m68k_write_memory_8(0xbfe201, 0x0001);  // AMIGA OVL
similarity index 81%
rename from main.h
rename to emulator.h
index 49944b00b57f9cec258dca9606698ab412670f50..328e4a4173bc6f3a58a3e4f327dbf264cd51eb99 100644 (file)
--- a/main.h
@@ -1,11 +1,13 @@
-//
-// BCM283x SMI interface 
-// Derived from Documentation
-// GVL 15-Oct-2014 
-//
-#ifndef MAIN__HEADER
-#define MAIN__HEADER
+/**
+ * pistorm
+ * emulator function declarations
+ */
 
+#ifndef _EMULATOR_H
+#define _EMULATOR_H
+
+// see feature_set_macros(7)
+#define _GNU_SOURCE
 
 #include <stdint.h>
 
@@ -19,7 +21,6 @@ void write8(uint32_t address,uint16_t data);
 uint16_t read8(uint32_t address);
 */
 
-
 void cpu_pulse_reset(void);
 void m68ki_int_ack(uint8_t int_level);
 int cpu_irq_ack(int level);
@@ -30,7 +31,4 @@ void m68k_write_memory_8(unsigned int address, unsigned int value);
 void m68k_write_memory_16(unsigned int address, unsigned int value);
 void m68k_write_memory_32(unsigned int address, unsigned int value);
 
-
-
-#endif /* MAIN__HEADER */
-
+#endif /* _EMULATOR_H */
index 9ea5ef35ca35ea28daf026c66c33ef1976c9b17e..6d78f53e3a57f762a674f4a6708ca09739a97286 100644 (file)
@@ -7,9 +7,9 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 #include <sys/ioctl.h>
-#include "../m68k.h"
-#include "../platforms/amiga/Gayle.h"
-#include "../platforms/amiga/gayle-ide/ide.h"
+#include "m68k.h"
+#include "platforms/amiga/Gayle.h"
+#include "platforms/amiga/gayle-ide/ide.h"
 #include "gpio_old.h"
 
 // I/O access
index 2e8364ee42aaef0040023a8b9542b918289238d1..92ec2ffcfdf041466e5dd3f78ad32c425820d1d4 100644 (file)
@@ -1,6 +1,6 @@
 /*
   Original Copyright 2020 Claude Schwarz
-  Code reorganized and rewritten by 
+  Code reorganized and rewritten by
   Niklas Ekström 2021 (https://github.com/niklasekstrom)
 */
 
@@ -13,7 +13,9 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
+
 #include "ps_protocol.h"
+#include "m68k.h"
 
 volatile unsigned int *gpio;
 volatile unsigned int *gpclk;
index cee65e72a7705feb45dc2e58ca56bd7e9a7c849d..184f5d36b30f0fd1f98be904e95858ad5ef76cc5 100644 (file)
@@ -1,10 +1,12 @@
-#include <termios.h>
-#include <unistd.h>
+#include <linux/input.h>
+#include <pthread.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <linux/input.h>
-#include "../platforms/platforms.h"
+#include <termios.h>
+#include <unistd.h>
+
+#include "platforms/platforms.h"
 #include "input.h"
 
 #define NONE 0x80
index 26ee063e9b08821558e7b05097e7bee07f1d11f4..a18195a26cd8f3953bb60d155ac7543cde293d52 100644 (file)
 #define M68K_USE_64_BIT  OPT_ON
 
 
-#include "main.h"
+#include "emulator.h"
 
 
 //#define m68k_read_memory_8(A)  read16(A)
index 3ecf4d2f9fe939832f78651827898886da6bc493..55da51ad6407b1297fd8692edbdfe5639fad57e2 100644 (file)
@@ -19,8 +19,8 @@
 #include <time.h>
 #include <endian.h>
 
-#include "../shared/rtc.h"
-#include "../../config_file/config_file.h"
+#include "platforms/shared/rtc.h"
+#include "config_file/config_file.h"
 
 #include "gayle-ide/ide.h"
 #include "amiga-registers.h"
@@ -109,7 +109,7 @@ void InitGayle(void) {
   }
   if (ide0)
     ide_reset_begin(ide0);
-  
+
   if (num_ide_drives == 0) {
     // No IDE drives mounted, disable IDE component of Gayle
     printf("No IDE drives mounted, disabling Gayle IDE component.\n");
index 054cfdb27c94b212e5cd141970168912059fc2d7..9fb849d44864090ae1a4c187ce3649a7f537c9f4 100644 (file)
@@ -1,4 +1,4 @@
-#include "../platforms.h"
+#include "platforms/platforms.h"
 #include "amiga-autoconf.h"
 #include <stdio.h>
 #include <stdlib.h>
@@ -263,7 +263,7 @@ unsigned int autoconfig_read_memory_8(struct emulator_config *cfg, unsigned int
       break;
   }
 
-  
+
   if ((address & 1) == 0 && (address / 2) < (int)sizeof(ac_fast_ram_rom)) {
     if (ac_z2_type[ac_z2_current_pic] == ACTYPE_MAPFAST_Z2 && address / 2 == 1) {
       val = get_autoconf_size(cfg->map_size[ac_z2_index[ac_z2_current_pic]]);
@@ -277,7 +277,7 @@ unsigned int autoconfig_read_memory_8(struct emulator_config *cfg, unsigned int
   val <<= 4;
   if (address != 0 && address != 2 && address != 0x40 && address != 0x42)
     val ^= 0xff;
-  
+
   return (unsigned int)val;
 }
 
index e5032a6364af2e9805c9c40ca6c7f819605ae028..554b6c67431aa3a2cb36f647127b5e3c84b044d0 100644 (file)
@@ -1,3 +1,5 @@
+#include "config_file/config_file.h"
+
 #define AC_Z2_BASE 0xE80000
 #define AC_Z3_BASE 0xFF000000
 #define AC_SIZE (64 * 1024)
index b284789d51b247848ad1d509b8eeba9007df95c1..5668bb8bdc2bfe016a5318002c5fe4aaebb2ec9b 100644 (file)
@@ -2,15 +2,15 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
-#include "../platforms.h"
 #include "amiga-autoconf.h"
 #include "amiga-registers.h"
-#include "../shared/rtc.h"
 #include "hunk-reloc.h"
-#include "piscsi/piscsi.h"
-#include "piscsi/piscsi-enums.h"
-#include "net/pi-net.h"
 #include "net/pi-net-enums.h"
+#include "net/pi-net.h"
+#include "piscsi/piscsi-enums.h"
+#include "piscsi/piscsi.h"
+#include "platforms/platforms.h"
+#include "platforms/shared/rtc.h"
 #include "rtg/rtg.h"
 
 int handle_register_read_amiga(unsigned int addr, unsigned char type, unsigned int *val);
@@ -249,7 +249,7 @@ int setup_platform_amiga(struct emulator_config *cfg) {
     index = get_named_mapped_item(cfg, z2_autoconf_id);
     if (index != -1)
         goto more_z2_fast;
-    
+
     for (int i = 0; i < MAX_NUM_MAPPED_ITEMS; i ++) {
         // Restore any "zapped" autoconf items so they can be reinitialized if needed.
         if (cfg->map_id[i] && strcmp(cfg->map_id[i], z2_autoconf_zap_id) == 0) {
@@ -292,7 +292,7 @@ int setup_platform_amiga(struct emulator_config *cfg) {
             fclose(in);
         }
     }
-    
+
     return 0;
 }
 
index 88314a424aaa7f2c92816a32bfdc69ead068727c..2d74fd6fe4f945e2f50db72d026fe1a4805378d4 100644 (file)
@@ -1,5 +1,5 @@
 #include "Gayle.h"
-#include "../../config_file/config_file.h"
+#include "config_file/config_file.h"
 #include "amiga-registers.h"
 
 uint8_t rtc_emulation_enabled = 1;
index cfe25cd8295b29133c0af3412ef0cf460dffb5bc..f41adf1ebc29b7c4dcd72c4203c09938e8af4459 100644 (file)
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
-#include "../../config_file/config_file.h"
+#include "config_file/config_file.h"
 
 uint8_t dmac_reg_idx = 0;
 uint8_t dmac_reg_values[0xFFFF];
index 64ddf4481a81c4686301e625ac1f7d9a66256417..9263201bbeead2d9bbd11e11f48fcb5f0c4f06f7 100644 (file)
 #include <errno.h>
 #include <time.h>
 #include <arpa/inet.h>
-#include "../../../config_file/config_file.h"
 
+#include "config_file/config_file.h"
 #include "ide.h"
 
 #define IDE_IDLE       0
 #define IDE_CMD                1
 #define IDE_DATA_IN    2
 #define IDE_DATA_OUT   3
+
 #define DCR_NIEN       2
 #define DCR_SRST       4
 
@@ -141,7 +141,7 @@ static off_t xlate_block(struct ide_taskfile *t)
   uint16_t cyl;
 
   if (d->controller->lba4 & DEVH_LBA) {
-/*    fprintf(stderr, "XLATE LBA %02X:%02X:%02X:%02X\n", 
+/*    fprintf(stderr, "XLATE LBA %02X:%02X:%02X:%02X\n",
       t->lba4, t->lba3, t->lba2, t->lba1);*/
     if (d->lba)
       return ((d->header_present) ? 2 : 0) + (((t->drive->controller->lba4 & DEVH_HEAD) << 24) | (t->drive->controller->lba3 << 16) | (t->drive->controller->lba2 << 8) | t->drive->controller->lba1);
@@ -261,7 +261,7 @@ static void ide_srst_begin(struct ide_controller *c)
     c->drive[0].taskfile.status |= ST_BSY;
   if (c->drive[1].present)
     c->drive[1].taskfile.status |= ST_BSY;
-}  
+}
 
 static void ide_srst_end(struct ide_controller *c)
 {
@@ -539,7 +539,7 @@ static void ide_data_out(struct ide_drive *d, uint16_t v, int len)
     if (d->dptr == d->data + 512) {
       if (ide_write_sector(d) < 0) {
         ide_set_error(d);
-        return;        
+        return;
       }
       d->length--;
       d->intrq = 1;
@@ -558,7 +558,7 @@ static void ide_issue_command(struct ide_taskfile *t)
   t->status |= ST_BSY;
   t->error = 0;
   t->drive->state = IDE_CMD;
-  
+
   /* We could complete with delays but don't do so yet */
   switch(t->command) {
     case IDE_CMD_EDD:  /* 0x90 */
@@ -675,7 +675,7 @@ void ide_write8(struct ide_controller *c, uint8_t r, uint8_t v)
       c->lba4 = v & (DEVH_HEAD|/*DEVH_DEV|*/DEVH_LBA);
       break;
     case ide_command_w:
-      t->command = v; 
+      t->command = v;
       ide_issue_command(t);
       break;
     case ide_devctrl_w:
@@ -831,7 +831,7 @@ void ide_detach(struct ide_drive *d)
 
 /*
  *     Free up and release and IDE controller
- */  
+ */
 void ide_free(struct ide_controller *c)
 {
   if (c->drive[0].present)
@@ -869,7 +869,7 @@ void ide_write_latched(struct ide_controller *c, uint8_t reg, uint8_t v)
   }
   if (reg == ide_data)
     d |=  (c->data_latch << 8);
-  ide_write16(c, reg, d);  
+  ide_write16(c, reg, d);
 }
 
 static void make_ascii(uint16_t *p, const char *t, int len)
@@ -883,7 +883,7 @@ static void make_ascii(uint16_t *p, const char *t, int len)
     *d = d[1];
     d[1] = c;
     d += 2;
-  }  
+  }
 }
 
 static void make_serial(uint16_t *p)
@@ -937,7 +937,7 @@ int ide_make_drive(uint8_t type, int fd)
 
   if (type < 1 || type > MAX_DRIVE_TYPE)
     return -2;
-  
+
   memset(ident, 0, 512);
   memcpy(ident, ide_magic, 8);
   if (write(fd, ident, 512) != 512)
@@ -949,7 +949,7 @@ int ide_make_drive(uint8_t type, int fd)
   ident[47] = 0; /* no read multi for now */
   ident[51] = le16(240 /* PIO2 */ << 8);       /* PIO cycle time */
   ident[53] = le16(1);         /* Geometry words are valid */
-  
+
   switch(type) {
     case ACME_ROADRUNNER:
       /* 504MB drive with LBA support */
@@ -959,7 +959,7 @@ int ide_make_drive(uint8_t type, int fd)
       make_ascii(ident + 23, "A001.001", 8);
       make_ascii(ident + 27, "ACME ROADRUNNER v0.1", 40);
       ident[49] = le16(1 << 9); /* LBA */
-      break;  
+      break;
     case ACME_ULTRASONICUS:
       /* 40MB drive with LBA support */
       c = 977;
@@ -985,7 +985,7 @@ int ide_make_drive(uint8_t type, int fd)
       s = 16;
       make_ascii(ident + 23, "A001.001", 8);
       make_ascii(ident + 27, "ACME COYOTE v0.1", 40);
-      break;  
+      break;
     case ACME_ACCELLERATTI:
       c = 1024;
       h = 16;
@@ -1016,10 +1016,10 @@ int ide_make_drive(uint8_t type, int fd)
   ident[61] = ident[58];
   if (write(fd, ident, 512) != 512)
     return -1;
-  
+
   memset(ident, 0xE5, 512);
   while(sectors--)
     if (write(fd, ident, 512) != 512)
-      return -1;  
+      return -1;
   return 0;
 }
index c153ac6c69fd47373f030eee1dc9dda68f447dd6..ef64444c75a9252d95eadb48e49f7d9bea38264e 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _HUNK_RELOC_H
+#define _HUNK_RELOC_H
+
 struct hunk_reloc {
     uint32_t src_hunk;
     uint32_t target_hunk;
@@ -32,3 +35,5 @@ int load_lseg(int fd, uint8_t **buf_p, struct hunk_info *i, struct hunk_reloc *r
 void reloc_hunk(struct hunk_reloc *h, uint8_t *buf, struct hunk_info *i);
 void process_hunks(FILE *in, struct hunk_info *h_info, struct hunk_reloc *r, uint32_t offset);
 void reloc_hunks(struct hunk_reloc *r, uint8_t *buf, struct hunk_info *h_info);
+
+#endif /* _HUNK_RELOC_H */
index 68923f5f6cc92eb084f7cdda2af275cee8f0d0cc..b7517a2c23f608732b4f9f8763c5a390265c2253 100644 (file)
@@ -128,7 +128,7 @@ uint32_t __UserDevOpen(struct IORequest *io, uint32_t num, uint32_t flags) {
 
             NewList(&dev_base->read_list);
             InitSemaphore(&dev_base->read_list_sem);
-            
+
             ret = 0;
             ok = 1;
         //}
@@ -162,7 +162,7 @@ uint32_t pinet_read_frame(struct IOSana2Req *ioreq) {
     uint32_t sz   = ((uint32_t)frm[0] << 8) | ((uint32_t)frm[1]);
     uint32_t ser  = ((uint32_t)frm[2] << 8) | ((uint32_t)frm[3]);
     uint16_t tp   = ((uint16_t)frm[16] << 8) | ((uint16_t)frm[17]);
-    
+
     if (req->ios2_Req.io_Flags & SANA2IOF_RAW) {
         frame_ptr = frm + 4;
         datasize = sz;
@@ -193,10 +193,10 @@ uint32_t pinet_read_frame(struct IOSana2Req *ioreq) {
         req->ios2_Req.io_Error = req->ios2_WireError = 0;
         err = 0;
     }
-    
+
     memcpy(req->ios2_SrcAddr, frame+4+6, HW_ADDRFIELDSIZE);
     memcpy(req->ios2_DstAddr, frame+4, HW_ADDRFIELDSIZE);
-    
+
     //D(("RXSZ %ld\n",(LONG)sz));
     //D(("RXPT %ld\n",(LONG)tp));
 
@@ -215,14 +215,14 @@ uint32_t pinet_read_frame(struct IOSana2Req *ioreq) {
     if (broadcast) {
         req->ios2_Req.io_Flags |= SANA2IOF_BCAST;
     }
-    
+
     req->ios2_PacketType = tp;*/
 
     return err;
 }
 
 void pinet_write_frame(struct IOSana2Req *ioreq) {
-    
+
 }
 
 void exit(int status) { }
@@ -333,7 +333,7 @@ void __AbortIO(struct IORequest* ioreq) {
 ADDTABL_1(__TermIO,a1);
 void __TermIO(struct IORequest *ioreq) {
     struct IOSana2Req* ios2 = (struct IOSana2Req*)ioreq;
-    
+
     if (!(ios2->ios2_Req.io_Flags & SANA2IOF_QUICK)) {
         ReplyMsg((struct Message *)ioreq);
     } else {
@@ -359,7 +359,7 @@ ULONG read_frame(struct IOSana2Req *req, volatile UBYTE *frame)
   ULONG sz   = ((ULONG)frm[0]<<8)|((ULONG)frm[1]);
   ULONG ser  = ((ULONG)frm[2]<<8)|((ULONG)frm[3]);
   USHORT tp  = ((USHORT)frm[16]<<8)|((USHORT)frm[17]);
-  
+
   if (req->ios2_Req.io_Flags & SANA2IOF_RAW) {
     frame_ptr = frm+4;
     datasize = sz;
@@ -390,10 +390,10 @@ ULONG read_frame(struct IOSana2Req *req, volatile UBYTE *frame)
     req->ios2_Req.io_Error = req->ios2_WireError = 0;
     err = 0;
   }
-  
+
   memcpy(req->ios2_SrcAddr, frame+4+6, HW_ADDRFIELDSIZE);
   memcpy(req->ios2_DstAddr, frame+4, HW_ADDRFIELDSIZE);
-  
+
   //D(("RXSZ %ld\n",(LONG)sz));
   //D(("RXPT %ld\n",(LONG)tp));
 
@@ -412,7 +412,7 @@ ULONG read_frame(struct IOSana2Req *req, volatile UBYTE *frame)
   if (broadcast) {
     req->ios2_Req.io_Flags |= SANA2IOF_BCAST;
   }
-  
+
   req->ios2_PacketType = tp;
 
   return err;
@@ -423,7 +423,7 @@ ULONG write_frame(struct IOSana2Req *req, UBYTE *frame)
    ULONG rc=0;
    struct BufferManagement *bm;
    USHORT sz=0;
-   
+
    if (req->ios2_Req.io_Flags & SANA2IOF_RAW) {
       sz = req->ios2_DataLength;
    } else {
index 857bc2c928af53ee576cca5ed78361cd946e7543..f19bae1db61c9a153de523f56588d3d9ebf5d140 100644 (file)
@@ -5,8 +5,8 @@
 #include <endian.h>
 #include "pi-net.h"
 #include "pi-net-enums.h"
-#include "../../../config_file/config_file.h"
-#include "../../../gpio/ps_protocol.h"
+#include "config_file/config_file.h"
+#include "gpio/ps_protocol.h"
 
 uint32_t pinet_u32[4];
 static const char *op_type_names[4] = {
index 3f354dd387ff9430ee8d71d3dae54f62927c69e0..cf9c696d006ad250d524d8a3e4585c3fb892ba4d 100644 (file)
@@ -5,11 +5,12 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <endian.h>
-#include "../hunk-reloc.h"
-#include "piscsi.h"
+
+#include "config_file/config_file.h"
+#include "gpio/ps_protocol.h"
 #include "piscsi-enums.h"
-#include "../../../config_file/config_file.h"
-#include "../../../gpio/ps_protocol.h"
+#include "piscsi.h"
+#include "platforms/amiga/hunk-reloc.h"
 
 #define BE(val) be32toh(val)
 #define BE16(val) be16toh(val)
@@ -213,16 +214,16 @@ void piscsi_refresh_drives() {
 void piscsi_find_filesystems(struct piscsi_dev *d) {
     if (!d->num_partitions)
         return;
-    
+
     uint8_t fs_found = 0;
-    
+
     uint8_t *fhb_block = malloc(512);
 
     lseek64(d->fd, d->fshd_offs, SEEK_SET);
 
     struct FileSysHeaderBlock *fhb = (struct FileSysHeaderBlock *)fhb_block;
     read(d->fd, fhb_block, 512);
-    
+
     while (BE(fhb->fhb_ID) == FS_IDENTIFIER) {
         char *dosID = (char *)&fhb->fhb_DosType;
 #ifdef PISCSI_DEBUG
@@ -245,7 +246,7 @@ void piscsi_find_filesystems(struct piscsi_dev *d) {
                 DEBUG("[FSHD] File system %c%c%c/%d already loaded. Skipping.\n", dosID[0], dosID[1], dosID[2], dosID[3]);
                 if (BE(fhb->fhb_Next) == 0xFFFFFFFF)
                     goto fs_done;
-                
+
                 goto skip_fs_load_lseg;
             }
         }
@@ -615,7 +616,7 @@ void handle_piscsi_write(uint32_t addr, uint32_t val, uint8_t type) {
                 memcpy(dst_data + addr, piscsi_rom_ptr + PISCSI_DRIVER_OFFSET, 0x4000 - PISCSI_DRIVER_OFFSET);
 
                 piscsi_hinfo.base_offset = val;
-                
+
                 reloc_hunks(piscsi_hreloc, dst_data + addr, &piscsi_hinfo);
 
                 #define PUTNODELONG(val) *(uint32_t *)&dst_data[p_offs] = htobe32(val); p_offs += 4;
@@ -685,7 +686,7 @@ void handle_piscsi_write(uint32_t addr, uint32_t val, uint8_t type) {
 skip_disk:;
                 }
             }
-           
+
             break;
         }
         case PISCSI_CMD_NEXTPART:
@@ -780,7 +781,7 @@ uint32_t handle_piscsi_read(uint32_t addr, uint8_t type) {
         }
         return 0;
     }
-    
+
     switch (addr & 0xFFFF) {
         case PISCSI_CMD_ADDR1: case PISCSI_CMD_ADDR2: case PISCSI_CMD_ADDR3: case PISCSI_CMD_ADDR4: {
             int i = ((addr & 0xFFFF) - PISCSI_CMD_ADDR1) / 4;
index 5ed0078320c3c711916b3a705bfd85b7896f27af..7c008d45b3e0e10186df7c73227c55779b83ec73 100644 (file)
@@ -1,3 +1,7 @@
+#include <stdint.h>
+
+#include "platforms/amiga/hunk-reloc.h"
+
 #define        TDF_EXTCOM (1<<15)
 
 #define CMD_INVALID    0
index 95b77983991e48fa00e59ce6621745439637c7de..8cd177fa3845a392b0ef61c61099204f36a0c5eb 100644 (file)
@@ -2,9 +2,9 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
-#include "../../../config_file/config_file.h"
+#include "config_file/config_file.h"
 #ifndef FAKESTORM
-#include "../../../gpio/ps_protocol.h"
+#include "gpio/ps_protocol.h"
 #endif
 #include "rtg.h"
 
@@ -344,7 +344,7 @@ void rtg_blittemplate(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t s
                         else {
                             SET_RTG_PIXELS2_COND_MASK(&dptr[xs << format], fg_color[format], bg_color[format], format);
                         }
-                        
+
                         xs += 7;
                     }
                     else {
@@ -484,7 +484,7 @@ void rtg_blitpattern(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t sr
                         else {
                             SET_RTG_PIXELS2_COND_MASK(&dptr[xs << format], fg_color[format], bg_color[format], format);
                         }
-                        
+
                         xs += 7;
                     }
                     else {
index 5423671ba76fd42e97cb413d0f8309cb4baaa111..0020e9c283e7adf511262ff04481d6f9d4f21aa0 100644 (file)
@@ -1,11 +1,13 @@
+#include "emulator.h"
+#include "rtg.h"
+
+#include <pthread.h>
 #include <SDL2/SDL.h>
-#include <stdio.h>
 #include <stdint.h>
+#include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
-#include <pthread.h>
 #include <string.h>
-#include "rtg.h"
+#include <unistd.h>
 
 #define RTG_INIT_ERR(a) { printf(a); *data->running = 0; }
 
@@ -201,7 +203,7 @@ shutdown_sdl:;
 
     if (reinit)
         goto reinit_sdl;
-    
+
     if (indexed_buf)
         free(indexed_buf);
 
index c4b7f561111dbbf7305adcc9273725c868d2dc29..a4be06952d528bd5aa9392ca16ac390ae247b5bc 100644 (file)
@@ -5,7 +5,7 @@
 #include <string.h>
 #include <time.h>
 #include "rtg.h"
-#include "../../../config_file/config_file.h"
+#include "config_file/config_file.h"
 
 uint8_t rtg_u8[4];
 uint16_t rtg_x[8], rtg_y[8];
index 7e431e0d5286ec5484f2c262f66d9d6b3a1e3b25..0a4e177d3f01998395ec0d0b9d4d4ae2e18fe2ae 100644 (file)
@@ -1,7 +1,8 @@
-#include "../platforms.h"
 #include <stdlib.h>
 #include <string.h>
 
+#include "platforms/platforms.h"
+
 int handle_register_read_dummy(unsigned int addr, unsigned char type, unsigned int *val);
 int handle_register_write_dummy(unsigned int addr, unsigned int value, unsigned char type);
 
index 82a286811e9687afef9d645450be90b56f5438ac..e9d2cdb1e4a3b07636693807c422d4938cef942d 100644 (file)
@@ -1,4 +1,4 @@
-#include "../config_file/config_file.h"
+#include "config_file/config_file.h"
 
 enum base_platforms {
     PLATFORM_NONE,
index 400fd593fdca4c299c935caaabaf54e5b0049b2e..d561daa36481ba0349f980e4a4a18afbf2bdbf75 100644 (file)
@@ -30,7 +30,7 @@ these four paragraphs for those parts of this code that are retained.
 
 =============================================================================*/
 
-#include "../m68kcpu.h" // which includes softfloat.h after defining the basic types
+#include "m68kcpu.h" // which includes softfloat.h after defining the basic types
 
 /*----------------------------------------------------------------------------
 | Floating-point rounding mode, extended double-precision rounding precision,