Skip to content

Commit

Permalink
Version 3.8 - see readme.md for details.
Browse files Browse the repository at this point in the history
  • Loading branch information
wavemotion-dave committed Jan 3, 2024
1 parent eafa0d6 commit 109d182
Show file tree
Hide file tree
Showing 52 changed files with 697 additions and 158 deletions.
Binary file modified A8DS.nds
Binary file not shown.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#DEVKITPPC=/opt/devkitpro/devkitPPC
#DEVKITPRO=/opt/devkitpro

VERSION=3.7d
VERSION=3.8

#---------------------------------------------------------------------------------
.SUFFIXES:
Expand Down
2 changes: 1 addition & 1 deletion arm9/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GRAPHICS := gfx
#ARCH := -mthumb -mthumb-interwork
ARCH :=

CFLAGS := -Wall -Warray-bounds=0 -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math $(ARCH)
CFLAGS := -Wall -Warray-bounds=0 -O2 -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math $(ARCH) -frename-registers -finline-functions -fpredictive-commoning -floop-interchange -ftree-partial-pre -fno-semantic-interposition

CFLAGS += $(INCLUDE) -DARM9
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
Expand Down
Binary file modified arm9/gfx/pdev_bg0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion arm9/source/CRC32.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CRC32.c contains the file CRC32 utility
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/CRC32.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* CRC32.c contains the file CRC32 utility
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down
11 changes: 9 additions & 2 deletions arm9/source/a8ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* TV frequency (60Hz or 50Hz depending on NTSC or PAL).
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand All @@ -18,6 +18,7 @@
* that project is released under the GPL V2, this program and source must also
* be distributed using that same licensing model. See COPYING for the full license.
*/

#include <nds.h>
#include <nds/fifomessages.h>

Expand Down Expand Up @@ -659,6 +660,8 @@ void load_os(void)
// ----------------------------------------------------------------------------
void install_os(void)
{
memset(debug, 0x00, sizeof(debug));

// Otherwise we either use the Atari OS or the Altirra based on user choice...
if (myConfig.os_type == OS_ALTIRRA_XL)
{
Expand Down Expand Up @@ -1757,7 +1760,11 @@ void dsMainLoop(void)
if (gTotalAtariFrames == (myConfig.tv_type == TV_NTSC ? 61:51)) gTotalAtariFrames = (myConfig.tv_type == TV_NTSC ? 60:50);
if (myConfig.fps_setting)
{
siprintf(fpsbuf,"%03d",gTotalAtariFrames); dsPrintValue(0,0,0, fpsbuf); // Show FPS
fpsbuf[0] = '0' + gTotalAtariFrames / 100;
fpsbuf[1] = '0' + (gTotalAtariFrames % 100) / 10;
fpsbuf[2] = '0' + (gTotalAtariFrames % 100) % 10;
fpsbuf[3] = 0;
dsPrintValue(0,0,0, fpsbuf); // Show FPS
if (myConfig.fps_setting==2) dsPrintValue(30,0,0,"FS");
}
gTotalAtariFrames = 0;
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/a8ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* A8DS.H contains externs and defines related to A8DS emulator.
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down
5 changes: 4 additions & 1 deletion arm9/source/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* config.c contains configurion handling to map all sorts of options into the emulator.
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down Expand Up @@ -222,6 +222,7 @@ void WriteGameSettings(void)
GameDB.GameSettings[idx].game_crc = last_crc;
GameDB.GameSettings[idx].slot_used = 1;
GameDB.GameSettings[idx].tv_type = myConfig.tv_type;
GameDB.GameSettings[idx].fps_setting = myConfig.fps_setting;
GameDB.GameSettings[idx].palette_type = myConfig.palette_type;
GameDB.GameSettings[idx].os_type = myConfig.os_type;
GameDB.GameSettings[idx].basic_type = myConfig.basic_type;
Expand Down Expand Up @@ -394,6 +395,7 @@ void SetMyConfigDefaults(void)
myConfig.artifacting = 0;
myConfig.cart_type = CART_NONE;
myConfig.emulatorText = true;
myConfig.fps_setting = 0;
myConfig.dpad_type = 0;
myConfig.blending = GameDB.default_blending;
myConfig.alphaBlend = GameDB.default_alphaBlend;
Expand Down Expand Up @@ -430,6 +432,7 @@ void ApplyGameSpecificSettings(void)
myConfig.yScale = GameDB.GameSettings[idx].yScale;
myConfig.artifacting = GameDB.GameSettings[idx].artifacting;
myConfig.palette_type = GameDB.GameSettings[idx].palette_type;
myConfig.fps_setting = GameDB.GameSettings[idx].fps_setting;
myConfig.os_type = GameDB.GameSettings[idx].os_type;
myConfig.basic_type = GameDB.GameSettings[idx].basic_type;
myConfig.tv_type = GameDB.GameSettings[idx].tv_type;
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* config.h contains externs and defines related to A8DS emulator.
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down
60 changes: 17 additions & 43 deletions arm9/source/emu/antic.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* it is strongly ecommended that you seek out the latest Atari800 sources.
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down Expand Up @@ -515,6 +515,7 @@ UBYTE missile_dma_enabled __attribute__((section(".dtcm")));
UBYTE missile_gra_enabled __attribute__((section(".dtcm")));
UBYTE player_flickering __attribute__((section(".dtcm")));
UBYTE missile_flickering __attribute__((section(".dtcm")));
UBYTE missile_or_player_dma_enabled __attribute__((section(".dtcm")));

UWORD pmbase_s __attribute__((section(".dtcm")));
UWORD pmbase_d __attribute__((section(".dtcm")));
Expand Down Expand Up @@ -628,6 +629,7 @@ static UBYTE hold_missiles_tab[16] __attribute__((section(".dtcm"))) = {

static void pmg_dma(void) {
/* VDELAY bit set == GTIA ignores PMG DMA in even lines */

if (player_dma_enabled) {
if (player_gra_enabled) {
const UBYTE *base;
Expand Down Expand Up @@ -806,7 +808,7 @@ void ANTIC_Reset(void) {
}\
}

static void do_border(void)
ITCM_CODE void do_border(void)
{
int kk;
UWORD *ptr = &scrn_ptr[LBORDER_START];
Expand Down Expand Up @@ -865,7 +867,7 @@ static void do_border_gtia11(void)
COLOUR_TO_WORD(cl_lookup[C_BAK],COLBK)
}

static void draw_antic_0(void)
ITCM_CODE static void draw_antic_0(void)
{
UWORD *ptr = scrn_ptr + LBORDER_START;
if (pm_dirty) {
Expand Down Expand Up @@ -1104,7 +1106,7 @@ static void draw_an_gtia11(const ULONG *t_pm_scanline_ptr)
if (blank_lookup[screendata & blank_mask])\
chdata ^= chptr[(screendata & 0x7f) << 3];

ITCM_CODE static void draw_antic_2(int nchars, const UBYTE *ANTIC_memptr, UWORD *ptr, const ULONG *t_pm_scanline_ptr)
static void draw_antic_2(int nchars, const UBYTE *ANTIC_memptr, UWORD *ptr, const ULONG *t_pm_scanline_ptr)
{
INIT_BACKGROUND_6
INIT_ANTIC_2
Expand Down Expand Up @@ -1161,7 +1163,7 @@ static void draw_antic_2_artif(int nchars, const UBYTE *ANTIC_memptr, UWORD *ptr
}


ITCM_CODE static void prepare_an_antic_2(int nchars, const UBYTE *ANTIC_memptr, const ULONG *t_pm_scanline_ptr)
static void prepare_an_antic_2(int nchars, const UBYTE *ANTIC_memptr, const ULONG *t_pm_scanline_ptr)
{
UBYTE *an_ptr = (UBYTE *) t_pm_scanline_ptr + (an_scanline - pm_scanline);
const UBYTE *chptr;
Expand All @@ -1181,7 +1183,7 @@ ITCM_CODE static void prepare_an_antic_2(int nchars, const UBYTE *ANTIC_memptr,
CHAR_LOOP_END
}

ITCM_CODE static void draw_antic_2_gtia9(int nchars, const UBYTE *ANTIC_memptr, UWORD *ptr, const ULONG *t_pm_scanline_ptr)
static void draw_antic_2_gtia9(int nchars, const UBYTE *ANTIC_memptr, UWORD *ptr, const ULONG *t_pm_scanline_ptr)
{
INIT_ANTIC_2
if ((unsigned long) ptr & 2) { /* HSCROL & 1 */
Expand Down Expand Up @@ -1274,7 +1276,7 @@ static void draw_antic_2_gtia10(int nchars, const UBYTE *ANTIC_memptr, UWORD *pt
do_border_gtia10();
}

ITCM_CODE static void draw_antic_2_gtia11(int nchars, const UBYTE *ANTIC_memptr, UWORD *ptr, const ULONG *t_pm_scanline_ptr)
static void draw_antic_2_gtia11(int nchars, const UBYTE *ANTIC_memptr, UWORD *ptr, const ULONG *t_pm_scanline_ptr)
{
INIT_ANTIC_2
if ((unsigned long) ptr & 2) { /* HSCROL & 1 */
Expand Down Expand Up @@ -2206,13 +2208,9 @@ void ANTIC_UpdateArtifacting(void)

inline UBYTE ANTIC_GetDLByte(UWORD *paddr)
{
int addr = *paddr;
UBYTE result;
result = dGetByte(addr);
addr++;
if ((addr & 0x3FF) == 0)
addr -= 0x400;
*paddr = (UWORD) addr;
UBYTE result = dGetByte(*paddr);
(*paddr)++;
if ((*paddr & 0x3FF) == 0) *paddr -= 0x400;
return result;
}

Expand Down Expand Up @@ -2300,7 +2298,10 @@ ITCM_CODE void ANTIC_Frame(int draw_display)

do {
POKEY_Scanline(); /* check and generate IRQ */
pmg_dma();
if (missile_or_player_dma_enabled)
{
pmg_dma();
}

need_load = FALSE;
if (need_dl) {
Expand Down Expand Up @@ -2572,34 +2573,6 @@ void ANTIC_PutByte(UWORD addr, UBYTE byte)
switch (byte & 0x03) {
case 0x00:
/* no ANTIC_load when screen off */
/* chars_read[NORMAL0] = 0;
chars_read[NORMAL1] = 0;
chars_read[NORMAL2] = 0;
chars_read[SCROLL0] = 0;
chars_read[SCROLL1] = 0;
chars_read[SCROLL2] = 0; */
/* no draw_antic_* when screen off */
/* chars_displayed[NORMAL0] = 0;
chars_displayed[NORMAL1] = 0;
chars_displayed[NORMAL2] = 0;
chars_displayed[SCROLL0] = 0;
chars_displayed[SCROLL1] = 0;
chars_displayed[SCROLL2] = 0;
x_min[NORMAL0] = 0;
x_min[NORMAL1] = 0;
x_min[NORMAL2] = 0;
x_min[SCROLL0] = 0;
x_min[SCROLL1] = 0;
x_min[SCROLL2] = 0;
ch_offset[NORMAL0] = 0;
ch_offset[NORMAL1] = 0;
ch_offset[NORMAL2] = 0;
ch_offset[SCROLL0] = 0;
ch_offset[SCROLL1] = 0;
ch_offset[SCROLL2] = 0; */
/* no borders when screen off, only background */
/* left_border_chars = 48 - LCHOP - RCHOP;
right_border_start = 0; */
break;
case 0x01:
chars_read[NORMAL0] = 32;
Expand Down Expand Up @@ -2686,6 +2659,7 @@ void ANTIC_PutByte(UWORD addr, UBYTE byte)
singleline = (byte & 0x10);
player_flickering = ((player_dma_enabled | player_gra_enabled) == 0x02);
missile_flickering = ((missile_dma_enabled | missile_gra_enabled) == 0x01);
missile_or_player_dma_enabled = (missile_dma_enabled | player_dma_enabled);

byte = HSCROL; /* update horizontal scroll data */
/* ******* FALLTHROUGH ******* */
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/emu/antic.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* it is strongly ecommended that you seek out the latest Atari800 sources.
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down
2 changes: 1 addition & 1 deletion arm9/source/emu/atari.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* files supported (which will run 99% of everything 8-bit).
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down
48 changes: 48 additions & 0 deletions arm9/source/emu/atari.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
/*
* ATARI.C contains the basic machine settings for the emulator.
* This defines how much RAM and whether the machine is compatible
* with the older stock Atari 800 or the newer XL/XE series (possibly
* with extended RAM banks). This routine also sorts out the various
* supported ROM file types - right now, ATR, ATX and XEX are the only
* files supported (which will run 99% of everything 8-bit).
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
* royalty provided this full copyright notice (including the Atari800 one below)
* is used and wavemotion-dave, alekmaul (original port), Atari800 team (for the
* original source) and Avery Lee (Altirra OS) are credited and thanked profusely.
*
* The A8DS emulator is offered as-is, without any warranty.
*
* Since much of the original codebase came from the Atari800 project, and since
* that project is released under the GPL V2, this program and source must also
* be distributed using that same licensing model. See COPYING for the full license
* but the original Atari800 copyright notice retained below:
*/

/*
* atari.c - main high-level routines
*
* Copyright (c) 1995-1998 David Firth
* Copyright (c) 1998-2006 Atari800 development team (see DOC/CREDITS)
*
* This file is part of the Atari800 emulator project which emulates
* the Atari 400, 800, 800XL, 130XE, and 5200 8-bit computers.
*
* Atari800 is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Atari800 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Atari800; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _ATARI_H_
#define _ATARI_H_

Expand Down
2 changes: 1 addition & 1 deletion arm9/source/emu/atari_nds.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* file can go away...
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down
4 changes: 2 additions & 2 deletions arm9/source/emu/binload.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* it is strongly recommended you seek out the latest Atari800 sources.
*
* A8DS - Atari 8-bit Emulator designed to run on the Nintendo DS/DSi is
* Copyright (c) 2021-2023 Dave Bernazzani (wavemotion-dave)
* Copyright (c) 2021-2024 Dave Bernazzani (wavemotion-dave)
* Copying and distribution of this emulator, its source code and associated
* readme files, with or without modification, are permitted in any medium without
Expand Down Expand Up @@ -159,7 +159,7 @@ static void loader_cont(void)
}
return;
}
MEMORY_PutByte(from, (UBYTE) byte);
PutByte(from, (UBYTE) byte);
from++;
} while (from != to);
segfinished = TRUE;
Expand Down
Loading

0 comments on commit 109d182

Please sign in to comment.